Skip to content

fluree export --format trig / --format nquads omit named graphs entirely #1847

Open

Description

@aaj3f

Found while chasing something unrelated in #1838, so this isn't caused by that PR and isn't fixed by it.

fluree export --format trig and --format nquads silently omit named graphs. Both formats exist more or less specifically to carry named graphs, so an export → import round-trip loses every one of them, with no error and nothing in the output to suggest anything is missing.

Repro

No import involved anywhere — this is an ordinary SPARQL INSERT DATA into a named graph, plus one default-graph triple for contrast:

$ fluree update -l exp:main --format sparql -e \
    'INSERT DATA { GRAPH <http://example.org/g1> { <ex:s> <ex:p> 42 } }'
$ fluree update -l exp:main --format sparql -e \
    'INSERT DATA { <ex:default1> <ex:p> 7 }'
$ fluree index exp:main

The data is demonstrably there and queryable:

$ fluree query -l exp:main --sparql 'SELECT ?g ?s WHERE { GRAPH ?g { ?s ?p ?o } }'
2 rows:  "default" / ex:default1
         http://example.org/g1 / ex:s

But:

$ fluree export -l exp:main --format trig     # -> ex:default1 only; zero occurrences of g1
$ fluree export -l exp:main --format nquads   # -> ex:default1 only; zero occurrences of g1

I haven't traced where in the export path the graph dimension gets dropped, so I don't have a file:line for the cause — the above is all black-box. Happy to dig further if it'd help, but it seemed worth filing before the detail gets lost.

Why it seems worth more than a nit

The two obvious consequences are that a TriG/N-Quads export isn't a faithful serialization of the ledger, and that export → import silently loses data rather than failing. The second is the one that worries me more — a round-trip that drops rows without an error is the kind of thing someone only discovers well after the fact.

It also interacts with #1838's reserved-graph work in a small way worth noting: that PR establishes that #config and #txn-meta are reachable by full IRI and that user named graphs route unchanged, but if export can't carry named graphs at all then none of that survives a round-trip either.

Not urgent as far as I can tell, and I don't think anything in flight depends on it — but it seems like something we'd want the formats to actually do.

Activity

  1. added
    bug
    area:cli
    on Sep 15, 2026
  2. aaj3f commented on Sep 18, 2026

    @aaj3f
    ContributorAuthor

    Reopening — this closed when #1875 merged, but its defect is still reachable on the CLI's default path.

    #1875 fixed the export side, and on the direct path the omission is reported. But when a local server is configured, fluree export takes the remote route, and that route never reports what it dropped:

    • report_rdf_stats is called only inside run_local_rdf (fluree-db-cli/src/commands/export.rs:521). run_remote_rdf (:411) returns without calling it.
    • RemoteClient::export_rdf returns the response body as bytes, so the server's omission headers are discarded before the CLI could report them.

    So fluree export mydb --format trig against a running server still drops named graphs and says nothing — the exact behaviour this issue describes. This was flagged in review of #1875 and sequenced as the last item, so the PR merged before it was fixed, and Fixes #1847 closed the issue on merge.

    A follow-up PR will carry the fix and re-link here. Reopening in the meantime so the issue stays true in the interval.

  3. reopened this on Sep 18, 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

    area:clibug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions