Class RDFResourceBlankNode

All Implemented Interfaces:
Serializable, Comparable<RDFNode>, org.apache.commons.rdf.api.BlankNode, org.apache.commons.rdf.api.BlankNodeOrIRI, org.apache.commons.rdf.api.RDFTerm, HasIRI

public class RDFResourceBlankNode extends RDFResource implements org.apache.commons.rdf.api.BlankNode
Anonymous node implementation.
See Also:
  • Constructor Details

    • RDFResourceBlankNode

      public RDFResourceBlankNode(IRI resource, boolean isIndividual, boolean forceId, boolean isAxiom)
      Create an RDFResource that is anonymous.
      Parameters:
      resource - The IRI of the resource
      isIndividual - true if the node represents an individual
      forceId - true if id should be output
      isAxiom - true if axiom
    • RDFResourceBlankNode

      public RDFResourceBlankNode(Integer anonId, boolean isIndividual, boolean forceId, boolean isAxiom)
      Create an RDFResource that is anonymous.
      Parameters:
      anonId - the number at the end of the anon IRI
      isIndividual - true if the node represents an individual
      forceId - true if id should be output
      isAxiom - true if axiom
    • RDFResourceBlankNode

      public RDFResourceBlankNode(boolean isIndividual, boolean forceId, boolean isAxiom)
      Create an RDFResource that is anonymous
      Parameters:
      isIndividual - true if this is an individual
      forceId - true if the id should be output
      isAxiom - true if axiom
  • Method Details

    • isIndividual

      public boolean isIndividual()
      Overrides:
      isIndividual in class RDFNode
      Returns:
      true if this is an anonymous individual
    • isAxiom

      public boolean isAxiom()
      Description copied from class: RDFNode
      Determines if this node is an axiom.
      Overrides:
      isAxiom in class RDFNode
      Returns:
      true if this node is a literal, otherwise false.
    • shouldOutputId

      public boolean shouldOutputId()
      Overrides:
      shouldOutputId in class RDFNode
      Returns:
      true if blank node id is mandatory for this resource
    • setIdRequired

      public void setIdRequired(boolean b)
      Parameters:
      b - change the value of the id required flag
    • isLiteral

      public boolean isLiteral()
      Description copied from class: RDFNode
      Determines if this node is a literal node.
      Overrides:
      isLiteral in class RDFNode
      Returns:
      true if this node is a literal, otherwise false.
    • isAnonymous

      public boolean isAnonymous()
      Description copied from class: RDFNode
      Determines if this node is a resource and is anonymous.
      Overrides:
      isAnonymous in class RDFNode
      Returns:
      true if this is a resource node (i.e. RDFNode.isLiteral() returns false) and the node is anonymous, or false if this is a resource node and is not anonymous.
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface org.apache.commons.rdf.api.BlankNode
      Specified by:
      hashCode in interface org.apache.commons.rdf.api.RDFTerm
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Specified by:
      equals in interface org.apache.commons.rdf.api.BlankNode
      Specified by:
      equals in interface org.apache.commons.rdf.api.RDFTerm
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getIRI

      public IRI getIRI()
      Description copied from interface: HasIRI
      Gets the IRI of this object.
      Specified by:
      getIRI in interface HasIRI
      Returns:
      The IRI of this object
    • getResource

      public IRI getResource()
      Specified by:
      getResource in class RDFResource
      Returns:
      the resource IRI
    • uniqueReference

      public String uniqueReference()
      Specified by:
      uniqueReference in interface org.apache.commons.rdf.api.BlankNode
    • getNodeIDValue

      public String getNodeIDValue()
      Description copied from class: RDFResource
      For blank nodes, return a valid value for the RDF/XML nodeId attribute. For non blank nodes, an exception should be thrown. The method must only be called on blank nodes.
      Specified by:
      getNodeIDValue in class RDFResource
      Returns:
      a valid value for thE RDF/XML nodeId attribute