MODLD-913: Make the label of CONCEPT resource predictable#152
Conversation
There was a problem hiding this comment.
Pull request overview
Updates CONCEPT label generation to produce a deterministic, domain-specific ordering of FOCUS/SUB_FOCUS components so label output is predictable.
Changes:
- Replaced ad-hoc edge sorting with a dedicated comparator for CONCEPT outgoing edges.
- Introduced SUB_FOCUS ordering by type precedence (TOPIC → TEMPORAL → PLACE → FORM) and case-insensitive label sorting.
- Updated/expanded the CONCEPT label generator test to validate the new ordering behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/main/java/org/folio/ld/dictionary/label/generators/ConceptLabelGenerator.java |
Adds a custom comparator to enforce consistent ordering of FOCUS/SUB_FOCUS edges when building CONCEPT labels. |
src/test/java/org/folio/ld/dictionary/label/ConceptLabelGeneratorTest.java |
Updates the test fixture and expected output to assert the new deterministic ordering for SUB_FOCUS elements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/org/folio/ld/dictionary/label/ConceptLabelGeneratorTest.java
Show resolved
Hide resolved
src/main/java/org/folio/ld/dictionary/label/generators/ConceptLabelGenerator.java
Show resolved
Hide resolved
69e659f to
f276b69
Compare
f276b69 to
f4eb010
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f4eb010 to
2e6e317
Compare
src/main/java/org/folio/ld/dictionary/label/generators/ConceptLabelGenerator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/folio/ld/dictionary/label/generators/ConceptLabelGenerator.java
Show resolved
Hide resolved
2e6e317 to
d2ca4d1
Compare
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



Make the label of CONCEPT resource predictable by having this format
focus label -- topic subfocus label -- place subfocus label -- temporal subfocus label -- form subfocus label