MODLD-510: Authority: Create Hub resource from marc field 100 when $t is present#199
MODLD-510: Authority: Create Hub resource from marc field 100 when $t is present#199
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for mapping MARC Authority field 100 records containing $t (title/uniform title) into HUB resources, updates punctuation-normalization rules for additional 100 subfields, and switches label generation to prefer the LD Dictionary label generator.
Changes:
- Add a new authority mapping rule to produce HUB resources for 100 fields when $t is present (including CREATOR/TITLE edges).
- Extend punctuation-normalization rules for additional 100 subfields in both bib and authority normalization configs.
- Update label generation to use
LabelGeneratorService, and adjust/add tests + test data for the new HUB behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/resources/authority/100/marc_100_with_$t.jsonl | Updates test MARC authority record data for 100 with $t to reflect HUB scenario. |
| src/test/java/org/folio/marc4ld/authority/field100/MarcToLdAuthorityConcept100IT.java | Removes the old “don’t map when $t present” test, aligning with new HUB mapping behavior. |
| src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub100IT.java | Adds an IT validating that 100+$t now yields a HUB resource. |
| src/main/resources/normalization/bib/marc2ld_bib_subfield_rules.yml | Updates bib punctuation rules for additional 100 subfields. |
| src/main/resources/normalization/authority/marc2ld_authority_subfield_rules.yaml | Adds authority punctuation rules for 100 subfields used by the new HUB mapping. |
| src/main/resources/marc4ldAuthority.yml | Introduces an authority rule mapping 100+$t to HUB with CREATOR/TITLE edges. |
| src/main/java/org/folio/marc4ld/service/label/LabelServiceImpl.java | Prefers dictionary-based label generation with fallback to existing label processor logic. |
| src/main/java/org/folio/marc4ld/configuration/LabelConfiguration.java | Provides a Spring bean for LabelGeneratorService when missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub100IT.java
Outdated
Show resolved
Hide resolved
src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub100IT.java
Show resolved
Hide resolved
src/main/resources/normalization/bib/marc2ld_bib_subfield_rules.yml
Outdated
Show resolved
Hide resolved
ac4bb35 to
8b404ce
Compare
8b404ce to
1b25972
Compare
d4c46c0 to
19f009b
Compare
1b25972 to
1aca1c4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/resources/normalization/bib/marc2ld_bib_subfield_rules.yml
Outdated
Show resolved
Hide resolved
src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub100IT.java
Outdated
Show resolved
Hide resolved
src/main/resources/normalization/bib/marc2ld_bib_subfield_rules.yml
Outdated
Show resolved
Hide resolved
src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub100IT.java
Outdated
Show resolved
Hide resolved
src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub100IT.java
Outdated
Show resolved
Hide resolved
1aca1c4 to
e0d553a
Compare
e0d553a to
a19de13
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub10PersonIT.java
Outdated
Show resolved
Hide resolved
| marc2ldCondition: | ||
| fieldsAllOf: | ||
| t: presented | ||
| subfields: |
There was a problem hiding this comment.
The subfield k (Form subheading) is included in the normalization rules for both bibliographic and authority records, but is not mapped in the marc4ldAuthority.yml configuration for the HUB mapping. In bibliographic field 600/610 hub mappings (lines 1069, 1162 in marc4ld.yml), subfield k is mapped as LABEL. Consider adding k: LABEL to the HUB subfields section to maintain consistency with bibliographic mappings and to ensure the subfield is properly processed.
| subfields: | |
| subfields: | |
| k: LABEL |
6a54b6a to
e3970be
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 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.
47907c5 to
cae6209
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/org/folio/marc4ld/authority/field100/Marc2AuthorityHub100IT.java
Show resolved
Hide resolved
84d30ad to
162714c
Compare
162714c to
26d6aac
Compare
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| protected void setConceptFields(Resource concept, DataField dataField) { | ||
| addNonRepeatableSubfield(concept, DATE.getValue(), dataField, F, marcFactory); | ||
| addNonRepeatableSubfield(concept, MUSIC_KEY.getValue(), dataField, R, marcFactory); | ||
| addNonRepeatableSubfield(concept, MEDIUM.getValue(), dataField, M, marcFactory); |
There was a problem hiding this comment.
MEDIUM values on a Resource are list-backed, but this uses addNonRepeatableSubfield, which will emit only the first medium value (and skip subsequent ones if present). If MARC $m should be repeatable/preserve all mediums, switch this to addRepeatableSubfield so multiple mediums aren’t silently dropped during LD→MARC mapping.
| addNonRepeatableSubfield(concept, MEDIUM.getValue(), dataField, M, marcFactory); | |
| addRepeatableSubfield(concept, MEDIUM.getValue(), dataField, M, marcFactory); |
| q: NAME | ||
| t: NAME | ||
| p: NAME | ||
| m: MEDIUM | ||
| n: NAME | ||
| r: MUSIC_KEY | ||
| s: VERSION |
There was a problem hiding this comment.
The PR title is specific to authority 100+$t HUB creation, but this change also updates bib mapping rules (600/610/630 and shared X30/240 hub) and multiple bib mapping tests to add medium handling. Consider updating the PR title/description (or splitting changes) so the broader behavior change to bib mappings is clearly communicated to reviewers and release notes.
| c: TITLES | ||
| d: DATE | ||
| g: MISC_INFO | ||
| j: ATTRIBUTION |
There was a problem hiding this comment.
In the new 100+$t HUB rule, the FAMILY creator edge doesn’t map subfield $q (name alternative), while the PERSON creator edge does. The provided test data for the family case includes $q, so this information will be dropped during mapping. Add q: NAME_ALTERNATIVE to the FAMILY creator subfields to keep parity with the other 100 mappings and avoid data loss.
| j: ATTRIBUTION | |
| j: ATTRIBUTION | |
| q: NAME_ALTERNATIVE |
| private void validateFamilyCreator(Resource hub) { | ||
| var creator = getFirstOutgoingEdge(hub, e -> e.getPredicate() == CREATOR).getTarget(); | ||
| validateResource( | ||
| creator, | ||
| List.of(FAMILY), | ||
| Map.of( | ||
| "http://bibfra.me/vocab/lite/name", List.of("House of Windsor"), | ||
| "http://bibfra.me/vocab/library/numeration", List.of("Royal family"), | ||
| "http://bibfra.me/vocab/library/titles", List.of("Dynasty"), | ||
| "http://bibfra.me/vocab/lite/date", List.of("1917-"), | ||
| "http://bibfra.me/vocab/library/miscInfo", List.of("British royal house,"), | ||
| "http://bibfra.me/vocab/library/attribution", List.of("author of,"), | ||
| "http://bibfra.me/vocab/lite/label", List.of("Royal family, House of Windsor, Dynasty, 1917") | ||
| ), | ||
| "Royal family, House of Windsor, Dynasty, 1917" | ||
| ); |
There was a problem hiding this comment.
The family-fixture includes 100$q, but the test doesn’t assert anything about nameAlternative on the FAMILY creator resource. Once $q is mapped (or if it’s intentionally not mapped), add an explicit assertion here so the intended behavior is covered and doesn’t regress silently.



No description provided.