SpaceAppsXploration / rdfendpoints

DEPRECATED, see semantic-data-chronos
https://github.com/SpaceAppsXploration/semantic-data-chronos
Apache License 2.0
2 stars 1 forks source link

Error in SPARQL query when GET parameters encoded #21

Closed Mec-iS closed 9 years ago

Mec-iS commented 9 years ago

When I send this urlencoded request to /ds

query=SELECT+%2A+WHERE+%7B+%3Fsatellites+%3Chttp%3A%2F%2Fontology.projectchronos.eu%2Fastronomy%2ForbitsPlanet%3E+%3Chttp%3A%2F%2Fontology.projectchronos.eu%2Fsolarsystem%2FSaturn%3E.+%7DSELECT+%2A+WHERE+%7B+%3Fsatellites+%3Chttp%3A%2F%2Fontology.projectchronos.eu%2Fastronomy%2ForbitsPlanet%3E+%3Fplanets.+%7D

This errors pops up:

    <pre>Traceback (most recent call last):
  File &quot;C:\google_appengine\lib\webapp2-2.5.2\webapp2.py&quot;, line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File &quot;C:\google_appengine\lib\webapp2-2.5.2\webapp2.py&quot;, line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File &quot;C:\google_appengine\lib\webapp2-2.5.2\webapp2.py&quot;, line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File &quot;C:\google_appengine\lib\webapp2-2.5.2\webapp2.py&quot;, line 1102, in __call__
    return handler.dispatch()
  File &quot;C:\google_appengine\lib\webapp2-2.5.2\webapp2.py&quot;, line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File &quot;C:\google_appengine\lib\webapp2-2.5.2\webapp2.py&quot;, line 570, in dispatch
    return method(*args, **kwargs)
  File &quot;C:\pramantha\chronostriples\main.py&quot;, line 65, in get
    return self.response.write(query(self.request.get('query')))
  File &quot;C:\pramantha\chronostriples\flankers\graphtools.py&quot;, line 25, in query
    response = graph().query(q)
  File &quot;lib\rdflib\graph.py&quot;, line 1078, in query
    query_object, initBindings, initNs, **kwargs))
  File &quot;lib\rdflib\plugins\sparql\processor.py&quot;, line 72, in query
    parsetree = parseQuery(strOrQuery)
  File &quot;lib\rdflib\plugins\sparql\parser.py&quot;, line 1052, in parseQuery
    return Query.parseString(q, parseAll=True)
  File &quot;C:\pramantha\chronostriples\pyparsing.py&quot;, line 1125, in parseString
    raise exc
ParseException: Expected end of text (at char 145), (line:1, col:146)

It happens only with this particular query, the other test queries work fine. Probably should consider parsing the query parameter before sending the query to datastore?

Test available here