How uicrail/semanticrsm works
Based on our review of the file tree and the README, the project is SemanticRSM – a semantic re-casting of the Rail System Model (RSM) using direct RDF/OWL modelling. Its purpose is to translate and transform rail network data (from sources like OpenStreetMap, IFC files, and specific rail data such as SD1 or railML) into a semantically rich ontology that is backward compatible with earlier models, while introducing improvements in topology, navigability, and modularization of the domain concepts.
Main Components
• Data Sources and Input:
• Source_data (containing ISO, Scheibenberg, Baltic Network, IFC, and OSM examples)
• External models (e.g., DATEX II, SRTI Datex II, ERA, etc.)
• Import and Parsing Modules:
• Code/Import directory with submodules for OSM_import, SD1_import, drawIO_import, railML32_import (each handling a different input type)
• Utilities like helper_functions, ontology version comparisons and file converters
• Transformation Pipeline:
• Code/Graph_transformation modules that include a series of Python scripts (step01_split_linear_elements.py, step02_join_linear_elements.py, etc.) that handle geometric and topological transformations and integrate port properties.
• Ontology Modules:
• Ontologies folder with separate namespaces (CDM, CCS-TMS, DATEX2v3, ERA, etc.), each containing TTL and other RDF files to define the underlying vocabulary and relations.
• Export Functionality:
• Code/Export containing Python scripts to output transformed data into different formats (e.g., export_ifcAlignment_to_kml.py, export_ttl_to_kml.py)
• Web-based Demonstration/Interface:
• Flask folder with an __init__.py and page definitions that allow launching a local server for demonstration, providing a user interface and using sample data.
• Supporting Documents & Developer Tools:
• Prolog scripts for demo path finding (shortest path algorithms)
• Various build/configuration (git, Qodana, etc.) and developer tool directories (IDE caches, lsp, etc.)
Relationships and Interactions
• Data Flow: Data originates from diverse Source_data and External Models and flows into the Import modules via specialized converters.
• Transformation Pipeline: Once imported, the data is processed through a sequence of transformation scripts in the Graph_transformation directory. Each step (splitting, joining, port adding, slip functionality, meso ports) refines and evaluates the input data.
• Ontology Integration: The processed data is then mapped into RDF/OWL representations by utilizing the ontologies stored in the Ontologies directory (which are structured in a clear, modular way to maintain high cohesion and low coupling).
Architectural Patterns and Design Principles
• Modular design: Clear separation into import, transformation, and export modules.
• Pipeline/Sequential Processing: Data flows through distinct transformation stages.
• Layered system: Inputs, processing, ontology mapping, presentation (Flask demo), and support/documentation layers.
• Interoperability via standards: Use of RDF, OWL, SHACL, SPARQL; adherence to UIC standards.
Instructing the Principal Software Engineer
• Create distinct sections for:
– External Data Inputs (Source_data, External Models)
– Data Import and Preprocessing (all modules in Code/Import)
– Core Transformation Pipeline (present the sequential processing steps from Code/Graph_transformation)
– Semantic Mapping and Ontology Generation (including the modular ontologies)
– Export and Interface Presentation (Code/Export and Flask server)
• Architectural principle of modularity and backward compatibility through separate but inter-dependent modules.