Interface Resource

    • Method Detail

      • getIdentifier

        IRI getIdentifier()
        Get an identifier for this resource.
        Returns:
        the identifier
      • getInteractionModel

        IRI getInteractionModel()
        Get the LDP interaction model for this resource.
        Returns:
        the interaction model
      • getModified

        Instant getModified()
        Get the last modified date.
        Returns:
        the last-modified date
      • getRevision

        default String getRevision()
        Get the revision or state tag of the resource.
        Returns:
        the revision tag of the resource
        API Note:
        the return value of this method should be unique to the state of the resource. That is, it should be unique across all resources on the server, and whenever a given resource changes, this revision tag should also change. This value will be used as the raw material for generating an ETag in the HTTP layer, and it should not return null.
        Implementation Requirements:
        the default implementation returns a concatenation of the resource identifier and the modification date.
      • getContainer

        Optional<IRI> getContainer()
        Get the container for this resource.
        Returns:
        the identifier for a container, if one exists.
        API Note:
        returning an empty Optional should indicate here that the resource is not contained by any parent resource. This may be because it is a root resource and therefore not contained by any other resource. Alternatively, it could mean that a PUT operation was used to create the resource.
      • getMembershipResource

        default Optional<IRI> getMembershipResource()
        Retrieve the membership resource if this is an LDP Direct or Indirect container.
        Returns:
        the membership resource
        Implementation Requirements:
        Other LDP resource types will always return an empty Optional value
      • getMemberRelation

        default Optional<IRI> getMemberRelation()
        Retrieve the member relation if this is an LDP Direct or Indirect container.
        Returns:
        the ldp:hasMemberRelation IRI
        Implementation Requirements:
        Other LDP resource types will always return an empty Optional value
      • getMemberOfRelation

        default Optional<IRI> getMemberOfRelation()
        Retrieve the member of relation IRI.
        Returns:
        the ldp:isMemberOfRelation IRI
        Implementation Requirements:
        Other LDP resource types will always return an empty Optional value
      • getInsertedContentRelation

        default Optional<IRI> getInsertedContentRelation()
        Retrieve the inserted content relation if this is an LDP Indirect container.
        Returns:
        the inserted content relation
        Implementation Requirements:
        Other LDP resource types will always return an empty Optional value
      • stream

        Stream<Quad> stream()
        Retrieve the RDF Quads for a resource.
        Returns:
        the RDF quads
      • dataset

        default Dataset dataset()
        Retrieve the RDF Quads for a resource.
        Returns:
        the RDF quads
      • stream

        default Stream<Quad> stream​(IRI graphName)
        Retrieve the RDF Quads for a given named graph.
        Parameters:
        graphName - the named graph
        Returns:
        the RDF quads
      • stream

        default Stream<Quad> stream​(Collection<IRI> graphNames)
        Retrieve the RDF Quads for a set of named graphs.
        Parameters:
        graphNames - the named graphs
        Returns:
        the RDF quads
      • getBinaryMetadata

        default Optional<BinaryMetadata> getBinaryMetadata()
        Retrieve a BinaryMetadata for this resouce, if it is a LDP-NR.
        Returns:
        the binary metadata
        Implementation Requirements:
        Other LDP resource types will always return an empty Optional value
      • hasMetadata

        default boolean hasMetadata​(IRI graphName)
        Test whether this resource has an attached metadata resource.
        Parameters:
        graphName - the name of the metadata graph
        Returns:
        true if this resource has an attached metadata resource; false otherwise
      • getMetadataGraphNames

        default Set<IRI> getMetadataGraphNames()
        Retrieve a collection of attached metadata graph names.
        Returns:
        a set of metadata resource graph names
      • getExtraLinkRelations

        default Stream<Map.Entry<String,​String>> getExtraLinkRelations()
        Get any extra implementation-defined link relations for this resource.
        Returns:
        a stream of relation types
        API Note:
        Each entry will be used to create a link header, such that the key refers to the URI and the value is the "rel" portion. For example, an item with key="http://example.com/author001" and value="author" will result in the header Link: <http://example.com/author001>; rel="author".