Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
298690d
UBO-294 Added modsperson module, object type and event handler
fluetze Jan 17, 2024
2f2eb5a
UBO-294 Work in progress, add class to lookup person data
fluetze Jan 17, 2024
6e5fbda
Merge branch 'develop' into issues/UBO-294-Implement-a-modsperson-obj…
erodde Sep 3, 2024
8736522
Merge remote-tracking branch 'origin/develop' into issues/UBO-294-Imp…
erodde Sep 23, 2024
2eca91c
first changes
erodde Oct 1, 2024
a709b74
Refactored lookup mechanism + add new person to lookup + corrected un…
erodde Oct 8, 2024
318fec8
UBO-294 leadID instead of LSF-ID + new test
erodde Oct 16, 2024
645bc12
UBO-294 adapted caching object
erodde Oct 22, 2024
0af04ef
UBO-294 intermediate solution to index modsperson names and identifiers
fluetze Oct 24, 2024
b67e01c
UBO-294 Loading Startup Cache through Solr
erodde Oct 25, 2024
df1d8c7
UBO-294 add license file
erodde Oct 25, 2024
7b81627
UBO-295 Separate modsperson indexing and fixed repeated given names
fluetze Oct 29, 2024
2201211
UBO-294 Added details page display for modsperson object
fluetze Oct 29, 2024
1b49162
UBO-294 removal of modsperson reference in mods upon deletion + new s…
erodde Nov 4, 2024
ee432c1
UBO-294 MODSPersonEventHandler: activate and persist changes to mods …
erodde Nov 12, 2024
b7f26ec
UBO-294 override MCRNameMerger: compound-names and alternativeNames h…
erodde Nov 14, 2024
8a2b26f
Merge remote-tracking branch 'origin/develop' into issues/UBO-294-Imp…
erodde Nov 19, 2024
938fc92
UBO-294 updated alternativeName handling
erodde Nov 19, 2024
a84d613
UBO-294 test fix
erodde Nov 19, 2024
af81d32
UBO-294 changed mode in modsperson-solr.xsl to prevent overwriting pe…
erodde Nov 27, 2024
339ff06
UBO-374 new UI elements WIP
erodde Jan 20, 2025
2e91000
UBO-374 smaller corrections
erodde Jan 27, 2025
e3fde6b
Merge branch 'develop' into issues/UBO-294_UBO-374_user_interface
erodde Mar 12, 2025
e8116ca
UBO-374 new person page + detail page popups use data from modsperson
erodde Mar 21, 2025
073c7d0
UBO-375 migration preliminary draft
erodde Mar 26, 2025
8b93e3d
Merge branch 'develop' into issues/UBO-294_UBO-375_cid_to_modsperson_…
erodde Mar 26, 2025
fc4ef07
UBO-375 implemented deletion of users as part of migration
erodde Mar 31, 2025
5432142
UBO-375 unit tests
erodde Apr 1, 2025
c46fadc
Merge branch 'develop' into issues/UBO-294_UBO-374_user_interface
erodde Apr 3, 2025
caf7d90
UBO-376 dedup person first implement
erodde Apr 10, 2025
e6fd36a
UBO-376 null save name criteria
erodde Apr 11, 2025
7e3e8e0
UBO-376 modsperson-structure
erodde Apr 23, 2025
6c3f261
UBO-376 correct actions in modsperson-structure + correctly display N…
erodde Apr 24, 2025
c9a2a18
UBO-376 Unit Tests + Bugfix in DeduplicationCriterionResolver
erodde Apr 30, 2025
d5c3397
Merge branch 'issues/UBO-294_UBO-376_merge_duplicates' into issues/UB…
erodde May 6, 2025
c4af7fe
Merge branch 'issues/UBO-294_UBO-375_cid_to_modsperson_migration' int…
erodde May 6, 2025
6189b34
UBO-376 remove lead-ID after setting modsperson reference
erodde May 6, 2025
8dbde7b
Merge branch 'issues/UBO-294_UBO-376_merge_duplicates' into issues/UB…
erodde May 6, 2025
f37d9e6
UBO-401 new IdentityService MODSPersonSearchService
erodde May 14, 2025
8099870
UBO-402 new publication list in modsperson detail view
erodde May 28, 2025
be7821f
UBO-294 bugfixes: fix MODSPersonCachingStartupHandler + set modsperso…
erodde May 28, 2025
4c16b43
UBO-294 dont update mods metadata on on object create + test fix
erodde May 28, 2025
dce12f0
UBO-294 null-save access to SOLR fields
erodde Jun 12, 2025
8bc1a66
UBO-375 delete CIDs in its own migration command
erodde Jun 18, 2025
1f7e25b
UBO-375 small changes in modsperson migration + null-safe MODSPersonC…
erodde Jun 23, 2025
aaee97b
UBO-375 activate modsperson migration with refactored name
erodde Jun 30, 2025
4164832
UBO-375 improved command help description
erodde Jul 2, 2025
5cbf360
UBO-375 exclude some attributes from modsperson migration + display m…
erodde Jul 9, 2025
97491d7
UBO-375 add cases to unit test
erodde Jul 9, 2025
df07a82
UBO-374 correct display of modsperson structure details + fixed delet…
erodde Jul 14, 2025
212898d
UBO-374 fix modsperson display
erodde Jul 21, 2025
17196a8
UBO-416 Set mycore version to 2024.06.1-SNAPSHOT
Possommi Jun 18, 2025
d6c3fdb
UBO-416 Do not use already deprecated api
Possommi Jun 18, 2025
0ca773d
UBO-416 Set <maven.compiler.release>21</maven.compiler.release>
Possommi Jun 18, 2025
b1b0c7f
UBO-416 Removed dependency to httpclient/core 4.x
Possommi Jun 18, 2025
56dfffd
UBO-416 Replaced new URL() by new URI().toURL()
Possommi Jun 18, 2025
f90137f
UBO-416 Added UBO.DeduplicationKeyManager = org.mycore.ubo.dedup.jpa.…
Possommi Jun 18, 2025
58c124b
UBO-416 Added JPA configuration to mycore.properties. Removed persist…
Possommi Jun 18, 2025
1f22e81
UBO-416 Updated README.md
Possommi Jun 18, 2025
514305b
UBO-416 Updated maven-pr.yml and maven-publish-*.yml to support Java 21
Possommi Jun 18, 2025
7259561
UBO-416 Updated README.md, added empty JPA properties to mycore.prope…
Possommi Jun 19, 2025
250864b
UBO-416 Used property variable for default transformer factory instea…
Possommi Jun 19, 2025
4f1ab6c
UBO-416 Updated property MCR.JPA.MappingFileNames
Possommi Jun 19, 2025
7a2be85
UBO-416 Set mycore parent to 57
Possommi Jun 20, 2025
2c7b86f
UBO-416 Fixed MCR.JPA.Dialect property
Possommi Jun 26, 2025
e9d7981
UBO-416 Removed invocation of deprecated CloseableHttpResponse
Possommi Jul 30, 2025
9ddb9b6
Merge branch 'UBO-416-migrate-to-my-co-re-2024-06-x' into issues/UBO-…
erodde Aug 13, 2025
c14ffb1
UBO-294 changes to modsperson to migrate to mycore 2024.06.x + small …
erodde Aug 14, 2025
8a50263
UBO-294 MODSPersonReferenceDeletionAction for removing references + n…
erodde Aug 14, 2025
fb411cd
UBO-294 partial rollback to make branch runnable without changes in m…
erodde Aug 29, 2025
0dfb345
UBO-294 overwrite MCRMODSLinksEventHandler until changes implemented …
erodde Sep 26, 2025
468ba22
UBO-294 some improvements regarding linking and visualizing links
erodde Oct 16, 2025
ad8cbf1
UBO-294 new event handler for orcid transfer to modsperson + fix migr…
erodde Oct 29, 2025
75ff3ad
UBO-294 MODSPersonEventHandler delete references in mcrUser upon dele…
erodde Oct 30, 2025
3981cc5
Merge branch 'develop' into issues/UBO-294_Entwicklungsstand
erodde Sep 29, 2026
aa880c3
UBO-294 fix merge
erodde Sep 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@
</developers>
<modules>
<module>ubo-common</module>
<module>ubo-modsperson</module>
<module>ubo-webapp</module>
<module>ubo-cli</module>
</modules>
Expand Down
6 changes: 6 additions & 0 deletions ubo-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>ubo-modsperson</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mycore</groupId>
<artifactId>mycore-ocfl</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions ubo-cli/src/main/setup/classifications/nameIdentifier.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
<label xml:lang="en" text="Local ID" />
<label xml:lang="x-display" text="false" />
</category>
<category ID="connection">
<label xml:lang="de" text="Connection ID" />
<label xml:lang="en" text="Connection ID" />
<label xml:lang="x-display" text="false" />
<category ID="modsperson">
<label xml:lang="de" text="Modsperson ID" />
<label xml:lang="en" text="Modsperson ID" />
<label xml:lang="x-display" text="true" />
</category>
</categories>
</mycoreclass>
6 changes: 6 additions & 0 deletions ubo-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@
<artifactId>mycore-webtools</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mycore.ubo</groupId>
<artifactId>ubo-modsperson</artifactId>
<version>dev-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
Expand Down
12 changes: 12 additions & 0 deletions ubo-common/src/main/java/org/mycore/ubo/DozBibEntryServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.mycore.common.MCRMailer;
import org.mycore.common.config.MCRConfiguration2;
import org.mycore.common.content.MCRJDOMContent;
import org.mycore.datamodel.common.MCRLinkTableManager;
import org.mycore.datamodel.common.MCRXMLMetadataManager;
import org.mycore.datamodel.metadata.MCRMetaLinkID;
import org.mycore.datamodel.metadata.MCRMetadataManager;
Expand All @@ -29,8 +30,10 @@
import org.mycore.mods.MCRMODSWrapper;

