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
Discovered during the review of #1581 (graph-map refusals); kept out of that PR because it is object maps, not graph maps.
A constant literal object loses its datatype at mapping load. constant_from_term in fluree-db-r2rml/src/loader/extractor.rs builds ConstantValue::Literal { datatype: None, .. } for every literal (there is a standing // TODO: extract datatype), so both spellings below mint a plain string:
extract_object_map does read a sibling rr:datatype, but returns through constant_from_term on the rr:constant path without passing it, so rr:objectMap [ rr:constant "5" ; rr:datatype xsd:integer ] is dropped the same way. The language tag is kept, so "x"@en survives while "5"^^xsd:integer does not.
Downstream, materialize_object_from_batch (materialize/term.rs) calls object_map_dtc(None, None) and emits an untyped literal, and ledger_info.rs reports every constant literal as xsd:string. So the value is stored and compared as a string on every surface: the virtual query path, the tracking materializer, and the twin builder. A typed constant only ever works when the mapping is built programmatically with the datatype set.
Fix sketch
constant_from_term carries the literal's own datatype from Term::Literal { datatype, .. } (plain strings stay None so nothing that works today changes).
On the rr:constant object path, apply the R2RML rule for a sibling rr:datatype (the spec restricts datatype overrides to column- and template-valued term maps; decide whether to refuse or apply it, and say so in the error or docs).
Twin tests on both surfaces per repo convention: an extractor test for each spelling, plus a query-path and a materialize assertion that the object comes back typed.
Activity