Re: on entailments and triple terms

It is indeed true that many SPARQL implementations do a poor job of optimizing 
queries that use the ontology facilities of RDFS.  It should be possible to 
run the query you provide at essentially the same speed as the version of the 
query that does not include subproperties on RDF graphs that have no relevant 
subproperty statements and with not much loss in speed on a graph that only 
has a few relevant subproperty statements (compared to running the simpler 
query on an RDF graph that has materialized the consequences of the 
subproperty statements).  If there are more than a few relevant subproperty 
statements then considerable extra time might be required I agree but my 
opinion is that optimizing performance on this kind of query is important.


peter


On 8/19/24 05:04, John Walker wrote:
>> For example, many queries do not take into account rdfs:subpropertyOf when
> 
>> querying non-ontology facts.  This has probably led to underuse of
> 
>> rdfs:subpropertyOf.  Even worse, SPARQL is incapable of uniformly querying
> 
>> ontologies that have subproperties of rdfs:subclassOf.  So, for example,
> 
>> SPARQL cannot uniformly query for class instances in Wikidata, as Wikidata has
> 
>> properties that are subproperties of its version of rdfs:subclassOf.
> 
> One practical challenge of using rdfs:subPropertyOf in real-world queries is that
> 
> in many cases the subject and object of the triple pattern will be variables or
> 
> blank nodes. It is then necessary to make the predicate a variable to match the
> 
> sub-property pattern, which quickly gets complex if we are interested in multiple
> 
> predicates.
> 
> A query like this will likely not perform on a non-trivial dataset:
> 
> prefix ex: <http://example.com/>
> 
> select ?o1 ?o2 ?o3
> 
> where {
> 
>    [] ?p1 ?o1 ;
> 
>      ?p2 ?o2 ;
> 
>      ?p3 ?o3 .
> 
>    ?p1 rdfs:subPropertyOf* ex:prop1 .
> 
>    ?p2 rdfs:subPropertyOf* ex:prop2 .
> 
>    ?p3 rdfs:subPropertyOf* ex:prop3 .
> 
> }
> 
> Adding RDF-star or RDFS+++ entailments into the mix as part of a query can
> 
> only increase the complexity.
> 
> Regards,
> 
> John Walker
> 
> Principal Consultant & co-founder
> 
> Semaku B.V. | Torenallee 20 (SFJ 3D) | 5617 BC Eindhoven | T +31 6 42590072 | 
> https://semaku.com/ <https://semaku.com/>
> 
> KvK: 58031405 | BTW: NL852842156B01 | IBAN: NL94 INGB 0008 3219 95
> 

Received on Monday, 19 August 2024 16:06:09 UTC