Skip to content

Export writes blank-node labels that its own Turtle parser rejects #1956

Closed

Description

@bplatz

Raised in review of #1940: #1940 (comment)

Problem

fluree export --format turtle writes blank-node labels verbatim, and so does N-Triples (write_turtle_iri_or_bnode in fluree-db-api/src/export.rs, around :790 and :1643). Labels minted by older imports contain / and :, which a Turtle BLANK_NODE_LABEL does not allow. The export of such a ledger is a document Fluree's own Turtle parser rejects.

#1940 unified the other RDF text writers on one rule (fluree-graph-ir::syntax::is_blank_node_label, with invalid labels hex-encoded behind an x), so a CONSTRUCT over the same data produces valid output. Export is the one writer left on its own policy.

Why it's its own change

The export writer keeps labels verbatim on purpose: an export has to round-trip. Hex-encoding changes the label text, so this needs a decision on what "round-trip" requires:

  • If re-import only needs the same graph shape, blank-node labels are document-scoped and hex-encoding is fine.
  • If re-import must give each blank node the same stored identifier (_:fdb-… / skolem id) it had, the encoding has to be reversible on import, or those labels need another form.

Changing it alters backup files, so it should be reviewed on its own rather than inside a feature PR.

Done when

  • Exported Turtle and N-Triples of a ledger with legacy blank-node labels parse with Fluree's Turtle parser.
  • Re-importing the export gives the round-trip behaviour decided above, with a test.

Activity

  1. added
    P3
    area:storage
    on Sep 26, 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:storage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions