Closed jeswr closed 3 years ago
Hi @jeswr, good idea!
I will comment here on the syntactical suggestion, and in #80 on the implementation.
I think that, instead of
person['foaf:friends*/foaf:givenName']
we should consider
person['foaf:friends*'].['foaf:givenName']
person['foaf:friends*'].foaf$givenName
person['foaf:friends*'].name
which seems to fit the chaining spirit of LDflex better.
And perhaps also
person.friends['*'].name
person.friends.star.name
person.friends.recursive.name
or with better words than star
/recursive
that I can't seem to find now 🙂
Hi @RubenVerborgh I agree that syntax closer to the chaining spirit of LDflex should be supported, however I am not quite sure how paths such as (ex:Mother|ex:Father)*
could be expressed in that manner. The best I can come up with off the top of my head is
person.star(['ex:mother', 'ex:father'])
and even then paths with nested operators such as (ex:Mother?|ex:Father)+
couldn't be expressed. Do you have any thoughts on how this could be achieved?
I also still think it would be nice for the original syntax to be supported - a current use case I have for #80 is to extract an sh:path
(SHACL path) in SPARQL/SHACLC syntax and then pass the path to LDflex.
Right. Would person['foaf:friends*'].['foaf:givenName']
currently be supported though?
Note that introducing full SPARQL paths does introduce some demands on the query engine. It will no longer work with the rdflib.js backend, for instance.
Yep #80 should already support that as 'foaf:friends*'
would be processed using the code that I added to the JSONLD-resolver and 'foaf:givenName'
would be processed by the existing predicate resolver. For all intents and purposes complex paths are just treated as a predicate by the rest of LDflex in #80
Okay. I think it makes sense to continue with #80 then.
It would be nice to index using complex SPARQL paths, for instance