Back to blogVolver al blog

Digital Twin Knowledge Graphs for IoT PlatformsKnowledge Graphs de Digital Twin para IoT

Finished MSc in Systems, Control and Robotics at KTH (Stockholm) & MSc in Telecomm. Engineering at UPM · Ericsson ResearchMáster en Systems, Control and Robotics (KTH, Estocolmo) y en Telecomunicaciones (UPM) · Ericsson Research

A Digital Twin (DT) is a dynamic virtual representation of a physical asset, process, or system. From smart factories and robotic assembly cells to intelligent buildings, Digital Twins promise to optimize operations, predict equipment failures, and simulate future scenarios. Un Digital Twin (DT) es una representación virtual dinámica de un activo, proceso o sistema físico. Desde fábricas y celdas robóticas hasta edificios inteligentes, los Digital Twins prometen optimizar operaciones, predecir fallos de equipos y simular escenarios futuros.

However, building a functional Digital Twin for complex Internet of Things (IoT) ecosystems exposes a fundamental architectural dilemma: how do you combine rich structural knowledge with high-frequency streaming telemetry? Sin embargo, construir un Digital Twin funcional para ecosistemas IoT complejos plantea un dilema arquitectónico fundamental: ¿cómo combinar conocimiento estructural rico con telemetría streaming de alta frecuencia?

This thesis research was conducted at Ericsson Research (Department of IoT and Cyber-Physical Systems, Kista) as part of my double-degree Master's program: MSc in Systems, Control and Robotics at KTH Royal Institute of Technology and MSc in Telecommunication Engineering at Universidad Politécnica de Madrid (UPM). Supervised by Dr. Bin Xiao (Ericsson), Prof. Bo Wahlberg (KTH), and Prof. Pedro J. Zufiria (UPM), the thesis is titled: "Digital Twin Knowledge Graphs for IoT Platforms: Towards a Virtual Model for Real-Time Knowledge Representation in IoT Platforms". Esta investigación de tesis se realizó en Ericsson Research (Department of IoT and Cyber-Physical Systems, Kista) como parte de mi programa de doble máster: MSc in Systems, Control and Robotics en KTH Royal Institute of Technology y MSc in Telecommunication Engineering en Universidad Politécnica de Madrid (UPM). Supervisada por Dr. Bin Xiao (Ericsson), Prof. Bo Wahlberg (KTH) y Prof. Pedro J. Zufiria (UPM), la tesis se titula: "Digital Twin Knowledge Graphs for IoT Platforms: Towards a Virtual Model for Real-Time Knowledge Representation in IoT Platforms".

The Semantic-Telemetry DivideBrecha semántica-telemetría

Modern IoT platforms deal with two very different kinds of data: Las plataformas IoT manejan dos tipos de datos muy distintos:

  • Static / Contextual Semantics: What physical devices exist? How are they connected? What are their operational thresholds, spatial locations, dependencies, and maintenance rules? (e.g. "Temperature Sensor 4 is mounted on Robot Arm 2 in Zone B, which must not exceed 65°C").Static / Contextual Semantics: ¿Qué dispositivos existen? ¿Cómo se conectan? ¿Cuáles son sus umbrales operativos, ubicaciones, dependencias y reglas de mantenimiento? (p. ej., "Temperature Sensor 4 está montado en Robot Arm 2 de la Zone B, sin superar los 65°C").
  • Dynamic Telemetry: High-throughput, streaming time-series metrics (temperatures, motor currents, vibrations, coordinate positions) sampled multiple times per second.Dynamic Telemetry: Métricas time-series de alto rendimiento (temperaturas, corrientes de motor, vibraciones, posiciones) muestreadas varias veces por segundo.

