Class JenaDTKGEngine

java.lang.Object
io.github.webbasedwodt.DTKGEngine.impl.JenaDTKGEngine
All Implemented Interfaces:
DTKGEngine, DTKGEngineReader

public class JenaDTKGEngine extends Object implements DTKGEngine
This class provides an implementation of the DTKGEngine using Apache Jena.
  • Constructor Details

    • JenaDTKGEngine

      public JenaDTKGEngine(URI digitalTwinUri, String digitalTwinType)
      Default constructor.
      Parameters:
      digitalTwinUri - the uri of the Digital Twin for which this class creates the DTKG
      digitalTwinType - the type of the Digital Twin
  • Method Details

    • removeDigitalTwin

      public void removeDigitalTwin()
      Description copied from interface: DTKGEngine
      Method that allows to signal the deletion or the stop of the underlying Digital Twin.
      Specified by:
      removeDigitalTwin in interface DTKGEngine
    • addDigitalTwinPropertyUpdate

      public void addDigitalTwinPropertyUpdate(RdfProperty property, Node newValue)
      Description copied from interface: DTKGEngine
      Add or update a Digital Twin property within the Digital Twin Knowledge Graph.
      Specified by:
      addDigitalTwinPropertyUpdate in interface DTKGEngine
      Parameters:
      property - the property to add/update
      newValue - the value of the property.
    • removeProperty

      public boolean removeProperty(RdfProperty property)
      Description copied from interface: DTKGEngine
      Remove a Digital Twin property within the Digital Twin Knowledge Graph.
      Specified by:
      removeProperty in interface DTKGEngine
      Parameters:
      property - the property to delete.
      Returns:
      true if deleted, false if not-existent.
    • addRelationship

      public void addRelationship(RdfProperty relationshipPredicate, Individual targetIndividual)
      Description copied from interface: DTKGEngine
      Add a relationship with another Digital Twin.
      Specified by:
      addRelationship in interface DTKGEngine
      Parameters:
      relationshipPredicate - the associated predicate
      targetIndividual - the target individual
    • removeRelationship

      public boolean removeRelationship(RdfProperty relationshipPredicate, Individual targetIndividual)
      Description copied from interface: DTKGEngine
      Delete an existing relationship with another Digital Twin.
      Specified by:
      removeRelationship in interface DTKGEngine
      Parameters:
      relationshipPredicate - the associated predicate
      targetIndividual - the target individual.
      Returns:
      true if correctly deleted, false if the relationship doesn't exist
    • removeRelationship

      public boolean removeRelationship(RdfProperty relationshipPredicate)
      Description copied from interface: DTKGEngine
      Delete all the occurrences of a relationship with another Digital Twin.
      Specified by:
      removeRelationship in interface DTKGEngine
      Parameters:
      relationshipPredicate - the associated predicate
      Returns:
      true if correctly deleted, false if the relationship doesn't exist
    • addActionId

      public void addActionId(String actionId)
      Description copied from interface: DTKGEngine
      Add an available action on the Digital Twin Knowledge Graph.
      Specified by:
      addActionId in interface DTKGEngine
      Parameters:
      actionId - the action identifier to identify the available action.
    • removeActionId

      public boolean removeActionId(String actionId)
      Description copied from interface: DTKGEngine
      Remove an action from the Digital Twin Knowledge Graph.
      Specified by:
      removeActionId in interface DTKGEngine
      Parameters:
      actionId - the action identifier to remove
      Returns:
      true if correctly deleted, false if the action id doesn't exist
    • getCurrentDigitalTwinKnowledgeGraph

      public String getCurrentDigitalTwinKnowledgeGraph()
      Description copied from interface: DTKGEngineReader
      Obtain the current status of the Digital Twin Knowledge Graph.
      Specified by:
      getCurrentDigitalTwinKnowledgeGraph in interface DTKGEngineReader
      Returns:
      the current state of the DTKG
    • addDTKGObserver

      public void addDTKGObserver(DTKGObserver observer)
      Description copied from interface: DTKGEngine
      Add a DTKGObserver that will be notified for each DTKG update.
      Specified by:
      addDTKGObserver in interface DTKGEngine
      Parameters:
      observer - the observer to add.