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