Jetty is quite happy about the string:
sparql?query=SELECT+*+WHERE+{%3Fs+%3Fp+%3Fo}
{} is special to Jersey though which _may_ be a source of confusion.
>> "in a path template"
^^^^^^^^
Try %-encoding the {}.
Andy
On 25/08/14 15:38, Reto Gmür wrote:
Hi Danny It seems to be an issue with jetty who doesn't like that URI. If you want to access sparql via HTTP I suggest you use POST. If your code is running in OSGi than simply get a refrence to TcManager (for an example, see the stanbol staefuull webapp maven archetype) and access one of its executeSparqlQuery methods: http://clerezza.apache.org/apidocs/org/apache/clerezza/rdf/core/access/TcManager.html#executeSparqlQuery%28java.lang.String,%20org.apache.clerezza.rdf.core.UriRef%29 Cheers, Reto On Mon, Aug 25, 2014 at 8:58 AM, Danny Ayers <[email protected]> wrote:On 23 August 2014 19:24, Reto Gmür <[email protected]> wrote:Hi Danny Could you tell more about what error you get when you run the queryagainsthttp://localhost:8080/sparql. What does the log say?Taking the query : SELECT * WHERE {?s ?p ?o} converted to URL becomes : http://localhost:8080/sparql?query=SELECT+*+WHERE+{%3Fs+%3Fp+%3Fo} with a GET gives the error : 25.08.2014 08:39:16.792 *WARN* [qtp22576245-34] org.eclipse.jetty.servlet.ServletHandler /sparql java.lang.IllegalArgumentException: Illegal character "%" at position 22 is not allowed as a start of a name in a path template "query=SELECT+*+WHERE+{%3Fs+%3Fp+%3Fo}&output=text&stylesheet=". at org.glassfish.jersey.uri.internal.UriTemplateParser.parseName(UriTemplateParser.java:305) at org.glassfish.jersey.uri.internal.UriTemplateParser.parse(UriTemplateParser.java:235) at org.glassfish.jersey.uri.internal.UriTemplateParser.<init>(UriTemplateParser.java:107) at org.glassfish.jersey.uri.UriTemplate.createURIComponent(UriTemplate.java:891) at org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:858) at org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:797) at org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:762) at org.glassfish.jersey.uri.internal.JerseyUriBuilder._build(JerseyUriBuilder.java:893) ... looks like it's not decoding the query in GETs per http://www.w3.org/TR/sparql11-protocol/#query-via-getAlso, the sparql HTTP endpoint is so that external can query the data.Youwrite that you're integrating it into OSGi, so why should you by acessing the HTTP endpoint?So it's possible to flip to using an external store by just changing the 2 SPARQL URLs, i.e. more loosely coupled. The messages being passed around are relatively small so shouldn't be a major hit on performance, though I guess accessing the store more directly would be an idea if this becomes an issue for later UI elements. Having said that, because I need to get this thing integrated asap, if there's a quick way of modifying code to do the comms through OSGi I'd love to hear it :) Cheers, Danny.Cheers, Reto On Sat, Aug 23, 2014 at 6:31 PM, Danny Ayers <[email protected]> wrote:Hi Hasan, everyone, I'm working on a module [1] intended to plug in to the Fusepoolextensionof Stanbol. It's a feed reader back by an RDF store, the store being addressed entirely through SPARQL (over HTTP). I developed the app outside of OSGi and am now in the process of integrating. I have been using a Fuseki store/endpoint but need to move this over to using Stanbol/Clerezza's SPARQL facilities. So what I'd like to know is how to set up SPARQL endpoints. The configI'vegot for Fuseki is below, essentially I need a dataset in a TDB-likestorethat supports named graphs, accessed via SPARQL query (GET) & update (POST). There's an example of the kind of update I'm doing at [2] - it'sactually afreemarker template with simple placeholder substitution, but theSPARQLispretty clear. Right now with a running Fusepool/Stanbol, pointing a browser at http://localhost:8080/query?sparql= gives the kind of SPARQL parsing error you'd expect, but giving it a genuine query leads to a HTTP 500. Any help greatly appreciated. Cheers, Danny. ## --------------------------------------------------------------- ## Updatable in-memory dataset. <#feedreader> rdf:type fuseki:Service ; # URI of the dataset -- http://host:port/feedreader fuseki:name "feedreader" ; # SPARQL query services e.g. http://host:port/feedreader/sparql?query=... fuseki:serviceQuery "sparql" ; fuseki:serviceQuery "query" ; # SPARQL Update service -- http://host:port/feedreader/update?request=... fuseki:serviceUpdate "update" ; # SPARQL query service -- /feedreader/update # Upload service -- http://host:port/feedreader/upload?graph=defaultor?graph=URI or ?default # followed by a multipart body, each part beingRDFsyntax. # Syntax determined by the file name extension. fuseki:serviceUpload "upload" ; # Non-SPARQL upload service # SPARQL Graph store protocol (read and write) # GET, PUT, POSTDELETEto http://host:port/feedreader/data?graph= or ?default= fuseki:serviceReadWriteGraphStore "data" ; # A separate read-only graph store endpoint: fuseki:serviceReadGraphStore "get" ; # Graph store protocol (read only) -- /feedreader/get fuseki:dataset <#emptyDataset> ; . ## In-memory, initially empty. <#emptyDataset> rdf:typeja:RDFDataset .## ------------------------------------------------------------------ [1] https://github.com/danja/NewsMonitor [2]https://github.com/danja/NewsMonitor/blob/master/src/main/resources/templates/html/it/danja/newsmonitor/resource/update-links.ftl-- http://dannyayers.com http://webbeep.it - text to tones and back again
