Class BlankNode

  • All Implemented Interfaces:
    Node, Resource

    public final class BlankNode
    extends java.lang.Object
    implements Resource
    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 Summary

      Constructors 
      Constructor Description
      BlankNode()
      Default constructor.
      BlankNode​(java.util.List<org.apache.commons.lang3.tuple.Pair<Property,​Node>> predicates)
      Constructor that allows you to configure the Blank Node with existing predicates.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      BlankNode addPredicate​(org.apache.commons.lang3.tuple.Pair<Property,​Node> predicate)
      Add a predicate to the BlankNode.
      java.util.List<org.apache.commons.lang3.tuple.Pair<Property,​Node>> getPredicates()
      Get the predicates inside the Blank node.
      java.util.Optional<java.lang.String> getUri()
      Get the URI of the Resource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BlankNode

        public BlankNode()
        Default constructor. It creates a Blank Node without any predicates.
      • BlankNode

        public BlankNode​(java.util.List<org.apache.commons.lang3.tuple.Pair<Property,​Node>> predicates)
        Constructor that allows you to configure the Blank Node with existing predicates.
        Parameters:
        predicates - the predicates to add
    • Method Detail

      • addPredicate

        public BlankNode addPredicate​(org.apache.commons.lang3.tuple.Pair<Property,​Node> predicate)
        Add a predicate to the BlankNode. Note that this is an immutable data structure, so it returns a new [BlankNode].
        Parameters:
        predicate - the predicate to add
        Returns:
        the modified version of the Blank Node
      • getPredicates

        public java.util.List<org.apache.commons.lang3.tuple.Pair<Property,​Node>> getPredicates()
        Get the predicates inside the Blank node.
        Returns:
        the list of predicates
      • getUri

        public java.util.Optional<java.lang.String> getUri()
        Description copied from interface: Resource
        Get the URI of the Resource.
        Specified by:
        getUri in interface Resource
        Returns:
        the uri, as an Optional String, of the resource