Class RdfBlankNode

java.lang.Object
io.github.webbasedwodt.model.ontology.rdf.RdfBlankNode
All Implemented Interfaces:
RdfNode, RdfResource

public final class RdfBlankNode extends Object implements RdfResource
It models the concept of RDF Blank Node in the context of Digital Twin Knowledge Graph. A Blank Node could have an associated list of predicates.
  • Constructor Details

    • RdfBlankNode

      public RdfBlankNode(String blankNodeId)
      Default constructor. It creates a Blank Node without any triples.
      Parameters:
      blankNodeId - the blank node id, used to safely update data.
    • RdfBlankNode

      public RdfBlankNode(String blankNodeId, List<RdfUnSubjectedTriple> tripleList)
      Constructor that allows you to configure the Blank Node with existing triples.
      Parameters:
      blankNodeId - the blank node id, used to safely update data.
      tripleList - the unsubjected triples to add
  • Method Details

    • addPredicate

      public RdfBlankNode addPredicate(RdfUnSubjectedTriple triple)
      Add a triple to the BlankNode. Note that this is an immutable data structure, so it returns a new RdfBlankNode.
      Parameters:
      triple - the triple to add
      Returns:
      the modified version of the Blank Node
    • getBlankNodeId

      public String getBlankNodeId()
      Get the blank node id.
      Returns:
      the blank node id
    • getPredicates

      public List<RdfUnSubjectedTriple> getPredicates()
      Get the triples inside the Blank node.
      Returns:
      the list of triples
    • getUri

      public Optional<URI> getUri()
      Description copied from interface: RdfResource
      Get the URI of the Resource.
      Specified by:
      getUri in interface RdfResource
      Returns:
      the uri, if present (e.g., in Blank Nodes is not present) of the resource