Skip to content

Commit

Permalink
Don't delete from context unknown fields
Browse files Browse the repository at this point in the history
AROMA now takes case of generating proper @context after every editing, and
the @context contains values that DV is not aware of, so we make sure these
won't get deleted.
  • Loading branch information
beepsoft committed Oct 27, 2023
1 parent 193f277 commit 6b577a7
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1102,12 +1102,12 @@ public RoCrate preProcessRoCrateFromAroma(Dataset dataset, String roCrateJson) t

// Delete properties from the @context, because AROMA only deletes them if they were added in aroma
// props added in DV won't be removed from the @context if they were deleted in AROMA
roCrateContext.fields().forEachRemaining(entry -> {
if (!rootDataEntityPropNames.contains(entry.getKey()) &&
roCrate.getAllContextualEntities().stream().noneMatch(ce -> ce.getProperties().has(entry.getKey()))) {
roCrate.deleteValuePairFromContext(entry.getKey());
}
});
// roCrateContext.fields().forEachRemaining(entry -> {
// if (!rootDataEntityPropNames.contains(entry.getKey()) &&
// roCrate.getAllContextualEntities().stream().noneMatch(ce -> ce.getProperties().has(entry.getKey()))) {
// roCrate.deleteValuePairFromContext(entry.getKey());
// }
// });

return roCrate;
}
Expand Down

0 comments on commit 6b577a7

Please sign in to comment.