Menu

#48 Query SPARQL end point returns "Unable to parse result"

v0.9.5
open
nobody
Parsers (11)
5
2008-03-07
2008-03-07
No

Query to remote SPARQL end point of dbpedia.org, e.g.

SELECT ?chalkboard_gag, ?season, ?episode
WHERE { ?episode skos:subject ?season .
?season rdfs:label ?season_title .
?episode dbpedia2:blackboard ?chalkboard_gag .
FILTER (regex(?season_title, "The Simpsons episodes, season")) . } ORDER BY ?season

The result is successfully returned in XML

Parsing that XML with the function writeQueryResultAsHtmlTable returns error "Unable to parse result"

This can be solved by removing trailing whitespace from the XML, by adding the following line at the top of function SparqlResultParser::parse()

$strInputXML = ltrim($strInputXML);

Discussion