inference rule on rdfs:subClassOf

Matters relating to the Virtual Database Engine functionality realm such as:
- Master Data Management (virtualization of Heterogeneous SQL (ODBC/JDBC/ADO.NET/OLE-DB), XML, RDF, and SOA based data sources)
- Product Information Management (building RDF Linked Data Spaces from Product Catalog Data)
- RDFization Middleware for producing RDF Linked Data from non RDF Data Sources
- Enteprise Information & Data Integration (in general)

inference rule on rdfs:subClassOf

Postby ingeval on Fri Jan 14, 2011 3:05 pm

Hi,

I am trying to understand the RDFS inference rules, in particular the rdfs:subClassOf inference. I was hoping a query such as

Code: Select all
sparql select * where {<class1> rdfs:subClassOf ?superClass};


will return all super classes of <class1>, including both directly asserted and inferred, however, it seems to me only asserted super classes are returned.
Anyone can help me clarify?

Here is what I did:

1. I have this data set, <a> is a subclass of <b>, and <b> is subclass of <c>.
Code: Select all
@base <http://example.com/test/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<a> rdfs:subClassOf <b> .
<b> rdfs:subClassOf <c> .

<ia> rdf:type <a> .


2. add rule set
Code: Select all
rdfs_rule_set ('testrules', 'http://example.com/test/');


3. execute this query
Code: Select all
sparql
define input:inference "testrules"
select * where {<http://example.com/test/a> rdfs:subClassOf ?sup};


4. only <b> is returned, but I think <c> is also an answer as the result of rdfs:subClassOf inference.
ingeval
 
Posts: 3
Joined: Fri Jan 14, 2011 2:47 pm

Re: inference rule on rdfs:subClassOf

Postby hwilliams on Fri Jan 14, 2011 4:21 pm

Hi Yonggang,

As indicated in my email to you, I have been able to recreate the issue and reported to development for resolution ...

Best Regards
Hugh Williams
OpenLink Software
hwilliams
 
Posts: 904
Joined: Thu Mar 06, 2008 4:30 am

Re: inference rule on rdfs:subClassOf

Postby ingeval on Fri Jan 14, 2011 5:53 pm

thanks!

I just discovered a workaround for this issue:

if I add
Code: Select all
rdfs:subClassOf rdf:type owl:TransitiveProperty .


to the data set, i.e. inform Virtuoso to treat rdfs:subClassOf as transitive property, then everything worked as expected.
ingeval
 
Posts: 3
Joined: Fri Jan 14, 2011 2:47 pm

Re: inference rule on rdfs:subClassOf

Postby hwilliams on Fri Jan 14, 2011 8:22 pm

Hi

Ok, good to hear this is working for you as that is what development suggested also ...

Best Regards
Hugh Williams
OpenLink Software
hwilliams
 
Posts: 904
Joined: Thu Mar 06, 2008 4:30 am

Re: inference rule on rdfs:subClassOf

Postby caha42 on Tue Dec 06, 2011 10:30 am

Since this is an quite old thread and there have been some new versions out of Virtuoso, is this problem still actual? Because I am running into the same problem and the documentation still says that rdfs:subClassOf should be working out of the box (see http://docs.openlinksw.com/virtuoso/rdfsparqlrule.html).

I add the following triples:
Code: Select all
<http://www.nlm.nih.gov/cgi/mesh/2011/MB_cgi?field=uid&term=C23.888.646.100.200> <http://purl.org/dc/terms/identifier> "C23.888.646.100.200"@en .
<http://www.nlm.nih.gov/cgi/mesh/2011/MB_cgi?field=uid&term=C23.888.821.030.249> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.scai.fraunhofe
r.de/mesh> .
<http://www.scai.fraunhofer.de/mesh> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://www.w3.org/2004/02/skos/core#Concept> .


And then query:

Code: Select all
SELECT * WHERE {
<http://www.nlm.nih.gov/cgi/mesh/2011/MB_cgi?field=uid&term=C23.888.646.100.200> rdf:type ?type .
}


And get the result:

Code: Select all
type
http://www.scai.fraunhofer.de/mesh


But expected to get:

Code: Select all
type
http://www.scai.fraunhofer.de/mesh
http://www.w3.org/2004/02/skos/core#Concept


Do I have an error somewhere or is the old bug still not fixed?

I am using Virtuoso OpenSource Version 6.1.4.
caha42
 
Posts: 2
Joined: Tue Dec 06, 2011 10:24 am

Re: inference rule on rdfs:subClassOf

Postby hwilliams on Wed Dec 07, 2011 11:41 am

Hi

I have checked the rdfs:subClassOf example in the documentation and it work for me against a 6.1.4 build, this what is the ontology data and rule you are loading/creating here that is proving problematic ?

Best Regards
Hugh Williams
OpenLink Software
hwilliams
 
Posts: 904
Joined: Thu Mar 06, 2008 4:30 am

Re: inference rule on rdfs:subClassOf

Postby caha42 on Thu Dec 08, 2011 3:35 am

Hi,

I realized I just got the documentation wrong. I thought that rdfs:subClassOf would be recognized automatically in all the triples and not only in defined rule sets. So there was my problem. After I did it like in the example you posted the link to, everything worked fine.

But I really dislike that I have to create a rule set first, since my subClassOf relations are spreaded over ~300 files. Instead of making them all to rule sets, I grepped all subClassOf relations and collected them in one file, but anyhow, this is kind of additional work. I would prefer to be able to turn the subClassOf feature on in general, like it is possible in Owlim for example.

Best regards and thanks for your help,
Carina
caha42
 
Posts: 2
Joined: Tue Dec 06, 2011 10:24 am


Return to Virtuoso - Virtual Data Management

Who is online

Users browsing this forum: No registered users and 1 guest

cron