Wouldn't the union graph provide different answers in some cases? for example
g2 contains ?sub rdfs:subClassOf ex:foo and g3 contains ex:foo rdfs:subClassOf <http://xmlns.com/foaf/0.1/Person> . the original query would not resolve ?sub *rdfs:subClassOf** <http://xmlns.com/foaf/0.1/Person> . would it? but the union graph would. At least I think that is the case. On Thu, Feb 8, 2018 at 8:39 AM, Jean-Marc Vanel <jeanmarc.va...@gmail.com> wrote: > 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 > -- I like: Like Like - The likeliest place on the web <http://like-like.xenei.com> LinkedIn: http://www.linkedin.com/in/claudewarren