  Complex IoT ecosystems often require the usage of Digital Twins (DTs) of
their physical assets in order to perform predictive analytics and simulate
what-if scenarios. DTs are able to replicate IoT devices and adapt over time to
their behavioral changes. However, DTs in IoT are typically tailored to a
specific use case, without the possibility to seamlessly adapt to different
scenarios. Further, the fragmentation of IoT poses additional challenges on how
to deploy DTs in heterogeneous scenarios characterized by the usage of multiple
data formats and IoT network protocols. In this paper, we propose the
Relativistic Digital Twin (RDT) framework, through which we automatically
generate general-purpose DTs of IoT entities and tune their behavioral models
over time by constantly observing their real counterparts. The framework relies
on the object representation via the Web of Things (WoT), to offer a
standardized interface to each of the IoT devices as well as to their DTs. To
this purpose, we extended the W3C WoT standard in order to encompass the
concept of behavioral model and define it in the Thing Description (TD) through
a new vocabulary. Finally, we evaluated the RDT framework over two disjoint use
cases to assess its correctness and learning performance, i.e., the DT of a
simulated smart home scenario with the capability of forecasting the indoor
temperature, and the DT of a real-world drone with the capability of
forecasting its trajectory in an outdoor scenario. Experiments show that the
generated DT can estimate the behavior of its real counterpart after an
observation stage, regardless of the considered scenario.
