public class SparqlEndpointResource
extends org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
BundleContext to retrive
TripleCollection s registered to OSGi environment. To be able to execute SPARQL queries on triple
collections, they should be registered to the OSGi environment with the following parameters:
If a uri is not specified, the graph having highest service.ranking value will be chosen.
| Modifier and Type | Class and Description |
|---|---|
class |
SparqlEndpointResource.TripleCollectionInfo |
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.clerezza.rdf.core.access.TcManager |
tcManager |
| Constructor and Description |
|---|
SparqlEndpointResource(javax.servlet.ServletContext servletContext) |
| Modifier and Type | Method and Description |
|---|---|
List<SparqlEndpointResource.TripleCollectionInfo> |
getTripleCollectionList() |
javax.ws.rs.core.Response |
handleCorsPreflight(javax.ws.rs.core.HttpHeaders headers) |
javax.ws.rs.core.Response |
postSparql(String graphUri,
String sparqlQuery,
javax.ws.rs.core.HttpHeaders headers)
HTTP GET service to execute SPARQL queries on
TripleCollections registered to OSGi environment. |
javax.ws.rs.core.Response |
sparql(String graphUri,
String sparqlQuery,
javax.ws.rs.core.HttpHeaders headers)
HTTP GET service to execute SPARQL queries on
TripleCollections registered to OSGi environment. |
public SparqlEndpointResource(@Context
javax.servlet.ServletContext servletContext)
public javax.ws.rs.core.Response handleCorsPreflight(@Context
javax.ws.rs.core.HttpHeaders headers)
public javax.ws.rs.core.Response sparql(String graphUri, String sparqlQuery, @Context javax.ws.rs.core.HttpHeaders headers) throws org.apache.clerezza.rdf.core.sparql.ParseException, org.osgi.framework.InvalidSyntaxException
TripleCollections registered to OSGi environment.
If a null, it is assumed that the request is coming from the HTML interface of SPARQL
endpoint. Otherwise the query is executed on the triple collection specified by graphUri.
But, if no graph uri is passed, then the triple collection having highest service.ranking value is
chosen.
Type of the result is determined according to type of the query such that if the specified query is
either a describe query or construct query, results are returned in
application/rdf+xml format, otherwise in pplication/sparql-results+xml format.graphUri - the URI of the graph on which the SPARQL query will be executed.sparqlQuery - SPARQL query to be executedorg.apache.clerezza.rdf.core.sparql.ParseExceptionorg.osgi.framework.InvalidSyntaxExceptionpublic javax.ws.rs.core.Response postSparql(String graphUri, String sparqlQuery, @Context javax.ws.rs.core.HttpHeaders headers) throws org.apache.clerezza.rdf.core.sparql.ParseException, org.osgi.framework.InvalidSyntaxException
TripleCollections registered to OSGi environment.
For details, see sparql(String, String, HttpHeaders)org.apache.clerezza.rdf.core.sparql.ParseExceptionorg.osgi.framework.InvalidSyntaxExceptionpublic List<SparqlEndpointResource.TripleCollectionInfo> getTripleCollectionList()
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.