Skip to content

feat(DocumentQueries): Descendants takes relationships = true — walk ownership as KerML 8.3.2.1 defines it, ownedRelationship then the elements each relationship owns - #19

Merged
NicolasRouquette merged 1 commit into
mainfrom
feat/descendants-relationships
Nov 3, 2026
Merged

NicolasRouquette merged 1 commit into
mainfrom
feat/descendants-relationships

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #18. DocumentQueries::Descendants walks the owned members of each namespace, so a document query never sees the relationships that own a model's elements — memberships, specializations, typings, feature values, imports — nor the elements those own in turn (a connector's implied ends, a port definition's conjugated ~P, a satisfy usage's subject parameter). KerML 8.3.2.1 defines ownership through exactly those relationships (ownedRelationship, then ownedRelatedElement), and a reflection view needs them.

One optional parameter on the existing calc def, default false, so every existing query reads as before:

calc def Descendants {
    in source : Element[0..*] ordered;
    in maxDepth : Integer[0..1] default null;
    in relationships : Boolean[0..1] default false;   // new
    return result : Element[0..*] ordered;
}

relationships = true walks ownedRelationship, then the related elements each relationship owns, recursively to maxDepth; the doc comment states the semantics. .meta.json is regenerated (write-project-meta.py: the unit's checksum).

  • Semver impact: MINOR — a new optional parameter; no name or existing meaning changes.
  • Engine contract: unchanged — engine-contract.json lists DocumentQueries::Descendants by name only.
  • Matching OpenSysML change: the engine side (internal/doc/queryexec/operations.go, with a test walking a part definition's memberships, typings and connector ends) is ready on feat/descendants-relationships; its PR re-pins the vendored copy to this merge.
  • Validation: ./scripts/validate-libraries.sh on the pinned pilot, ./scripts/check-readme-table.sh, ./scripts/write-project-meta.py --check.

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/18ad47adf36f44e9b6824a4472f9678d
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/18ad47adf36f44e9b6824a4472f9678d?variant=devin
Requested by: @NicolasRouquette


Devin Review

…ownership as KerML 8.3.2.1 defines it, ownedRelationship then the elements each relationship owns

A document query could reach a model's elements but none of the relationships
that own them, nor the implied elements those own (connector ends, the
conjugated port definition, a satisfy subject). The parameter defaults to
false, so every existing query reads as before; the engine contract lists
Descendants by name only. Closes #18.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@NicolasRouquette
NicolasRouquette merged commit 93e34bf into main Nov 3, 2026
2 checks passed
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.

DocumentQueries::Descendants cannot reach the relationships that own a model's elements (ownedRelationship / ownedRelatedElement, KerML 8.3.2.1)

1 participant