Reputation: 921
The MarkLogic semantics documentation mentions that all SPARQL 1.1 property paths are supported, with the exception of negation. I have been unable to get the syntax where path length is specified to work, i.e.
elt{n,m} A path between n and m occurrences of elt.
elt{n} Exactly n occurrences of elt. A fixed length path.
elt{n,} n or more occurrences of elt.
elt{,n} Between 0 and n occurrences of elt.
If I try something like:
select ?leaf ?distance {
select ?leaf (count(?mid) as ?distance) {
?leaf <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} ?mid .
?mid <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} <http://rdf.abbvienet.com/infrastructure/person/10019933> .
}
group by ?leaf
}
I get the following error:
XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected {
Does this work for anyone else, or does anyone know whether this path syntax is supported or not in MarkLogic?
Upvotes: 3
Views: 197
Reputation: 4001
See the SPARQL 1.1 specification for property paths - Note this is different than earlier drafts for SPARQL Property Paths, and in particular the n-to-m occurrences of a property was removed.
You also may find this article useful - boundary for arbitrary property path in SPARQL 1.1.
As an aside, not that the sub-select in your query would be superfluous (if the query worked). The following is equivalent to what you have:
select ?leaf (count(?mid) as ?distance) {
?leaf <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} ?mid .
?mid <http://schemas.abbvienet.com/ontologies/infrastructure.owl#manager>{1,2} <http://rdf.abbvienet.com/infrastructure/person/10019933> .
}
group by ?leaf
Upvotes: 3