Skip to content

JSON-LD crawl in a reasoning query: render the reasoned state instead of refusing under a view policy #2287

Open

Description

@bplatz

A JSON-LD graph crawl (select: {"?s": ["*"]}) in a reasoning query renders different facts depending on which path answers it.

  • Query-time reasoning: the crawl hydrates stored facts only, even for root. Under owl2rl, ex:ann (stored @type ex:Student, with ex:Student rdfs:subClassOf ex:Person) renders @type: ["Student"].
  • Served from a reasoning index: the same crawl renders @type: ["Student", "Person"], because the generation holds the derived facts.

Under a non-root view policy, a crawl in a reasoning query is currently refused with a 400 (apply_reasoning_to_executable in fluree-db-api/src/view/query.rs). Without the refusal, class policies would be judged on stored facts during hydration, so a deny on a derived class would miss the crawl.

Proposed: hydrate through the query's reasoned state, as typed Cypher node rendering now does (QueryResult.reasoned_overlay + GraphDb::reasoned). Single-view hydration already reads result.novelty. The dataset hydration path (query_connection, HTTP) needs reasoned views for each member. Once both paths render the reasoned state, lift the refusal.

Still to verify: whether a crawl with no where patterns materializes derived facts at all.

Activity

  1. added
    enhancement
    P2
    area:query
    on Nov 9, 2026
  2. bplatz commented on Nov 20, 2026

    @bplatz
    ContributorAuthor

    #2292 (merged into next 2026-11-13) handles single-graph hydration. Open for restricted multi-graph hydration, which is still unsupported.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:queryenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions