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 Dataset |
dataset()
Retrieve the RDF Quads for a resource.
|
default Optional<BinaryMetadata> |
getBinaryMetadata()
Retrieve a BinaryMetadata for this resouce, if it is a LDP-NR.
|
Optional<IRI> |
getContainer()
Get the container for this resource.
|
default Stream<Map.Entry<String,String>> |
getExtraLinkRelations()
Get any extra implementation-defined link relations for this resource.
|
IRI |
getIdentifier()
Get an identifier for this resource.
|
default Optional<IRI> |
getInsertedContentRelation()
Retrieve the inserted content relation if this is an LDP Indirect container.
|
IRI |
getInteractionModel()
Get the LDP interaction model for this resource.
|
default Optional<IRI> |
getMemberOfRelation()
Retrieve the member of relation IRI.
|
default Optional<IRI> |
getMemberRelation()
Retrieve the member relation if this is an LDP Direct or Indirect container.
|
default Optional<IRI> |
getMembershipResource()
Retrieve the membership resource if this is an LDP Direct or Indirect container.
|
Instant |
getModified()
Get the last modified date.
|
default String |
getRevision()
Get the revision or state tag of the resource.
|
default boolean |
hasAcl()
Test whether this resource has an ACL resource.
|
Stream<Quad> |
stream()
Retrieve the RDF Quads for a resource.
|
default Stream<Quad> |
stream(Collection<IRI> graphNames)
Retrieve the RDF Quads for a set of named graphs.
|
default Stream<Quad> |
stream(IRI graphName)
Retrieve the RDF Quads for a given named graph.
|
IRI getIdentifier()
IRI getInteractionModel()
Instant getModified()
default String getRevision()
null
.Optional<IRI> getContainer()
default Optional<IRI> getMembershipResource()
Optional
valuedefault Optional<IRI> getMemberRelation()
Optional
valuedefault Optional<IRI> getMemberOfRelation()
Optional
valuedefault Optional<IRI> getInsertedContentRelation()
Optional
valuedefault Dataset dataset()
default Stream<Quad> stream(IRI graphName)
graphName
- the named graphdefault Stream<Quad> stream(Collection<IRI> graphNames)
graphNames
- the named graphsdefault Optional<BinaryMetadata> getBinaryMetadata()
Optional
valuedefault boolean hasAcl()
default Stream<Map.Entry<String,String>> getExtraLinkRelations()
key="http://example.com/author001"
and value="author"
will result
in the header Link: <http://example.com/author001>; rel="author"
.