Skip to content

A simple middleware prototype that allows to expose Ditto Digital Twins as HWoDT-compliant DTs.

License

Notifications You must be signed in to change notification settings

Web-of-Digital-Twins/ditto-wodt-adapter

 
 

Repository files navigation

Ditto Web of Digital Twins Adapter

Release License: Apache License Version

A simple middleware prototype that allows to expose Eclipse Ditto Digital Twins (or Things) as HWoDT-compliant DTs.

Usage

1. Start Eclipse Ditto

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.

2. Configuration

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.

3. Adapter start

You can start the adapter using the provided docker image. To start it via a docker container you need to:

  1. Provide a .env file with all the environment variables described above
  2. Run the container with the command:
    docker run ghcr.io/web-of-digital-twins/ditto-wodt-adapter:<version>
    1. Provide a port mapping to the DIGITAL_TWIN_EXPOSED_PORT.
    2. Create a volume to pass the ontology file.
    3. If you want to pass an environment file whose name is different from .env use the --env-file <name> parameter.

Alternatively, you can obviously start the adapter directly via Gradle.

About

A simple middleware prototype that allows to expose Ditto Digital Twins as HWoDT-compliant DTs.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Java 99.1%
  • Other 0.9%