Skip to content

#470 [BRIDGE] Add Minus/Optional conversion#483

Merged
remiceres merged 2 commits into
feature/corese-nextfrom
feature/470-bridge-add-minusoptional-conversion
Jul 10, 2026
Merged

#470 [BRIDGE] Add Minus/Optional conversion#483
remiceres merged 2 commits into
feature/corese-nextfrom
feature/470-bridge-add-minusoptional-conversion

Conversation

@abdessamad-abdoun

Copy link
Copy Markdown
Contributor

No description provided.

@abdessamad-abdoun abdessamad-abdoun self-assigned this Jul 7, 2026
@abdessamad-abdoun abdessamad-abdoun linked an issue Jul 7, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Test Results

  431 files    431 suites   21s ⏱️
2 464 tests 2 464 ✅ 0 💤 0 ❌
2 478 runs  2 478 ✅ 0 💤 0 ❌

Results for commit 09ee2bd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Overall Project 50.21% 🍏

There is no coverage information present for the Files changed

@remiceres

Copy link
Copy Markdown
Contributor

I added integration coverage for the full next bridge path and fixed a MINUS scoping issue found by those tests. Variables that only appear inside MINUS are no longer resolved as visible body variables for SELECT, ORDER BY, DESCRIBE, or CONSTRUCT, while OPTIONAL variables remain visible as expected.

@github-actions

Copy link
Copy Markdown
Overall Project 50.21% 🍏
Files changed 100% 🍏

File Coverage
CoreseAstQueryBuilder.java 91.05% 🍏

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens MINUS scoping semantics in the SPARQL bridge so that variables that occur only inside MINUS { ... } are treated as internal evaluation nodes (not visible/projectable bindings), and it adds tests to lock down OPTIONAL/MINUS compilation structure and scoping behavior.

Changes:

  • Update CoreseAstQueryBuilder to resolve “visible” variables from the outer pattern scope only (excluding MINUS/EXISTS-collected query nodes) for projection/DESCRIBE/ORDER BY/CONSTRUCT-template variable reuse.
  • Add/extend unit tests covering OPTIONAL/MINUS compilation shape and the visibility rules (SELECT *, explicit projection, ORDER BY, DESCRIBE, CONSTRUCT template).
  • Introduce a dedicated minus-scope test validating how KGRAM collects pattern nodes vs query nodes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/java/fr/inria/corese/core/next/query/impl/sparql/bridge/CoreseAstQueryBuilder.java Restricts variable resolution to nodes visible from the outer pattern scope (avoids leaking MINUS-only variables into projection, ORDER BY, DESCRIBE, and template node reuse).
src/test/java/fr/inria/corese/core/next/query/impl/sparql/bridge/WhereCompilerTest.java Adds tests ensuring OPTIONAL/MINUS are compiled with the expected grouping/associativity and that OPTIONAL-local filters stay inside the OPTIONAL right-hand side.
src/test/java/fr/inria/corese/core/next/query/impl/sparql/bridge/CoreseAstQueryBuilderTest.java Adds tests asserting SELECT * / explicit projection / ORDER BY behavior for MINUS-only vs OPTIONAL-introduced variables.
src/test/java/fr/inria/corese/core/next/query/impl/sparql/bridge/CoreseAstQueryBuilderMinusScopeTest.java New test verifying MINUS-only variables are collected as query nodes (not pattern nodes), while OPTIONAL variables remain in the outer pattern scope.
src/test/java/fr/inria/corese/core/next/query/impl/sparql/bridge/CoreseAstQueryBuilderDescribeTest.java Adds regression coverage: DESCRIBE must reject variables only occurring in MINUS.
src/test/java/fr/inria/corese/core/next/query/impl/sparql/bridge/CoreseAstQueryBuilderConstructTest.java Adds regression coverage: template variables that only occur in MINUS remain “fresh” template vars and must not reuse internal MINUS nodes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@remiceres remiceres merged commit 25941bd into feature/corese-next Jul 10, 2026
3 checks passed
@remiceres remiceres deleted the feature/470-bridge-add-minusoptional-conversion branch July 10, 2026 15:56
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.

[BRIDGE] Add Minus/Optional conversion

3 participants