Dear DBpedians,

this is a rather odd problem (see exception below) when querying DBpedia 
via JENA+SPARQL (sample code below). The query itself seems sane and can 
also be executed without any problems using the web interface:
select distinct ?p where {<http://dbpedia.org/resource/Darmstadt> ?p 
?o}  ORDER BY ?p

The exception seems to occur when the iterator steps from
http://dbpedia.org/property/marHighC
to
http://dbpedia.org/property/marLowC
both of which do not contain any special characters or the like.

Any ideas, anyone?

Best,
Heiko

The exception I get is (message translated: "XML document structures 
have to begin and end with the same element"):
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[232,57]
Message: XML-Dokumentstrukturen müssen innerhalb derselben Entität 
beginnen und enden.
     at 
com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:592)
     at 
com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getElementText(XMLStreamReaderImpl.java:836)
     at 
com.hp.hpl.jena.sparql.resultset.XMLInputStAX$ResultSetStAX.getOneSolution(XMLInputStAX.java:506)
     at 
com.hp.hpl.jena.sparql.resultset.XMLInputStAX$ResultSetStAX.hasNext(XMLInputStAX.java:231)



My code:
         QueryExecution qe = 
QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql";,
                 "select distinct ?p where 
{<http://dbpedia.org/resource/Darmstadt> ?p ?o}  ORDER BY ?p");
         ResultSet rs = qe.execSelect();

         qe.close();

         try {
             for (; rs.hasNext();)
                 System.out.println(rs.next().get("p"));
         } catch (Exception e) {
             System.out.println(e);
         }

-- 
Dr. Heiko Paulheim
Knowledge Engineering Group
Technische Universität Darmstadt
Phone: +49 6151 16 6634
Fax:   +49 6151 16 5482
http://www.ke.tu-darmstadt.de/staff/heiko-paulheim


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Dbpedia-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to