Hi

I wonder about performance of  arbitrary length path in Jena :
https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#propertypath-arbitrary-length

For example , here is the query in semantic_forms for searching a string
with a type class. I added yesterday the rdfs:subClassOf* pattern.
I wonder if it would not be more efficient with the unionGraph instead of
numerous GRAPH blocks .

PREFIX text: <http://jena.apache.org/text#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX form: <
http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl#
>

SELECT DISTINCT ?thing ?COUNT WHERE {
 ?thing text:query ( 'Jean*' ) .

 graph ?g1 {
   ?thing a ?sub .
 }
 graph ?g2 {
   ?sub *rdfs:subClassOf** <http://xmlns.com/foaf/0.1/Person> .
 } .
 OPTIONAL {
   graph ?grCount {
    ?thing form:linksCount ?COUNT.
  } }
}
ORDER BY DESC(?COUNT)
LIMIT 10


-- 
Jean-Marc Vanel
http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me#subject
<http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
Déductions SARL - Consulting, services, training,
Rule-based programming, Semantic Web
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui

Reply via email to