Skip to content

syster export formats do not include attribute expression values #708

@phreed

Description

@phreed

syster export formats do not include attribute expression values

syster version: 0.3.1-alpha and 0.3.2-alpha

Summary

When a SysML v2 model assigns concrete values to attributes
(e.g., attribute name = "temperature-01" or attribute sampleRate = 100),
syster parses these correctly (0 errors, 0 warnings),
but none of the export formats (--export yaml, --export json-ld, --export xmi, --export-ast)
include the assigned values in their output.
Only the attribute names, qualified names, types, and ownership relationships are exported.

Reproduction

Test file: values-test.sysml

package ValuesTest {

    // Part definition with typed attributes (no defaults)
    part def Sensor {
        attribute name : String;
        attribute sampleRate : Integer;
        attribute enabled : Boolean;
    }

    // Part usage with concrete attribute values
    part tempSensor : Sensor {
        attribute name = "temperature-01";
        attribute sampleRate = 100;
        attribute enabled = true;
    }

    // Standalone attribute with a default value in a definition
    part def Config {
        attribute endpoint : String = "http://localhost:8080";
        attribute maxRetries : Integer = 3;
        attribute ratio : Real = 0.75;
    }

    // Nested values
    part def System {
        part sensor : Sensor {
            attribute name = "pressure-02";
            attribute sampleRate = 50;
        }
    }
}

Parse step (succeeds)

$ syster values-test.sysml
✓ Analyzed 1 files: 17 symbols, 0 warnings

YAML export (missing values)

$ syster --export yaml values-test.sysml

The tempSensor::name attribute appears as:

- '@type': AttributeUsage
  '@id': c1196ed0-a60e-4c05-9ad4-2eba30b2fdc0
  name: name
  qualifiedName: ValuesTest::tempSensor::name
  owner:
    '@id': b91ec43d-a19e-486c-ba51-4e4bd0210c09

Expected:
The value "temperature-01" should appear somewhere in this element,
for example as a value or defaultValue field,
or as an ownedMember of type LiteralString.

AST export (missing values)

$ syster --export-ast values-test.sysml

The same attribute appears as:

{
  "name": "name",
  "qualified_name": "ValuesTest::tempSensor::name",
  "kind": "AttributeUsage",
  "file": "values-test.sysml",
  "start_line": 12,
  "start_col": 19,
  "end_line": 12,
  "end_col": 23,
  "supertypes": [
    "ValuesTest::Sensor::name"
  ]
}

Expected:
A value field (e.g., "value": "temperature-01") or
equivalent representation of the assigned expression.

JSON-LD export (missing values)

Same structure as YAML, no value fields present.

XMI export (missing values)

<ownedRelatedElement xsi:type="sysml:AttributeUsage"
  xmi:id="5d9261b4-cdba-4f36-9bf6-75ce2e4a3de4"
  elementId="5d9261b4-cdba-4f36-9bf6-75ce2e4a3de4"
  declaredName="name"
  qualifiedName="ValuesTest::tempSensor::name"/>

Expected:
Per the SysML v2 / KerML metamodel, the attribute should
contain an ownedMember of type FeatureValue which in turn owns a
LiteralString (or LiteralInteger, LiteralBoolean, LiteralRational)
expression element.
For example:

<ownedRelatedElement xsi:type="sysml:AttributeUsage"
  declaredName="name" qualifiedName="ValuesTest::tempSensor::name">
  <ownedRelatedElement xsi:type="kerml:FeatureValue">
    <ownedRelatedElement xsi:type="kerml:LiteralString" value="temperature-01"/>
  </ownedRelatedElement>
</ownedRelatedElement>

Affected value types

All of the following are parsed without error but not exported:

SysML source Expected element type Exported?
attribute name = "temperature-01" LiteralString No
attribute sampleRate = 100 LiteralInteger No
attribute enabled = true LiteralBoolean No
attribute endpoint : String = "http://localhost:8080" LiteralString No
attribute maxRetries : Integer = 3 LiteralInteger No
attribute ratio : Real = 0.75 LiteralRational No

Impact

Without expression values in the export, downstream tools that consume
syster's interchange output
(e.g., model-to-diagram converters, code generators, model validators)
cannot access the concrete configuration data that is a core part of the model.
The structural skeleton is exported correctly, only the value expressions are missing.

Environment

  • syster 0.3.1-alpha, 0.3.2-alpha
  • Platform: Linux x86_64 (Fedora 43)
  • Installed via: conda install -c https://prefix.dev/meso-forge syster-cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions