What is the error message you get?

It is not unheard of for Virtuoso (the software that powers DBPedia) to
produce bad output particularly if the data has not been appropriately
sanitised so I would suspect Virtuoso before suspecting Jena in a case
like this

Rob

On 13/05/2015 10:16, "Jeremy Debattista" <[email protected]> wrote:

>Dear All,
>
>I am trying to query the DBpedia SPARQL endpoint using the
>QueryExecutionFactory sparqlService and execSelect(), but I’m given the
>following error: com.hp.hpl.jena.sparql.resultset.ResultSetException:
>Failed when initializing the StAX parsing engine
>
>The query in question is
>PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX
>rdfs:<http://www.w3.org/2000/01/rdf-schema#> PREFIX
>owl:<http://www.w3.org/2002/07/owl#>  SELECT distinct ?class ?label
>WHERE { {?class rdf:type owl:Class} UNION {?class rdf:type rdfs:Class}.
>?class rdfs:label ?label.   FILTER(bound(?label)  && REGEX(?label,
>"\\bact","i"))} ORDER BY ?class
>
>which gives a result in dbpedia sparql web interface [1].
>
>The code in question is the following:
>
>public static ResultSet executeQuery(String uri, String queryString) {
>       Query query = QueryFactory.create(queryString);
>       QueryExecution qexec = QueryExecutionFactory.sparqlService(uri, query);
>       try {
>               ResultSet results = qexec.execSelect();
>               return results;
>       } finally {
>
>       }
>}
>
>After debugging, the problem seems to be related to how the XML parser is
>reading the stream input. Would you have any other idea how I can go
>around it?
>
>Best Regards,
>Jeremy
>
>
>
>[1] 
>http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query
>=PREFIX+rdf%3A%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23
>%3E+PREFIX+rdfs%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3
>E+PREFIX+owl%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E++SELECT+
>distinct+%3Fclass+%3Flabel++WHERE+%7B+%7B%3Fclass+rdf%3Atype+owl%3AClass%7
>D+UNION+%7B%3Fclass+rdf%3Atype+rdfs%3AClass%7D.+%3Fclass+rdfs%3Alabel+%3Fl
>abel.+++FILTER%28bound%28%3Flabel%29++%26%26+REGEX%28%3Flabel%2C+%22%5C%5C
>bact%22%2C%22i%22%29%29%7D+ORDER+BY+%3Fclass%0D%0A&format=text%2Fhtml&time
>out=30000&debug=on




Reply via email to