Skip to content

JSON-LD: a @json-typed term drops null and ignores a @list container #2357

Open

Description

@bplatz

Two edge cases of a term typed "@type": "@json", where the expander departs from JSON-LD 1.1:

  1. null is dropped. "p": null under a @json term writes nothing. In the expansion algorithm the @json step runs before the step that drops a null value, so the result is the JSON literal null. In parse_node_value (fluree-graph-json-ld/src/expand.rs) the JsonValue::Null arm runs before the @json arm. Moving the @json arm first also needs a Value::Null case in the rdf:JSON arm of process_literal (fluree-graph-json-ld/src/adapter.rs), which bulk import goes through.

  2. A @list container is ignored. With "@type": "@json", "@container": "@list", "p": [1, 2] is stored as one JSON literal outside any list. The spec result is a list of one element holding the literal. The @json arm returns before the array arm's list wrapping.

Both are obscure. A where pattern under the same term should mirror whatever the insert side writes (parse_property in fluree-db-query/src/parse/node_map.rs).

Found in review of #2283.

Activity

  1. added
    bug
    P3
    area:sparql
    on Nov 11, 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:sparqlbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions