Skip to content

Convert: name the standard-library elements a converted model references #731

Description

@someshSandbox

A converted graph refers to a standard-library element by its normative id alone. A consumer without the library can't tell which element it is.

package P {
    attribute speed : ScalarValues::Real;
}

sysml p.sysml -convert api-json (develop 62f2442c3) writes 6 elements. The typing is:

{"@type": "FeatureTyping", "@id": "P__speed_ft0", "typedFeature": {"@id": "P__speed"}, "type": {"@id": "14c0aa22-5489-59b5-b438-ded26e83ba31"}}

14c0aa22-… is ScalarValues::Real's normative id: uuid5(uuid5(NAMESPACE_URL, https://www.omg.org/spec/KerML/ScalarValues), ScalarValues::Real), as internal/semantic/identity/normative.go derives it. No element in the output carries that id, and nothing in it states the name. Turtle is the same: sysml:type <urn:sysmlv2:element:14c0aa22-…> and no triple about that subject.

The id can't be turned back into a name: it is a hash, and the service has no call that lists the library.

  • Query reaches a library element when scope names it (scope: ["ScalarValues::Real"] → AttributeDefinition), but only by a name the caller already knows.
  • Query's @id is the qualified name, not this id.

So a consumer that reads the export needs its own copy of the library, at the version the service bundles, to name types such as Real, redefined or subsetted library features, superclassifiers and imported library packages. On one 170-file model the export refers to 36 library elements about 3,000 times.

Request. Have Convert (ttl, api-json, the command line and the service) state the qualified name of each library element the output references, without exporting the library itself. For example:

  • In Turtle, <id> sysml:qualifiedName "ScalarValues::Real" (and rdf:type) for each referenced library subject. That's two triples per element, the facts the writer already has (identityFacts.library).
  • In API JSON, the same as a minimal element {"@id", "@type", "qualifiedName"} marked as a library reference, or as a separate name table, whichever fits the element-list shape better.

A reader importing the output back should keep treating these as references into the bundled library, not as declared elements.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions