Skip to content

DATATYPE()/LANG() reject non-variable arguments #1440

Description

@aaj3f

eval/rdf.rs:58-62 bails unless the argument is a bare Expression::Var; LANG (eval/string.rs:115-134) silently returns "" for expression arguments. FILTER(datatype(?a + ?b) = xsd:integer) and datatype("foo"@en) fail. 29 W3C tests and any user composing expressions inside these builtins are affected.

Fix: evaluate the argument to a value, read its datatype/lang, type-error on non-literals — SPARQL-scoped per decision D-12 (the @id extension on the JSON-LD surface is deliberate and stays). Roadmap PR-X1 (D2/D2b).

Found and verified by the W3C SPARQL burn-down audit (PR #1437; docs/audit/burn-down/ROADMAP.md §5 on branch test/sparql-testsuite-full-coverage).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions