Skip to content

query: datatype-aware =/!= for stored language-tagged literals (§17.4.1.7) #1468

Closed

Description

@aaj3f

Deferred from PR #1462 review (O1); documented D5b limitation. lit_to_comparable (fluree-db-query/src/eval.rs:463) maps a stored LangTag(_) literal to a bare ComparableValue::String, dropping the tag. So FILTER(?a = ?b) with stored "x"@en, "x"@fr collapses both to String("x") → true (should be false per §17.4.1.7), while the constant form FILTER("x"@en = "x"@fr) correctly returns false via the (Lang,Lang) arm in compare.rs. The lang_parts/EqKind::Lang machinery is dead for stored data, and PR-X2 newly makes constants and stored data disagree.

Why deferred: X2's documented bet (eval.rs:458-462) — carrying the tag through would break every string builtin (CONTAINS/REPLACE/…) that assumes plain String.

Fix direction: route stored lang-tagged literals to a LangTag-carrying TypedLiteral at the eval boundary while keeping the string builtins tag-transparent (or teach them to strip the tag).

Acceptance: stored "x"@en = "x"@fr → false; "x"@en = "x"@en → true; CONTAINS/REPLACE/etc. unaffected.

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