Enhance DataEngine Logic to Support Duplicate Semantic IDs Across Different Node Types#84
Enhance DataEngine Logic to Support Duplicate Semantic IDs Across Different Node Types#84
Conversation
…Node Expanded HandoverDocumentation.xml to support richer, standards-based, multi-language metadata for document handover, including new properties, preview files, and concept descriptions aligned with VDI 2770 and IEC 61360. Updated database schema to model languages and many-to-many relationships between document versions and languages. Refactored semantic tree handling logic for type-safe node selection, removed mixed-type skipping, and improved unit tests to ensure correct handling of branch/leaf node ambiguities and multi-language scenarios.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR updates the DataEngine submodel fill-out flow to support cases where the same semanticId appears on different semantic tree node types (branch vs leaf), and refreshes unit tests and example data to reflect the new behavior.
Changes:
- Add typed semantic tree navigation (
FindNodeBySemanticId<T>) and update filling logic to select nodes by both semanticId and expected node type. - Update/refactor unit tests to cover duplicate semanticIds across node types and the resulting fill-out behavior.
- Update example Postgres seed script and AAS example XML to match the new multi-language/language-list structure.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SubmodelRepositoryService.cs | Minor refactor in submodel build flow (no functional change intended). |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SemanticTreeNavigator.cs | Introduces generic typed node lookup to filter by node type. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SemanticIdResolver.cs | Adds cached internal semantic id value from options. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SemanticId/FillOut/SubmodelFiller.cs | Updates fill-out logic to select branch vs leaf nodes based on submodel element type. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SemanticIdHandlerTests.cs | Adjusts expectations for complex data fill-out results. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SemanticTreeNavigatorTests.cs | Replaces removed tests with coverage for typed lookup behavior. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SemanticId/FillOut/SubmodelFillerTests.cs | Adds tests for resolving duplicate semanticIds across branch/leaf nodes. |
| example/postgres/04_handoverdocumentation.sql.inc | Normalizes language storage into separate tables and adds relationship data. |
| example/aas/HandoverDocumentation.xml | Updates example AAS environment XML to align with the revised structure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...DataEngine/ApplicationLogic/Services/SubmodelRepository/SemanticId/FillOut/SubmodelFiller.cs
Show resolved
Hide resolved
...Engine/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SemanticIdResolver.cs
Outdated
Show resolved
Hide resolved
...nEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SubmodelRepositoryService.cs
Outdated
Show resolved
Hide resolved
Reformatted SQL inserts for readability and fixed a minor syntax issue in DocumentVersionLanguages. Improved SubmodelFiller logic to skip elements with no semantic nodes and refactored methods for conciseness. Removed unused field and clarified property naming in SemanticIdResolver. Simplified result handling in SubmodelRepositoryService. These changes enhance code clarity, maintainability, and correctness.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...DataEngine/ApplicationLogic/Services/SubmodelRepository/SemanticId/FillOut/SubmodelFiller.cs
Show resolved
Hide resolved
...Tests/ApplicationLogic/Services/SubmodelRepository/SemanticId/FillOut/SubmodelFillerTests.cs
Show resolved
Hide resolved
|
Test & Coverage ReportTest Results Summary
Code CoverageUnit Tests Coverage
Minimum allowed line rate is Module Tests Coverage
|



PR Description
This update enhances the DataEngine to correctly handle scenarios where the same semanticId appears across different node types (e.g., branchNode and leafNode).
Key updates include: