Andy Seaborne created JENA-1216:
-----------------------------------

             Summary: xsd:integer literals with leading/trailing whitespace not 
handled as values.
                 Key: JENA-1216
                 URL: https://issues.apache.org/jira/browse/JENA-1216
             Project: Apache Jena
          Issue Type: Bug
          Components: ARQ
    Affects Versions: Jena 3.1.0
            Reporter: Andy Seaborne
            Assignee: Andy Seaborne
             Fix For: Jena 3.1.1


This throws an exception:

{noformat}
        Node n = SSE.parseNode("' 1'^^xsd:integer") ;
        NodeValue.makeNode(n) ;
{noformat}

Once you know that, it's quite easy to cause the problem from SPARQL:

{noformat}
PREFIX :  <http://example/> .
PREFIX xsd:     <http://www.w3.org/2001/XMLSchema#>
# whitespace in the lexical form.
:s :p " 1"^^xsd:integer .
{noformat}
and any query with a FILTER that uses the value of the literal.
{noformat}
SELECT *
WHERE {
      ?s ?p ?o .
      FILTER ( ?o != 9 )
}
{noformat}
It affects xsd:integer and derived types, not other datatypes.

Because Turtle short form for integers does not generate this situation, it is 
masked to some extent.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to