Dear List members,

I am still hanging on this problem and though would send you another email.
Here is what i have done so far:

1. Let's say I have an ontology which I have loaded with TTLP function as
graph "http://myontology.org";. This ontology contains atleast this:
(baseuri: http://Entity.owl <http://entity.owl/>)

Person a owl:Class
Actor a owl:Class
Actor rdfs:subclassOf Person

2. And I have data that refers to the elements from the above ontology and
is loaded again with TTLP as graph "http://mydata.org";

a sample data is:

Don a Actor

3. Now I create a ruleset from the ontology in 1 using RDFS_Ruleset function
such as:
rdfs_rule_set ('http://inference.org', 'http://myontology.org');
4. As I am interested in checking the subclass relationship: here is what I
do at my local sparql endpoint interface:

define input:inference 'http://inference.org'  select ?s where {?s <
http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  <http://Entity.owl#Person
>}

I successfully get *Don*  as answer.

However when I do the same with the API as follows I get nothing:


///code start

String url;
if(args.length == 0)
            url = "jdbc:virtuoso://localhost:
1111/charset=UTF-8/log_enable=2";
 else
            url = args[0];


 VirtGraph set = new VirtGraph (url, "dba", "dba");



Query sparql = QueryFactory.create("define input:inference '
http://inference.org'  select ?s where {?s <
http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  <http://Entity.owl#Person
>}");

VirtuosoQueryExecution vqe = VirtuosoQueryExecutionFactory.create (sparql,
set);

ResultSet results = vqe.execSelect();

while (results.hasNext())
  {
com.hp.hpl.jena.query.QuerySolution result = results.nextSolution();
            RDFNode s = result.get("s");
            System.out.println("{ " + " " + s + "  }");

 }

///code end

due to define:inference in the above it gives me lexical error (as obviously
not being a standard sparql syntax) and when I remove it and try it again it
returns nothing. When I try it with


select ?s where {?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  <
http://Entity.owl#Actor>}


It works fine with *Don *again as an answer.

Any hints?


Thanks for your help

Dhaval

Reply via email to