Closed dachafra closed 4 years ago
Hi, thanks for your bug report.
I assume you are using the toRDF:true option for getting n3/ttl output.
Inernally we work with JSONLD and then convert it to ttl. It seems to me that something weird/unexpected is happening during the conversion of jsonld to ttl.
We use the package jsonld
to do this for us.
I used your example mapping and csv files:
2nd Tripplemap with subjectMap rr:template "http://{value}" (with starting http://) In JSON-LD:
[
{
"@id": "http://hello"
},
{
"@id": "http://ex.com/1",
"http://ex.com#example": {
"@id": "http://hello"
}
}
]
In N3/Turtle:
<http://ex.com/1> <http://ex.com#example> <http://hello> .
Everything is fine.
2nd Tripplemap with subjectMap rr:template "{value}" (without starting http://) In JSON-LD:
[
{
"@id": "hello"
},
{
"@id": "http://ex.com/1",
"http://ex.com#example": {
"@id": "hello"
}
}
]
In N3/Turtle:
# no turtle generated
The jsonld
package doesn't allow relative iris, so the tripple is ommited (see https://w3c.github.io/json-ld-api/#dfn-well-formed and https://github.com/digitalbazaar/jsonld.js/blob/7cf2f7155f7d9af6b1c60404cbeeb87788694883/lib/toRdf.js#L275).
2nd Tripplemap with subjectMap rml:reference "value" and no predicateObjectMap in first TrippleMap In JSON-LD:
[
{
"@id": "_:hello"
},
{
"@id": "http://ex.com/1"
}
]
In N3/Turtle:
# no turtle generated
The jsonld doesnt contain any tripples (no subject predicate object) so no tripples are generated.
2nd Tripplemap with subjectMap rml:reference "value" and a predicateObjectMap in first TrippleMap In JSON-LD:
[
{
"@id": "_:hello"
},
{
"@id": "http://ex.com/1",
"http://ex.com#example": {
"@id": "_:hello"
}
}
]
In N3/Turtle:
<http://ex.com/1> <http://ex.com#example> _:b0 .
The jsonld package makes new blank node ids when transforming to rdf. So _:hello
becomes :_b0
. They are semantically equivalent. (also described in https://w3c.github.io/json-ld-api/#deserialize-json-ld-to-rdf-algorithm)
TL;DR Error/Unexpected happens when converting from JSON-LD to turtle/RDF. I don't think there is anything we can do about that. You could try to output JSON-LD and use another JSONLD->RDF converter.
When there is a join between two TriplesMap (
rr:parentTriplesMap
does not contain any POM):rr:parentTriplesMap
specifies arr:template
that does not start withhttp:/
it does not generate anything (although the referenced value stars withhttp://
)rr:parentTriplesMap
specifiesrml:reference
instead ofrr:template
does not generate anythingrr:parentTriplesMap
specifiesrml:reference
and the value is used in the join condition it outputs a blank node as Object of the generated triple. Example attached.mapping-data-join.zip