feat(export): name the standard library elements a converted model references (#731) - #746
Merged
Merged
Conversation
…ferences (Open-MBEE#731) A reference to a library element is its normative id, a hash no reader can turn back into a name. Each referenced library element is now stated under that id with its metaclass, elementId, qualifiedName and declaredName, marked isLibraryElement; a referenced library membership with its memberElement. The library itself is not exported. Reading back, such an element is a reference into the bundled library, checked against it, and not written; repository sync leaves it alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ames # Conflicts: # internal/translate/export/behavior.go # internal/translate/export/rdf_in.go
…her true Review: - a library membership is refused unless the library gives its id to the owning membership of the element its memberElement names, so an import of it cannot silently name another element; - isLibraryElement is read as an xsd:boolean, so "1" marks a library element as "true" does, in the reader, the root namespace and sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Accepted! Thank you! |
4 of 6 tasks
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.
Fixes #731.
sysml l.sysml -convert api-json:develop@ids referenced but not in the output14c0aa22-5489-59b5-b438-ded26e83ba31ScalarValues::Real{"@type": "DataType", "@id": "14c0aa22-…", "elementId": "14c0aa22-…", "qualifiedName": "ScalarValues::Real", "declaredName": "Real", "isLibraryElement": true}ISQ(imported namespace)LibraryPackagewith the same propertiesimport ScalarValues::Real(importedMembership)OwningMembershipwithmemberElement→Real,isLibraryElement: trueA referenced library element is stated under its normative id, and nothing more is written about it:
elementId,qualifiedNameanddeclaredName, andisLibraryElement: true(KerMLElement::isLibraryElement,Element_isLibraryElementin the ontology).Change:
claimLibraryrecords each library element a document links to.libraryNamesthen states the ones the output references, after the normative relationships are materialized. A library package is aLibraryPackage. An alias, or an element with no metaclass to state, isn't stated, and neither is its membership.LibraryReference).rdf-mapping.mddescribes them.Tests:
tests/export/library_names_test.go:@idthe output references is an element of it;Real,Integer,MassValueandISQ;.golden.ttlfiles are regenerated. The diff only adds the stated library elements (29), no line removed.TestFixtureElementIDsRoundTripskips stated library elements, which keep the normative id the references to them carry.TestToolkitReExportTablecounts model elements only.internal/translate/...,tests/export/...,tests/corpus/...,tests/identity/...,tests/reposync/...,tests/grpc/...,internal/frontend/grpc/...,internal/workspace/...andinternal/check/...pass.sysml -validate.🤖 Generated with Claude Code