org.apache.stanbol.commons.web.sparql.resource
Class SparqlEndpointResource
java.lang.Object
org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
org.apache.stanbol.commons.web.sparql.resource.SparqlEndpointResource
public class SparqlEndpointResource
- extends org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
This is the SPARQL endpoint which is used throughout the Stanbol. It uses 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:
- graph.uri (required) : The URI of the graph. This is the same as used with the TcManager
- service.ranking: If this parameter is not specified, "0" will be used as default value.
- graph.name: The name of the graph. Human readable name intended to be used in the UI
- graph.description: human readable description providing additional information about the RDF graph
If a uri is not specified, the graph having highest service.ranking value will be chosen.
| Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource |
org.apache.stanbol.commons.web.base.resource.BaseStanbolResource.MenuItem |
|
Field Summary |
protected org.apache.clerezza.rdf.core.access.TcManager |
tcManager
|
| Fields inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource |
LINK_RESOURCES, NAVIGATION_LINKS, ROOT_URL, SCRIPT_RESOURCES, STATIC_RESOURCES_ROOT_URL, SYSTEM_CONSOLE, uriInfo |
| Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource |
getConsoleBaseUri, getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRequestUri, getRootUrl, getStaticRootUrl |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tcManager
protected org.apache.clerezza.rdf.core.access.TcManager tcManager
SparqlEndpointResource
public SparqlEndpointResource(@Context
javax.servlet.ServletContext servletContext)
handleCorsPreflight
public javax.ws.rs.core.Response handleCorsPreflight(@Context
javax.ws.rs.core.HttpHeaders headers)
sparql
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
- HTTP GET service to execute SPARQL queries on
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.
- Parameters:
graphUri - the URI of the graph on which the SPARQL query will be executed.sparqlQuery - SPARQL query to be executed
- Returns:
-
- Throws:
org.apache.clerezza.rdf.core.sparql.ParseException
org.osgi.framework.InvalidSyntaxException
postSparql
public 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
- HTTP GET service to execute SPARQL queries on
TripleCollections registered to OSGi environment.
For details, see sparql(String, String, HttpHeaders)
- Throws:
org.apache.clerezza.rdf.core.sparql.ParseException
org.osgi.framework.InvalidSyntaxException
getTripleCollectionList
public List<SparqlEndpointResource.TripleCollectionInfo> getTripleCollectionList()
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.