Class OntologyManagerImpl

java.lang.Object
io.github.webbasedwodt.DTDManager.impl.OntologyManagerImpl
All Implemented Interfaces:
OntologyManager, DTOntology

public final class OntologyManagerImpl extends Object implements DTOntology, OntologyManager
This class handles ontological information from the two possible configurations: thing model and config file.
  • Constructor Details

    • OntologyManagerImpl

      public OntologyManagerImpl(org.eclipse.ditto.things.model.Thing dittoThing, String yamlOntologyPath)
      Default constructor.
      Parameters:
      dittoThing - the ditto thing to expose
      yamlOntologyPath - the yaml config file path
  • Method Details

    • getDigitalTwinType

      public String getDigitalTwinType()
      Description copied from interface: DTOntology
      This represents the type of the Digital Twin.
      Specified by:
      getDigitalTwinType in interface DTOntology
      Returns:
      the type of the Digital Twin
    • getDomainTag

      public Optional<String> getDomainTag(String rawElement)
      Description copied from interface: DTOntology
      Get the Domain Tag of a Digital Twin property, relationship or action. If the property/relationship/action is not present, returns an empty Optional
      Specified by:
      getDomainTag in interface DTOntology
      Parameters:
      rawElement - the Digital Twin property/relationship/action name for which obtain the corresponding Domain Tag
      Returns:
      the Domain Tag of the Digital Twin property/relationship/action
    • obtainEventType

      public Optional<String> obtainEventType(String rawEvent)
      Description copied from interface: DTOntology
      Obtain the semantic type that describe the event.
      Specified by:
      obtainEventType in interface DTOntology
      Parameters:
      rawEvent - the input raw event name
      Returns:
      an optional with the event type if present
    • mapPropertyData

      public <T> Optional<org.apache.commons.lang3.tuple.Pair<RdfProperty,Node>> mapPropertyData(String rawProperty, T value)
      Description copied from interface: DTOntology
      Convert a raw property and its value to the ontology model. If the mapping cannot be done it will return an empty optional
      Specified by:
      mapPropertyData in interface DTOntology
      Type Parameters:
      T - the type of the value
      Parameters:
      rawProperty - the input raw property
      value - the value of the property
      Returns:
      an optional that is filled with the Pair of the mapped Property and its mapped value if possible
    • mapRelationshipInstance

      public Optional<org.apache.commons.lang3.tuple.Pair<RdfProperty,Individual>> mapRelationshipInstance(String rawRelationship, String targetUri)
      Description copied from interface: DTOntology
      Convert a raw relationship and its target uri to the ontology model. If the mapping cannot be done it will return an empty optional.
      Specified by:
      mapRelationshipInstance in interface DTOntology
      Parameters:
      rawRelationship - the input raw relationship
      targetUri - the target uri of the relationship
      Returns:
      an optional that is filled with the Pair of the mapped Property and its mapped target uri if possible
    • getAvailableContextExtensions

      public List<ThingModelElement> getAvailableContextExtensions()
      Description copied from interface: OntologyManager
      Get the available context extensions of the digital twin.
      Specified by:
      getAvailableContextExtensions in interface OntologyManager
      Returns:
      the available context extensions.
    • getAvailableProperties

      public List<ThingModelElement> getAvailableProperties()
      Description copied from interface: OntologyManager
      Get the available properties.
      Specified by:
      getAvailableProperties in interface OntologyManager
      Returns:
      the available properties
    • getAvailableRelationships

      public List<ThingModelElement> getAvailableRelationships()
      Description copied from interface: OntologyManager
      Get the available relationships of the digital twin.
      Specified by:
      getAvailableRelationships in interface OntologyManager
      Returns:
      the available relationships
    • getAvailableActions

      public List<ThingModelElement> getAvailableActions()
      Description copied from interface: OntologyManager
      Get the available actions of the digital twin.
      Specified by:
      getAvailableActions in interface OntologyManager
      Returns:
      the available actions
    • getAvailableEvents

      public List<ThingModelElement> getAvailableEvents()
      Description copied from interface: OntologyManager
      Get the available events of the digital twin.
      Specified by:
      getAvailableEvents in interface OntologyManager
      Returns:
      the available events