public class JenaLDPRDFSource extends LDPRDFSource
Modifier and Type | Field and Description |
---|---|
static String |
CONSTRAINTS_URI |
protected String |
fConfigGraphURI
A companion resource "next to" the "real" resource, used to hold implementation
specific data.
|
protected TDBGraphStore |
fGraphStore |
fModel, fRDFType, fURI
Modifier | Constructor and Description |
---|---|
protected |
JenaLDPRDFSource(String resourceURI,
TDBGraphStore graphStore) |
Modifier and Type | Method and Description |
---|---|
protected void |
amendResponse(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.MultivaluedMap<String,String> preferences) |
protected org.apache.jena.rdf.model.Model |
amendResponseGraph(org.apache.jena.rdf.model.Model graph,
javax.ws.rs.core.MultivaluedMap<String,String> preferences)
For sub-classes to implement, given the graph for resource R, amend some triples before
response set to client
|
protected javax.ws.rs.core.Response |
build(javax.ws.rs.core.Response.ResponseBuilder response)
Helper to add standard content (Allow header, Link header) to this response.
|
protected javax.ws.rs.core.Response |
buildErrorResponse(org.apache.jena.rdf.model.Model body) |
protected javax.ws.rs.core.Response |
buildErrorResponse(org.apache.jena.rdf.model.Model body,
javax.ws.rs.core.Response.Status status) |
protected void |
checkIfMatch(javax.ws.rs.core.HttpHeaders requestHeaders,
org.apache.jena.rdf.model.Model before) |
void |
delete()
Delete the specified member resource and remove it from the container.
|
protected void |
fail(javax.ws.rs.core.Response.Status status) |
protected void |
failIfReadOnlyPropertyChanged(org.apache.jena.rdf.model.Model before,
org.apache.jena.rdf.model.Model after,
String property) |
protected void |
failParsingRDF(String contentType,
Exception e) |
protected void |
failReadOnlyProperty(String uri) |
javax.ws.rs.core.Response |
get(String contentType,
javax.ws.rs.core.MultivaluedMap<String,String> preferences)
Get the current state of resource with the specified content type.
|
Set<String> |
getAllowedMethods()
Returns the allowed HTTP methods for this resource as defined in RFC 2616.
|
protected org.apache.jena.rdf.model.Model |
getConfigModel() |
protected String |
getContainerURIForResource(String resourceURI)
Given as input resourceURI, find the containerURI that ldp:contains it
|
protected String |
getETag(org.apache.jena.rdf.model.Model m)
Create a weak ETag value from a Jena model.
|
TDBGraphStore |
getGraphStore() |
protected Set<String> |
getReadOnlyProperties() |
protected boolean |
isJSONLDPresent() |
javax.ws.rs.core.Response |
options() |
void |
patch(String resourceURI,
InputStream stream,
String contentType,
String user) |
void |
putUpdate(InputStream stream,
String contentType,
String user,
javax.ws.rs.core.HttpHeaders requestHeaders)
Updates state of the resource with the contents of the specified stream.
|
protected org.apache.jena.rdf.model.Model |
readModel(String baseURI,
InputStream stream,
String contentType) |
protected void |
updateResource(InputStream stream,
String contentType,
String user,
javax.ws.rs.core.HttpHeaders requestHeaders) |
getModel, getTypeURI, getURI, setModel, setURI
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getModel, getTypeURI, getURI, setModel, setURI
public static final String CONSTRAINTS_URI
protected String fConfigGraphURI
protected final TDBGraphStore fGraphStore
protected JenaLDPRDFSource(String resourceURI, TDBGraphStore graphStore)
protected org.apache.jena.rdf.model.Model getConfigModel()
public void putUpdate(InputStream stream, String contentType, String user, javax.ws.rs.core.HttpHeaders requestHeaders)
ILDPResource
The Content-Type of the input stream is specified by the
contentType
argument.
stream
- the input stream containing the resource representation.contentType
- the Content-Type of the input stream.requestHeaders
- the HTTP request headersprotected void updateResource(InputStream stream, String contentType, String user, javax.ws.rs.core.HttpHeaders requestHeaders)
protected void checkIfMatch(javax.ws.rs.core.HttpHeaders requestHeaders, org.apache.jena.rdf.model.Model before)
public void patch(String resourceURI, InputStream stream, String contentType, String user)
public void delete()
ILDPResource
public javax.ws.rs.core.Response get(String contentType, javax.ws.rs.core.MultivaluedMap<String,String> preferences)
ILDPResource
The Content-Type of which to write the model is specified by the
contentType
argument.
contentType
- the Content-Type of which to write the model.preferences
- the preferences from the HTTP Prefer
headerprotected void amendResponse(javax.ws.rs.core.Response.ResponseBuilder response, javax.ws.rs.core.MultivaluedMap<String,String> preferences)
protected String getETag(org.apache.jena.rdf.model.Model m)
m
- the model that represents the HTTP response bodyprotected org.apache.jena.rdf.model.Model amendResponseGraph(org.apache.jena.rdf.model.Model graph, javax.ws.rs.core.MultivaluedMap<String,String> preferences)
graph
- preferences
- public TDBGraphStore getGraphStore()
protected boolean isJSONLDPresent()
protected String getContainerURIForResource(String resourceURI)
resourceURI
- protected void fail(javax.ws.rs.core.Response.Status status)
protected javax.ws.rs.core.Response build(javax.ws.rs.core.Response.ResponseBuilder response)
response
- the response builder to add topublic javax.ws.rs.core.Response options()
public Set<String> getAllowedMethods()
ILDPResource
protected org.apache.jena.rdf.model.Model readModel(String baseURI, InputStream stream, String contentType)
protected void failIfReadOnlyPropertyChanged(org.apache.jena.rdf.model.Model before, org.apache.jena.rdf.model.Model after, String property)
protected javax.ws.rs.core.Response buildErrorResponse(org.apache.jena.rdf.model.Model body)
protected javax.ws.rs.core.Response buildErrorResponse(org.apache.jena.rdf.model.Model body, javax.ws.rs.core.Response.Status status)
protected void failReadOnlyProperty(String uri)
Copyright © 2018. All rights reserved.