I'm looking for a clear approach to use SWRL clearly in virtuoso server. For example, I designed an ontology using Protege 4.3 and I wrote the SWRL rules using Rules tab in Protege.
Product(?P),hasName(?P,?N),inGroupB(?P,?B)->hasBug(?P)
I uploaded my RDF data (~3GB) into Virtuoso server, along with the Ontology schema. I tried to recall the data that is supposed to be inferred based on the Rules in the ontology but the query return empty results. Example of the SPARQL query that it should clearly return the inferred relation form the rule above as follow:
DEFINE input:inference <http://example.com/2/owl>
PREFIX e:<http://example.com/e/>
SELECT *
FROM <http://example.com/2/data>
WHERE
{
?P a e:Product ;
e:hasBug ?B
}
I believe that I have problem on integrating the things together (RDF data ,OWL schema and SWRL rules). I used Jena and Virtuoso Jena driver in order to load data, ontology and run the SPARQL queries. Any advice on how to let the reasoning part work properly?
Virtuoso 7.x does not support SWRL.
Virtuoso 8.x implements SPIN, into which SWRL can be translated, among other complex reasoning.
See Creating Custom Inference Rules using the SPIN Vocabulary and Virtuoso 8.0 for one walk-through.
Your rough SWRL above translates roughly to --
-- or --
Once you have a SPARQL
CONSTRUCT
, making a Custom Inference Rule boils down to a few steps:EXEC ('SPARQL ' || SPARQL_SPIN_GRAPH_TO_DEFSPIN('{turtle-doc-with-rule-description-iri'))
More complete user documentation is in progress; you can get assistance via the Virtuoso Users mailing list or the OpenLink Support Case System.