Skip to content

Enhance DataEngine Logic to Support Duplicate Semantic IDs Across Different Node Types#84

Open
mm-hsh wants to merge 17 commits intodevelopfrom
feature/600-Same-SemanticId
Open

Enhance DataEngine Logic to Support Duplicate Semantic IDs Across Different Node Types#84
mm-hsh wants to merge 17 commits intodevelopfrom
feature/600-Same-SemanticId

Conversation

@mm-hsh
Copy link
Contributor

@mm-hsh mm-hsh commented Mar 25, 2026

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:

  • Updated DataEngine logic to differentiate nodes using both semanticId and nodeType.
  • Updated unit tests to cover the new behavior and ensure backward compatibility.
  • Refactored existing tests to reflect the new multi‑type semanticId handling logic.

mm-kgi and others added 15 commits March 5, 2026 14:45
…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.
Copilot AI review requested due to automatic review settings March 25, 2026 06:04
@github-actions
Copy link

github-actions bot commented Mar 25, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sonarqubecloud
Copy link

@github-actions
Copy link

Test & Coverage Report

Test Results Summary

Metric Count
✅ Passed 1019
❌ Failed 0
⏭️ Skipped 0

View Detailed Test Results


Code Coverage

Unit Tests Coverage

Package Line Rate Branch Rate Complexity Health
AAS.TwinEngine.DataEngine 91% 83% 1504
Summary 91% (2552 / 2802) 83% (1074 / 1295) 1504

Minimum allowed line rate is 80%

Module Tests Coverage

Package Line Rate Branch Rate Complexity Health
AAS.TwinEngine.DataEngine 56% 42% 1504
Summary 56% (1559 / 2802) 42% (540 / 1295) 1504

@mm-hsh mm-hsh requested review from mm-asha and mm-kgi March 25, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants