Skip to content

metadata construct not parsed — VerificationMethodKind annotations fail with 'expected a body member' #608

Description

@mzargham

Summary

The metadata construct in SysML v2 (used for VerificationMethodKind annotations on verification cases) fails to parse in OpenSysML v0.9.0.

Reproduction

import opensysml
conn = opensysml.connect(version='v0.9.0')
src = '''
package MetaTest {
    private import VerificationCases::*;
    part def Widget { attribute size : Real default = 1.0; }
    requirement def SizeReq {
        subject widget : Widget;
        require constraint { widget.size <= 5.0 }
    }
    requirement sizeReq : SizeReq;
    verification def SizeCheck {
        subject widget : Widget;
        #verificationMethod = VerificationMethodKind::test;
        objective {
            verify sizeReq;
        }
    }
}
'''
m = conn.load_from_content(src, strict=False)
print(m.ok)        # False
print(m.diagnostics[0].message)  # 'expected a body member'

Expected

ok=True — the metadata shorthand #feature = value should parse per SysML v2 formal/2026-03-02 §7.24 Table 22.

Spec citation

SysML v2 formal/2026-03-02 §7.24.1 (p.141), Table 22 (p.143): Verification Methods Compartment textual notation:
metadata VerificationMethod { kind = (VerificationMethodKind::inspect, ...); }

The #verificationMethod shorthand is the textual notation for this metadata block.

Context

Reported from Open-MBEE/toaster#19 while building an executable SysML v2 tutorial.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions