Skip to content

Conversation

@berezovskyi
Copy link
Contributor

@berezovskyi berezovskyi commented Dec 28, 2025

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:

  • Core, AM, CM, QM, RM domain vocabs
  • CM domain shapes

Other changes:

  • Update the CM shapes domain prefix
  • Update the CM shapes domain namespace

Checklist

  • This PR adds an entry to the CHANGELOG. See https://keepachangelog.com/en/1.0.0/ for instructions. Minor edits are exempt.
  • This PR was tested on at least one Lyo OSLC server (comment @oslc-bot /test-all if not sure) or adds unit/integration tests.
  • This PR does NOT break the API
  • Lint checks pass (run mvn package org.openrewrite.maven:rewrite-maven-plugin:run spotless:apply -DskipTests -P'!enforcer' if not, commit & push)

@berezovskyi
Copy link
Contributor Author

@oslc-bot /test-all

@oslc-bot
Copy link

oslc-bot commented Dec 28, 2025

Downstream Build Status

Repository Lyo CI Job state Workflow
oslc-op/refimpl ✅ Pass completed Link
oslc/lyo-samples ✅ Pass completed Link
oslc/promcode-lyo-server ✅ Pass completed Link

@berezovskyi berezovskyi added this to the 7.0 milestone Dec 28, 2025
@berezovskyi
Copy link
Contributor Author

@oslc-bot /test-all

@berezovskyi berezovskyi marked this pull request as ready for review December 28, 2025 15:42
@oslc-bot
Copy link

oslc-bot commented Dec 28, 2025

Downstream Build Status

Repository Lyo CI Job state Workflow
oslc-op/refimpl 🔴 Fail completed Link
oslc/lyo-samples ✅ Pass completed Link
oslc/promcode-lyo-server ✅ Pass completed Link

Copilot AI review requested due to automatic review settings December 28, 2025 15:42
Copy link
Contributor

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 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_cmDomainConstants to Oslc_cm_shapesDomainConstants
  • Updated OSLC Core vocabulary constants with additional resource types
  • Corrected property definitions to use OsclVocabularyConstants.OSLC_CORE_NAMSPACE instead of OslcDomainConstants.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
Copy link

Copilot AI Dec 28, 2025

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.

Suggested change
// End of user code
// End of user code
@Override

Copilot uses AI. Check for mistakes.
@OslcOccurs(Occurs.ZeroOrMany)
@OslcValueType(ValueType.String)
@OslcValueType(ValueType.Resource)
@OslcReadOnly(false)
Copy link

Copilot AI Dec 28, 2025

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.

Suggested change
@OslcReadOnly(false)
@OslcReadOnly(false)
@Override

Copilot uses AI. Check for mistakes.
@@ -193,7 +196,7 @@ public void addCreator(final Link creator) {
this.creator.add(creator);
}

Copy link

Copilot AI Dec 28, 2025

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.

Suggested change
@Override

Copilot uses AI. Check for mistakes.

// Start of user code setterAnnotation:severity
// End of user code
public void setSeverity(final Set<Link> severity) {
Copy link

Copilot AI Dec 28, 2025

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.

Copilot uses AI. Check for mistakes.

// Start of user code setterAnnotation:relatedTestScript
// End of user code
public void setRelatedTestScript(final Set<Link> relatedTestScript) {
Copy link

Copilot AI Dec 28, 2025

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.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,31 @@
import textwrap
from pathlib import Path
Copy link

Copilot AI Dec 28, 2025

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.

Suggested change
from pathlib import Path

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,141 @@
import tempfile
Copy link

Copilot AI Dec 28, 2025

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.

Suggested change
import tempfile

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,141 @@
import tempfile
from pathlib import Path
Copy link

Copilot AI Dec 28, 2025

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.

Suggested change
from pathlib import Path

Copilot uses AI. Check for mistakes.
label = vocab.get('label')
if label:
return label
except Exception:
Copy link

Copilot AI Dec 28, 2025

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.

Copilot uses AI. Check for mistakes.
for item in vocab.findall(f'.//{item_type}'):
if item.get('name') == item_name:
return True
except Exception:
Copy link

Copilot AI Dec 28, 2025

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.

Copilot uses AI. Check for mistakes.
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.

2 participants