-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add a tool to sync LyoD models from RDF #866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@oslc-bot /test-all |
|
@oslc-bot /test-all |
There was a problem hiding this 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 adds a Python-based tool (lyo-model-sync) to synchronize RDF vocabularies and OSLC shapes with Lyo Designer model XML files. The changes also include regenerated domain classes with updated constants and imports reflecting corrections from the sync tool.
Key changes:
- New Python model-sync tool with CLI for syncing RDF vocabularies and shapes
- Refactored Change Management domain constants from
Oslc_cmDomainConstantstoOslc_cm_shapesDomainConstants - Updated OSLC Core vocabulary constants with additional resource types
- Corrected property definitions to use
OsclVocabularyConstants.OSLC_CORE_NAMSPACEinstead ofOslcDomainConstants.OSLC_NAMSPACE
Reviewed changes
Copilot reviewed 81 out of 84 changed files in this pull request and generated 44 comments.
Show a summary per file
| File | Description |
|---|---|
| domains/model-sync/* | New Python tool for syncing RDF vocabularies/shapes to Lyo Designer XML models |
| domains/oslc-domains/src/main/java/org/eclipse/lyo/oslc/domains/cm/* | Refactored CM domain to use Oslc_cm_shapesDomainConstants with correct namespace URI |
| domains/oslc-domains/src/main/java/org/eclipse/lyo/oslc/domains/OsclVocabularyConstants.java | Added OSLC Core resource type constants |
| domains/oslc-domains/src/main/java/org/eclipse/lyo/oslc/domains/*/package-info.java | Updated Lyo Designer generation timestamps |
| domains/org.eclipse.lyo.tools.domainmodels/*.xml | Updated vocabulary and domain specification XML with synced RDF data |
| pom.xml | Updated google-java-format version from 1.27.0 to 1.28.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -592,7 +597,7 @@ public void setTitle(final String title) { | |||
|
|
|||
| // Start of user code setterAnnotation:type | |||
| // End of user code | |||
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method overrides IResource.setType; it is advisable to add an Override annotation.
| // End of user code | |
| // End of user code | |
| @Override |
| @OslcOccurs(Occurs.ZeroOrMany) | ||
| @OslcValueType(ValueType.String) | ||
| @OslcValueType(ValueType.Resource) | ||
| @OslcReadOnly(false) |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method overrides IResource.getType; it is advisable to add an Override annotation.
| @OslcReadOnly(false) | |
| @OslcReadOnly(false) | |
| @Override |
| @@ -193,7 +196,7 @@ public void addCreator(final Link creator) { | |||
| this.creator.add(creator); | |||
| } | |||
|
|
|||
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method overrides IResource.addType; it is advisable to add an Override annotation.
| @Override |
|
|
||
| // Start of user code setterAnnotation:severity | ||
| // End of user code | ||
| public void setSeverity(final Set<Link> severity) { |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method overrides IChangeRequest.setSeverity; it is advisable to add an Override annotation.
|
|
||
| // Start of user code setterAnnotation:relatedTestScript | ||
| // End of user code | ||
| public void setRelatedTestScript(final Set<Link> relatedTestScript) { |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method overrides IChangeRequest.setRelatedTestScript; it is advisable to add an Override annotation.
| @@ -0,0 +1,31 @@ | |||
| import textwrap | |||
| from pathlib import Path | |||
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'Path' is not used.
| from pathlib import Path |
| @@ -0,0 +1,141 @@ | |||
| import tempfile | |||
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'tempfile' is not used.
| import tempfile |
| @@ -0,0 +1,141 @@ | |||
| import tempfile | |||
| from pathlib import Path | |||
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'Path' is not used.
| from pathlib import Path |
| label = vocab.get('label') | ||
| if label: | ||
| return label | ||
| except Exception: |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
| for item in vocab.findall(f'.//{item_type}'): | ||
| if item.get('name') == item_name: | ||
| return True | ||
| except Exception: |
Copilot
AI
Dec 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'except' clause does nothing but pass and there is no explanatory comment.
I mainly needed such a tool for the SysML/KerML v2 vocab and shape sync/conversion but I think it should be useful for the main project and it is a good place to serve as the tool's home.
In this PR, I ran the sync on:
Other changes:
Checklist
@oslc-bot /test-allif not sure) or adds unit/integration tests.mvn package org.openrewrite.maven:rewrite-maven-plugin:run spotless:apply -DskipTests -P'!enforcer'if not, commit & push)