Overview

5 Modeling reality

This chapter shows how a digital twin advances from collecting raw measurements to modeling and reasoning about the real world. It argues that numbers only become useful when enriched with meaning—context that lets systems interpret what readings represent, how they relate, and what they imply. Using the data–information–knowledge–wisdom progression, it frames the core challenge as knowledge engineering: capturing human expertise and tacit know‑how so a twin can apply it consistently. Central to this is encoding four kinds of context—spatial, temporal, relational, and physical—so that identical readings can be interpreted correctly depending on where they come from, what they’re connected to, and how they behave over time.

The chapter then details how to construct this model of reality. It covers practical contextualization via entity matching and similarity techniques to connect fragmented identifiers across systems. It introduces ontologies as blueprints that define concepts, properties, relationships, and rules, and discusses trade‑offs between adopting, extending, or creating one (with DTDL exemplifying a machine‑readable approach). Knowledge graphs implement these ontologies, turning data into an interconnected, queryable structure; the text explains labeled property graphs and alternative representations (RDF/OWL/NGSI‑LD), and shows how graph traversals surface insights. With this foundation, generative AI can be grounded in the twin’s domain context to avoid hallucination and deliver specialized diagnostics, recommendations, and predictions.

Finally, the chapter addresses making the model usable and interoperable. It proposes a tiered standards strategy—from protocols and schemas to domain and ISO frameworks—along with a pragmatic cost–benefit assessment, and highlights the Asset Administration Shell for exchanging asset knowledge across lifecycles. To serve the model, it advocates context‑aware APIs that use the knowledge graph as a semantic router, orchestrating queries to underlying stores. It compares REST, OData, and GraphQL for graph‑shaped data access and shows how a schema aligned to an ontology enables precise, efficient queries (for example, aggregating measurements for all devices serving specific spaces). The result is a twin that not only mirrors reality but also delivers timely, actionable intelligence through standardized, scalable interfaces.

An example of raw data without context from sensors in my home digital twin. Without knowing what the data is related to, I cannot use it to make any meaningful decisions.
ch05 f01 biegel
Ackoff’s pyramid showing how valuable knowledge and wisdom are less available than lower value data and information.
ch05 f02 biegel
The importance of context in interpreting raw data and transforming it into information and knowledge.
ch05 f03 biegel
An example of how raw data produced by a moisture sensor in my garden can be contextualized with temporal, spatial, physical, and relationship context.
ch05 f04 biegel
The main concepts and relationships in the DTDL implementation of the RealEstateCore ontology provided by Microsoft ( https://github.com/Azure/opendigitaltwins-building). © Microsoft Corporation, licensed under MIT license. https://opensource.org/license/mit.
ch05 f05 biegel
Euler’s '7 Bridges of Königsberg' problem that was the origin of graph theory. He proved it was not possible to cross each of the 7 bridges connecting the two islands in the city (shown to the left) once and only once. The abstract representation of the seven bridges, two islands, and the shore either side of the river as nodes connected by edges is shown to the right.
ch05 f06 biegel
An example of a knowledge graph represented as a labeled property graph showing labels on both nodes and edges, and key, value pair properties against a node. This fragment represents a thermostat located in a room on the second floor of a hotel.
ch05 f07 biegel
hedgehog cypher
An example traversal that identifies a starting node, and follows edges to gather information.
ch05 f07 biegel traverse
The complete knowledge graph of my home shown at left, with the detail of the relationships between the swimming pool, pump, related sensors and documents shown at right.
ch05 f09 biegel
An example of an AAS record for a Siemens pressure gauge, available from the IDTA AAS server at https://v3.admin-shell-io.com/. Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0.
ch05 f14 biegel
The knowledge graph provides a semantic model to the API layer that it uses to understand what data stores to query, both internal and external to the digital twin, constructing a model to return to the client.
ch05 f15 biegel

Summary

  • A model of the reality of the physical world is at the heart of a digital twin.
  • The wide variety of data that a digital twin acquires and stores needs to be turned into information, which is the basis of higher level understanding of the physical system it represents.
  • Contextualization is the process of linking related data together to create information and knowledge.
  • Ontologies provide formal semantic definitions of models of reality.
  • Knowledge graphs provide a powerful mechanism for modeling the real world based on an ontology.
  • There are a range of efforts underway by various bodies to formalize standards related to digital twins as models of reality.
  • The model of reality maintained within a digital twin must be served to consumers via an API layer that mediates between the semantic model, and raw data stores.

FAQ

Why isn’t raw sensor data enough for a digital twin?Because numbers without context don’t describe reality. A value like 20.1 means little unless you know the unit, where it was measured, when, what it’s attached to, and what “normal” looks like. Digital twins add semantics and relationships so data can progress from data → information → knowledge → decisions (Ackoff’s pyramid), enabling actions like maintenance recommendations rather than just monitoring.
What types of context does a digital twin need to add to data?Four complementary contexts: - Spatial: where an entity is (absolute or relative location). - Temporal: when readings occur and how they change over time. - Relational: how entities connect (e.g., which valve controls which pipe). - Physical (structural): part–whole hierarchies (sensor → equipment → room → building). Together they turn isolated measurements into actionable insights (e.g., watering a specific garden zone).
How do ontologies provide a blueprint for modeling reality?Ontologies formally define a domain’s concepts (classes), their properties (attributes/telemetry), relationships, and rules/constraints. This shared vocabulary gives machines semantic clarity, consistency, and the ability to reason. In digital twins, languages like DTDL express these models in a machine-interpretable way, enabling robust, scalable representations.
How should I choose between a standard, extended, or custom ontology?Three strategies: - Adopt a standard: maximizes interoperability and tool support but can be rigid. - Extend a standard: keeps compatibility while adding domain specifics; requires managing extensions. - Create custom: perfect fit but minimal interoperability. Example: choosing RealEstateCore (via DTDL) for a home twin and extending it where needed.
What is a knowledge graph and why use it for digital twins?A knowledge graph models entities as nodes and their relationships as edges, enriched with semantic meaning from an ontology. It turns disparate data into a coherent, queryable model that mirrors the real world. Implementations include labeled property graphs and RDF/OWL/NGSI‑LD, enabling powerful reasoning and flexible evolution as systems grow.
How can I link records that refer to the same real-world entity?Use data matching to contextualize across silos: - Fuzzy matching (e.g., Levenshtein distance, token-set similarity) to align near-identical identifiers. - Scale with techniques like locality-sensitive hashing (LSH) to avoid quadratic comparisons. These matches reveal semantic relationships (e.g., two IDs representing the same pump) and are used in practical tools for contextualization.
Why does generative AI need context from a digital twin?Context enables: - Grounding: prevents hallucinations by anchoring answers in the twin’s real data (equipment specs, history). - Specialization: leverages proprietary domain knowledge to perform expert analyses (e.g., interpreting turbine vibration against maintenance and operating hours), turning a general LLM into a domain expert.
What is graph traversal and how does it answer contextual questions?Traversal starts at a relevant node and follows relationships to collect needed facts (e.g., Level 2 → Rooms → Equipment → battery levels). With languages like Cypher, you express “human” questions as paths through the graph, making queries like “all equipment on Level 2 and their battery levels” efficient and intuitive.
What’s the best way to serve a model of reality via an API?It depends: - REST: simple but often requires many calls for relational data. - OData: improves REST with filtering and $expand for related data. - GraphQL: clients request exactly the shape they need across relationships in a single round trip—ideal for graph-shaped, context-rich queries like “temperatures in all rooms on the second floor.”
Which standards should I prioritize and what are the trade-offs?Think in layers: - Protocols (e.g., MQTT, OPC UA) for reliable data exchange. - Data models/schemas (e.g., IFC, ISO 15926) for semantic consistency. - Digital twin frameworks (e.g., ISO 30173/30194) for conceptual guidance. Assess benefits vs. costs (implementation, audits/compliance, training, maintenance). A practical example is the Asset Administration Shell (AAS), which provides standardized, lifecycle-wide “digital passports” that streamline integration and data ingestion.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Digital Twins in Action ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Digital Twins in Action ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Digital Twins in Action ebook for free