public interface Resource
Resource object
with metadata such as getModified(), getInteractionModel() and other data fetched
by the accessors. The resource content, on the other hand, is often loaded on-demand via
the stream() method. This pattern tends to reduce the number of requests to the
persistence layer while also limiting the data held in memory for a given Resource object.| Modifier and Type | Interface and Description |
|---|---|
static class |
Resource.SpecialResources |
| Modifier and Type | Method and Description |
|---|---|
default org.apache.commons.rdf.api.Dataset |
dataset()
Retrieve the RDF Quads for a resource.
|
default java.util.Optional<BinaryMetadata> |
getBinaryMetadata()
Retrieve a BinaryMetadata for this resouce, if it is a LDP-NR.
|
java.util.Optional<org.apache.commons.rdf.api.IRI> |
getContainer()
Get the container for this resource.
|
default java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.lang.String>> |
getExtraLinkRelations()
Get any extra implementation-defined link relations for this resource.
|
org.apache.commons.rdf.api.IRI |
getIdentifier()
Get an identifier for this resource.
|
default java.util.Optional<org.apache.commons.rdf.api.IRI> |
getInsertedContentRelation()
Retrieve the inserted content relation if this is an LDP Indirect container.
|
org.apache.commons.rdf.api.IRI |
getInteractionModel()
Get the LDP interaction model for this resource.
|
default java.util.Optional<org.apache.commons.rdf.api.IRI> |
getMemberOfRelation()
Retrieve the member of relation IRI.
|
default java.util.Optional<org.apache.commons.rdf.api.IRI> |
getMemberRelation()
Retrieve the member relation if this is an LDP Direct or Indirect container.
|
default java.util.Optional<org.apache.commons.rdf.api.IRI> |
getMembershipResource()
Retrieve the membership resource if this is an LDP Direct or Indirect container.
|
java.time.Instant |
getModified()
Get the last modified date.
|
default java.lang.String |
getRevision()
Get the revision or state tag of the resource.
|
default boolean |
hasAcl()
Test whether this resource has an ACL resource.
|
java.util.stream.Stream<org.apache.commons.rdf.api.Quad> |
stream()
Retrieve the RDF Quads for a resource.
|
default java.util.stream.Stream<org.apache.commons.rdf.api.Quad> |
stream(java.util.Collection<org.apache.commons.rdf.api.IRI> graphNames)
Retrieve the RDF Quads for a set of named graphs.
|
default java.util.stream.Stream<org.apache.commons.rdf.api.Quad> |
stream(org.apache.commons.rdf.api.IRI graphName)
Retrieve the RDF Quads for a given named graph.
|
org.apache.commons.rdf.api.IRI getIdentifier()
org.apache.commons.rdf.api.IRI getInteractionModel()
java.time.Instant getModified()
default java.lang.String getRevision()
null.java.util.Optional<org.apache.commons.rdf.api.IRI> getContainer()
default java.util.Optional<org.apache.commons.rdf.api.IRI> getMembershipResource()
Optional valuedefault java.util.Optional<org.apache.commons.rdf.api.IRI> getMemberRelation()
Optional valuedefault java.util.Optional<org.apache.commons.rdf.api.IRI> getMemberOfRelation()
Optional valuedefault java.util.Optional<org.apache.commons.rdf.api.IRI> getInsertedContentRelation()
Optional valuejava.util.stream.Stream<org.apache.commons.rdf.api.Quad> stream()
default org.apache.commons.rdf.api.Dataset dataset()
default java.util.stream.Stream<org.apache.commons.rdf.api.Quad> stream(org.apache.commons.rdf.api.IRI graphName)
graphName - the named graphdefault java.util.stream.Stream<org.apache.commons.rdf.api.Quad> stream(java.util.Collection<org.apache.commons.rdf.api.IRI> graphNames)
graphNames - the named graphsdefault java.util.Optional<BinaryMetadata> getBinaryMetadata()
Optional valuedefault boolean hasAcl()
default java.util.stream.Stream<java.util.Map.Entry<java.lang.String,java.lang.String>> getExtraLinkRelations()
key="http://example.com/author001" and value="author" will result
in the header Link: <http://example.com/author001>; rel="author".