Relational and NoSQL time-series databases easily handle high ingestion rates, but they lack semantic reasoning capabilities — answering queries like "find all actuators downstream of overheating motors" requires complex, brittle application code. Conversely, Semantic Web Knowledge Graphs (RDF / OWL / SPARQL) and graph databases (such as GraphDB) provide expressive relationship modeling and reasoning, but historically choke when flooded with continuous high-frequency time-series writes. Las bases de datos relacionales y NoSQL time-series soportan altas tasas de ingesta, pero carecen de razonamiento semántico — responder consultas como "find all actuators downstream of overheating motors" exige código de aplicación complejo y frágil. En cambio, los Knowledge Graphs (RDF / OWL / SPARQL) de la Semantic Web y las graph databases (como GraphDB) ofrecen modelado y razonamiento expresivos, pero se ahogan con escrituras time-series continuas de alta frecuencia.

An Event-Driven Knowledge Graph Digital Twin ArchitectureArquitectura Digital Twin event-driven (Knowledge Graphs)

To bridge this gap, we designed a decoupled, event-driven architecture that allows Knowledge Graphs to maintain an up-to-date semantic representation of the physical world without suffering from time-series ingestion bottlenecks (Figure 1). Para cerrar esta brecha, diseñamos una arquitectura desacoplada y event-driven que permite a los Knowledge Graphs mantener una representación semántica actualizada del mundo físico sin cuellos de botella de ingesta time-series (Figure 1).

High-level architecture of the Knowledge Graph Digital Twin platform for IoT
Figure 1Figure 1System architecture: decoupling time-series ingestion, semantic ontology representation in GraphDB, and real-time constraint validation.Arquitectura del sistema: ingesta time-series desacoplada, ontología semántica en GraphDB y validación de restricciones en tiempo real.

The architecture centers around three cooperating layers: La arquitectura se basa en tres capas cooperativas:

  1. Semantic Ontology Model: Uses established standards (W3C SSN/SOSA, SAREF, Brick, and custom industrial extensions) to model the physical topology, device types, observation properties, and rules (Figure 2).Semantic Ontology Model: Usa estándares (W3C SSN/SOSA, SAREF, Brick y extensiones industriales propias) para modelar topología física, tipos de dispositivo, propiedades de observación y reglas (Figure 2).
  2. Event-Driven Constraint Handler: A lightweight validation layer that listens to incoming telemetry events, queries the graph to resolve contextual relationships, and validates physical constraints in real time.Event-Driven Constraint Handler: Capa de validación ligera que escucha eventos de telemetría, consulta el grafo para resolver relaciones contextuales y valida restricciones físicas en tiempo real.
  3. Graph Synchronization Engine: Batches state updates and updates semantic graph triples only when meaningful state transitions or threshold violations occur, shielding the graph engine from raw high-frequency noise.Graph Synchronization Engine: Agrupa actualizaciones de estado y actualiza los triples del grafo semántico solo ante transiciones o violaciones de umbral, protegiendo el motor de grafo del ruido de alta frecuencia.
Knowledge Graph ontology schema defining devices, sensors, actuators, and physical constraints
Figure 2Figure 2Semantic ontology schema: structuring device capabilities, sensor observations, spatial hierarchies, and rule-based operational constraints.Esquema de ontología semántica: capacidades de dispositivo, observaciones de sensores, jerarquías espaciales y restricciones por reglas.

Real-Time Constraint Validation & Automated InterventionsRestricciones en tiempo real y actuación automática

A key contribution of the platform is the Constraint Handler pipeline (Figure 3). When incoming telemetry violates predefined safety rules or operational boundaries, the system executes targeted SPARQL queries to understand the broader context (e.g., finding the emergency shutdown switch for that specific machine cell) and automatically issues corrective actuation commands. Una contribución clave de la plataforma es el Constraint Handler pipeline (Figure 3). Cuando la telemetría viola reglas de seguridad o límites operativos predefinidos, el sistema ejecuta consultas SPARQL dirigidas para entender el contexto (p. ej., localizar el interruptor de emergencia de esa celda) y emite automáticamente comandos de actuación correctiva.

Event-driven constraint handler flowchart for automated real-time Digital Twin interventions
Figure 3Figure 3Flowchart of the real-time constraint handler: validating incoming streaming measurements against graph-defined operational limits.Diagrama de flujo del constraint handler: valida mediciones streaming frente a límites operativos del grafo en tiempo real.

