When several graph maps are elligible to generate a triple (e.g. one associated to the subject map, and another one associated to the predicate-object map), the ones targetting the default graph (via the special IRI rr:defaultGraph) are ignored.
Example:
data.json
[ { "id": "0", "name": "Alice" } ]
map.ttl
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix s: <http://schema.org/> .
[
a rr:TriplesMap;
rml:logicalSource [
rml:source "data.json" ;
rml:referenceFormulation ql:JSONPath ;
rml:iterator "$[*]";
];
rr:subjectMap [
rr:template "https://example.org/instances/{id}";
rr:class s:Person ;
rr:graph <graph:1> ;
];
rr:predicateObjectMap [
rr:predicate s:givenName ;
rr:objectMap [ rml:reference "name" ] ;
rr:graph rr:defaultGraph ;
];
] .
generates
<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
I would have expected
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> <graph:1> .
because according to the spec, both graph maps should apply to this predicate-object map.
By the way, if I replace rr:defaultGraph with <graph:2>, the "givenName" triple is indeed generated twice, once in <graph:1> and once in <graph:2>, which is consistent with my expectation above.
Note also that if I swap rr:defaultGraph and <graph:1> in map.ttl, I would expect
<https://example.org/instances/0> <http://schema.org/givenName> "Alice".
<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person>.
but instead I get
<https://example.org/instances/0> <http://schema.org/givenName> "Alice" <graph:1> .
<https://example.org/instances/0> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .
When several graph maps are elligible to generate a triple (e.g. one associated to the subject map, and another one associated to the predicate-object map), the ones targetting the default graph (via the special IRI
rr:defaultGraph) are ignored.Example:
data.json
map.ttl
generates
I would have expected
because according to the spec, both graph maps should apply to this predicate-object map.
By the way, if I replace
rr:defaultGraphwith<graph:2>, the "givenName" triple is indeed generated twice, once in<graph:1>and once in<graph:2>, which is consistent with my expectation above.Note also that if I swap
rr:defaultGraphand<graph:1>in map.ttl, I would expectbut instead I get