Correction:
The current transitive relationship is commented out (which returns partial
results) and the line without transitive relationship is uncommented (which
return all results as I expected.)


With regards,
Jason Koh
cseweb.ucsd.edu/~jbkoh

On Fri, May 11, 2018 at 1:56 PM, Jason Koh <jb...@eng.ucsd.edu> wrote:

> Hi,
>
> I am using Virtuoso opensource v7.2.4. I found that SPARQLs with
> transitive relationships return partial results. Could you confirm this
> behavior? Here are the reproducing ISQL queries.
>
> - Data insertion:
>
> ```
> sparql
> prefix : <http://test.abc#>
> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> prefix owl: <http://www.w3.org/2002/07/owl#>
> insert IN GRAPH <urn:test1>
> {
>   :class1 a owl:Class .
>   :class2 a owl:Class .
>   :entity0 a :class1.
>   :entity1 a :class2.
>   :entity2 a :class2.
>   :entity0 :relation1 :entity1.
>   :entity0 :relation1 :entity2.
> };
> ```
>
> - Verification of the data
>
> ```
> sparql
> select ?s ?p ?o from <urn:test1> where {?s ?p ?o .};
> ```
>
> - The problem query
> ```
> sparql
> prefix : <http://test.abc>
> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> select ?s ?o where {
>   #?o a/rdfs:subClassOf* :class2. # Only returns a tuple. I think
> incorrect.
>   ?o a :class2. # returns all the tuples. I think correct.
>   ?s :relation1 ?o.
> };
> ```
>
> If I run the above query, it only returns one pair of ?s and ?o instead of
> two pairs of (entity0, entity1) and (entity0, entity1). If I comment out
> the transitive line and uncomment the second line, it returns the correct
> result with the two pairs. I believe those two queries should return the
> same result.
>
> Is this a bug or do I misunderstand something in the SPARQL?
>
> Thank you!
>
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to