Package org.trellisldp.jdbc
Class DBResource
- java.lang.Object
-
- org.trellisldp.jdbc.DBResource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.trellisldp.api.Resource
Resource.SpecialResources
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompletionStage<Resource>
findResource(DataSource ds, IRI identifier, Map<String,IRI> extensions, boolean includeLdpType)
Try to load a Trellis resource.static CompletionStage<Resource>
findResource(org.jdbi.v3.core.Jdbi jdbi, IRI identifier, Map<String,IRI> extensions, boolean includeLdpType)
Try to load a Trellis resource.static CompletionStage<Resource>
findResource(org.jdbi.v3.core.Jdbi jdbi, IRI identifier, Map<String,IRI> extensions, boolean includeLdpType, boolean supportDirectContainment, boolean supportIndirectContainment)
Try to load a Trellis resource.Optional<BinaryMetadata>
getBinaryMetadata()
Retrieve a BinaryMetadata for this resouce, if it is a LDP-NR.Optional<IRI>
getContainer()
Get the container for this resource.Stream<Map.Entry<String,String>>
getExtraLinkRelations()
Get any extra implementation-defined link relations for this resource.IRI
getIdentifier()
Get an identifier for this resource.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.Optional<IRI>
getMemberOfRelation()
Retrieve the member of relation IRI.Optional<IRI>
getMemberRelation()
Retrieve the member relation if this is an LDP Direct or Indirect container.Optional<IRI>
getMembershipResource()
Retrieve the membership resource if this is an LDP Direct or Indirect container.Set<IRI>
getMetadataGraphNames()
Retrieve a collection of attached metadata graph names.Instant
getModified()
Get the last modified date.boolean
hasMetadata(IRI graphName)
Test whether this resource has an attached metadata resource.boolean
isDeleted()
Identify whether this resource had previously been deleted.Stream<Quad>
stream()
Retrieve the RDF Quads for a resource.Stream<Quad>
stream(Collection<IRI> graphNames)
Retrieve the RDF Quads for a set of named graphs.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.trellisldp.api.Resource
dataset, getRevision, stream
-
-
-
-
Method Detail
-
findResource
public static CompletionStage<Resource> findResource(DataSource ds, IRI identifier, Map<String,IRI> extensions, boolean includeLdpType)
Try to load a Trellis resource.- Parameters:
ds
- the datasourceidentifier
- the identifierextensions
- a map of extensionsincludeLdpType
- whether to include the LDP type in the RDF body- Returns:
- a Resource, if one exists
-
findResource
public static CompletionStage<Resource> findResource(org.jdbi.v3.core.Jdbi jdbi, IRI identifier, Map<String,IRI> extensions, boolean includeLdpType)
Try to load a Trellis resource.- Parameters:
jdbi
- the Jdbi objectidentifier
- the identifierextensions
- a map of extensionsincludeLdpType
- whether to include the LDP type in the RDF body- Returns:
- a Resource, if one exists
-
findResource
public static CompletionStage<Resource> findResource(org.jdbi.v3.core.Jdbi jdbi, IRI identifier, Map<String,IRI> extensions, boolean includeLdpType, boolean supportDirectContainment, boolean supportIndirectContainment)
Try to load a Trellis resource.- Parameters:
jdbi
- the Jdbi objectidentifier
- the identifierextensions
- a map of extensionsincludeLdpType
- whether to include the LDP type in the RDF bodysupportDirectContainment
- whether to support direct containmentsupportIndirectContainment
- whether to support indirect containment- Returns:
- a Resource, if one exists
-
isDeleted
public boolean isDeleted()
Identify whether this resource had previously been deleted.- Returns:
- true if the resource previously existed
-
stream
public Stream<Quad> stream()
Description copied from interface:Resource
Retrieve the RDF Quads for a resource.
-
stream
public Stream<Quad> stream(Collection<IRI> graphNames)
Description copied from interface:Resource
Retrieve the RDF Quads for a set of named graphs.
-
getIdentifier
public IRI getIdentifier()
Description copied from interface:Resource
Get an identifier for this resource.- Specified by:
getIdentifier
in interfaceResource
- Returns:
- the identifier
-
getInteractionModel
public IRI getInteractionModel()
Description copied from interface:Resource
Get the LDP interaction model for this resource.- Specified by:
getInteractionModel
in interfaceResource
- Returns:
- the interaction model
-
getContainer
public Optional<IRI> getContainer()
Description copied from interface:Resource
Get the container for this resource.- Specified by:
getContainer
in interfaceResource
- Returns:
- the identifier for a container, if one exists.
-
getMembershipResource
public Optional<IRI> getMembershipResource()
Description copied from interface:Resource
Retrieve the membership resource if this is an LDP Direct or Indirect container.- Specified by:
getMembershipResource
in interfaceResource
- Returns:
- the membership resource
-
getMemberRelation
public Optional<IRI> getMemberRelation()
Description copied from interface:Resource
Retrieve the member relation if this is an LDP Direct or Indirect container.- Specified by:
getMemberRelation
in interfaceResource
- Returns:
- the ldp:hasMemberRelation IRI
-
getMemberOfRelation
public Optional<IRI> getMemberOfRelation()
Description copied from interface:Resource
Retrieve the member of relation IRI.- Specified by:
getMemberOfRelation
in interfaceResource
- Returns:
- the ldp:isMemberOfRelation IRI
-
getInsertedContentRelation
public Optional<IRI> getInsertedContentRelation()
Description copied from interface:Resource
Retrieve the inserted content relation if this is an LDP Indirect container.- Specified by:
getInsertedContentRelation
in interfaceResource
- Returns:
- the inserted content relation
-
getBinaryMetadata
public Optional<BinaryMetadata> getBinaryMetadata()
Description copied from interface:Resource
Retrieve a BinaryMetadata for this resouce, if it is a LDP-NR.- Specified by:
getBinaryMetadata
in interfaceResource
- Returns:
- the binary metadata
-
getModified
public Instant getModified()
Description copied from interface:Resource
Get the last modified date.- Specified by:
getModified
in interfaceResource
- Returns:
- the last-modified date
-
hasMetadata
public boolean hasMetadata(IRI graphName)
Description copied from interface:Resource
Test whether this resource has an attached metadata resource.- Specified by:
hasMetadata
in interfaceResource
- Parameters:
graphName
- the name of the metadata graph- Returns:
- true if this resource has an attached metadata resource; false otherwise
-
getMetadataGraphNames
public Set<IRI> getMetadataGraphNames()
Description copied from interface:Resource
Retrieve a collection of attached metadata graph names.- Specified by:
getMetadataGraphNames
in interfaceResource
- Returns:
- a set of metadata resource graph names
-
-