You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Richard Cyganiak (JIRA)" <ji...@apache.org> on 2019/03/25 15:19:00 UTC

[jira] [Closed] (JENA-1694) Lexical form for unsigned numeric types should not include sign

     [ https://issues.apache.org/jira/browse/JENA-1694?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Cyganiak closed JENA-1694.
----------------------------------
    Resolution: Invalid

Ok, thanks.

The SPARQL 1.1 spec links to the old XSD spec in the Operand Datatypes section, and leaves it in general a bit unclear which version of XSD applies. But the correct answer certainly _should_be XSD 1.1.

> Lexical form for unsigned numeric types should not include sign
> ---------------------------------------------------------------
>
>                 Key: JENA-1694
>                 URL: https://issues.apache.org/jira/browse/JENA-1694
>             Project: Apache Jena
>          Issue Type: Bug
>    Affects Versions: Jena 3.10.0
>            Reporter: Richard Cyganiak
>            Priority: Minor
>
> According to the XSD spec, the lexical space for the four unsigned numeric types available in SPARQL (unsignedLong, unsignedInt, unsignedShort, unsignedByte) consists of a sequence of digits only. It does not start with a sign. So, "+1", "+0" or "-0" should not be valid lexical forms for these datatypes.
> Jena accepts all of these lexical forms for all of the unsigned datatypes.
> For example, the following query returns {{"+1"^^xsd:unsignedLong}} but should return no binding for {{?x}}:
> {noformat}
> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> SELECT (xsd:unsignedLong("+1") AS ?x) {}
> {noformat}
> This returns true but should return false:
> {noformat}
> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> SELECT (isNumeric("-0"^^xsd:unsignedByte) AS ?x) {}
> {noformat}
> References:
> - [unsignedLong|https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#unsignedLong-lexical-representation]
> - [unsignedInt|https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#unsignedInt-lexical-representation]
> - [unsignedShort|https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#unsignedShort-lexical-representation]
> - [unsignedByte|https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#unsignedByte-lexical-representation]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)