my code:

String sparqlQueryString8="prefix sumo:" +

"prefix rdf:"+

"select ?c where {?c rdf:type sumo:City }";

OntModel modelcity=ModelFactory.createOntologyModel();

modelcity.read("SUMO.owl");

Query querycity = QueryFactory.create(sparqlQueryString8);

QueryExecution qexeccity = QueryExecutionFactory.create(sparqlQueryString8, modelcity);

ResultSet resultcity = qexeccity.execSelect() ;

for (; resultcity.hasNext();) {

QuerySolution sltcity=resultcity.next();

System.out.println(sltcity.toString());

}

please help me.

More Kazem Taghandiky's questions See All
Similar questions and discussions