How can you implement concise bounded description using SPARQL CONSTRUCT if you don't want to rely on "black-boxed" implementations using SPARQL DESCRIBE?
The basic query for symmetric CBD would simply look like this:
CONSTRUCT {
:resource ?p1 ?o1 . # Outbound links
?s1 ?p2 :resource . # Inbound links
}
WHERE {
:resource ?p1 ?o1 .
?s1 ?p2 :resource .
}
However, since the CBD is trying to describe not only a resource but an entity, its boundaries are broader. To define boundaries of entity CBD "abuses" the semantics of blank-nodes and reified rdf:Statements and possibly other "dependent" resource, that don't have a separate identity (e.g., rdf:List comes to mind). The CBD specification thus further recursively describes (expands on) these dependent resources, which for blank nodes can look like this:
:resource ?p1 ?o1 .
FILTER (isBlank(?o1))
?o1 ?p2 ?o2 .
However, since SPARQL can't express recursion it is probably necessary to write down graph patterns for nested blank nodes/rdf:Statements/etc. explicitly with OPTIONAL clauses. I wrote "probably" because I was wondering if the recursive expansion of CBD cannot be solved by using SPARQL extensions for transitivity. For example, in the case of OpenLink's Virtuoso it's possible to use OPTION (TRANSITIVE) for subqueries (documentation). However so far, I haven't managed to implement it using the transitive extensions. I've also learnt it's possible to register a custom SPARQL DESCRIBE handler in Jena, however the documentation of this feature seems to be fairly sparse.
My question is then what do you think is the best way to implemented CBD in SPARQL using CONSTRUCT query and, if necessary, some extensions? Do you think it can be done? Will there be some problems with performance of the transitive queries?
asked
11 Jan, 10:22
jindrichm
1.4k●1●10
accept rate:
32%