Re: Efficient SPARQL query for RDF collections

2021-01-14 Thread Andy Seaborne
On 14/01/2021 15:18, Mikael Pesonen wrote: Okay, so comparing the same examples, fast one:   1 (base   2   (prefix ((owl: )   3    (rdf: )   4    (skos:

Re: Efficient SPARQL query for RDF collections

2021-01-14 Thread Mikael Pesonen
Okay, so comparing the same examples, fast one: 1 (base 2 (prefix ((owl: ) 3(rdf: ) 4(skos: ) 5(rdfs:

Re: Efficient SPARQL query for RDF collections

2021-01-14 Thread Andy Seaborne
http://www.sparql.org/query-validator.html and use the "SPARQL algebra (general optimizations)" and on the command line: qparse --print=opt On 14/01/2021 10:53, Mikael Pesonen wrote: Would be really helpful to know how variables are bound etc if there exists a simple guide for that. This

Re: Efficient SPARQL query for RDF collections

2021-01-14 Thread Mikael Pesonen
I wasn't even aware of such thing. So SELECT ?class ?classLabel WHERE {   VALUES ?superClass  {id:308925008}   ?scIntsec list:member ?superClass .   ?scTmp owl:intersectionOf ?scIntsec .    ?class rdfs:subClassOf ?scTmp.    ?class skos:prefLabel ?classLabel . } runs under 20ms. Thanks! On

Re: Efficient SPARQL query for RDF collections

2021-01-14 Thread Andy Seaborne
Have you tried using the property function "list:member"? Andy On 13/01/2021 14:28, Mikael Pesonen wrote: Related to this. This query returns in 70ms SELECT ?class ?classLabel WHERE {   ?scIntsec rdf:rest*/rdf:first id:308925008 .   ?scTmp owl:intersectionOf ?scIntsec .   ?class rdfs:s

Re: Efficient SPARQL query for RDF collections

2021-01-14 Thread Mikael Pesonen
Would be really helpful to know how variables are bound etc if there exists a simple guide for that. This query SELECT count(?scIntsec) WHERE {   ?scIntsec rdf:first ?superClass . } returns 851029 which must be the reason for slowness in my case. But I'm still not getting why it matters and

Re: Efficient SPARQL query for RDF collections

2021-01-13 Thread Steve Vestal
I'm going to generalize this request a bit.  I earlier reported restructuring a query to get from 25 minutes to 90 ms, where I found the "Learning SPARQL" book to be helpful.  Do you know of any more detailed tutorial or guidelines focusing on performance issues, something that goes into a bit

Re: Efficient SPARQL query for RDF collections

2021-01-13 Thread Mikael Pesonen
Related to this. This query returns in 70ms SELECT ?class ?classLabel WHERE {   ?scIntsec rdf:rest*/rdf:first id:308925008 .   ?scTmp owl:intersectionOf ?scIntsec .   ?class rdfs:subClassOf ?scTmp.   ?class skos:prefLabel ?classLabel . } but this doesn't finish in 15 minutes (aborted then) SE

Re: Efficient SPARQL query for RDF collections

2020-12-16 Thread Mikael Pesonen
Hi, 3.17 seems to be about the same, but breaking down the query helped partially Original single subclass query: 28s, broke up query: 31ms ( returns 14 items) Original subclass of subclass: 150s ( returns 23 items), broke up query doesn't finish in 15 mins and Fuseki seems to hang. H

Re: Efficient SPARQL query for RDF collections

2020-12-15 Thread Andy Seaborne
On 15/12/2020 14:33, Mikael Pesonen wrote: Hi, I am querying subclasses of class (here id:365852007) which belongs to RDF collection like this id:1 rdf:type owl:Class ;     rdfs:subClassOf [ owl:intersectionOf ( ... id:365852007 ... ) ]  ;     skos:prefLabel "something"@en . id:

Efficient SPARQL query for RDF collections

2020-12-15 Thread Mikael Pesonen
Hi, I am querying subclasses of class (here id:365852007) which belongs to RDF collection like this id:1 rdf:type owl:Class ;     rdfs:subClassOf [ owl:intersectionOf ( ... id:365852007 ... ) ]  ;     skos:prefLabel "something"@en . id:2 rdf:type owl:Class ;     rdfs:subClassOf [