Student studies course, this is the statement. Individuals are Student1, Student2, Student3(subjects) and Course2(object). Student1, Student2, Student3 studies Course2 where some other students studies course1.
On Sat, Aug 22, 2015 at 12:09 PM, Chris Dollin <[email protected] > wrote: > On 08/22/2015 11:47 AM, kumar rohit wrote: > >> This code only displays "Student1" where it suppose to display Student1, >> student2 and student 3 as i made the ontology in Protege so.. In protege >> it >> displays all three but here in Jena its output is: >> | var | >> =============== >> | rr:Student1 | >> >> >> code is below >> > > Show the model and how you construct it. > > > >> __________________________________________________________________ >> String querystring="PREFIX rr:< >> http://www.semanticweb.org/asadali/ontologies/2015/5/untitled-ontology-22# >> >" >> + "SELECT ?var \n " >> + "WHERE {" >> + " ?var rr:studies rr:Course2 " + " }"; >> Query query=QueryFactory.create(querystring); >> QueryExecution qe = QueryExecutionFactory.create(query, m); >> try { >> ResultSet results = qe.execSelect(); >> ResultSetFormatter.out(System.out, results, query); >> //System.out.println(querystring); >> } >> >> > Chris >
