Enrichment Resolver does not query newly found identifiers

Description

According to the description the MCREnricher is expected to analyse resolved data sources for new identifiers and resolve those recursively: "Should a data source return new, additional identifiers, other data sources that support these identifiers will be tried again." However, this is not the case.

My suggestion to fix this issue is as follows:

mycore\mycore-mods\src\main\java\org\mycore\mods\enrichment\MCREnricher.java

@@ -104,9 +104,12 @@
this.publication = publication;
idPool.addIdentifiersFrom(publication);

  • resolveExternalData();

  • mergeExternalData();

  • MCRMODSSorter.sort(publication);
    + while(idPool.hasNewIdentifiers()) {
    + resolveExternalData();
    + mergeExternalData();
    + MCRMODSSorter.sort(publication);
    + idPool.addIdentifiersFrom(publication);
    + }


for (Element nestedObject : xPath2FindNestedObjects.evaluate(publication)) {
idPool.continueWithNewIdentifiers();

mycore\mycore-mods\src\main\java\org\mycore\mods\enrichment\MCRIdentifierPool.java

@@ -70,7 +70,6 @@

/** Merges all new identifies into the set of old identifiers */
void continueWithNewIdentifiers() {

  • oldIdentifiers.clear();
    oldIdentifiers.addAll(newIdentifiers);
    newIdentifiers.clear();
    }

Environment

None

Activity

Show:
Kai Brandhorst
October 22, 2020, 10:14 AM

My first fix suggestion was not complete, because the “oldIdentifiers” need to be cleared before nested objects are resolved. So I rather suggest the following fix:

mycore\mycore-mods\src\main\java\org\mycore\mods\enrichment\MCREnricher.java

mycore\mycore-mods\src\main\java\org\mycore\mods\enrichment\MCRIdentifierPool.java

Assignee

Unassigned

Reporter

Kai Brandhorst

Labels

None

URL

None

External issue ID

None

Components

Affects versions

Priority

Medium
Configure