Skip to content

Enhance query describe to include metadata attributes in Summary#45

Merged
Malcolmnixon merged 1 commit into
mainfrom
feature/describe-metadata-attributes
Jul 19, 2026
Merged

Enhance query describe to include metadata attributes in Summary#45
Malcolmnixon merged 1 commit into
mainfrom
feature/describe-metadata-attributes

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request extends the describe query verb in SysML2Tools to include applied metadata annotations in its output. It updates both the implementation and documentation to ensure that metadata annotations—along with their attributes—are surfaced in the summary lines, and adds comprehensive tests to verify correct rendering in both Markdown and JSON formats.

Enhancements to the describe verb:

  • The describe verb now reports applied metadata annotations for an element, including:
    • Bare annotations as "Metadata {Type}".
    • Scalar attributes (boolean, number, string) as "Metadata {Type}.{Attribute}: {value}", with appropriate formatting (e.g., booleans as true/false, numbers in invariant culture, strings unquoted).
    • Non-scalar or unsupported attribute values fall back to their raw source text and are never dropped. [1] [2]

Documentation updates:

  • All relevant user, design, and requirements documentation now describes the inclusion and formatting of metadata annotations in the describe output, both in prose and tabular summaries. [1] [2] [3] [4] [5] [6] [7]

Test coverage improvements:

  • Adds targeted tests to verify:
    • Reporting of bare metadata annotations.
    • Rendering of scalar and non-scalar attribute values.
    • Handling of multiple metadata annotations on a single element.
    • Consistency of summary lines in both Markdown and JSON outputs.
  • Documents these tests and their requirements traceability in the verification docs. [1] [2]

Internal code changes:

  • Introduces the FormatMetadataAttributeValue helper method to encapsulate correct formatting of metadata attribute values.
  • Adds necessary using directives for culture-aware formatting and JSON serialization in tests. [1] [2]

These changes ensure that applied metadata is fully and correctly represented in the describe output, improving traceability and completeness for users.

Query describe now emits Metadata {Type}/{Type}.{Attribute}: {value} lines
in the Summary output for SysmlMetadataNode instances attached to an
element's Children, mirroring the existing Comment/Documentation
annotation lines. Covers scalar (Boolean/Number/String) attribute values,
list/unsupported attribute values via raw-text fallback, bare metadata
with no attributes, and multiple metadata annotations on the same
element. Purely additive to Summary; Children/Entries semantics and
existing Comment/Documentation/Supertypes/Typing output are unchanged.

Adds 5 unit tests to QueryVerbsTests.cs covering scalar attributes,
list-valued fallback, no-metadata regression, bare metadata, multiple
annotations, and JSON format shape parity.

Updates design, verification, reqstream, and user guide docs for the
Query subsystem describe verb to document the new behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant