feat(ontology): generate the metamodel table from the pilot's SysML.ecore (20250201) - #865
Merged
Merged
Conversation
…core (20250201) Read the pinned pilot implementation's SysML.ecore instead of the 202407 OWL rendering, record each property's ordering, derivation, redefinitions, subsettings and opposite and each class's abstractness, and fail CI when the table drifts from the pin. Write nonunique as isUnique false and own the flow, payload, end, terminate and instantiation metaclasses through a FeatureMembership, still reading graphs earlier releases wrote. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
force-pushed
the
feature/ontology-pilot-metamodel
branch
from
October 3, 2026 23:06
1a1bee7 to
702bfdb
Compare
…f:type Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
…ilot-metamodel Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # Makefile
6 tasks done
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ilot-metamodel Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # Makefile
…cluded Co-Authored-By: jason.han <hanhuijun@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Regenerates
internal/translate/rdf/ontology/table.gofrom the current OMG SysML v2 metamodel, version 20250201 (nsURI https://www.omg.org/spec/SysML/20250201), read directly from the pilot implementation'sorg.omg.sysml/model/SysML.ecoreat the tag and commitscripts/pilot-pin.shalready pins (2026-08,692170b7). The table now records, per property,Ordered,Derived,Redefines,SubsetsandOppositebesideMany, and, per class,Abstract. CI fails when the table drifts from the pin.Why the table was stale
Open-MBEE/sysmlv2-rdf-ontologyhas not moved. The pinned commita1fda262(2024-11-07) is still the head ofmaster; there are no tags or releases. Itssysml2/README.mdbadge says202407, and itssysml2/ecore/SysML.ecorecarriesnsURI .../SysML/20240201. The only newer commit is on thelightbranch (2026-03, "Initial reduced ontology"): a 68-class ownership subset of that same 202407 ontology, not a newer metamodel. So the ontology repository itself lags OMG by one metamodel release.-ontology <path>/$SYSMLV2_RDF_ONTOLOGY) and recorded its SHA; nothing pinned it, there was no Makefile target and no download script, and no CI job or scheduled check compared the table against any source. The table only moved when someone regenerated it by hand, and upstream gave nothing newer to regenerate from.SysML.ecorerather than from the OWL rendering. The pilot implementation publishes it, it is the filesysmlv2-rdf-ontologyrenders from, and the repository already pins every other pilot input (corpora, grammars, library XMI, validators) byscripts/pilot-pin.sh. Tying the table to that pin means it moves with the release the rest of the tree is measured against. The ecore carries everything the table used from the OWL (classes, supertypes, every structural feature with its type), and the property IRIs keep the OWL rendering'sSysML#<DefiningClass>_<name>spelling, so the RDF vocabulary is unchanged. Run against the old checkout's ecore, the new generator reproduces the 202407 table's classes, supertypes, properties, kinds, ranges and multiplicities.What changed between 202407 and 20250201
Ambiguous unqualified names: 59 → 58 (342 distinct names).
Classes renamed (7):
ItemFlow→Flow,SuccessionItemFlow→SuccessionFlow,ItemFlowEnd→FlowEnd,ItemFeature→PayloadFeature,FlowConnectionDefinition→FlowDefinition,FlowConnectionUsage→FlowUsage,SuccessionFlowConnectionUsage→SuccessionFlowUsage.Classes added (5):
ConstructorExpression,CrossSubsetting,IndexExpression,InstantiationExpression,TerminateActionUsage.Classes removed (2):
Featuring,LifeClass.Properties renamed (9):
ItemFlow::{interaction, sourceOutputFeature, targetInputFeature}→Flow::…,ItemFlow::itemFeature→Flow::payloadFeature,ItemFlow::itemFlowEnd→Flow::flowEnd,ItemFlow::itemType→Flow::payloadType,FlowConnectionUsage::flowConnectionDefinition→FlowUsage::flowDefinition,InvocationExpression::argument→InstantiationExpression::argument,Feature::isReadOnly→Feature::isConstant.Properties added (12):
Feature::{crossFeature, ownedCrossSubsetting, isVariable},CrossSubsetting::{crossedFeature, crossingFeature},Connector::defaultFeaturingType,FlowDefinition::flowEnd,InstantiationExpression::instantiatedType,Usage::mayTimeVary,Annotation::ownedAnnotatingElement,AnnotatingElement::owningAnnotatingRelationship,TerminateActionUsage::terminatedOccurrenceArgument.Properties removed (8):
Feature::isNonunique,Featuring::{feature, type},OccurrenceDefinition::lifeClass,Succession::{effectStep, guardExpression, transitionStep, triggerStep}.New flags over the 415 properties: 181
Many, 155Ordered, 328Derived, 119 withRedefines, 190 withSubsets, 70 withOpposite; 8 abstract classes.What broke and how it is fixed
Manynow means an ecore upper bound above 1 or unbounded (-1), not only-1.MultiplicityRange::boundandFlow::flowEnd(upper bound 2) were single-valued in the 202407 table too; they are nowManyandOrdered. The api-json export writes neither, so no export output moved.nonunique: the metamodel no longer declaresisNonunique, so it is writtensysml:isUnique false(Feature::isUnique). Graphs statingisNonuniquestill read.terminate, constructor/index/instantiation expressions: the old table did not know these metaclasses, so they were not recognised as features and were owned through a plainOwningMembership. They are now owned through aFeatureMembershipand listed inownedFeature, like any feature. A SysML graph from an earlier release, owning them through a plainOwningMembership, still reads as the same feature (SysML has nomember). Six export goldens move accordingly.tests/export/testdata/ontology-known-violations.txtthe new table resolves are removed (unknown-classFlowUsage,PayloadFeature,FlowEnd,TerminateActionUsage,ConstructorExpression;unknown-property AttributeUsage isConstant), and one is added,domain-mismatch PayloadFeature value: the sameFeatureValue::valuecollapse already listed for usages, now visible becausePayloadFeatureis a known class. 487 triples in 78 distinct violations → 455 in 73.abstract-classviolation for a subject typed by an abstract metaclass, replacing the hand auditdocs/project/roadmap.md§ D7 described. No golden graph has one.FeatureMembership.sysml-sdk'sexamples/queries/models/drones.sysmlandpumps.sysmlconvert sysml → api-json → sysml byte-identical to the source (and todevelop's output).pumps' api-json is identical todevelop's;drones' differs only in the flow/payload/end elements above.Drift guard and next bump
scripts/download-pilot-metamodel.shfetches the pinnedSysML.ecoreintobuild/pilot-metamodel/with a pin stamp; the generator refuses a download stamped with another pin.make ontology-tableregenerates;make ontology-table-check(go run -C tools ./gen/ontology -check) fails when the committed table differs from what the pin generates.go-gatesruns it in CI.TestTableFollowsThePilotPin(tests/ontology) fails without any download whenscripts/pilot-pin.shmoves and the table header still names the old pin.internal/translate/rdf/ontology/README.md§ Bumping): move the pilot pin,make ontology-table, review the table diff, update the counts intests/ontologyanddocs/project/roadmap.md§ D8, then run the export/ontology/migrate tests and the corpus round-trip gates;TestGoldenGraphsMatchOntologylists every new violation and every resolved known one.Specification basis
OMG SysML v2 metamodel,
https://www.omg.org/spec/SysML/20250201, asSysML.ecorein Systems-Modeling/SysML-v2-Pilot-Implementation2026-08. The abstract-metaclass row ofdocs/project/spec-compliance.mdstays faithful, now checked by the ontology gate instead of by hand.How it was verified
go build ./...,go vet ./...(root andtools),gofmt -l .empty,go test ./...andgo test -C tools ./gen/ontologypass;make buildpasses.go test -raceoverinternal/translate/...,tests/export,tests/ontology,tests/migratepasses.training_examples_expected.txtand the round-trip expectations are unchanged.make lint(staticcheck, gosec) passes. The fullgo test -race ./...in one process exceeds the 10-minute package timeout locally on unrelated packages; CI runs it sharded.make ontology-table-check,doc-counts -check, doc-id, doc-figure and link checks, andchangelog.py checkpass.Checklist
make testandmake lintpass locally (race suite per touched package; see above)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog