Skip to content

Commit fc155e6

Browse files
Executor: handle defaultGraph properly
1 parent 4c8dae3 commit fc155e6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Fixed
1111
- Better handle unsupported reference formulation (See [issue 247](https://github.com/RMLio/rmlmapper-java/issues/247))
12+
- Graph Maps with default graph must not be ignored (See [issue 252](https://github.com/RMLio/rmlmapper-java/issues/252))
1213

1314
## [7.3.2] - 2025-03-04
1415

src/main/java/be/ugent/rml/Executor.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,13 @@ private List<PredicateObjectGraph> combineMultiplePOGs(List<ProvenancedTerm> pre
372372
predicates.forEach(
373373
p -> objects.forEach(
374374
o -> graphs.forEach(
375-
g -> results.add(new PredicateObjectGraph(p, o, g))
375+
g -> {
376+
if (g.getTerm().equals(new NamedNode(NAMESPACES.RML2 + "defaultGraph"))) {
377+
results.add(new PredicateObjectGraph(p, o, null));
378+
} else {
379+
results.add(new PredicateObjectGraph(p, o, g));
380+
}
381+
}
376382
)
377383
)
378384
);
@@ -475,10 +481,8 @@ private void generatePredicateObjectsForSubjects(final List<ProvenancedTerm> sub
475481
TermGenerator pogGraphGenerator = pogGraphMappingInfo.getTermGenerator();
476482
if (pogGraphGenerator != null) {
477483
pogGraphGenerator.generate(record).forEach(term -> {
478-
if (!term.equals(new NamedNode(NAMESPACES.RML2 + "defaultGraph"))) {
479-
List<Term> graphTargets = getAllTargets(pogGraphMappingInfo, record);
480-
poGraphs.add(new ProvenancedTerm(term, null, graphTargets));
481-
}
484+
List<Term> graphTargets = getAllTargets(pogGraphMappingInfo, record);
485+
poGraphs.add(new ProvenancedTerm(term, null, graphTargets));
482486
});
483487
}
484488
}

0 commit comments

Comments
 (0)