Interface BlankNode

  • All Superinterfaces:
    BlankNodeOrIRI, RDFTerm
    All Known Subinterfaces:
    JsonLdBlankNode, RDF4JBlankNode
    All Known Implementing Classes:
    BlankNodeImpl, BlankNodeImpl, JsonLdBlankNodeImpl

    public interface BlankNode
    extends BlankNodeOrIRI
    A RDF-1.1 Blank Node, as defined by RDF-1.1 Concepts and Abstract Syntax, a W3C Recommendation published on 25 February 2014.
    Note:
    Blank nodes are disjoint from IRIs and literals. Otherwise, the set of possible blank nodes is arbitrary. RDF makes no reference to any internal structure of blank nodes.
    Also note that:
    Blank node identifiers are local identifiers that are used in some concrete RDF syntaxes or RDF store implementations. They are always locally scoped to the file or RDF store, and are not persistent or portable identifiers for blank nodes. Blank node identifiers are not part of the RDF abstract syntax, but are entirely dependent on the concrete syntax or implementation. The syntactic restrictions on blank node identifiers, if any, therefore also depend on the concrete RDF syntax or implementation. Implementations that handle blank node identifiers in concrete syntaxes need to be careful not to create the same blank node from multiple occurrences of the same blank node identifier except in situations where this is supported by the syntax.
    A BlankNode SHOULD contain a UUID-derived string as part of its universally unique uniqueReference().
    See Also:
    RDF.createBlankNode(), RDF.createBlankNode(String), RDF-1.1 Blank Node
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)
      Check it this BlankNode is equal to another BlankNode.
      int hashCode()
      Calculate a hash code for this BlankNode.
      java.lang.String uniqueReference()
      Return a reference for uniquely identifying the blank node.
    • Method Detail

      • uniqueReference

        java.lang.String uniqueReference()
        Return a reference for uniquely identifying the blank node.

        The reference string MUST universally and uniquely identify this blank node. That is, different blank nodes created separately in different JVMs or from different RDF instances MUST NOT have the same reference string.

        The uniqueReference() of two BlankNode instances MUST be equal if and only if the two blank nodes are equal according to equals(Object).

        Clients should not assume any particular structure of the reference string, however it is recommended that the reference string contain a UUID-derived string, e.g. as returned from UUID.toString().

        IMPORTANT: This is not a blank node identifier nor a serialization/syntax label, and there are no guarantees that it is a valid identifier in any concrete RDF syntax. For an N-Triples compatible identifier, use RDFTerm.ntriplesString().

        Returns:
        A universally unique reference to identify this BlankNode
      • equals

        boolean equals​(java.lang.Object other)
        Check it this BlankNode is equal to another BlankNode. Two BlankNodes MUST be equal if, and only if, they have the same uniqueReference().

        Implementations MUST also override hashCode() so that two equal Literals produce the same hash code.

        Specified by:
        equals in interface RDFTerm
        Overrides:
        equals in class java.lang.Object
        Parameters:
        other - Another object
        Returns:
        true if other is a BlankNode instance that represent the same blank node
        See Also:
        Object.equals(Object)
      • hashCode

        int hashCode()
        Calculate a hash code for this BlankNode.

        The returned hash code MUST be equal to the String.hashCode() of the uniqueReference().

        This method MUST be implemented in conjunction with equals(Object) so that two equal BlankNodes produce the same hash code.

        Specified by:
        hashCode in interface RDFTerm
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a hash code value for this BlankNode.
        See Also:
        Object.hashCode()