Industrial Testbeds & Empirical BenchmarksTestbeds industriales y benchmarks

We evaluated the platform across two realistic simulated deployment environments: Evaluamos la plataforma en dos entornos de simulación realista:

  1. Industrial Robot Pickup Workstation: An automated manufacturing cell with a 6-DoF robotic arm, proximity sensors, and conveyor belts, testing real-time spatial constraint checking and safety interlocks during rapid cycle times.Industrial Robot Pickup Workstation: Celda automatizada con brazo robótico de 6-DoF, sensores de proximidad y cintas, que prueba la verificación espacial en tiempo real y los interlocks de seguridad en ciclos rápidos.
  2. Smart Building Air Quality & Safety Monitoring: A multi-room facility tracking CO₂, particulate matter (PM2.5), temperature, and humidity (Figure 4), triggering dynamic ventilation adjustments and evacuation protocols based on semantic room occupancy models.Smart Building Air Quality & Safety Monitoring: Edificio multi-sala que monitoriza CO₂, partículas (PM2.5), temperatura y humedad (Figure 4), activando ajustes dinámicos de ventilación y protocolos de evacuación según modelos semánticos de ocupación.
Time-series air quality telemetry integration with the Digital Twin Knowledge Graph
Figure 4Figure 4Multi-sensor air quality telemetry stream cross-referenced in real time with the Knowledge Graph spatial model.Telemetría de aire multi-sensor contrastada en tiempo real con el modelo espacial del Knowledge Graph.

Our benchmark experiments quantified the exact performance boundaries of the system: Los benchmarks cuantificaron los límites exactos de rendimiento del sistema:

  • SPARQL Query Latency: Complex multi-hop semantic queries executed within sub-50ms thresholds for graphs containing up to tens of thousands of triples.SPARQL Query Latency: Consultas semánticas multi-hop complejas ejecutadas en menos de 50ms en grafos con hasta decenas de miles de triples.
  • Ingestion Throughput: The event-driven buffering and selective triple update strategy reduced GraphDB write load by over 85% compared to naive triplestore streaming, enabling real-time IoT responsiveness.Ingestion Throughput: El buffering event-driven y la actualización selectiva de triples redujo la carga de GraphDB en más de un 85% frente al triplestore streaming naive, con respuesta IoT en tiempo real.

The project repository includes an interactive visualization suite so you can explore the system end to end. Figure 5 shows the Factory Floor Digital Twin viewer — the 3D representation of the robotic cell where every virtual element is linked to its semantic graph node. El repositorio incluye una suite de visualización interactiva para explorar el sistema completo. La Figure 5 muestra el Factory Floor Digital Twin viewer — la representación 3D de la celda robótica, con cada elemento enlazado a su nodo del grafo semántico.

Factory floor digital twin 3D visualization linked to the knowledge graph
Figure 5Figure 5The Factory Floor Digital Twin viewer: a 3D virtual representation of the robotic workstation, with each device linked to its semantic Knowledge Graph entity.El viewer del Factory Floor Digital Twin: representación 3D de la estación robótica, con cada dispositivo enlazado a su entidad semántica del Knowledge Graph.

Under the hood, Figure 6 shows the TypeDB Knowledge Graph concept map — the semantic backbone that lets the platform answer contextual queries like "which sensors feed this actuator?" in milliseconds. Bajo el capó, la Figure 6 muestra el concept map del TypeDB Knowledge Graph — la columna semántica que responde en milisegundos a consultas contextuales como "which sensors feed this actuator?".

TypeDB knowledge graph concept map of the IoT digital twin ontology
Figure 6Figure 6The TypeDB Knowledge Graph concept map: the semantic backbone modeling devices, sensors, actuators, and their operational relationships.El concept map del TypeDB Knowledge Graph: la columna semántica que modela dispositivos, sensores, actuadores y sus relaciones.

The full thesis document is available via the KTH DiVA Portal, and the complete source code, ontology definitions, and simulation benchmarks are hosted on GitHub. La tesis completa está disponible en el KTH DiVA Portal; el código fuente, las ontologías y los benchmarks de simulación, en GitHub.

