Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-15 Thread Kingsley Idehen
On 5/15/18 10:49 AM, Jason Koh wrote:
> Hi Kingsley,
>
> I know how to use inference rules thanks to the documents and I use it
> in other cases. But I don't know why I need inference in this case. I
> don't necessarily need to suppress that subClassOf* into a subClassOf
> with an inference and it's just a regular SPARQL query without any
> inferences. Furthermore, RDFS does not have an assumption of using OWL
> (transitive property).
>
> If it is the only way, I will add the inference rule for the
> convenience, but just want to leave a note that it's an unexpected
> behavior. 
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh 


Okay, so you know how to use built-in inferences and/or create custom
inference rules using Virtuoso. Thus, if your data contains
rdfs:subClassOf relations and you want to use property paths as per "*"
operator, what's the problem?

Remember I stated:

sparql
prefix : 
prefix rdf: >
prefix rdfs: >
prefix owl: >
insert IN GRAPH 
{
  :class1 a owl:Class .
  :class2 a owl:Class .
## Note relation added here ##
  :class2 rdfs:subClassOf :class1 .
  :entity0 a :class1.
  :entity1 a :class2.
  :entity2 a :class2.
  :entity0 :relation1 :entity1.
  :entity0 :relation1 :entity2.
}

Which implies the fact that :entity1 rdfs:subClassOf :entity0 isn't
explicitly stated in the data, unless you have some other named graph
holding those relations, hence the need for reasoning and inference.

If the relations are in place, you can use property paths. If not, you
need to materialize them by way of reasoning and inference.

-- 
Regards,

