On 16 March 2011 18:39, Olivier Grisel <[email protected]> wrote: > 2011/3/16 Enrico Daga <[email protected]>: >> On 16 March 2011 17:22, Olivier Grisel <[email protected]> wrote: >>> One should probably extend / adapt the JAX-RS SPARQL resource of the >>> enhancers to point to other graph ids as needed. One could make a new >>> JAX-RS resources such as /graph/{graphId}/sparql to build dynamically >>> sparql endpoint for all the clerezza graphs registered in stanbol for >>> instance: >>> >>> In the class SparqlQueryResource, instead of the hard-coded: >>> >>> Object result = tcManager.executeSparqlQuery(query, >>> store.getEnhancementGraph()); >>> >>> One could have something like: >>> >>> Object result = tcManager.executeSparqlQuery(query, >>> tcManager.getGraph(new UriRef("urn:graph:" + graphId))); >> But what happens if I want to query multiple graphs? >> I need for instance to query the enhancement graph and the result of >> my /kres/reengineer process (another graph) together. This would open >> to a variety of use cases, and in general this is how sparql endpoints >> work. > > It seems to me by reading the source code of > TcManager#executeSparqlQuery and JenaSparqlEngine#execute and > TcDataset#getNamedGraph that the clerezza sparql execution should be > able to perform queries accross several graphs. The second argument of > TcManager#executeSparqlQuery is just the default named graph used when > the sparql query does not have FROM clause. > > Please try to build a SPARQL query with an explicit FROM clause > pointing to a graph id used by kres to check this assertion. If it > works, try another query that mixes triples from both graphs > (reengineer and enhancer) using the GRAPH keyword in the body of the > SPARQL query as in > http://www.w3.org/TR/rdf-sparql-query/#restrictByLabel for instance. > > If it does not work, i think we should ask the question on the > clerezza mailing list directly instead. Thank you Olivier. Yes, it looks like it should support this. So I can assume that the answer to my question is YES, Stanbol has a Sparql endpoint which should cover all graphs in the store. So we don't need additional components for that, just use the /sparql path and maybe improve it, if needed. I'll do more test about it.
Thank you Enrico > > -- > Olivier > http://twitter.com/ogrisel - http://github.com/ogrisel > -- Enrico Daga -- http://www.enridaga.net skype: enri-pan