import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;

public class DozBibEntryServlet extends MCRServlet {

Expand Down Expand Up @@ -110,6 +113,15 @@ private void deleteEntry(HttpServletRequest req, HttpServletResponse res) throws
return;
}

MCRLinkTableManager linkTableManager = MCRLinkTableManager.getInstance();
if (linkTableManager.countReferenceLinkTo(oid) > 0) {
Collection<String> linkedIds = linkTableManager.getSourceOf(oid);
String message = String.format(Locale.ROOT, "Entry still has %d linked entries: %s",
linkedIds.size(), String.join(", ", linkedIds));
res.sendError(HttpServletResponse.SC_CONFLICT, message);
return;
}

obj.getService().setState("deleted");
Document xml = obj.createXML();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.mycore.datamodel.metadata.MCRObjectID;
import org.mycore.mods.merger.MCRHyphenNormalizer;
import org.mycore.ubo.dedup.jpa.DeduplicationKeyManager;
import org.mycore.ubo.dedup.jpa.DeduplicationKeyManager.DedupType;

import java.text.Normalizer;
import java.text.Normalizer.Form;
Expand Down Expand Up @@ -63,7 +64,8 @@ public void updateDeDupCriteria(Element mods, MCRObjectID id) {

// add new dedup keys, if any
for (DeDupCriterion criteria : getDeDupCriteria(mods)) {
deduplicationKeyManager.addDeduplicationKey(id.toString(), criteria.getType(), criteria.getKey());
deduplicationKeyManager.addDeduplicationKey(id.toString(),
DedupType.fromString(criteria.getType()), criteria.getKey());
}

/* add dedup keys for the host, too or not???
Expand All @@ -75,10 +77,34 @@ public void updateDeDupCriteria(Element mods, MCRObjectID id) {
} */
}

