Hi Przemek,
On 12/03/2012 02:48 PM, Przemyslaw Misiuda wrote:
> Hi
>
> There is a problem with parsing your results in dotNetRDF and Jena
> tools. Some data uses code 8211 instead of hyphen char.
>
> For more details please look at this topic:
> http://stackoverflow.com/questions/13631193/query-dbpedia-sparql-endpoint-using-dotnetrdf-rdfparseexception
I've checked that query with jena and it worked fine.
I've checked it against DBpedia-Live [1], and it worked as well.
The following code excerpt does the work:
QueryExecution queryExecutor;
String queryJapaneseFilms = "CONSTRUCT { ?film ?p ?o}\n" +
"WHERE {\n" +
" ?film <http://purl.org/dc/terms/subject>
<http://dbpedia.org/resource/Category:Japanese_films> .\n" +
" ?film ?p ?o\n" +
"}\n" +
"limit 500";
QueryExecution execution =
QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql",
queryGetJapaneseFilms);
try {
Model model = execution.execConstruct();
StmtIterator iter = model.listStatements();
while (iter.hasNext()) {
Statement stmt = iter.next();
String subject = stmt.getSubject().toString();
String predicate = stmt.getPredicate().toString();
String object = stmt.getObject().toString();
System.out.println(subject + "\t" + predicate + "\t" +
object);
}
} catch (Exception e) {
e.printStackTrace();
}
finally {
execution.close();
}
>
> Best Regards
> Przemek Misiuda
[1] http://live.dbpedia.org/sparql
--
Kind Regards
Mohamed Morsey
Department of Computer Science
University of Leipzig
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion