Skip to content

ST6RI-921 Invalid feature references are allowed in filter expressions#743

Merged
seidewitz merged 5 commits intomasterfrom
ST6RI-921
Apr 2, 2026
Merged

ST6RI-921 Invalid feature references are allowed in filter expressions#743
seidewitz merged 5 commits intomasterfrom
ST6RI-921

Conversation

@seidewitz
Copy link
Copy Markdown
Member

@seidewitz seidewitz commented Mar 17, 2026

This PR removes an exception made in the Pilot Implementation that allowed invalid feature references in filter expressions.

Background

Both the KerML Specification (in 7.4.14 Packages) and the SysML Specification (in 7.5.4 Import Filtering) show examples of referencing features using a qualified name notation. For example:

filter @Annotations::ApprovalAnnotation and
    Annotations::ApprovalAnnotation::approved and
    Annotations::ApprovalAnnotation::level > 1;

This example has subexpressions that are feature reference expressions for non-package-level features, such as Annotations::Approval::approved. However, filter expressions are at package level (have no featuring type), and therefore do not have access to non-package-level features.

This should have caused a checkConnectorTypeFeaturing error on the implied binding connector between the referent feature and the expression result. But the Pilot Implementation had an explicit check coded in FeatureReferenceExpressionAdapter::addReferenceConnector to not add the binding connector if the expression was in a filter, so no error was reported. There is no such exception in the normative metamodel, despite the examples given in Clause 7 of the specifications (see also KERML11-183 on the specification inconsistency).

Changes

Updated FeatureReferenceExpressionAdapter::addReferenceConnector to remove the exception for filter expressions.

Feature expressions such as in the example above now cause errors. The corrected version of the example is:

filter @Annotations::ApprovalAnnotation and
    (as Annotations::ApprovalAnnotation).approved and
    (as Annotations::ApprovalAnnotation).level > 1;

@seidewitz seidewitz added this to the 2026-02 milestone Mar 17, 2026
@seidewitz seidewitz self-assigned this Mar 17, 2026
@seidewitz seidewitz added the bug Something isn't working label Mar 17, 2026
@seidewitz seidewitz requested a review from hpdekoning March 17, 2026 20:10
Copy link
Copy Markdown
Member

@hpdekoning hpdekoning left a comment

Choose a reason for hiding this comment

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

Looks good to merge.

@seidewitz seidewitz merged commit 4de3265 into master Apr 2, 2026
1 check passed
@seidewitz seidewitz modified the milestones: 2026-02, 2026-03 Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants