You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON-LD value-to-term rules are implemented separately in each reader #2407
A JSON-LD value becomes an RDF term in three separate places:
the transaction parser: parse_literal_value_with_meta in fluree-db-transact/src/parse/jsonld.rs
the adapter behind a bulk import, rdf::parse and inline shapes: process_literal in fluree-graph-json-ld/src/adapter.rs
the JSON-LD where parser: parse_value_object, value_object_dtc and parse_object_value in fluree-db-query/src/parse/node_map.rs
Each rule about how a context term or a value object types a value has to be written into each of them. When one is missed, a where pattern written like the insert no longer matches what the insert stored, or two readers store the same document differently.
Six changes have had to edit the where side by hand to match the write side:
eac9be9: @vocab and @json coercion, term @language, null terms, @index maps
The two write-side readers drift apart as well. In #2393, an array @value with no @json or @vector type was refused by a transaction but silently dropped by the adapter, until the expander refused it for both.
Proposal
One function that turns a JSON-LD value under its term definition into a term, called by all three readers, so the next rule is a one-place change.
The where side has intentional differences, and the shared function needs to keep them (see docs/reference/compatibility.md):
A variable ("?v" or {"@value": "?v"}) keeps its term's datatype as a constraint.
A map stays a node pattern under an @index term.
A pattern on a term defined as null is refused.
Target next: three of the rules above (6e4d006, 14695d2, #2393) exist only there.
From #2033: differences that are deliberate, such as null as UNDEF in values but refused as a parameter, stay with the caller. #2356, #2357 and #2360 are each one more rule that would otherwise need writing into several of these.
Activity
bplatz commentedon Nov 20, 2026
Folding in #2033, which asks for the same shared term parser from the read side. Together, the readers that turn a JSON-LD value into a term are:
parse_literal_value_with_meta(fluree-db-transact/src/parse/jsonld.rs)rdf::parseand inline shapes:process_literal(fluree-graph-json-ld/src/adapter.rs)whereparser:parse_value_object,value_object_dtcandparse_object_value(fluree-db-query/src/parse/node_map.rs)valuesclause:parse_values_cell(fluree-db-query/src/parse/values.rs)Value::parse(fluree-db-sparql/src/params.rs)From #2033: differences that are deliberate, such as
nullas UNDEF invaluesbut refused as a parameter, stay with the caller. #2356, #2357 and #2360 are each one more rule that would otherwise need writing into several of these.