Skip to content

XSD datetimes with trailing zeros are loosing precision #524

@marcelotto

Description

@marcelotto

First of all, a big thank you for this wonderful project.

I encountered the following misbehavior: when storing an XSD datetime trailing zeros on the microseconds are cut off, leading to a different value than the original.

Current behavior

with oxigraph_server 0.3.16

PREFIX ex: <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

INSERT DATA {
  ex:S ex:p "2023-06-04T20:36:33.100000"^^xsd:dateTime .
}
PREFIX ex: <http://example.org/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT * WHERE {
  ex:S ex:p ?obj .
}

Results:

{
  "head": {
    "vars": [
      "obj"
    ]
  },
  "results": {
    "bindings": [
      {
        "obj": {
          "type": "literal",
          "value": "2023-06-04T20:36:33.1",
          "datatype": "http://www.w3.org/2001/XMLSchema#dateTime"
        }
      }
    ]
  }
}

Expected behavior

{
  "head": {
    "vars": [
      "obj"
    ]
  },
  "results": {
    "bindings": [
      {
        "obj": {
          "type": "literal",
          "value": "2023-06-04T20:36:33.100000",
          "datatype": "http://www.w3.org/2001/XMLSchema#dateTime"
        }
      }
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions