queries as JSON objects in the HTTP body of a POST
request.
Another interesting model for query languages
that plays nicely with JSON is Facebook’s GraphQL.
It is particularly suitable for data represented in the
form of graphs and allows the user to specify the data
representation in a very flexible way, adapted to the
needs of the application. Although it is not as
common as REST interfaces, it has quite a significant
user base and good tool support and is a promising
technology for empowering data-driven applications
on graph-structured data. GraphQL has been explored
in the context of Digital Twin applications before, see
for example (Autiosalo et al., 2021).
2.3 Standards
Different initiatives exist which develop standardized
APIs for Digital Twins and related technologies,
including the Asset Administration Shell (AAS)
(Boss et al., 2020), (Plattform Industrie 4.0, 2021),
the NGSI-LD standard by ETSI (ETSI, 2021), which
has its roots in the FIWARE initiative (FIWARE
Foundation, 2021), and the Web of Things (WoT)
developed by W3C (W3C, 2020).
Proprietary platforms targeted at Industrial IoT
and Digital Twin applications are, among other and in
alphabetical order, Amazon AWS IoT, Bosch IoT
Suite, Hitachi Lumada, Microsoft Azure IoT, PTC
ThingWorx, Siemens MindSphere, and Software
AG’s Cumulocity IoT platform. In our case there is a
requirement to base the platform on open-source
components to avoid a lock-in effect and to enable
market access to small and medium sized companies,
which is why we will not further investigate these
commercial platforms here. A comparative
evaluation including them will be an interesting
proposal for future work.
It should be noted that Microsoft has published a
specification called Digital Twin Definition
Language (DTDL) (Microsoft, 2019), which
describes the modeling principles behind Azure IoT
services and is somewhat similar in nature to the
NGSI-LD model. Whereas the open publication of
the specification is certainly useful and (Jacoby &
Usländer, 2020) include it in their analysis, we
decided not to include this proprietary model here.
On the one hand, the generic nature of standard
interfaces can be useful from the point of view of
interoperability. On the other hand, these interfaces
are typically not domain-specific and not tailored to
the situation at hand, possibly leading to inefficient
and non-obvious query patterns, which is why
domain-specific interfaces are generally considered a
good-practice in software development. In the case of
NGSI-LD, the proposed way to enhance the interface
with domain-specific information is to provide a
separate domain model describing the possible
properties and relationships that entities can have, in
terms of JSON schema files. A similar approach can
be taken for the AAS. This does not remedy all the
problems with the generic nature of the interfaces,
however. WoT takes a different approach in that it
provides an interface description language which can
be used to support multiple different APIs. The idea
behind this approach is to integrate multiple devices
which already come equipped with an API of their
own. This setting appears to be less relevant to our
scenario.
An analysis of different standards from the point
of view of digital twin applications has been
published in (Jacoby & Usländer, 2020). Among
other criteria, they considered the support for
different data types (geo-spatial, temporal, and
timeseries, besides normal structured data), the
possibility to describe custom events and services,
and the query language.
The survey finds that NGSI-LD has good support
for different data types (geo-spatial, temporal and
timeseries) and a reasonable metamodel, but falls
short of describing custom services and events, an
aspect we consider of lower importance for our case.
AAS on the other hand, lacks in support for data
types, but covers services and events descriptions for
submodels (Plattform Industrie 4.0, 2021).
The handling of multimedia data seems not to be
covered by the existing standards, but to fully
integrate with the asset-centric Digital Twin platform,
advanced filtering possibilities will be needed, and it
could be beneficial to standardise those as well
(BDVA, 2017).
All the standards investigated in (Jacoby &
Usländer, 2020) support JSON via HTTP, and the
JSON-LD is also commonly used. For filtering, both
NGSI-LD and AAS mainly rely on query parameters
instead of request bodies, and AAS even defines
several query parameters as BASE64-encoded,
complex JSON objects. NGSI-LD on the other hand
provides an alternative query interface that accepts
POST requests with filters in the body. The query
objects are only partially adapted to this setting,
however, and may still require lengthy and error-
prone string concatenations for complex queries.
A GraphQL interface is not foreseen by any of the
specifications mentioned above, but since the NGSI-
LD metamodel already assumes a graph-like structure,
these two technologies might still be a good fit.