[ 
https://issues.apache.org/jira/browse/JENA-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17514606#comment-17514606
 ] 

Andy Seaborne commented on JENA-2318:
-------------------------------------

"02022-01-02" is not legal as xsd:date.

If more than 4 digits must start with 1-9, not zero (makes the date canonical).

"-2022-01-02"^^xsd:dateTime has no part time so it is not an xsd:date. Cast it. 
{{xsd:dateTime("-2022-01-02"^^xsd:date)}} 

 
This is in your own comment on schemaorg/schemaorg/issues/1781 so why is it a 
bug?

> jena rejects some valid xsd:date literals
> -----------------------------------------
>
>                 Key: JENA-2318
>                 URL: https://issues.apache.org/jira/browse/JENA-2318
>             Project: Apache Jena
>          Issue Type: Bug
>            Reporter: Vladimir Alexiev
>            Priority: Major
>
> (related to https://github.com/schemaorg/schemaorg/issues/1781)
> On a query like this:
> {noformat}
> PREFIX schema: <http://schema.org/>
> PREFIX xsd:    <http://www.w3.org/2001/XMLSchema#>
> select * {
>     bind("2022-01-01"^^schema:Date < "02022-01-02"^^schema:Date as ?x1)
>     bind(str("2022-01-01"^^schema:Date) < str("02022-01-02"^^schema:Date) as 
> ?x2)
>     bind("2022-01-01"^^xsd:date < "02022-01-02"^^xsd:date as ?x3)
>     bind("1"^^schema:Integer < "02"^^schema:Integer as ?x4)
>     bind(str("1"^^schema:Integer) < str("02"^^schema:Integer) as ?x5)
>     bind("1"^^xsd:integer < "02"^^xsd:integer as ?x6)
> }
> {noformat}
> - http://sparql.org/sparql.html returns UNDEF for ?x3
> - arq returns 
> {noformat}
> WARN  NodeValue       :: Datatype format exception: "02022-01-02"^^xsd:date
> {noformat}
> But according to https://en.wikipedia.org/wiki/ISO_8601#Years, one can use 
> more than 4 digits (to accommodate years >10000).
> Negative years are also allowed, but sparql.org returns UNDEF for comparison 
> of "-2022-01-02"^^xsd:dateTime



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to