Repository navigation
Description
The JSON-LD expander treats an explicit value object like a bare value: it gives it the context's default @language, and the datatype of the term it sits under. JSON-LD 1.1 applies both only to bare strings and scalars (value expansion); a value object is taken as written.
Default language
{
"@context": {"@language": "en", "ex": "http://example.org/"},
"@id": "ex:s",
"ex:t": ["plain", {"@value": "obj"}]
}Both values are stored tagged @en. Expected: plain tagged @en, obj an untagged xsd:string. {"@value": "..."} is the standard way to opt one string out of the default language, and it does not work. A term's "@language": null does not reach value objects either.
Term datatype
{
"@context": {"ex": "http://example.org/", "n": {"@id": "ex:n", "@type": "http://www.w3.org/2001/XMLSchema#integer"}},
"@id": "ex:s",
"n": {"@value": "5"}
}5 is stored as an xsd:integer. Expected: the string "5".
Where
parse_value_object in fluree-graph-json-ld/src/expand.rs: the None arms that fall back to entry.type_ and to context.language. The test value_object_language_overrides_the_term_datatype assumes the current datatype behavior.
The two halves should change together, so value objects are consistently taken as written.
Why 5.0
Documents that work today would write different values (plain strings where they wrote language-tagged ones, strings where they wrote typed values), and data already stored would stop matching the same document on delete or upsert. It needs a Behavior changes entry and a repair note in docs/reference/compatibility.md.
Found in review of #2283.
Activity
bplatz commentedon Nov 22, 2026
Fixed on
nextby #2393 (merged 2026-11-15, e448092). A value object now takes neither the default@languagenor its term's@type, in transactions, imports and JSON-LD queries alike. A PR intonextdoesn't close the issues it fixes, so this one is closed by hand.