November 11, 2025

Building Semantic Digital Twin Models with Node-RED: A Complete Guide to Knowledge Graph Integration

Blog Details Image

Industry 4.0 systems require seamless communication between different stakeholders including embedded systems engineers, application developers, and system managers. This guide explains how to create semantic digital twin models using Node-RED, enabling knowledge sharing and automated reasoning through standardized semantic modeling and knowledge graphs.

This tutorial is designed for engineers, researchers, and architects developing digital twin solutions that require cross-domain knowledge integration and system interoperability.

Understanding Digital Twin Terminology: Models, Shadows, and Twins

The term "digital twin" refers to different concepts depending on automation levels. Three distinct categories exist:

Digital Model Definition

A digital model represents a physical asset with manual data flow in both directions:

Physical to Digital Flow: Updates from physical assets are manually transferred to digital representationsDigital to Physical Flow: Changes in digital models are manually implemented in physical systems

Common Applications: CAD models, design-phase simulation models, engineering specifications

Digital Shadow Definition

A digital shadow provides automatic updates from physical assets but requires manual feedback:

Physical to Digital Flow: Automatic data collection through sensors and monitoring systemsDigital to Physical Flow: Manual implementation of adjustments based on digital insights

Common Applications: Real-time monitoring dashboards, predictive maintenance alert systems

Digital Twin Definition

A digital twin features bidirectional automatic data flow between physical and digital representations:

Physical to Digital Flow: Automatic sensor data collection and system monitoringDigital to Physical Flow: Automatic control commands and system adjustments

Common Applications: Closed-loop control systems, autonomous process optimization

True digital twins represent the highest integration level where physical and digital systems synchronize continuously without manual intervention.

Comparing Traditional Model-Based Design with Digital Twin Approaches

Traditional Model-Based Design Workflow

Conventional model-based design follows this sequence:

  1. Create system models using modeling languages (UML, SysML, AutomationML)
  2. Generate code and system configurations from models
  3. Deploy to physical systems and equipment
  4. Collect operational data in cloud platforms
  5. Archive models after deployment completion

In this approach, models serve primarily as development artifacts that become disconnected from operational systems after deployment.

Digital Twin Design Workflow

Digital twin methodology extends modeling throughout the complete product lifecycle:

  1. Create system models during development phase
  2. Generate physical system implementations
  3. Collect operational data from deployed systems
  4. Maintain active models alongside operational data
  5. Enable stakeholder access to updated system perspectives
  6. Generate automated adjustments based on model analysis

The fundamental difference: models remain active throughout the system lifecycle, evolving with physical systems and enabling continuous improvement.

Defining Digital Twins: A Comprehensive Framework

Research literature provides multiple digital twin definitions. This framework synthesizes key concepts:

A digital twin is a combination of models that represent an observable asset from the real world.

Framework Components

Models: Multiple representations providing different perspectivesObservable Assets: Physical entities (equipment, devices) or non-physical elements (processes, workflows)Multiple Perspectives: Behavioral models, 3D geometry, state machines, validation testsContinuous Updates: Real-time tracking of asset properties and statesBidirectional Interaction: Properties that change, actions that execute, and events that signal transitions

Practical Example: Wind Turbine Digital Twin

Consider a wind turbine as the physical asset. The digital twin includes:

3D Geometry Model: Physical structure, dimensions, and spatial positioningAutomationML Model: Equipment hierarchy and system connectionsState Machine Model: Operating modes including starting, running, stopping, and maintenance statesBehavioral Model: Power generation curves and efficiency characteristicsValidation Tests: Software component testing and verification

These combined models form the complete cyber representation of the physical wind turbine, serving different stakeholders and supporting various use cases.

W3C Web of Things Standard Integration

This semantic modeling approach aligns with W3C (World Wide Web Consortium) Web of Things standards, which define a "Thing" with three core elements:

Properties: Readable and writable attributes such as temperature, speed, and operational statusActions: Invocable operations including start, stop, calibrate, and reset functionsEvents: Notifications about state changes like alarms triggered or cycles completed

Alignment with established W3C standards ensures interoperability with existing platforms and avoids proprietary implementations that limit system integration.

Semantic Digital Twin Modeling Methodology: Step-by-Step Process

This methodology provides a systematic approach to semantic digital twin creation:

Step 1: Identify Observable System Assets

Decompose your system into discrete, observable components with these characteristics:

  • Unique identification
  • Independent observability
  • Logical distinctness

Production Line Example:

  • Conveyor transport systems
  • Assembly robotic systems
  • Quality inspection stations
  • Programmable logic controllers (PLCs)