public void updateDeDupCriteriaPerson(Element modsperson, MCRObjectID id) {
// remove existion dedup keys
for (Element extension : modsperson.getChildren("extension", MCRConstants.MODS_NAMESPACE)) {
extension.removeChildren("dedup");
if(extension.getChildren().isEmpty()) {
extension.detach();
}
}
DeduplicationKeyManager deduplicationKeyManager = DeduplicationKeyManager.getInstance();

if (modsperson.getName().equals("mods")) {
deduplicationKeyManager.clearDeduplicationKeys(id.toString());
}
// add new dedup keys, if any
for (DeDupCriterion criteria : getDeDupCriteriaPerson(modsperson)) {
deduplicationKeyManager.addDeduplicationKey(id.toString(),
DedupType.fromString(criteria.getType()), criteria.getKey());
}
}

private Set<DeDupCriterion> getDeDupCriteria(Element mods) {
return buildFromMODS(mods);
}

private Set<DeDupCriterion> getDeDupCriteriaPerson(Element modsPerson) {
return buildFromMODSPerson(modsPerson);
}

/**
* Builds deduplication criteria from the given MODS publication metadata
*/
Expand All @@ -102,6 +128,43 @@ public Set<DeDupCriterion> buildFromMODS(Element mods) {
return criteria;
}

