Skip to content

feat(ontology): generate the metamodel table from the pilot's SysML.ecore (20250201) - #865

Merged
HuiJun merged 6 commits into
developfrom
feature/ontology-pilot-metamodel
Oct 4, 2026
Merged

HuiJun merged 6 commits into
developfrom
feature/ontology-pilot-metamodel

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Regenerates internal/translate/rdf/ontology/table.go from the current OMG SysML v2 metamodel, version 20250201 (nsURI https://www.omg.org/spec/SysML/20250201), read directly from the pilot implementation's org.omg.sysml/model/SysML.ecore at the tag and commit scripts/pilot-pin.sh already pins (2026-08, 692170b7). The table now records, per property, Ordered, Derived, Redefines, Subsets and Opposite beside Many, and, per class, Abstract. CI fails when the table drifts from the pin.

Why the table was stale

  • Open-MBEE/sysmlv2-rdf-ontology has not moved. The pinned commit a1fda262 (2024-11-07) is still the head of master; there are no tags or releases. Its sysml2/README.md badge says 202407, and its sysml2/ecore/SysML.ecore carries nsURI .../SysML/20240201. The only newer commit is on the light branch (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.
  • Nothing could bump it. The generator took any local checkout (-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.
  • Decision: generate from the OMG metamodel's own SysML.ecore rather than from the OWL rendering. The pilot implementation publishes it, it is the file sysmlv2-rdf-ontology renders from, and the repository already pins every other pilot input (corpora, grammars, library XMI, validators) by scripts/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's SysML#<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

202407 20250201 added removed of which renamed
Classes 172 175 12 9 7
Properties 411 (348 object, 63 datatype) 415 (351 object, 64 datatype) 21 17 9

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, 155 Ordered, 328 Derived, 119 with Redefines, 190 with Subsets, 70 with Opposite; 8 abstract classes.

What broke and how it is fixed

  • Bounded multiplicities: Many now means an ecore upper bound above 1 or unbounded (-1), not only -1. MultiplicityRange::bound and Flow::flowEnd (upper bound 2) were single-valued in the 202407 table too; they are now Many and Ordered. The api-json export writes neither, so no export output moved.
  • nonunique: the metamodel no longer declares isNonunique, so it is written sysml:isUnique false (Feature::isUnique). Graphs stating isNonunique still read.
  • Flows, payloads, flow ends, 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 plain OwningMembership. They are now owned through a FeatureMembership and listed in ownedFeature, like any feature. A SysML graph from an earlier release, owning them through a plain OwningMembership, still reads as the same feature (SysML has no member). Six export goldens move accordingly.
  • Ontology gate: six entries of tests/export/testdata/ontology-known-violations.txt the new table resolves are removed (unknown-class FlowUsage, PayloadFeature, FlowEnd, TerminateActionUsage, ConstructorExpression; unknown-property AttributeUsage isConstant), and one is added, domain-mismatch PayloadFeature value: the same FeatureValue::value collapse already listed for usages, now visible because PayloadFeature is a known class. 487 triples in 78 distinct violations → 455 in 73.
  • Abstractness: since the table now records it, the gate reports an abstract-class violation for a subject typed by an abstract metaclass, replacing the hand audit docs/project/roadmap.md § D7 described. No golden graph has one.
  • API JSON: now that the table knows them, a flow end's and payload's multi-valued properties are written as arrays, and the flow's membership as a FeatureMembership. sysml-sdk's examples/queries/models/drones.sysml and pumps.sysml convert sysml → api-json → sysml byte-identical to the source (and to develop's output). pumps' api-json is identical to develop's; drones' differs only in the flow/payload/end elements above.

Drift guard and next bump

  • scripts/download-pilot-metamodel.sh fetches the pinned SysML.ecore into build/pilot-metamodel/ with a pin stamp; the generator refuses a download stamped with another pin.
  • make ontology-table regenerates; make ontology-table-check (go run -C tools ./gen/ontology -check) fails when the committed table differs from what the pin generates. go-gates runs it in CI.
  • TestTableFollowsThePilotPin (tests/ontology) fails without any download when scripts/pilot-pin.sh moves and the table header still names the old pin.
  • Bump procedure (also in internal/translate/rdf/ontology/README.md § Bumping): move the pilot pin, make ontology-table, review the table diff, update the counts in tests/ontology and docs/project/roadmap.md § D8, then run the export/ontology/migrate tests and the corpus round-trip gates; TestGoldenGraphsMatchOntology lists every new violation and every resolved known one.

Specification basis

OMG SysML v2 metamodel, https://www.omg.org/spec/SysML/20250201, as SysML.ecore in Systems-Modeling/SysML-v2-Pilot-Implementation 2026-08. The abstract-metaclass row of docs/project/spec-compliance.md stays faithful, now checked by the ontology gate instead of by hand.

How it was verified

  • go build ./..., go vet ./... (root and tools), gofmt -l . empty, go test ./... and go test -C tools ./gen/ontology pass; make build passes.
  • go test -race over internal/translate/..., tests/export, tests/ontology, tests/migrate passes.
  • RDF and API-JSON corpus round-trip gates, training-corpus and pilot-corpora gates pass with the require variables set; training_examples_expected.txt and the round-trip expectations are unchanged.
  • make lint (staticcheck, gosec) passes. The full go 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, and changelog.py check pass.

Checklist

  • make test and make lint pass locally (race suite per touched package; see above)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

…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>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

…f:type

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ilot-metamodel

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	Makefile
devin-ai-integration Bot and others added 2 commits October 4, 2026 03:34
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ilot-metamodel

Co-Authored-By: jason.han <hanhuijun@gmail.com>

# Conflicts:
#	Makefile
devin-ai-integration[bot]

This comment was marked as resolved.

…cluded

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@HuiJun
HuiJun merged commit 59aa5c4 into develop Oct 4, 2026
24 checks passed
@HuiJun
HuiJun deleted the feature/ontology-pilot-metamodel branch October 4, 2026 05:42
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.

1 participant