Step 2: Create Asset Models

Develop models for each identified asset, defining three core elements:

  • Properties: Measurable or configurable attributes
  • Actions: Executable operations and commands
  • Events: Generated notifications and alerts

Step 3: Define Semantic Relationships

Establish relationships between assets using semantic descriptions:

  • Spatial Relationships: Equipment location within facility zones
  • Functional Relationships: Process flows and material handling connections
  • Hierarchical Relationships: Organizational structure and ownership

Semantic descriptions enable automated reasoning beyond simple data exchange.

Step 4: Link External Model Resources

Connect additional representation formats:

  • 3D CAD models for visualization purposes
  • Simulation models for scenario analysis
  • Maintenance documentation and procedures
  • Compliance specifications and regulations

Step 5: Configure Communication Interfaces

Establish physical asset connectivity:

  • OPC UA connections to programmable logic controllers
  • MQTT subscriptions for sensor data streams
  • REST API connections to business systems
  • Database connections for historical data access

Step 6: Deploy Digital Twin System

Deploy the configured digital twin to operational infrastructure, making it available for use.

Step 7: Generate Knowledge Graph Database

Semantic relationships create a knowledge graph—interconnected facts stored as entities and relationships. Knowledge graphs enable:

Inference Capabilities: Deriving new facts from existing relationship dataDiscovery Functions: Finding related information across different domainsIntegration Benefits: Connecting previously siloed stakeholder knowledge

Step 8: Build Applications on Knowledge Graph

Develop applications leveraging the knowledge graph infrastructure:

  • Analytics and machine learning models
  • Automated process optimization
  • Predictive maintenance systems
  • Process improvement recommendations

Knowledge Graphs for Industrial Applications: Key Benefits

Knowledge graphs provide capabilities that complement machine learning approaches.

Formalizing Industrial System Knowledge

Knowledge graphs represent facts as interconnected entities and relationships:

Entity Examples: BMW, i-Next Electric Car, Tesla, Model S, Automotive IndustryRelationship Examples:

  • BMW is_member_of Automotive Industry
  • BMW produces i-Next
  • i-Next is_type Electric Car
  • Tesla produces Model S
  • Model S is_type Electric Car

Automated Inference Capabilities

Knowledge graphs derive implicit knowledge from explicit facts:

Given Facts: BMW is_member_of Automotive Industry, Tesla produces Model S, Model S is_type Electric CarInferred Fact: Tesla is_member_of Automotive Industry

This reasoning capability enables systems to understand unstated relationships, connecting distributed stakeholder knowledge.

Cross-Domain Knowledge Integration Benefits

Embedded systems engineers possess hardware knowledge. Application developers understand software requirements. Knowledge graphs formally capture and relate this distributed expertise, enabling:

  • Automated validation of software-hardware compatibility
  • Discovery of cross-domain optimization opportunities
  • Impact analysis for system changes

Generic Semantic Modeling Language Design

This research provides domain-independent semantic modeling language for representing knowledge across diverse areas:

Manufacturing Domain: Equipment hierarchies, production workflows, quality parametersInformation Technology Domain: Network architecture, software components, data flowsBusiness Operations Domain: Product catalogs, customer requirements, financial constraints

Generic semantic primitives (entities, relationships, properties) enable consistent modeling across all domains, facilitating previously difficult integration scenarios.

Node-RED Implementation for Digital Twins

Node-RED Platform Advantages

Node-RED offers multiple benefits for digital twin implementation:

Visual Programming Interface: Flow-based development accessible to non-programmersExtensive Node Library: Thousands of nodes supporting industrial protocols, databases, and cloud platformsLightweight Architecture: Runs on edge devices, gateways, and cloud infrastructureJavaScript Foundation: Extensible through custom node developmentActive Community: Large industrial IoT user base and contributor network

System Architecture Components

The Node-RED implementation includes:

Asset Nodes: Represent observable assets with properties, actions, and eventsSemantic Relationship Nodes: Define connections between assetsCommunication Protocol Nodes: Connect to physical systems using OPC UA, MQTT, and RESTKnowledge Graph Nodes: Generate and query semantic representationsStorage Nodes: Persist knowledge graphs to database systems

Creating Digital Twin Models in Node-RED

Digital twin creation workflow in Node-RED:

  1. Add Asset Node: Configure asset name, type, and unique identifier
  2. Define Properties: Add measurement points and configuration parameters
  3. Define Actions: Specify executable operations and commands
  4. Define Events: Declare notification types and triggers
  5. Connect Physical Systems: Wire communication nodes to actual systems
  6. Add Semantic Relationships: Connect assets with relationship nodes
  7. Deploy System: Activate the complete digital twin

