Closed tpluscode closed 2 years ago
It looks like the struct for the last blank node does not have full triples?
{
"_:b77401": [
"time:hasEnd",
"time:inXSDDate"
]
}
Should be something like this instead i think?
{
"_:b77401": {
"time:hasEnd": "^xsd:date\"2021-01-01",
"time:inXSDDate": "^xsd:date\"2021-11-09"
}
}
Thanks for taking your time to look at this.
The _: b77401
node should in fact be a list [] :sh:resultPath ( time:hasEnd time:inXSDDate )
Oh I see. Yes for collections, a nested array will do the trick:
{
"_:b77401": {
"sh:resultPath": [ // this array is for different objects
[ // this array creates a collection
"time:hasEnd",
"inXSDDate",
],
],
}
did this work?
Sorry, haven't had the chance to try yet. Let me do that now
From your advice I figured that list nodes shared by multiple subjects are the problem. When extracted to a "top-level" node, the first rdf:first
/rdf:rest
must be broken up. Not unlike you'd type in turtle
ex:foo ex:list _:list .
ex:bar ex:list _:list .
ex:baz ex:list _:list .
_:list rdf:first "a" ; ref:rest ( "b" ) .
And so, the hash must reflect that:
{
"*": {
"_:list": {
"rdf:first": [ "\"a" ],
"rdf:rest": [
[ "\"b" ]
]
},
"ex:foo": { "ex:list": [ "_:list"] },
"ex:bar": { "ex:list": [ "_:list"] },
"ex:baz": { "ex:list": [ "_:list"] }
}
}
This appears to be correct. Please let me know if you think otherwise or feel free to close.
Thanks!
Ah, I see. Makes sense 👍
I'm seeing an error when trying to pretty-serialise the graph below using c4 terms in turtle. I cannot exactly place it but the problem is somewhere with the RDF List at the end
I think that the triples are correct, coming from a SHACL engine. Can you
Here's the full stack
And this is the c4 JSON I pass to the serializer