@ApplicationScoped @Path(value="/ldpath") public class LDPathWebService extends Object
Constructor and Description |
---|
LDPathWebService() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
evaluatePathQuery(String path,
String resourceUri)
Evaluate a single LDPath selection using the path passed as argument and starting at the resource identified
by the uri.
|
javax.ws.rs.core.Response |
evaluateProgramQuery(InputStream body,
String resourceUri)
Evaluate a LDPath program using the program string passed as argument and starting at the resource identified
by the uri.
|
javax.ws.rs.core.Response |
evaluateProgramQuery(String program,
String resourceUri)
Evaluate a LDPath program using the program string passed as argument and starting at the resource identified
by the uri.
|
javax.ws.rs.core.Response |
getFunction(String name)
Return a description of the function whose name is passed as path argument.
|
javax.ws.rs.core.Response |
listFunctions()
Return a list of all LDPath functions that have been registered in the LDPath installation.
|
javax.ws.rs.core.Response |
testProgram(String[] contextURI,
String[] contextURIarr,
javax.servlet.http.HttpServletRequest request)
Evaluate the LDPath program send as byte stream in the POST body of the request starting at the contexts (array)
given as URL query arguments.
|
@GET @Path(value="/path") @Produces(value="application/json") public javax.ws.rs.core.Response evaluatePathQuery(@QueryParam(value="path") String path, @QueryParam(value="uri") String resourceUri)
{ "type": "uri", "value": "..." }
for resources{ "type": "literal", "value": "...", "language": "...", "datatype": "..."}
for literals (datatype and language optional)path
- the LDPath expression to evaluateresourceUri
- the URI of the resource from which to start the resource@GET @Path(value="/program") @Produces(value="application/json") public javax.ws.rs.core.Response evaluateProgramQuery(@QueryParam(value="program") String program, @QueryParam(value="uri") String resourceUri)
{ "type": "uri", "value": "..." }
for resources{ "type": "literal", "value": "...", "language": "...", "datatype": "..."}
for literals (datatype and language optional)program
- the program to evaluateresourceUri
- the URI of the resource where to start@POST @Path(value="/program") @Produces(value="application/json") public javax.ws.rs.core.Response evaluateProgramQuery(InputStream body, @QueryParam(value="uri") String resourceUri)
{ "type": "uri", "value": "..." }
for resources{ "type": "literal", "value": "...", "language": "...", "datatype": "..."}
for literals (datatype and language optional)body
- the program to evaluateresourceUri
- the URI of the resource where to start@GET @Path(value="/functions") @Produces(value="application/json") public javax.ws.rs.core.Response listFunctions()
@GET @Path(value="/functions/{name}") @Produces(value="application/json") public javax.ws.rs.core.Response getFunction(@PathParam(value="name") String name)
@POST @Path(value="/debug") @Produces(value="application/json") public javax.ws.rs.core.Response testProgram(@QueryParam(value="context") String[] contextURI, @QueryParam(value="context[]") String[] contextURIarr, @Context javax.servlet.http.HttpServletRequest request)
{ "type": "uri", "value": "..." }
for resources{ "type": "literal", "value": "...", "language": "...", "datatype": "..."}
for literals (datatype and language optional)contextURI
- the URI of a single context to evaluate the program againstcontextURIarr
- an array of URIs to use as contexts to evaluate the program againstrequest
- a POST request containing the LDPath program in the POST bodyCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.