[Solved] Sparql queries Sparql queries

Here is an example for #4 First you need to look at the Ontology Class of City in DbPedia. city is described as city Select distinct ?city ?location Where { ?city a dbo:City. ?city dbo:location ?location. } LIMIT 100 Then you can the filter clause to get the city you want. solved Sparql queries Sparql … Read more

[Solved] To write a query SPARQL in Java code using strstarts filter

I have resolved my problem using this code: public QueryExecution query(){ String stringa = “http://dbpedia.org/resource/Fred_Guy”; ParameterizedSparqlString qs = new ParameterizedSparqlString( “” + “prefix dbpediaont: <http://dbpedia.org/ontology/>\n” + “prefix dbpedia: <http://dbpedia.org/resource/>\n” + “prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n” + “\n” + “select ?resource where {\n” + “?mat rdf:type ?resource\n” + “filter strstarts(str(?resource), dbpediaont:)\n” + “}” ); Resource risorsa = ResourceFactory.createResource(stringa); … Read more