Repository navigation
feat(identity): fix ids for OpenSysML's own library elements so references link by id - #1332
Merged
HuiJun merged 5 commits intoOct 21, 2026
Conversation
…ences link by id
A reference into one of the bundled extension libraries (DocumentQueries,
MOSA, OOSEM, ...) was written as a {"@ref": name} name reference, because
libraryElement gave an id only to symbols the norm identifies. The
extension libraries now carry fixed, deterministic ids derived as the
normative ones are, under the libraries' upstream URL (identity.OpenSysML,
SourceExtension), so the writer links them by id and names them with a
library stub, hover reports them as (extension, OpenSysML), and the
identity gate checks they collide with nothing in the pilot's XMI.
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)".
|
…to OpenSysML's libraries linked by id The writer now links every reference into this repository's own libraries by the element's fixed id, so the baseline moves present-different 50027 -> 45688 and indeterminate 21034 -> 25703 on the same 920 files; the record adjudicates every row that moved and closes gap row 41 for those libraries. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…braries' into feat/extension-library-identity
…library identity change The base branch now records the writer's source digest in the baseline; a full -update over the merged tree moves only that digest, every count being the one already recorded. Co-Authored-By: jason.han <hanhuijun@gmail.com>
HuiJun
merged commit Oct 21, 2026
8d2e3ff
into
feat/apijson-bridge-opensysml-libraries
27 checks passed
6 tasks done
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
A reference into one of OpenSysML's own libraries (
DocumentQueries,MOSA,OOSEM, …) was written as a{"@ref": "caption"}name reference, where the pilot writes an element id —Redefinition.redefinedFeature,FeatureTyping.type,MetadataUsage.type,ViewUsage.type,FeatureReferenceExpression.referent,ReferenceSubsetting.referencedFeature(gap row 41 ofdocs/project/api-json-differential.md, measured by #1328 once the pilot bridge loadedOpenSysML Libraries/). Cause:rdf_identity.golibraryElementgave an id only to symbols the norm identifies (SourceNormative); the extension libraries are not normative, so the writer fell back to the name.The extension libraries' named elements now carry a fixed, deterministic id, derived exactly as a normative id is but under the libraries' own URL:
identity.LanguagegainsOpenSysML, whosePrefix()isExtensionPrefix = "https://github.com/Open-MBEE/OpenSysML-Extensions-Library/"(the libraries' upstream home, as the OMG libraries hash under their specification URLs). A package's id isuuid5(URL name space, prefix + package), each named element under ituuid5(package id, escaped qualified name), the owning membership…/owningMembership—ElementID/OwningMembershipIDunchanged,LibraryLanguage(TierOpenSysML)maps to it, soLibraryCatalogcatalogues the 800 named extension elements beside the normative ones.identity.SourcegainsSourceExtension("extension"), kept apart fromSourceNormative:Info.Normative()still means "the norm fixes it"; the newSource.Fixed()/Info.Fixed()means "a bundled library fixes it" and is what the writer (libraryElement,symbolTerm,normativeFQN, the library-document names), the reader (catalog lookup by id, unchanged) and the LSP (hover(extension, OpenSysML), no minted-id code action) key on.examples/mosa-demo/mosa-demo.sysml: 683{"@ref": …}on the base → 0; each becomes{"@id": <uuid>}with the target named by a library stub (sysml:isLibraryElement true,qualifiedName,elementId) in the Turtle, as a standard-library target is.Not the pilot's ids. The pilot, loading the same files as a library directory, hashes every library package under
https://www.omg.org/spec/SysML/(itsLibraryPackageAdapter), so its ids forMOSA::…differ from ours by the prefix constant alone. The OMG namespace is for OMG-published content: minting a non-OMG library under it is a pilot departure, not a specification requirement, and the referee's outcome is identical either way, so the prefix stays OpenSysML's own (ExtensionPrefix, one constant) and the difference is stated indocs/reference/rdf-mapping.md.Related. #1232's
LibraryCatalogWithOpenSysML(a second, OMG-prefixed catalog of the extension libraries) becomes redundant once this lands, and its rebase will conflict ininternal/semantic/identity/library.go. #1331 and #1333 re-record the samedocs/project/api-json-differential-baseline.jsonanddocs/project/api-json-differential.mdas this PR: whichever of the three lands second re-merges the first and re-runsgo run -C tools ./cmd/pilot-apijson-diff -updateplusmake docs-countson the merged tree.Specification basis
KerML 1.1 Beta 2 §8.3.2.1.2
Element::elementId— every Element has one — and §8.3.3.3.7/§8.3.3.3.8 for theRedefinition/FeatureTypingends, which are elements, not names. No clause fixes the ids of non-normative libraries; the scheme here is the implementation's, deterministic and never random per run, and is documented as such. Nospec-compliance.mdrow moves.In-flight overlap
feature/api-json-derived-properties-layered): addsLibraryCatalogWithOpenSysML, minting extension ids under the OMG prefixes by document kind, and resolvesimportedNamespacethrough it; on the model above it writes noredefinedFeature/type/referentfor these sites at all (the properties are dropped rather than written by id), so it does not cover this gap. It is 76 commits behinddevelopwith two red checks. Conflict surface with this PR:internal/semantic/identity/library.goandrdf_identity.go; this PR's catalog is the one the whole pipeline already uses, so feat(export): owned absence and evaluator-derived properties in API JSON #1232's parallel catalog becomes redundant on rebase.feat/apijson-bridge-opensysml-libraries): the measurement this PR acts on; this PR is based on its branch (merge commit oforigin/developon top) and retargets todevelopwhen it lands. feat(referee): load the OpenSysML Libraries into the pilot JSON bridge and re-record the api-json differential #1328 itself is stacked on feat(referee): list the api-json matches a run lost and gained, and record why naming-feature keys cost manual-examples 171 #1323.feat/api-json-writer-provenance): now merged into feat(referee): load the OpenSysML Libraries into the pilot JSON bridge and re-record the api-json differential #1328's branch and so into this one; theapi-json-writersource digest it adds to the baseline is re-recorded here (a full-updateover the merged tree moved that digest alone, every count unchanged).fix/653-multi-document-convert(PR-less): touchesrdf_identity.gofor multi-document analysis only; no identity derivation change.internal/semantic/identity,tests/identityor the id derivation.How it was verified
tests/identity:TestOpenSysMLLibraryElementCarriesAFixedExtensionID(source, language,ElementID/OwningMembershipID, theuuid5(URL, ExtensionPrefix+name)package rule, not a specification-URL id, deterministic across independent analyses, catalogued both ways);TestPilotLibraryXMInow also asserts no extension id collides with an id in the pilot's XMI (every other XMI assertion unchanged; extension elements are excluded from the "pilot serializes nothing with that id" check since the XMI has none).TestUserElementIsDerivedAndOpenSysMLLibraryIsNotNormativeis split: the user-element half stays, the extension half now asserts the extension id (the behaviour it pinned — a derived id — is the one this PR changes, intentionally).tests/export/extension_library_identity_test.go: API JSON has no@ref;Redefinition.redefinedFeature,FeatureTyping.type,MetadataUsage.type,NamespaceImport.importedNamespacereference the catalogued ids; the Turtle stub carrieselementId/qualifiedName/isLibraryElement; Turtle and API JSON both read back to notation.(extension, OpenSysML)case added toTestHoverStatesDeclaredAndNormativeIdentity.TestCorpusRoundTripandTestCorpusAPIJSONRoundTripwithOPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 OPENSYSML_REQUIRE_SPEC_EXAMPLES=1: pass, no verdict moved (the Turtle of every model referencing these libraries changed — IRIs and stubs where names were — and every one still round-trips as before).go build ./...,go vet ./...,gofmt -l .(empty),go test ./...,go test -C tools ./...,make lint,python3 scripts/changelog.py check,make docs-counts("Documentation counts and refereed figures are current").Referee: reproduction and movement
Fresh
XDG_CACHE_HOMEeach run, pilot2026-08(0.62.0), 920 files.developreproduces its committed baseline byte for byte but for the recording date (86974 matched; 596664 / 47633 / 1021444 / 65920 / 2020649 / 20867).-updatewrites the run's report verbatim; the committed file is that report, and a-checkrun over it reproduces).Movement against #1328's baseline — pilot side and keys untouched, so every movement is the writer's — 56 rows, all adjudicated in the record (
docs/project/api-json-differential.md§ "References into this repository's libraries link by id"):Redefinition.redefinedFeatureFeatureTyping.typeMetadataUsage.typeViewUsage.typeFeatureReferenceExpression.referentReferenceSubsetting.referencedFeatureSame shape, same direction, on the rows the brief did not list:
InvocationExpression.function245 → 19,Membership.memberElement353 → 99,PartUsage.type235 → 63,Subclassification.superclassifier126 → 13,Subsetting.subsettedFeature44 → 34,NamespaceImport.importedNamespace25 → 8,MembershipImport.importedMembership15 → 13,CalculationUsage.type7 → 3,ItemUsage.type20 → 16,ReferenceUsage.type48 → 46, and each relationship's restated ends (target,relatedElement,general,subsettedFeature) with the end they restate.Why indeterminate and not equal: the element form carries the model's own elements only, so a library target has no key on our side and the referee cannot equate it — the bucket that already holds references to standard library elements. No row's present-equal fell; no counter moved toward the pilot's disadvantage except the shapes the 66 newly matched elements carry: the metadata body feature
@MOSAPackage { pillar = … }was written as aReferenceUsagewithdeclaredName "pillar"and a value (its redefinition reached a library feature the writer could not link); it is now unnamed with an ownedRedefinitionofMOSAPackage::pillar, as the pilot writes it, so 66Redefinitions match (matched +66, pilot-only −66,ReferenceUsage.declaredNamepilot-missing 70 → 4,ReferenceUsage.ownedRedefinition/ownedSpecialization/ownedSubsetting+66 present-equal each) and carry theRedefinitionrows' existing shapes (isLibraryElement/owningTypeours-missing +66,owner/redefinespilot-missing +66). RemainingRedefinition.redefinedFeaturepresent-different (58): redefinitions of a feature inherited within the model the writer still spells as a name (vehicle_b_1::providePower), not into these libraries — a separate gap, out of scope here.Behaviour changes
{"@id"}); a reader resolves it against the bundled catalog by id, or by the stub'squalifiedNamewhen the id is foreign (the existing standard-library path).(extension, OpenSysML); the "annotate with a minted id" code action is no longer offered for one (it has a fixed id).identity.LibraryCatalogcatalogues the 800 named extension-library elements;Info.Normative()is unchanged (false for them),Info.Fixed()is the new predicate.Checklist
make testandmake lintpass locallychanges/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 changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/9096ac68d66141d487cd94f44d459425
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/9096ac68d66141d487cd94f44d459425?variant=devin
Requested by: @HuiJun