Skip to content

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

Closed

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).

Activity

  1. added a commit that references this issue on Jul 17, 2026
    b319bb2
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions