A simple middleware prototype that allows to expose Eclipse Ditto Digital Twins (or Things) as HWoDT-compliant DTs.
First of all you need to start Eclipse Ditto, for example via Docker Compose, and create the Ditto Thing you want to expose as a WoDT Digital Twin.
Before starting the adapter you need to create a .yml
file that contains the ontology mappings. You can find an example in src/main/resources/ontology_example.yml.
Alternatively, the configuration of the domain tags can be equally achieved by setting them directly when creating the Ditto Thing in Eclipse Ditto, specifying a Thing Model like the one in this example.
Then, to start the adapter, you need to specify the following environment variables:
DITTO_URL
: the URL of the Eclipse Ditto instance.DITTO_OBSERVATION_ENDPOINT
: the WebSocket endpoint of the Eclipse Ditto instance.DITTO_USERNAME
: the username of a valid user on the Eclipse Ditto instance.DITTO_PASSWORD
: the corresponding password of the user on the Eclipse Ditto instance.DITTO_THING_ID
: the Eclipse Ditto Thing ID to expose as a WoDT DT.YAML_ONTOLOGY_PATH
: the path of the ontology configuration.PLATFORM_URI
: [optional] the WoDT Platform URI to automatically register in, if present.PHYSICAL_ASSET_ID
: the ID of the corresponding Physical Asset.DIGITAL_TWIN_URI
: the Digital Twin URI that will be exposed (it includes also the final exposed port).DIGITAL_TWIN_EXPOSED_PORT
: the port to actually expose for the adapter.DIGITAL_TWIN_VERSION
: the version of the Digital Twin to expose.
You can start the adapter using the provided docker image. To start it via a docker container you need to:
- Provide a
.env
file with all the environment variables described above - Run the container with the command:
docker run ghcr.io/web-of-digital-twins/ditto-wodt-adapter:<version>
- Provide a port mapping to the
DIGITAL_TWIN_EXPOSED_PORT
. - Create a volume to pass the ontology file.
- If you want to pass an environment file whose name is different from
.env
use the--env-file <name>
parameter.
- Provide a port mapping to the
Alternatively, you can obviously start the adapter directly via Gradle.