/**
* Builds deduplication criteria from the given MODS person metadata
*/
public Set<DeDupCriterion> buildFromMODSPerson(Element modsperson) {
Set<DeDupCriterion> criteria = new HashSet<>();

for (Element identifier : removeEmptyElements(getNodes(modsperson,
"mods:name[@type='personal']/mods:nameIdentifier"))) {
if (identifier.getAttributeValue("type") != null &&
!identifier.getAttributeValue("type").equals("connection")) {
criteria.add(buildFromNameIdentifier(identifier));
}
}

for (Element name : getNodes(modsperson, "mods:name[@type='personal']")) {
Element familyName = getNodes(name, "mods:namePart[@type='family']").isEmpty() ?
null : getNodes(name, "mods:namePart[@type='family']").get(0);
Element givenName = getNodes(name, "mods:namePart[@type='given']").isEmpty() ?
null : getNodes(name, "mods:namePart[@type='given']").get(0);
if (givenName != null && familyName != null) {
criteria.add(buildFromFullName(givenName, familyName));
}

for (Element alternativeName : getNodes(modsperson, "mods:alternativeName")) {
Element altFamilyName = getNodes(alternativeName, "mods:namePart[@type='family']") == null ?
null : getNodes(alternativeName, "mods:namePart[@type='family']").get(0);
Element altGivenName = getNodes(alternativeName, "mods:namePart[@type='given']") == null ?
null : getNodes(alternativeName, "mods:namePart[@type='given']").get(0);
if (altGivenName != null && altFamilyName != null) {
criteria.add(buildFromFullName(altGivenName, altFamilyName));
}
}
}

return criteria;
}

/**
* Helper method to get a list of nodes by specifying an xPath
*
Expand Down Expand Up @@ -147,6 +210,16 @@ public DeDupCriterion buildFromIdentifier(String type, String value) {
return new DeDupCriterion("identifier", type + ":" + value);
}

/**
* Builds a deduplication criterion from a mods:nameIdentifier element
*/
public DeDupCriterion buildFromNameIdentifier(Element identifier) {
String type = identifier.getAttributeValue("type");
String value = identifier.getTextTrim();
value = value.replaceAll("-", "");
return new DeDupCriterion("nameidentifier", type + ":" + value);
}

/**
* Builds a deduplication criterion for a given mods:shelflocator
*/
Expand Down Expand Up @@ -182,7 +255,7 @@ private String getCombinedTitle(Element modsTitle) {
}

