Skip to content

3289 harvest via oai pmh of rein d space fails#3321

Open
lbownik wants to merge 34 commits into
developfrom
3289_Harvest_via_OAI_PMH_of_REIN_DSpace_fails
Open

3289 harvest via oai pmh of rein d space fails#3321
lbownik wants to merge 34 commits into
developfrom
3289_Harvest_via_OAI_PMH_of_REIN_DSpace_fails

Conversation

@lbownik

@lbownik lbownik commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@lbownik lbownik requested a review from rscipien July 2, 2026 11:16
if(this.protocol == null || this.authority == null || this.identifier == null) {
return "";
} else if(HTTP_PROTOCOL.equals(this.protocol) || HTTPS_PROTOCOL.equals(this.protocol)) {
return this.protocol + ':' + this.protocol + "://" + this.authority + this.identifier;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Two time this.protocol this was intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes - we have the following global id types: "doi", "hdl" "http" and "https"
in case of doi the string representation shall be
doi:blabla
in case of hdl the string represenation shall be
hdl:blablabla
so in case of http the string representation shall be
http:http://blablabalaba
ans in case of https the string respresentation shall be
htttps:https://blablabla

Comment on lines +114 to +122
final ArrayList<Node> identifiers = getNodes(document, "identifier");
if(identifiers.isEmpty()) {
throw new EJBException("Missing dc:identifier xml element");
}
for(final Node node : identifiers) {
version.addField(newField(otherId, null).
addChild(newField(otherIdValue, node.getTextContent())));
}
dataset.setGlobalId(createGlobalId(identifiers));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe this code could be moved where title is parsed. Both are required fields so maybe could be in the same place

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved it - tests broke. not worth it .

if (harvestingClient == null || harvestingClient.getDataverse() == null) {
public Dataset doImportHarvestedDataset(final DataverseRequest request,
final HarvestingClient client, final String identifier,
final HarvestImporterType importType, final String xml) throws ImportException {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would not change last parameter from metadata -> xml. In OAI-PMH specification content is called metadata

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

maybe - but naming it xml states exactly what this variable holds - an xml text


private GlobalId createGlobalId(final ArrayList<Node> identifierNodes) {

final List<String> identifiers = identifierNodes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If in this code we are only interested in first id, maybe just get first id and the do the logic without without for each type? final Optional<GlobalId> doi = identifiers .stream() .filter(GlobalId::isDOI) .findFirst()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

in this code fists we try to find UNBROKEN id of type HANDLE (there are broken ones in harvested xml documents)
it this fails we try finding UNBROKEN id of type HANDLE (again there are broken ones in receaved xml documents)
if this fails we try finding UNBROKEN is that is a URL (HTTP or HTTPS that is not DOI or HANDLE) (again there are bronke ones in received xml documents)
it it fails we fail

Id's can be placed in documents in any order but there are no more than one id of particular type in a single document.

Generally theseIDs are mess the code needs to handle somehow to maximise harvesting yeld.

@rscipien rscipien assigned lbownik and unassigned rscipien Jul 3, 2026
@lbownik lbownik assigned rscipien and unassigned lbownik Jul 5, 2026
@lbownik lbownik requested a review from rscipien July 5, 2026 09:40
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.

2 participants