Skip to content

[Query] Implement SPARQL 1.1 scalar built-in functions and casting operators #563

Description

@remiceres

Summary

Implement the standard library of SPARQL 1.1 scalar built-in functions, type checking, and XML Schema casting operators in core.next.query.


Objectives and Technical Scope

1. Standard Built-in Functions

  • String Functions: STRLEN, SUBSTR, UCASE, LCASE, STRSTARTS, STRENDS, CONTAINS, STRBEFORE, STRAFTER, ENCODE_FOR_URI, CONCAT, LANGMATCHES, REGEX, REPLACE.
  • Numeric Functions: ABS, ROUND, CEIL, FLOOR, RAND.
  • Date and Time Functions: NOW, YEAR, MONTH, DAY, HOURS, MINUTES, SECONDS, TIMEZONE, TZ.
  • Cryptographic Hash Functions: MD5, SHA1, SHA256, SHA384, SHA512.
  • Term Constructors and Accessors: IRI/URI, BNODE, STRDT, STRLANG, UUID, STRUUID, ISNUMERIC, IF, COALESCE.

2. Casting Operators

  • Implement casting functions matching XML Schema specifications: xsd:string, xsd:integer, xsd:decimal, xsd:double, xsd:float, xsd:boolean, xsd:dateTime.

3. Type Error Handling and Effective Boolean Value (EBV)

  • Standardize runtime TypeError emission and absorption per W3C specification inside FILTER, IF, and COALESCE.
  • Validate against official W3C SPARQL 1.1 test suites (functions, cast) in corese-w3c.

Dependencies

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requeststandard featureIssue related to an implementation based on W3C standards

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions