Class OntologyManagerImpl
java.lang.Object
io.github.webbasedwodt.DTDManager.impl.OntologyManagerImpl
- All Implemented Interfaces:
OntologyManager
,DTOntology
This class handles ontological information from the two possible configurations: thing model and config file.
-
Constructor Summary
ConstructorsConstructorDescriptionOntologyManagerImpl
(org.eclipse.ditto.things.model.Thing dittoThing, String yamlOntologyPath) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the available actions of the digital twin.Get the available context extensions of the digital twin.Get the available events of the digital twin.Get the available properties.Get the available relationships of the digital twin.This represents the type of the Digital Twin.getDomainTag
(String rawElement) Get the Domain Tag of a Digital Twin property, relationship or action.<T> Optional<org.apache.commons.lang3.tuple.Pair<RdfProperty,
Node>> mapPropertyData
(String rawProperty, T value) Convert a raw property and its value to the ontology model.Optional<org.apache.commons.lang3.tuple.Pair<RdfProperty,
Individual>> mapRelationshipInstance
(String rawRelationship, String targetUri) Convert a raw relationship and its target uri to the ontology model.obtainEventType
(String rawEvent) Obtain the semantic type that describe the event.
-
Constructor Details
-
OntologyManagerImpl
public OntologyManagerImpl(org.eclipse.ditto.things.model.Thing dittoThing, String yamlOntologyPath) Default constructor.- Parameters:
dittoThing
- the ditto thing to exposeyamlOntologyPath
- the yaml config file path
-
-
Method Details
-
getDigitalTwinType
Description copied from interface:DTOntology
This represents the type of the Digital Twin.- Specified by:
getDigitalTwinType
in interfaceDTOntology
- Returns:
- the type of the Digital Twin
-
getDomainTag
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 emptyOptional
- Specified by:
getDomainTag
in interfaceDTOntology
- 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
Description copied from interface:DTOntology
Obtain the semantic type that describe the event.- Specified by:
obtainEventType
in interfaceDTOntology
- 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 interfaceDTOntology
- Type Parameters:
T
- the type of the value- Parameters:
rawProperty
- the input raw propertyvalue
- 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 interfaceDTOntology
- Parameters:
rawRelationship
- the input raw relationshiptargetUri
- 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
Description copied from interface:OntologyManager
Get the available context extensions of the digital twin.- Specified by:
getAvailableContextExtensions
in interfaceOntologyManager
- Returns:
- the available context extensions.
-
getAvailableProperties
Description copied from interface:OntologyManager
Get the available properties.- Specified by:
getAvailableProperties
in interfaceOntologyManager
- Returns:
- the available properties
-
getAvailableRelationships
Description copied from interface:OntologyManager
Get the available relationships of the digital twin.- Specified by:
getAvailableRelationships
in interfaceOntologyManager
- Returns:
- the available relationships
-
getAvailableActions
Description copied from interface:OntologyManager
Get the available actions of the digital twin.- Specified by:
getAvailableActions
in interfaceOntologyManager
- Returns:
- the available actions
-
getAvailableEvents
Description copied from interface:OntologyManager
Get the available events of the digital twin.- Specified by:
getAvailableEvents
in interfaceOntologyManager
- Returns:
- the available events
-