@ApplicationScoped @Path(value="/sparql") public class SparqlWebService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PATH |
static String |
SELECT |
static String |
UPDATE |
| Constructor and Description |
|---|
SparqlWebService() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
get(String query,
String update,
javax.servlet.http.HttpServletRequest request)
Single SPARQL endpoint, redirecting to the actual select endpoint
when possible
|
javax.ws.rs.core.Response |
post(javax.servlet.http.HttpServletRequest request)
Single endpoint for direct post queries (not yet implemented)
|
javax.ws.rs.core.Response |
selectGet(String query,
String resultType,
javax.servlet.http.HttpServletRequest request)
Execute a SPARQL 1.1 tuple query on the LMF triple store using the query passed as query parameter to the
GET request.
|
javax.ws.rs.core.Response |
selectPost(String resultType,
javax.servlet.http.HttpServletRequest request)
Execute a SPARQL 1.1 tuple query on the LMF triple store using the query passed in the body of the
POST request.
|
javax.ws.rs.core.Response |
selectPostForm(String query,
String resultType,
javax.servlet.http.HttpServletRequest request)
Execute a SPARQL 1.1 tuple query on the LMF triple store using the query passed as form parameter to the
POST request.
|
javax.ws.rs.core.Response |
updateGet(String update,
String query,
String resultType,
javax.servlet.http.HttpServletRequest request)
Execute a SPARQL 1.1 Update request passed in the query parameter of the GET.
|
javax.ws.rs.core.Response |
updatePostDirectly(javax.servlet.http.HttpServletRequest request,
String resultType)
Execute a SPARQL 1.1 Update request using update via POST directly;
see details at http://www.w3.org/TR/sparql11-protocol/\#update-operation
|
javax.ws.rs.core.Response |
updatePostUrlEncoded(javax.servlet.http.HttpServletRequest request)
Execute a SPARQL 1.1 Update request using update via URL-encoded POST;
see details at http://www.w3.org/TR/sparql11-protocol/\#update-operation
|
public static final String PATH
public static final String SELECT
public static final String UPDATE
@GET
public javax.ws.rs.core.Response get(@QueryParam(value="query")
String query,
@QueryParam(value="update")
String update,
@Context
javax.servlet.http.HttpServletRequest request)
throws URISyntaxException
query - update - request - URISyntaxException@POST
public javax.ws.rs.core.Response post(@Context
javax.servlet.http.HttpServletRequest request)
request - @GET
@Path(value="/select")
public javax.ws.rs.core.Response selectGet(@QueryParam(value="query")
String query,
@QueryParam(value="output")
String resultType,
@Context
javax.servlet.http.HttpServletRequest request)
query - the SPARQL 1.1 Query as a string parameterresultType - the format for serializing the query results ("html", "json", or "xml")@POST
@Consumes(value={"application/x-www-url-form-urlencoded","application/x-www-form-urlencoded"})
@Path(value="/select")
public javax.ws.rs.core.Response selectPostForm(@FormParam(value="query")
String query,
@QueryParam(value="output")
String resultType,
@Context
javax.servlet.http.HttpServletRequest request)
query - the SPARQL 1.1 Query as a string parameterresultType - the format for serializing the query results ("html", "json", or "xml")@POST
@Path(value="/select")
public javax.ws.rs.core.Response selectPost(@QueryParam(value="output")
String resultType,
@Context
javax.servlet.http.HttpServletRequest request)
request - the servlet request (to retrieve the SPARQL 1.1 Query passed in the body of the POST request)resultType - the format for serializing the query results ("html", "json", or "xml")@GET
@Path(value="/update")
public javax.ws.rs.core.Response updateGet(@QueryParam(value="update")
String update,
@QueryParam(value="query")
String query,
@QueryParam(value="output")
String resultType,
@Context
javax.servlet.http.HttpServletRequest request)
update - the update query in SPARQL 1.1 syntaxquery - the update query in SPARUL syntax@POST
@Path(value="/update")
@Consumes(value="application/sparql-update")
public javax.ws.rs.core.Response updatePostDirectly(@Context
javax.servlet.http.HttpServletRequest request,
@QueryParam(value="output")
String resultType)
request - the servlet request (to retrieve the SPARQL 1.1 Update query passed in the
body of the POST request)@POST
@Path(value="/update")
@Consumes(value={"application/x-www-url-form-urlencoded","application/x-www-form-urlencoded"})
public javax.ws.rs.core.Response updatePostUrlEncoded(@Context
javax.servlet.http.HttpServletRequest request)
request - the servlet request (to retrieve the SPARQL 1.1 Update query passed in the
body of the POST request)Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.