Skip to content

A JSON-LD graph pattern naming a graph source without its branch panics in debug builds #2362

Open

Description

@bplatz

A JSON-LD graph pattern that names an R2RML graph source without its branch panics in debug builds. Release builds apply the default branch instead of panicking.

Repro

With a native ledger native-people:main and an R2RML graph source registered as local-people (so its id is local-people:main):

{ "from": "native-people:main", "select": ["?s", "?n"],
  "where": [["graph", "local-people", { "@id": "?s", "ex:name": "?n" }]] }
panicked at fluree-db-core/src/address_path.rs:30:5:
Non-canonical ledger id 'local-people' reached a storage path: expected 'name:branch'.

It behaves the same with and without the source in from-named.

Cause

The un-normalized name travels from the graph scope to a storage path:

GraphOperator::execute_in_graph → r2rml_mapping_for_rewrite → FlureeR2rmlProvider::compiled_mapping → Fluree::content_store

content_store builds a path from the id and asserts (debug only) that it is canonical name:branch. Nothing on that route normalizes a bare name.

Expected

The name is normalized (default branch applied) before it reaches the provider, or the query is refused with a 400, the same in debug and release builds. A debug-only assertion should not be the thing that distinguishes the two.

Notes

Found while reviewing #2314 and reproduced on main at the time, so it predates that PR. Not re-run since #2314's later changes; with those, a source outside the dataset is refused before it is read, so the case to re-check first is the one with the source in from-named.

Activity

  1. added
    bug
    P3
    area:query
    on Nov 12, 2026
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

    P3area:querybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions