I created a simple query to show subjects with value of a DataType property. This query runs in Protege 3.4.3. But when I run in Jena I receive this title "com.hp.hpl.jena.sparql.engine.ResultSetStream@16be68f". Why? this is my query:
PREFIX VB: <http://VBnet#>
SELECT ?x ?y
WHERE {
?x rdf:type VB:LearnerInformation .
?x VB:Name 开发者_运维技巧?y
}
LearnerInformation is one class and Name is a Datatype property.
You have received a set of results, which is represented by a ResultSet. You can step through it as follows:
ResultSet results = ... // result of query
while (results.hasNext()) {
QuerySolution soln = results.next();
System.err.printf("X is '%s'\n", soln.getResource("x"));
System.err.printf("Y is '%s'\n", soln.getLiteral("y"));
}
Note that the results are structured objects themselves.
精彩评论