GeoKnow / Jassa

JAvascript Suite for Sparql Access
25 stars 3 forks source link

Odd SPARQL query generated when using SparqlServiceHttp constructor with a graph #1

Closed patrickwestphal closed 10 years ago

patrickwestphal commented 10 years ago

When creating a Jassa.sparql.SparqlServiceHttp like that

$scope.endpoint = new Jassa.sparql.SparqlServiceHttp('http://localhost/sparql', 'http://linkedgeodata.org')

and then call

$scope.endpoint.execSelect('SELECT ?t WHERE { [] a ?t }');

the query that is generated is:

http://localhost/sparql?default-graph-uri=h&default-graph-uri=t&default-graph-uri=t&default-graph-uri=p&default-graph-uri=:&default-graph-uri=/&default-graph-uri=/&default-graph-uri=l&default-graph-uri=i&default-graph-uri=n&default-graph-uri=k&default-graph-uri=e&default-graph-uri=d&default-graph-uri=g&default-graph-uri=e&default-graph-uri=o&default-graph-uri=d&default-graph-uri=a&default-graph-uri=t&default-graph-uri=a&default-graph-uri=.&default-graph-uri=o&default-graph-uri=r&default-graph-uri=g&query=SELECT ?t WHERE { [] a ?t }&

(I already URL decoded it for readability.) There are several default-graph-uri GET parameters, each holding one letter of the actual default graph 'http://linkedgeodata.org'

patrickwestphal commented 10 years ago

This is due to the fact that a list of graphs is expected there (the corresponding function arg is also called defaultGraphUris). So the constructor is totally fine but was used wrongly.