Xsd:time not working

I am trying to create a valid time variable with xsd:time in SPARQL but I am getting an error message. I am able to do the same for a date with xsd:date however.

select ?eventDate (xsd:date((strbefore(?eventDate, " "))) as ?date) (xsd:time(strafter(?eventDate, " ")) as ?time)

In previous posts, it was mentionned that future versions will support that function. When is it supposed to be supported?

Thanks

You do not need casting here. For creating typed literals from strings you can use the builtin strdt function as in (strdt(strafter(?eventDate, " "), xsd:time) as ?time).

Best,
Evren

There is a slight difference: Casting validates the lexical value and strdt doesn't. So using strdt is prone to data corruption. Ex:
SELECT ?time (datatype(?time) AS ?dt) { BIND (strdt("2019-0909", xsd:time) as ?time) }

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.