I've been testing Sesame 2.7.2 and I got a big surprise when faced to the fact that DESCRIBE queries do not include blank nodes closure [EDIT: the right term for this is CBD for concise bounded description]
If I correctly understand, the SPARQL spec is quite loose on that and says that what is returned is actually up to the provider, but I'm still surprised at the choice, since bnodes (in the results of the describe query) cannot be used in subsequent SPARQL queries.
So the question is: how can I get a closed description of a resource <uri1>
without doing:
- query
DESCRIBE <uri1>
- iterate over the result to determine which objects are blank nodes
- then
DESCRIBE ?b WHERE { <uri1> pred_relating_to_bnode_ ?b }
- do it recursively and chaining over as long as bnodes are found
If I'm not mistaken, depth-2 bnodes would have to be described with
DESCRIBE ?b2 WHERE {<uri1> <p1&> ?b . ?b <p2> ?b2 }
unless there is a simpler way to do this?
Finally, would it not be better and simpler to let DESCRIBE
return a closed description of a resource where you can still obtain the currently returned result with something like the following?
CONSTRUCT {<uri1> ?p ?o} WHERE {<uri1> ?p ?o}
EDIT: here is an example of a closed result I want to get back from Sesame
<urn:sites#1> a my:WebSite .
<urn:sites#1> my:domainName _:autos1 .
<urn:sites#1> my:online "true"^^xsd:boolean .
_:autos1 a rdf:Alt .
_:autos1 rdf:_1 _:autos2
_:autos2 my:url "192.168.2.111:15001"@fr
_:autos2 my:url "192.168.2.111:15002"@en
Currently: DESCRIBE <urn:sites#1>
returns me the same result as the query CONSTRUCT WHERE {<urn:sites#1> ?p ?o}
, so I get only that
<urn:sites#1> a my:WebSite .
<urn:sites#1> my:domainName _:autos1 .
<urn:sites#1> my:online "true"^^xsd:boolean .
construct where { <uri1> ?p ?o }
. – Unbodied:Alice :likes :Bill, [ :named :Carl ] .
you're getting:Alice :likes Bill, []
for results fromdescribe :Alice
, but you want the full data. Is this right? – Unbodied:Bill :likes :Daphne
, so we didn't keep following the links from thedescribe
d resource. Do you have a particular definition in mind? – Unbodied