Skip to content

MODLD-630: Do not set RESOURCE_PREFERRED flag when resource is created from Bib #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025

Conversation

pkjacob
Copy link
Contributor

@pkjacob pkjacob commented May 29, 2025

Per the decision we made during the beginning of this project,"http://library.link/vocab/resourcePreferred": true property should be added to a resource node only when that resource is created out of a MARC authority record.

In this case, this property was added to a node created out of Bib MARC records. This PR fixes the problem.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the RESOURCE_PREFERRED flag when creating a resource from a Bib record. The changes update both the integration tests and the main mapper to no longer expect or set the RESOURCE_PREFERRED property.

  • Removed the RESOURCE_PREFERRED flag from the expected mappings in the tests.
  • Removed the setting of RESOURCE_PREFERRED in the ConceptFormMapper’s creation of resources.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/test/java/org/folio/marc4ld/mapper/field008/Marc2LdConceptFormIT.java Removed RESOURCE_PREFERRED flag from expected test maps
src/main/java/org/folio/marc4ld/service/marc2ld/bib/mapper/custom/ConceptFormMapper.java Removed setting of RESOURCE_PREFERRED on created resource

@@ -94,8 +93,7 @@ protected void addSubResource(Resource resource, char code) {
LABEL.getValue(), List.of(CODE_TO_LCCN_MAP.get(code))
), Collections.emptyMap());
var form = createResource(Set.of(FORM), Map.of(
NAME.getValue(), List.of(CODE_TO_LABEL_MAP.get(code)),
RESOURCE_PREFERRED.getValue(), List.of("true")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this resource is created from MARC Bib record, do not set the RESOURCE_PREFERRED flag.

Copy link

@pkjacob pkjacob merged commit 5f721e6 into master May 30, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants