public class JenaLDPContainer extends JenaLDPRDFSource implements ILDPContainer
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_RESOURCE_PREFIX |
protected String |
fResourceURIPrefix |
CONSTRAINTS_URI, fConfigGraphURI, fGraphStore
fModel, fRDFType, fURI
Modifier | Constructor and Description |
---|---|
protected |
JenaLDPContainer(String containerURI,
TDBGraphStore graphStore) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToContainer(String resourceURI,
org.apache.jena.rdf.model.Model resourceModel,
Calendar time)
Adds containment triples and, if a direct container, membership triples
for this resource.
|
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 container,
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
|
static String |
appendURISegment(String base,
String append) |
static JenaLDPContainer |
create(String containerURI,
TDBGraphStore graphStore)
Create a LDPContainer instance for the specified URI and with the default configuration parameters}.
|
protected String |
createResource(String resourceURI,
boolean addToContainer,
InputStream stream,
String contentType,
String user)
Create resource and add membership triples
|
void |
delete()
Delete the specified member resource and remove it from the container.
|
Set<String> |
getAllowedMethods()
Returns the allowed HTTP methods for this resource as defined in RFC 2616.
|
static org.apache.jena.rdf.model.Property |
getIsMemberOfRelation(org.apache.jena.rdf.model.Model containerGraph,
org.apache.jena.rdf.model.Resource containerResource) |
static org.apache.jena.rdf.model.Property |
getMemberRelation(org.apache.jena.rdf.model.Model containerGraph,
org.apache.jena.rdf.model.Resource containerResource) |
static String |
getMembershipResourceURI(org.apache.jena.rdf.model.Model containerGraph,
org.apache.jena.rdf.model.Resource containerResource) |
protected Set<String> |
getReadOnlyProperties() |
protected boolean |
includeContainment(javax.ws.rs.core.MultivaluedMap<String,String> preferences) |
protected boolean |
isReturnRepresentationPreferenceApplied(javax.ws.rs.core.MultivaluedMap<String,String> preferences) |
void |
patch(String resourceURI,
InputStream stream,
String contentType,
String user) |
protected void |
patchResource(String resourceURI,
String baseURI,
InputStream stream,
String contentType,
String user) |
String |
post(InputStream stream,
String contentType,
String user,
String nameHint,
boolean isResourceInteractionModel)
Post a new member to the container.
|
javax.ws.rs.core.Response |
postNonRDFSource(InputStream content,
String stripCharset,
String user,
String slug)
Post a new LDP-NR (non-RDF source) to the container.
|
boolean |
putCreate(String resourceURI,
InputStream stream,
String contentType,
String user,
javax.ws.rs.core.HttpHeaders requestHeaders)
Creates a new resource at resourceURI with the contents of the specified stream.
|
void |
query(OutputStream outStream,
String queryString,
String resultsFormat)
Execute the specified SPARQL query over the container and its entries,
specifying the output format.
|
void |
setConfigParameters() |
build, buildErrorResponse, buildErrorResponse, checkIfMatch, fail, failIfReadOnlyPropertyChanged, failParsingRDF, failReadOnlyProperty, get, getConfigModel, getContainerURIForResource, getETag, getGraphStore, isJSONLDPresent, options, putUpdate, readModel, updateResource
getModel, getTypeURI, getURI, setModel, setURI
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get, getModel, getTypeURI, getURI, options, putUpdate, setModel, setURI
public static final String DEFAULT_RESOURCE_PREFIX
protected String fResourceURIPrefix
protected JenaLDPContainer(String containerURI, TDBGraphStore graphStore)
public static JenaLDPContainer create(String containerURI, TDBGraphStore graphStore)
#LDPContainer(String, String, GraphStore, GraphStore, InputStream)
public void setConfigParameters()
public void query(OutputStream outStream, String queryString, String resultsFormat)
ILDPContainer
query
in interface ILDPContainer
outStream
- the output stream in which to write the query result.queryString
- the SPARQL query to execute.resultsFormat
- the desired result format content type ; if null
or not supported, the format will be XML.public String post(InputStream stream, String contentType, String user, String nameHint, boolean isResourceInteractionModel)
ILDPContainer
The Content-Type of the input stream is specified by the
contentType
argument. Supported values are "application/rdf+xml",
"text/turtle", and "application/x-turtle".
post
in interface ILDPContainer
stream
- the input stream containing the posted resource representation.contentType
- the Content-Type of the input stream.user
- The user URI to use for dcterms:creatornameHint
- Value from Slug header or other source, used to determine the newly created resource's URLisResourceInteractionModel
- If true, treat container as resource (don't allow POST)public boolean putCreate(String resourceURI, InputStream stream, String contentType, String user, javax.ws.rs.core.HttpHeaders requestHeaders)
ILDPContainer
The Content-Type of the input stream is specified by the
contentType
argument.
putCreate
in interface ILDPContainer
resourceURI
- the URI of to-be-created resource.stream
- the input stream containing the resource representation.contentType
- the Content-Type of the input stream.requestHeaders
- the HTTP request headerspublic void patch(String resourceURI, InputStream stream, String contentType, String user)
patch
in interface ILDPResource
patch
in class JenaLDPRDFSource
protected String createResource(String resourceURI, boolean addToContainer, InputStream stream, String contentType, String user)
resourceURI
- The NEW resource being added (including any query params, etc)addToContainer
- If true, will add membership and containment triplesstream
- Bytes from the requestcontentType
- Suggested type of the stream (turtle, rdf/xml, json, ...)user
- dcterms:creator nameprotected void addToContainer(String resourceURI, org.apache.jena.rdf.model.Model resourceModel, Calendar time)
resourceURI
- the URI of the resource to addresourceModel
- the RDF content or null for non-RDF source (needed for the ldp:isMemberOfRelation)time
- the current time (for dcterms:modified properties)protected void patchResource(String resourceURI, String baseURI, InputStream stream, String contentType, String user)
public void delete()
ILDPResource
delete
in interface ILDPResource
delete
in class JenaLDPRDFSource
protected org.apache.jena.rdf.model.Model amendResponseGraph(org.apache.jena.rdf.model.Model container, javax.ws.rs.core.MultivaluedMap<String,String> preferences)
JenaLDPRDFSource
amendResponseGraph
in class JenaLDPRDFSource
protected boolean isReturnRepresentationPreferenceApplied(javax.ws.rs.core.MultivaluedMap<String,String> preferences)
protected void amendResponse(javax.ws.rs.core.Response.ResponseBuilder response, javax.ws.rs.core.MultivaluedMap<String,String> preferences)
amendResponse
in class JenaLDPRDFSource
public static org.apache.jena.rdf.model.Property getMemberRelation(org.apache.jena.rdf.model.Model containerGraph, org.apache.jena.rdf.model.Resource containerResource)
public static org.apache.jena.rdf.model.Property getIsMemberOfRelation(org.apache.jena.rdf.model.Model containerGraph, org.apache.jena.rdf.model.Resource containerResource)
public static String getMembershipResourceURI(org.apache.jena.rdf.model.Model containerGraph, org.apache.jena.rdf.model.Resource containerResource)
public Set<String> getAllowedMethods()
ILDPResource
getAllowedMethods
in interface ILDPResource
getAllowedMethods
in class JenaLDPRDFSource
protected Set<String> getReadOnlyProperties()
getReadOnlyProperties
in class JenaLDPRDFSource
public javax.ws.rs.core.Response postNonRDFSource(InputStream content, String stripCharset, String user, String slug)
ILDPContainer
postNonRDFSource
in interface ILDPContainer
Copyright © 2018. All rights reserved.