Skip to content

feat(queryexec): WhereType exact keeps only the elements whose own metaclass is named - #1689

Merged
NicolasRouquette merged 5 commits into
developfrom
feature/wheretype-exact
Oct 29, 2026
Merged

NicolasRouquette merged 5 commits into
developfrom
feature/wheretype-exact

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What and why

WhereType(type = "PartUsage") keeps everything conforming to the type: subclasses of the metaclass and the model's own definitions/usages. A reflective walk over the metamodel (Open-MBEE/qvts reflection.sysml, one query per concrete metaclass) needs each element under exactly one metaclass, so WhereType now takes exact = true — declared in Open-MBEE/OpenSysML-Extensions-Library#15 (merged) — and keeps only the rows whose own metaclass is one of the named ones:

// evaluateWhereType
if (exact && e.valueIsExactly(value, test)) || (!exact && e.valueIsA(value, test)) { … }

// valueIsExactly: Model.MetaclassOf(row) is the named metaclass by identity (so a transition is a
// TransitionUsage, and "SysML::Systems::PartUsage" names the same metaclass as "PartUsage");
// a type of the model is never kept.

Unknown-classification reporting is unchanged (a name that is neither a metamodel type nor resolvable is still the typed error). The default is untouched, so no existing query changes meaning.

Dependency: the vendored extension libraries are pinned to main's merge commit of #15, 1ef079deaa98ff8be988ab7dea2f7a8c0640fb22 (scripts/extension-libraries-pin.sh), which declares the parameter; nothing upstream is pending.

Specification basis

OpenSysML DocumentQueries surface (Extensions Library), not an OMG clause; no row of docs/project/spec-compliance.md moves.

How it was verified

  • TestExecuteWhereTypeExactKeepsOnlyTheNamedMetaclass (internal/doc/queryexec/wheretype_exact_test.go): type = "Usage" keeps every usage by default and nothing with exact; ("PartUsage", "ItemUsage"), exact = true keeps the part and the item and not the attribute or port; a model type (Heavy) with exact keeps nothing; "SysML::Systems::PartUsage" keeps the part; in a state machine "TransitionUsage" keeps the transition and "StateUsage" the two states.
  • go test ./internal/doc/queryexec ./internal/ir/queryplan, go vet, gofmt -l clean; scripts/sync-extension-libraries.sh --check in sync with the pin.
  • Cookbook (docs/manual/query-cookbook.md) says what exact keeps; changelog fragment changes/unreleased/wheretype-exact.added.md.

Checklist

  • make test and make lint pass locally (targeted packages; the full tier runs in CI)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (none moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

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-ai-integration Bot and others added 2 commits October 29, 2026 15:10
…taclass is named

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…ary feature/wheretype-exact (b6784f23), which declares WhereType exact

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

…-Extensions-Library#15 (WhereType exact)

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

This comment was marked as resolved.

…etaclassOf) with the named one by identity — transitions are TransitionUsages, a qualified metaclass name is the metaclass

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
…on libraries

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
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.

2 participants