The visual flow representation displays complete system structure and data flows, making complex relationships understandable.

Industrial Standards Integration

W3C Web of Things (WoT) Standard

Full W3C WoT Thing Description specification compliance ensures:

  • Interoperability with WoT-compliant platforms and tools
  • Standard JSON-LD representation format
  • Standardized discovery mechanisms
  • Built-in security and authentication patterns

OPC UA Protocol Integration

OPC UA integration provides:

  • Direct connection to industrial equipment
  • Information modeling using OPC UA address space
  • Type hierarchies and object modeling
  • Security through OPC UA authentication and encryption

NGSI-LD Context Information Management

NGSI-LD (Next Generation Service Interfaces - Linked Data) support enables:

  • Context information management capabilities
  • Subscription and notification patterns
  • Federation across distributed systems
  • Geographic information system (GIS) integration

GAIA-X Data Infrastructure Integration

Planned GAIA-X (European data infrastructure initiative) integration will provide:

  • Trusted data exchange mechanisms
  • Service provider and consumer relationship management
  • European data sovereignty compliance
  • Federated catalog and discovery services

GAIA-X enables safe, trusted data sharing across organizational boundaries—essential for industrial digital twin ecosystems spanning multiple companies.

Practical Implementation Example: Temperature Sensor Digital Twin

Digital Twin Model Definition

Asset Type: Industrial Temperature SensorProperty Definitions:

  • Current temperature reading (read-only, Celsius)
  • Sample rate configuration (read-write, milliseconds)
  • Operational status (read-only, enumeration: operational/maintenance/fault)

Action Definitions:

  • Calibrate sensor: Execute calibration routine
  • Reset sensor: Restore default settings

Event Definitions:

  • Temperature threshold exceeded
  • Sensor fault detected
  • Calibration procedure completed

Node-RED Implementation Flow

  1. MQTT Input Node: Subscribe to topic factory/area1/sensor1/temperature
  2. Digital Twin Asset Node: Process incoming data and update property values
  3. Knowledge Graph Node: Store semantic data with timestamps and context
  4. Dashboard Visualization Node: Display current sensor values
  5. Database Output Node: Persist data to time-series database

Semantic Relationship Configuration

  • Sensor1 is_located_in Area1
  • Sensor1 measures_parameter Temperature
  • Temperature affects_quality ProcessQuality
  • Area1 is_part_of ProductionLine1

Knowledge Graph Query Example

Query: "Identify all sensors in ProductionLine1 currently reporting fault status"

Knowledge graph traversal process:

  1. Find all areas with relationship is_part_of ProductionLine1
  2. Find all sensors with relationship is_located_in those areas
  3. Filter sensors where Status property equals "fault"
  4. Return matching sensor list

This query demonstrates automated reasoning across relationships not explicitly programmed—the core advantage of semantic modeling.

Benefits of Semantic Digital Twin Implementation

System Interoperability

Semantic models based on international standards enable different systems to exchange information without custom integration development.

Knowledge Preservation

Formalized semantic knowledge remains accessible despite personnel changes. Semantic models document not only data structures but also meaning and relationships.

Automated Reasoning Capabilities

Knowledge graphs enable automated relationship discovery, constraint validation, and optimization opportunity identification beyond manual analysis.

Stakeholder Alignment

Different stakeholders view the same semantic model from domain-specific perspectives, ensuring consistent information while using appropriate tools.

Future-Proof Architecture

Standards-based implementations adapt more easily to new technologies and requirements compared to proprietary, tightly-coupled systems.

Summary: Semantic Digital Twins for Industry 4.0

Semantic digital twin models using Node-RED provide a research-driven methodology for connecting diverse stakeholders, systems, and knowledge domains in Industry 4.0 environments. By extending traditional digital twin concepts with semantic modeling and knowledge graphs, this approach enables automated reasoning, cross-domain integration, and standards-based interoperability.

The Node-RED implementation makes semantic modeling accessible through visual programming while maintaining alignment with W3C Web of Things, OPC UA, NGSI-LD, and GAIA-X standards. The property-action-event framework provides consistent asset representation regardless of application domain.

While currently in active research and development phase, the project welcomes community participation to guide its evolution. By formalizing industrial knowledge as semantic models and knowledge graphs, organizations can preserve expertise, enable automated optimization, and bridge operational technology and information technology more effectively than traditional point-to-point integration approaches.