A have a problem with receiving SPARQL response. A problem is method
((ResultSet) response).hasNext()
returns false
despite response shouldn't be empty.
Request is:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ontology: <http://www.semanticweb.org/kseniia/ontologies/2013/1/untitled-ontology-12#> SELECT ?x
WHERE {?x rdfs:subClassOf ontology:Visual}
This works correctly in Protege and returns 3 objects:
Location
Relation
Descriptive
Query was executed in jena such way:
Query query = QueryFactory.create(queryString);
QueryExecution qexec = QueryExecutionFactory.create(query, model);
Object response = qexec.execSelect();
qexec.close();
for ( ; ((ResultSet) response).hasNext(); ) { // always false
QuerySolution soln = ((ResultSet) response).nextSolution();
// etc
}
Maybe I missed something?