Skip to content

feat(next): connect KGRAM producer to StorageManager#482

Open
remiceres wants to merge 9 commits into
feature/corese-nextfrom
feature/472-bridge-storage-manager-producer
Open

feat(next): connect KGRAM producer to StorageManager#482
remiceres wants to merge 9 commits into
feature/corese-nextfrom
feature/472-bridge-storage-manager-producer

Conversation

@remiceres

@remiceres remiceres commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR completes the storage-backed SPO/BGP path for the next KGRAM pipeline.

KGRAM can now query triples from the new StorageManager, receive storage results as KGRAM edges, and materialize simple BGP mappings.

Changes

  • Added StorageManagerProducer

    • Translates KGRAM triple patterns into storage StatementPattern queries.
  • Added StorageManagerEdge

    • Wraps storage Statement results as next KGRAM Edge objects.
  • Added StorageManagerKgramValues

    • Centralizes conversions between storage Value, Corese IDatatype, and next KGRAM Node.
  • Added BGP mapping support

    • getMappings(...) now materializes basic graph patterns and joins repeated variables.
  • Fixed predicate handling in the AST bridge

    • Ensures variable predicates such as ?s ?p ?o are correctly represented for KGRAM.
  • Fixed graph/dataset handling

    • Propagates GRAPH <g> and active FROM restrictions to storage contexts.
  • Fixed KGRAM fail semantics

    • Restores the expected behavior for expressions marked as always failing.
  • Extended tests

    • Covers SPO enumeration, predicates, invalid RDF roles, graph restrictions, BGP joins, and parser-to-storage execution.

@remiceres remiceres self-assigned this Jul 6, 2026
@remiceres remiceres added the Refactoring Issue created during the 2025 refactoring effort label Jul 6, 2026
@remiceres remiceres requested a review from Copilot July 6, 2026 14:17
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Overall Project 50.72% -0.18% 🍏
Files changed 48.94%

File Coverage
CoreseAstQueryBuilder.java 90.06% 🍏
StorageManagerEdge.java 57.02% -42.98%
StorageManagerProducer.java 46.99% -53.01%

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Test Results

  432 files    432 suites   20s ⏱️
2 462 tests 2 462 ✅ 0 💤 0 ❌
2 476 runs  2 476 ✅ 0 💤 0 ❌

Results for commit 0cffbf6.

♻️ This comment has been updated with latest results.

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

Implements a new KGRAM Producer backed by the Corese-next StorageManager, enabling query evaluation over the new storage layer without relying on the legacy Graph implementation (Issue #472).

Changes:

  • Added StorageManagerProducer to translate KGRAM triple patterns into StatementPattern queries against StorageManager.
  • Added StorageManagerEdge as an Edge view over storage-layer Statement results.
  • Updated CoreseAstQueryBuilder to mark compiled expressions as evaluable for execution, and added dedicated tests covering the new producer behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/test/java/fr/inria/corese/core/next/query/kgram/tool/StorageManagerProducerTest.java Adds integration-style tests validating edge enumeration, context handling, and evaluation through Eval and the SPARQL bridge.
src/main/java/fr/inria/corese/core/next/query/kgram/tool/StorageManagerProducer.java Introduces a StorageManager-backed KGRAM producer and basic BGP mappings materialization.
src/main/java/fr/inria/corese/core/next/query/kgram/tool/StorageManagerEdge.java Adds an Edge adapter over storage Statement results for KGRAM consumption.
src/main/java/fr/inria/corese/core/next/query/impl/sparql/bridge/CoreseAstQueryBuilder.java Ensures compiled WHERE expressions are marked for evaluation when building runtime Query objects.

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

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Overall Project 50.75% -0.18% 🍏
Files changed 48.2%

File Coverage
CoreseAstQueryBuilder.java 91.01% 🍏
StorageManagerEdge.java 57.02% -42.98%
StorageManagerProducer.java 46.88% -53.13%

@remiceres remiceres marked this pull request as draft July 9, 2026 08:55
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Overall Project 50.74% -0.18% 🍏
Files changed 47.89%

File Coverage
StorageManagerEdge.java 57.02% -42.98%
StorageManagerProducer.java 46.88% -53.13%
Eval.java 25.05% 🍏

@remiceres remiceres marked this pull request as ready for review July 9, 2026 15:34
@remiceres

Copy link
Copy Markdown
Contributor Author

Salut Abdessamad, j'ai fini d'étudier le code de la PR, d'ajouter les javadocs explicatives (sur le rôle de getMappings, join, et le BindingEnvironment/BindingSet) et de faire les correctifs. La PR est prête pour ta revue. Merci !

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Overall Project 50.76% -0.17% 🍏
Files changed 51.34%

File Coverage
StorageManagerEdge.java 57.02% -42.98%
StorageManagerProducer.java 50.67% -49.33%
Eval.java 25.05% 🍏

@remiceres remiceres marked this pull request as draft July 9, 2026 15:36
@remiceres

Copy link
Copy Markdown
Contributor Author

Oups, je la repasse temporairement en draft pour terminer quelques vérifications demain matin avant la revue finale. À demain !

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Overall Project 50.76% -0.17% 🍏
Files changed 51.34%

File Coverage
StorageManagerEdge.java 57.02% -42.98%
StorageManagerProducer.java 50.67% -49.33%
Eval.java 25.05% 🍏

@github-actions

Copy link
Copy Markdown
Overall Project 50.76% -0.17% 🍏
Files changed 51.34%

File Coverage
StorageManagerEdge.java 57.02% -42.98%
StorageManagerProducer.java 50.67% -49.33%
Eval.java 25.05% 🍏

@github-actions

Copy link
Copy Markdown
Overall Project 50.79% -0.14% 🍏
Files changed 59.21%

File Coverage
StorageManagerEdge.java 73.47% -26.53% 🍏
StorageManagerKgramValues.java 69.92% -30.08% 🍏
StorageManagerProducer.java 56.41% -43.59%
Eval.java 25.05% 🍏

@remiceres remiceres marked this pull request as ready for review July 10, 2026 12:58
@remiceres remiceres requested a review from Copilot July 10, 2026 12:58

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

@github-actions

Copy link
Copy Markdown
Overall Project 50.79% -0.14% 🍏
Files changed 59.21%

File Coverage
StorageManagerEdge.java 73.47% -26.53% 🍏
StorageManagerKgramValues.java 69.92% -30.08% 🍏
StorageManagerProducer.java 56.41% -43.59%
Eval.java 25.05% 🍏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactoring Issue created during the 2025 refactoring effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BRIDGE] Create Producer implementation to connect KGRAM to the new StorageManager

2 participants