🧠 Dynamic Discovery & Local Semantic Embedding Matcher🧠 Dynamic Discovery y Local Semantic Embedding Matcher

A major real-world limitation of industrial digital twins is handling unanticipated devices: what happens when a sensor is swapped on the factory floor, or a new robotic arm is added to a workstation without updating the static schema beforehand? Una limitación real importante de los digital twins industriales es gestionar dispositivos no previstos: ¿qué ocurre si se cambia un sensor en la fábrica o se añade un brazo robótico a una estación sin actualizar antes el schema estático?

To solve this, our integration pipeline implements a Dual-Metric Semantic Integration Hub (Figure 7). It combines Semantic Definition Format (SDF) text similarity with time-series pattern matching (the STUMPY / Matrix Profile algorithm) to automatically classify incoming MQTT streams into the TypeDB ontology: Para resolverlo, nuestro pipeline de integración implementa un Dual-Metric Semantic Integration Hub (Figure 7): combina la similitud del Semantic Definition Format (SDF) con el pattern matching time-series (STUMPY / Matrix Profile) para clasificar los streams MQTT en la ontología TypeDB:

  • Device Replacement: Detects when a new sensor (e.g. AirQualitySimplified) replaces an inactive one (AirQuality) with a 94.2% match.Device Replacement: Detecta si un sensor (p. ej., AirQualitySimplified) sustituye a uno inactivo (AirQuality) con 94.2% de match.
  • Complementary Addition: Dynamically integrates secondary robots (e.g. PickUpRobot-2) joining active assembly stations with a 98.8% match.Complementary Addition: Integra robots secundarios (p. ej., PickUpRobot-2) que se unen a estaciones activas, con 98.8% de match.
Dual-metric semantic integration and discovery hub interface
Figure 7Figure 7The Dual-Metric Semantic Integration Hub: evaluating unanticipated device streams through combined SDF schema similarity and time-series behavior matching.El Dual-Metric Semantic Integration Hub: evalúa streams de dispositivos no previstos combinando similitud de schema SDF y matching time-series.

Future Work: Dense Embeddings via Local LLMs (Qwen3-Embedding-4B)Future Work: Dense Embeddings y LLMs locales (Qwen3-Embedding-4B)

In our latest open-source extension, we pushed semantic discovery further by replacing string-level distance metrics with dense semantic vector embeddings computed entirely locally (Figure 8). Using Qwen3-Embedding-4B (2,560-dimensional vectors, 32k-token context) running locally on an RTX 4090 GPU via Ollama, the digital twin evaluates semantic proximity across device classes and manages autonomous failover: En nuestra última extensión open-source, impulsamos el descubrimiento semántico sustituyendo las métricas de distancia a nivel de string por dense semantic vector embeddings calculados en local (Figure 8). Con Qwen3-Embedding-4B (vectores 2,560-D, contexto 32k tokens) en una GPU RTX 4090 vía Ollama, el digital twin evalúa la proximidad semántica entre clases de dispositivos y gestiona el failover autónomo:

Local dense semantic similarity engine evaluating device replacement and disappearance scenarios
Figure 8Figure 8The Local Semantic Embedding Matcher: dense vector similarity rankings for device replacement, complementary robotics adoption, and automated disappearance failover.El Local Semantic Embedding Matcher: ranking de similitud por vectores densos para sustitución de dispositivos, robótica complementaria y failover automático.

Verified benchmark results from live inference demonstrate high-confidence semantic resolution: Los benchmarks de inferencia en vivo confirman resolución semántica de alta confianza:

Scenario New / Missing Device Top Ontology Match Similarity Score
Replacement indoors_airqualitysimp AirQualitySimplified / AirQuality 86.9% / 86.4%
Complementary bodyconfig_pickuprob2 PickUpRobot 84.0%
Disappearance windowmilling_pickuprob windowmilling_pickuprob2 92.0%
Disappearance indoors_airquality indoors_airqualitysimp 97.0%
Disappearance outdoors_windsensor outdoors_windsensor2 100.0%
Table 2Table 2Real-world semantic embedding matching benchmarks running Qwen3-Embedding-4B locally on RTX 4090.Benchmarks reales de semantic embedding matching con Qwen3-Embedding-4B en local sobre RTX 4090.

📊 Head-to-Head Empirical Benchmark: Thesis Baseline vs. Qwen3-Embedding-4B📊 Benchmark head-to-head: Thesis Baseline vs. Qwen3-Embedding-4B

To rigorously evaluate whether dense neural embeddings outperform the thesis’s string-level Levenshtein distance baseline (thefuzz), we ran an empirical benchmark across 16 realistic industrial IoT integration scenarios covering manufacturer vocabulary mismatch, industry synonyms (e.g., Anemometer → WindSensor, Articulated Handler → PickUpRobot), minimalist schemas, and multi-modal edge devices: Para evaluar si los dense neural embeddings superan al baseline de la tesis (distancia Levenshtein a nivel de string, thefuzz), ejecutamos un benchmark empírico con 16 escenarios realistas de integración IoT industrial cubriendo vocabulario de fabricantes, sinónimos del sector (p. ej., Anemometer → WindSensor, Articulated Handler → PickUpRobot), schemas minimalistas y edge devices multi-modales:

Evaluation Metric Thesis Baseline (thefuzz / Levenshtein) Neural Embeddings (Qwen3-Embedding-4B) Relative Gain
Top-1 Accuracy 25.0% 75.0% +300% (3× Precision)
Top-3 Accuracy 50.0% 93.8% +87.6%
Mean Reciprocal Rank (MRR) 0.374 0.849 +127%
Avg Discriminative Margin 2.5% 6.2% +148% (Wider Separation)
Table 3Table 3Head-to-head empirical benchmark across 16 industrial IoT integration scenarios comparing the original thesis string-distance baseline against local Qwen3-Embedding-4B vectors.Benchmark empírico head-to-head en 16 escenarios de integración IoT industrial: el baseline string-distance de la tesis frente a vectores locales de Qwen3-Embedding-4B.

Key Empirical Findings:Hallazgos clave:

  • Vocabulary Invariance: String-distance token matching fails whenever third-party vendors use industry synonyms. For instance, an UltrasonicAnemometer scored only 36% (ranked #14) with Levenshtein string distance, but achieved 89.6% (Rank #1) with Qwen3 semantic embeddings. Vocabulary Invariance: El token matching por string-distance falla cuando los proveedores usan sinónimos del sector. Por ejemplo, UltrasonicAnemometer puntuó solo 36% (#14) con Levenshtein, pero logró 89.6% (Rank #1) con Qwen3.
  • Wider Decision Margin: Dense neural embeddings generate an average 6.2% separation between the top candidate and the runner-up (vs. only 2.5% for string distance), creating a clear statistical decision boundary for automated schema insertion without false positives. Wider Decision Margin: Los dense neural embeddings generan una separación media del 6.2% entre el mejor candidato y el segundo (vs. 2.5% con string distance), creando un límite de decisión estadístico claro para insertar schemas automáticamente sin falsos positivos.
  • Dual-Modality Synergy: Coupling dense semantic vector similarity with STUMPY time-series matrix profile matching provides both conceptual schema correctness and runtime behavioural verification. Dual-Modality Synergy: Combinar la similitud de vectores semánticos densos con el matrix profile de STUMPY aporta conceptual schema correctness y runtime behavioural verification.

October 2022 · MSc Thesis (KTH & UPM)October 2022 · MSc Thesis (KTH & UPM)GitHubGitHubKTH DiVA PDFKTH DiVA PDFEricsson ResearchEricsson ResearchKTH EECSKTH EECS

Alejandro Jarabo-Peñas · Supervised by Bin Xiao (Ericsson Research), Bo Wahlberg (KTH), Pedro J. Zufiria (UPM)Alejandro Jarabo-Peñas · Supervisión: Bin Xiao (Ericsson Research), Bo Wahlberg (KTH), Pedro J. Zufiria (UPM)