Kingsley Idehen   
Founder & CEO 
OpenLink Software   (Home Page: http://www.openlinksw.com)

Weblogs (Blogs):
Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
Blogspot Blog: http://kidehen.blogspot.com
Medium Blog: https://medium.com/@kidehen

Profile Pages:
Pinterest: https://www.pinterest.com/kidehen/
Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter: https://twitter.com/kidehen
Google+: https://plus.google.com/+KingsleyIdehen/about
LinkedIn: http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
: 
http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this



smime.p7s
Description: S/MIME Cryptographic Signature
--
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


Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-15 Thread Jason Koh
Hi Kingsley,

I know how to use inference rules thanks to the documents and I use it in
other cases. But I don't know why I need inference in this case. I don't
necessarily need to suppress that subClassOf* into a subClassOf with an
inference and it's just a regular SPARQL query without any inferences.
Furthermore, RDFS does not have an assumption of using OWL (transitive
property).

If it is the only way, I will add the inference rule for the convenience,
but just want to leave a note that it's an unexpected behavior.


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

On Mon, May 14, 2018 at 4:40 AM, Kingsley Idehen 
wrote:

> On 5/12/18 5:38 PM, Jason Koh wrote:
>
> Sorry I meant entity1 and entity 2 (not entity0 and entity1). And I found
> a more obvious proof of it.
>
>
> More obviously, if I run a query just with a/subClassOf*, it returns the
> correct result.
> ```
> sparql
> prefix : 
> prefix rdfs: 
> select ?o where {
>   ?o a/rdfs:subClassOf* :class2.
> };
> ```
> This returns both entity1 and entity2
>
> If I run
> ```
> sparql
> prefix : 
> prefix rdfs: 
> select ?s ?o where {
>   ?s :relation1 ?o.
> };
> ```
> It returns both entity1 and entity2.
>
> If I run
> ```
> sparql
> prefix : 
> prefix rdfs: 
> select ?s ?o where {
>   ?o a/rdfs:subClassOf* :class2.
>   ?s :relation1 ?o.
> };
> ```
> It returns entity0 only.
>
>
> It looks like a bug to me.
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh 
>
>
> You need to create an inference rule to make this work.
>
> You could easily have found out how to do this by searching our docs or
> just searching on google.
>
> 1. Make you inference rule based on a named graph that has a relation that
> designates rdfs:subClassOf as being a owl:Transitive property
>
> 2. Make you query with the inference rule enabled.
>
>
> You can also create your own custom inference rule if you want.
> There are lots of documents about these capabilities that you can lookup
> by doing a little bit of research.
>
> --
> Regards,
>
> Kingsley Idehen   
> Founder & CEO
> OpenLink Software   (Home Page: http://www.openlinksw.com)
>
> Weblogs (Blogs):
> Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
> Blogspot Blog: http://kidehen.blogspot.com
> Medium Blog: https://medium.com/@kidehen
>
> Profile Pages:
> Pinterest: https://www.pinterest.com/kidehen/
> Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
> Twitter: https://twitter.com/kidehen
> Google+: https://plus.google.com/+KingsleyIdehen/about
> LinkedIn: http://www.linkedin.com/in/kidehen
>
> Web Identities (WebID):
> Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
> : 
> http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this
>
>
--
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


Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-14 Thread Kingsley Idehen
On 5/12/18 5:38 PM, Jason Koh wrote:
> Sorry I meant entity1 and entity 2 (not entity0 and entity1). And I
> found a more obvious proof of it.
>
>
> More obviously, if I run a query just with a/subClassOf*, it returns
> the correct result.
> ```
> sparql
> prefix : 
> prefix rdfs: 
> select ?o where {
>   ?o a/rdfs:subClassOf* :class2.
> };
> ```
> This returns both entity1 and entity2
>
> If I run
> ```
> sparql
> prefix : 
> prefix rdfs: 
> select ?s ?o where {
>   ?s :relation1 ?o.
> };
> ```
> It returns both entity1 and entity2.
>
> If I run
> ```
> sparql
> prefix : 
> prefix rdfs: 
> select ?s ?o where {
>   ?o a/rdfs:subClassOf* :class2.
>   ?s :relation1 ?o.
> };
> ```
> It returns entity0 only.
>
>
> It looks like a bug to me.
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh 


You need to create an inference rule to make this work.

You could easily have found out how to do this by searching our docs or
just searching on google.

1. Make you inference rule based on a named graph that has a relation
that designates rdfs:subClassOf as being a owl:Transitive property

2. Make you query with the inference rule enabled.


You can also create your own custom inference rule if you want.
There are lots of documents about these capabilities that you can lookup
by doing a little bit of research.

-- 
Regards,

Kingsley Idehen   
Founder & CEO 
OpenLink Software   (Home Page: http://www.openlinksw.com)

Weblogs (Blogs):
Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
Blogspot Blog: http://kidehen.blogspot.com
Medium Blog: https://medium.com/@kidehen

Profile Pages:
Pinterest: https://www.pinterest.com/kidehen/
Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter: https://twitter.com/kidehen
Google+: https://plus.google.com/+KingsleyIdehen/about
LinkedIn: http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
: 
http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this



smime.p7s
Description: S/MIME Cryptographic Signature
--
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


Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-12 Thread Jason Koh
I want to use the subClassOf* to find instances of any subclasses of class2
including itself. I guess example return values would make this case
clearer. Before talking about the example, let me explain it in the high
level first. Below two lines should be equal for my original graph.
?o a/rdfs:subClassOf* :class2.
==
?o a :class2.
As there subClassOf* means zero or more paths to class2 with subClassOf
relationships,* a/rdfs:subClassOf* should be interpreted as "a" or
"a/rdfs:subClassOf" or "a/rdfs:subClassOf/rdfs:subClassOf* ... and so on.*

I guess we need to agree on the above statement. Let me know if I am wrong.

If the above case is right, I am looking for instances of class2 with the
above pattern, so I do not need class1 rdfs:subClassOf class2. And I didn't
intend that pattern.


More obviously, *a query with subClassOf* returns only one result,
"test:entity0", while a query without subClassOf* returns both entities
"test:entity0" and "test:entity1"*. With your suggestion, the first query
should return nothing.


Note: there was a typo in the namespace in the query. Here's the right one
```
sparql
prefix : 
prefix rdfs: 
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.
};
```
The above returns one tuple, "test:entity0", though entity0 and entity1 are
exactly in the same pattern.

```
sparql
prefix : 
prefix rdfs: 
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.
};
```
This returns two tuples.

Let me know if it's still unclear.

Thank you!


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

On Sat, May 12, 2018 at 2:20 PM, Kingsley Idehen 
wrote:

> On 5/12/18 5:11 PM, Jason Koh wrote:
>
> From https://www.w3.org/TR/sparql11-property-paths/,
> *elt** A path of zero or more occurrences of *elt*.
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh 
>
>
>
> You have:
>
>
>
> You have:
>
> ```
> sparql
> prefix : 
> prefix rdf: 
> prefix rdfs: 
> prefix owl: 
> insert IN GRAPH 
> {
>   :class1 a owl:Class .
>   :class2 a owl:Class .
>   :entity0 a :class1.
>   :entity1 a :class2.
>   :entity2 a :class2.
>   :entity0 :relation1 :entity1.
>   :entity0 :relation1 :entity2.
> };
> ```
>
> Where are your rdfs:subClassOf relations?
>
> Implies it should have been:
>
> ```
> sparql
> prefix : 
> prefix rdf: 
> prefix rdfs: 
> prefix owl: 
> insert IN GRAPH 
> {
>   :class1 a owl:Class .
>   :class2 a owl:Class .
> ## Note relation added here ##
>   :class2 rdfs:subClassOf :class1 .
>   :entity0 a :class1.
>   :entity1 a :class2.
>   :entity2 a :class2.
>   :entity0 :relation1 :entity1.
>   :entity0 :relation1 :entity2.
> };
> ```
>
> Kingsley
>
>
> On Sat, May 12, 2018 at 2:10 PM, Jason Koh  wrote:
>
>> Hi Kingsley,
>>
>> I put * path modifier, which should also match no subClassOf relationship
>> pattern in my understanding.
>>
>>
>> With regards,
>> Jason Koh
>> cseweb.ucsd.edu/~jbkoh 
>>
>> On Sat, May 12, 2018 at 1:57 PM, Kingsley Idehen 
>> wrote:
>>
>>> On 5/11/18 4:56 PM, Jason Koh 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 : 
>>> prefix rdf: 
>>> prefix rdfs: 
>>> prefix owl: 
>>> insert IN GRAPH 
>>> {
>>>   :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  where {?s ?p ?o .};
>>> ```
>>>
>>> - The problem query
>>> ```
>>> sparql
>>> prefix : 
>>> prefix rdfs: 
>>> 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 transit

Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-12 Thread Kingsley Idehen
On 5/12/18 5:11 PM, Jason Koh wrote:
> From https://www.w3.org/TR/sparql11-property-paths/,
> /elt*/A path of zero or more occurrences of /elt/.
>
>
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh 


You have:



You have:

```
sparql
prefix : 
prefix rdf: 
prefix rdfs: 
prefix owl: 
insert IN GRAPH 
{
  :class1 a owl:Class .
  :class2 a owl:Class .
  :entity0 a :class1.
  :entity1 a :class2.
  :entity2 a :class2.
  :entity0 :relation1 :entity1.
  :entity0 :relation1 :entity2.
};
```

Where are your rdfs:subClassOf relations?

Implies it should have been:

```
sparql
prefix : 
prefix rdf: 
prefix rdfs: 
prefix owl: 
insert IN GRAPH 
{
  :class1 a owl:Class .
  :class2 a owl:Class .
## Note relation added here ##
  :class2 rdfs:subClassOf :class1 .
  :entity0 a :class1.
  :entity1 a :class2.
  :entity2 a :class2.
  :entity0 :relation1 :entity1.
  :entity0 :relation1 :entity2.
};
```

Kingsley

>
> On Sat, May 12, 2018 at 2:10 PM, Jason Koh  > wrote:
>
> Hi Kingsley,
>
> I put * path modifier, which should also match no subClassOf
> relationship pattern in my understanding.
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh 
>
> On Sat, May 12, 2018 at 1:57 PM, Kingsley Idehen
> mailto:kide...@openlinksw.com>> wrote:
>
> On 5/11/18 4:56 PM, Jason Koh 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 : 
>> prefix rdf: > >
>> prefix rdfs: > >
>> prefix owl: > >
>> insert IN GRAPH 
>> {
>>   :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  where {?s ?p ?o .};
>> ```
>>
>> - The problem query
>> ```
>> sparql
>> prefix : 
>> prefix rdfs: > >
>> 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 
>>
>
> You have:
>
> ```
> sparql
> prefix : 
> prefix rdf:  >
> prefix rdfs:  >
> prefix owl:  >
> insert IN GRAPH 
> {
>   :class1 a owl:Class .
>   :class2 a owl:Class .
>   :entity0 a :class1.
>   :entity1 a :class2.
>   :entity2 a :class2.
>   :entity0 :relation1 :entity1.
>   :entity0 :relation1 :entity2.
> };
> ```
>
> Where have are your rdfs:subClassOf relations?
>
>
> [1] http://docs.openlinksw.com/virtuoso/rdfsparqlruleexamples/
>  
> -- built-in inference docs .
>
>
> -- 
> Regards,
>
> Kingsley Idehen 
>   

Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-12 Thread Jason Koh
>From https://www.w3.org/TR/sparql11-property-paths/,
*elt** A path of zero or more occurrences of *elt*.


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

On Sat, May 12, 2018 at 2:10 PM, Jason Koh  wrote:

> Hi Kingsley,
>
> I put * path modifier, which should also match no subClassOf relationship
> pattern in my understanding.
>
>
> With regards,
> Jason Koh
> cseweb.ucsd.edu/~jbkoh
>
> On Sat, May 12, 2018 at 1:57 PM, Kingsley Idehen 
> wrote:
>
>> On 5/11/18 4:56 PM, Jason Koh 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 : 
>> prefix rdf: 
>> prefix rdfs: 
>> prefix owl: 
>> insert IN GRAPH 
>> {
>>   :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  where {?s ?p ?o .};
>> ```
>>
>> - The problem query
>> ```
>> sparql
>> prefix : 
>> prefix rdfs: 
>> 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 
>>
>>
>> You have:
>>
>> ```
>> sparql
>> prefix : 
>> prefix rdf: 
>> prefix rdfs: 
>> prefix owl: 
>> insert IN GRAPH 
>> {
>>   :class1 a owl:Class .
>>   :class2 a owl:Class .
>>   :entity0 a :class1.
>>   :entity1 a :class2.
>>   :entity2 a :class2.
>>   :entity0 :relation1 :entity1.
>>   :entity0 :relation1 :entity2.
>> };
>> ```
>>
>> Where have are your rdfs:subClassOf relations?
>>
>>
>> [1] http://docs.openlinksw.com/virtuoso/rdfsparqlruleexamples/  --
>> built-in inference docs .
>>
>>
>> --
>> Regards,
>>
>> Kingsley Idehen  
>> Founder & CEO
>> OpenLink Software   (Home Page: http://www.openlinksw.com)
>>
>> Weblogs (Blogs):
>> Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
>> Blogspot Blog: http://kidehen.blogspot.com
>> Medium Blog: https://medium.com/@kidehen
>>
>> Profile Pages:
>> Pinterest: https://www.pinterest.com/kidehen/
>> Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
>> Twitter: https://twitter.com/kidehen
>> Google+: https://plus.google.com/+KingsleyIdehen/about
>> LinkedIn: http://www.linkedin.com/in/kidehen
>>
>> Web Identities (WebID):
>> Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
>> : 
>> http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this
>>
>>
>> 
>> --
>> 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
>>
>>
>
--
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


Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-12 Thread Jason Koh
Hi Kingsley,

I put * path modifier, which should also match no subClassOf relationship
pattern in my understanding.


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

On Sat, May 12, 2018 at 1:57 PM, Kingsley Idehen 
wrote:

> On 5/11/18 4:56 PM, Jason Koh 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 : 
> prefix rdf: 
> prefix rdfs: 
> prefix owl: 
> insert IN GRAPH 
> {
>   :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  where {?s ?p ?o .};
> ```
>
> - The problem query
> ```
> sparql
> prefix : 
> prefix rdfs: 
> 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 
>
>
> You have:
>
> ```
> sparql
> prefix : 
> prefix rdf: 
> prefix rdfs: 
> prefix owl: 
> insert IN GRAPH 
> {
>   :class1 a owl:Class .
>   :class2 a owl:Class .
>   :entity0 a :class1.
>   :entity1 a :class2.
>   :entity2 a :class2.
>   :entity0 :relation1 :entity1.
>   :entity0 :relation1 :entity2.
> };
> ```
>
> Where have are your rdfs:subClassOf relations?
>
>
> [1] http://docs.openlinksw.com/virtuoso/rdfsparqlruleexamples/  --
> built-in inference docs .
>
>
> --
> Regards,
>
> Kingsley Idehen   
> Founder & CEO
> OpenLink Software   (Home Page: http://www.openlinksw.com)
>
> Weblogs (Blogs):
> Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
> Blogspot Blog: http://kidehen.blogspot.com
> Medium Blog: https://medium.com/@kidehen
>
> Profile Pages:
> Pinterest: https://www.pinterest.com/kidehen/
> Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
> Twitter: https://twitter.com/kidehen
> Google+: https://plus.google.com/+KingsleyIdehen/about
> LinkedIn: http://www.linkedin.com/in/kidehen
>
> Web Identities (WebID):
> Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
> : 
> http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this
>
>
> 
> --
> 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
>
>
--
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


Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-12 Thread Kingsley Idehen
On 5/11/18 4:56 PM, Jason Koh 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 : 
> prefix rdf: 
> prefix rdfs: 
> prefix owl: 
> insert IN GRAPH 
> {
>   :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  where {?s ?p ?o .};
> ```
>
> - The problem query
> ```
> sparql
> prefix : 
> prefix rdfs: 
> 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 
>

You have:

```
sparql
prefix : 
prefix rdf: 
prefix rdfs: 
prefix owl: 
insert IN GRAPH 
{
  :class1 a owl:Class .
  :class2 a owl:Class .
  :entity0 a :class1.
  :entity1 a :class2.
  :entity2 a :class2.
  :entity0 :relation1 :entity1.
  :entity0 :relation1 :entity2.
};
```

Where have are your rdfs:subClassOf relations?


[1] http://docs.openlinksw.com/virtuoso/rdfsparqlruleexamples/  --
built-in inference docs .


-- 
Regards,

Kingsley Idehen   
Founder & CEO 
OpenLink Software   (Home Page: http://www.openlinksw.com)

Weblogs (Blogs):
Legacy Blog: http://www.openlinksw.com/blog/~kidehen/
Blogspot Blog: http://kidehen.blogspot.com
Medium Blog: https://medium.com/@kidehen

Profile Pages:
Pinterest: https://www.pinterest.com/kidehen/
Quora: https://www.quora.com/profile/Kingsley-Uyi-Idehen
Twitter: https://twitter.com/kidehen
Google+: https://plus.google.com/+KingsleyIdehen/about
LinkedIn: http://www.linkedin.com/in/kidehen

Web Identities (WebID):
Personal: http://kingsley.idehen.net/public_home/kidehen/profile.ttl#i
: 
http://id.myopenlink.net/DAV/home/KingsleyUyiIdehen/Public/kingsley.ttl#this



smime.p7s
Description: S/MIME Cryptographic Signature
--
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


Re: [Virtuoso-users] A wrong behavior of SPARQL with transitive relationships.

2018-05-11 Thread Jason Koh
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  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 : 
> prefix rdf: 
> prefix rdfs: 
> prefix owl: 
> insert IN GRAPH 
> {
>   :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  where {?s ?p ?o .};
> ```
>
> - The problem query
> ```
> sparql
> prefix : 
> prefix rdfs: 
> 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