/**
* Builds a combined deduplication criterion from a title and author elment.
* Builds a combined deduplication criterion from a title and author element.
* That means both must match together to identify duplicates.
*/
public DeDupCriterion buildFromTitleAuthor(String title, String author) {
Expand All @@ -191,6 +264,16 @@ public DeDupCriterion buildFromTitleAuthor(String title, String author) {
return new DeDupCriterion("ta", author + ": " + title);
}

/**
* Builds a combined deduplication criterion from a given and family name.
* That means both must match together to identify duplicates.
*/
public DeDupCriterion buildFromFullName(Element givenNameModsPart, Element familyNameModsPart) {
String givenName = normalizeText(givenNameModsPart.getTextTrim());
String familyName = normalizeText(familyNameModsPart.getTextTrim());
return new DeDupCriterion("name", givenName + ":" + familyName);
}

/**
* Normalizes text to be fault tolerant when matching for duplicates.
* Accents, umlauts, case are normalized. Punctuation and non-alphabetic/non-digit characters are removed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ protected void handleObjectRepaired(MCREvent evt, MCRObject obj) {

@Override
protected void handleObjectDeleted(MCREvent evt, MCRObject obj) {
LOGGER.info("clearing deduplication keys and no duplicates for object " + obj.getId().toString());
LOGGER.info("clearing deduplication keys and no duplicates for object " + obj.getId());
DeduplicationKeyManager.getInstance().clearDeduplicationKeys(obj.getId().toString());
DeduplicationKeyManager.getInstance().clearNoDuplicates(obj.getId().toString());

}

private void updateDeDupCriteria(MCRObject obj) {
LOGGER.info("updating deduplication keys for object " + obj.getId().toString());
if (!("mods".equals(obj.getId().getTypeId()) || "modsperson".equals(obj.getId().getTypeId()))) {
return;
}
LOGGER.info("updating deduplication keys for object " + obj.getId());
Element mods = new MCRMODSWrapper(obj).getMODS();
new DeDupCriteriaBuilder().updateDeDupCriteria(mods, obj.getId());
if ("mods".equals(obj.getId().getTypeId())) {
new DeDupCriteriaBuilder().updateDeDupCriteria(mods, obj.getId());
} else {
new DeDupCriteriaBuilder().updateDeDupCriteriaPerson(mods, obj.getId());
}
}
}
57 changes: 43 additions & 14 deletions ubo-common/src/main/java/org/mycore/ubo/dedup/DeDupResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import jakarta.ws.rs.core.Response;
import org.mycore.ubo.AccessControl;
import org.mycore.ubo.dedup.jpa.DeduplicationKeyManager;
import org.mycore.ubo.dedup.jpa.DeduplicationKeyManager.DedupType;
import org.mycore.ubo.dedup.jpa.DeduplicationNoDuplicate;

import java.util.List;
Expand All @@ -23,28 +24,56 @@ public class DeDupResource {
@Path("list/duplicates")
@Produces(MediaType.APPLICATION_JSON)
public Response listDedup(@QueryParam("idSort") String idSortStr, @QueryParam("typeSort") String typeSortStr, @QueryParam("type") String type) {
DedupType[] filter = DeduplicationKeyManager.PUBLICATION_CATEGORY_GROUP;
if (type != null) {
filter = new DedupType[] {
DedupType.fromString(type) };
}
return listDedupIntern(idSortStr, typeSortStr, filter);
}

@GET
@Path("list/duplicates-person")
@Produces(MediaType.APPLICATION_JSON)
public Response listDedupPerson(@QueryParam("idSort") String idSortStr, @QueryParam("typeSort") String typeSortStr, @QueryParam("type") String type) {
DedupType[] filter = DeduplicationKeyManager.PERSON_CATEGORY_GROUP;
if (type != null) {
filter = new DedupType[] {
DedupType.fromString(type) };
}
return listDedupIntern(idSortStr, typeSortStr, filter);
}

/**
* Returns a sorted list of all duplicates of the given deduplication types.
* @param idSortStr sort order of id field (asc, desc, none)
* @param typeSortStr sort order of type field (asc, desc, none)
* @param dedupTypes all {@link DeduplicationKeyManager.DedupType dedup types} that should be searched for
* @return the dedup list
*/
private Response listDedupIntern(String idSortStr, String typeSortStr, DedupType[] dedupTypes) {

if (!AccessControl.currentUserIsAdmin()) {
return Response.status(Response.Status.FORBIDDEN).build();
}

DeduplicationKeyManager.SortOrder idSort = idSortStr == null ? DeduplicationKeyManager.SortOrder.NONE :
switch (idSortStr) {
case "asc" -> DeduplicationKeyManager.SortOrder.ASC;
case "desc" -> DeduplicationKeyManager.SortOrder.DESC;
case "none" -> DeduplicationKeyManager.SortOrder.NONE;
default -> throw new BadRequestException("Invalid sort order: " + idSortStr);
};
switch (idSortStr) {
case "asc" -> DeduplicationKeyManager.SortOrder.ASC;
case "desc" -> DeduplicationKeyManager.SortOrder.DESC;
case "none" -> DeduplicationKeyManager.SortOrder.NONE;
default -> throw new BadRequestException("Invalid sort order: " + idSortStr);
};

DeduplicationKeyManager.SortOrder typeSort = typeSortStr == null ? DeduplicationKeyManager.SortOrder.NONE :
switch (typeSortStr) {
case "asc" -> DeduplicationKeyManager.SortOrder.ASC;
case "desc" -> DeduplicationKeyManager.SortOrder.DESC;
case "none" -> DeduplicationKeyManager.SortOrder.NONE;
default -> throw new BadRequestException("Invalid sort order: " + typeSortStr);
};

List<PossibleDuplicate> duplicates = DeduplicationKeyManager.getInstance().getDuplicates(idSort, typeSort, type);
switch (typeSortStr) {
case "asc" -> DeduplicationKeyManager.SortOrder.ASC;
case "desc" -> DeduplicationKeyManager.SortOrder.DESC;
case "none" -> DeduplicationKeyManager.SortOrder.NONE;
default -> throw new BadRequestException("Invalid sort order: " + typeSortStr);
};

List<PossibleDuplicate> duplicates = DeduplicationKeyManager.getInstance().getDuplicates(idSort, typeSort, dedupTypes);
String json = new Gson().toJson(duplicates.toArray(), PossibleDuplicate[].class);
return Response.ok(json)
.header("Access-Control-Allow-Origin", "*")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.mycore.mods.MCRMODSWrapper;
import org.mycore.ubo.dedup.DeDupCriteriaBuilder;
import org.mycore.ubo.dedup.DeDupCriterion;
import org.mycore.ubo.dedup.jpa.DeduplicationKeyManager.DedupType;

import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
Expand Down Expand Up @@ -54,7 +55,8 @@ public Source resolve(String href, String base) throws TransformerException {
}

String relation = parts[2];
if(!Objects.equals("base", relation) && Objects.equals("parent", relation) && Objects.equals("host", relation)) {
if(!(Objects.equals("base", relation) || Objects.equals("parent", relation)
|| Objects.equals("host", relation) || Objects.equals("person", relation))) {
LOGGER.error("Unknown relation: {} in {}", relation, href);
return null;
}
Expand All @@ -80,19 +82,27 @@ public Source resolve(String href, String base) throws TransformerException {
if(Objects.equals("base", relation) || Objects.equals("parent", relation)) {
Set<DeDupCriterion> criteria = deDupCriteriaBuilder.buildFromMODS(mods);
criteria.forEach(criterion -> {
possibleDuplicates.addAll(DeduplicationKeyManager.getInstance().getDuplicates(id.toString(), criterion.getType(), criterion.getKey()));
possibleDuplicates.addAll(DeduplicationKeyManager.getInstance().getDuplicates(id.toString(),
Objects.requireNonNull(DedupType.fromString(criterion.getType())), criterion.getKey()));
});
} else {
} else if (Objects.equals("host", relation)) {
for (Element host : deDupCriteriaBuilder.getNodes(mods, "mods:relatedItem[@type='host']")) {
String externalID = host.getAttributeValue("href", MCRConstants.XLINK_NAMESPACE);
if(externalID != null) {
// skip external hosts, they get handled by their own object id
continue;
}
deDupCriteriaBuilder.buildFromMODS(host).forEach(criterion -> {
possibleDuplicates.addAll(DeduplicationKeyManager.getInstance().getDuplicates(id.toString(), criterion.getType(), criterion.getKey()));
possibleDuplicates.addAll(DeduplicationKeyManager.getInstance().getDuplicates(id.toString(),
Objects.requireNonNull(DedupType.fromString(criterion.getType())), criterion.getKey()));
});
}
} else {
Set<DeDupCriterion> criteria = deDupCriteriaBuilder.buildFromMODSPerson(mods);
criteria.forEach(criterion -> {
possibleDuplicates.addAll(DeduplicationKeyManager.getInstance().getDuplicates(id.toString(),
Objects.requireNonNull(DedupType.fromString(criterion.getType())), criterion.getKey()));
});
}

possibleDuplicates
Expand Down
Loading
Loading