org.apache.stanbol.commons.web.sparql.resource
Class SparqlEndpointResource

java.lang.Object
  extended by org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
      extended by org.apache.stanbol.commons.web.sparql.resource.SparqlEndpointResource

public class SparqlEndpointResource
extends BaseStanbolResource

Implementation of a SPARQL endpoint as defined by the W3C: http://www.w3.org/TR/rdf-sparql-protocol/ (Might not be 100% compliant yet, please report bugs/missing features in the issue tracker). If the "query" parameter is not present, then fallback to display and HTML view with an ajax-ified form to test the SPARQL endpoint from the browser.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
BaseStanbolResource.MenuItem
 
Field Summary
protected  Store store
           
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, servletContext, STATIC_RESOURCES_ROOT_URL, uriInfo
 
Constructor Summary
SparqlEndpointResource(javax.servlet.ServletContext ctx)
           
 
Method Summary
 javax.ws.rs.core.Response handleCorsPreflight(javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response postSparql(java.lang.String sparqlQuery, javax.ws.rs.core.HttpHeaders headers)
           
 javax.ws.rs.core.Response sparql(java.lang.String sparqlQuery, javax.ws.rs.core.HttpHeaders headers)
           
 
Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRootUrl, getStaticRootUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

store

protected Store store

tcManager

protected org.apache.clerezza.rdf.core.access.TcManager tcManager
Constructor Detail

SparqlEndpointResource

public SparqlEndpointResource(@Context
                              javax.servlet.ServletContext ctx)
Method Detail

handleCorsPreflight

public javax.ws.rs.core.Response handleCorsPreflight(@Context
                                                     javax.ws.rs.core.HttpHeaders headers)

sparql

public javax.ws.rs.core.Response sparql(java.lang.String sparqlQuery,
                                        @Context
                                        javax.ws.rs.core.HttpHeaders headers)
                                 throws SparqlQueryEngine.SparqlQueryEngineException,
                                        org.apache.clerezza.rdf.core.sparql.ParseException
Throws:
SparqlQueryEngine.SparqlQueryEngineException
org.apache.clerezza.rdf.core.sparql.ParseException

postSparql

public javax.ws.rs.core.Response postSparql(java.lang.String sparqlQuery,
                                            @Context
                                            javax.ws.rs.core.HttpHeaders headers)
                                     throws SparqlQueryEngine.SparqlQueryEngineException,
                                            org.apache.clerezza.rdf.core.sparql.ParseException
Throws:
SparqlQueryEngine.SparqlQueryEngineException
org.apache.clerezza.rdf.core.sparql.ParseException


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.