Skip to content

Commit

Permalink
avoid empty data to create phantom records for datacite import
Browse files Browse the repository at this point in the history
  • Loading branch information
floriangantner committed May 10, 2024
1 parent 9cd1a10 commit 9667a33
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,16 @@ public Collection<ImportRecord> getRecords(String query, int start, int count) t
Iterator<JsonNode> iterator = dataNode.iterator();
while (iterator.hasNext()) {
JsonNode singleDoiNode = iterator.next();
String json = singleDoiNode.at("/attributes").toString();
records.add(transformSourceRecords(json));
JsonNode singleDoiNodeAttribute = singleDoiNode.at("/attributes");
if (!singleDoiNodeAttribute.isMissingNode()) {
records.add(transformSourceRecords(singleDoiNodeAttribute.toString()));
}
}
} else {
String json = dataNode.at("/attributes").toString();
records.add(transformSourceRecords(json));
JsonNode singleDoiNodeAttribute = dataNode.at("/attributes");
if (!singleDoiNodeAttribute.isMissingNode()) {
records.add(transformSourceRecords(singleDoiNodeAttribute.toString()));
}
}

return records;
Expand Down

0 comments on commit 9667a33

Please sign in to comment.