On 08/22/2015 12:15 PM, kumar rohit wrote:
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.

I mean the actual triples that are in the model, as produced by, say,
writing it as Turtle.

And how you construct it. (It might matter whether it's a Model or
and OntModel, for example.)

Show what we call a "minimal complete example"; the smallest code&model
that shows the problem.

(We might want to run your query against it to see what /we/ gte as
a reslt.)

Chris

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


Reply via email to