Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1679

Effective boolean value for "NaN"^^xsd:float/xsd:double should be false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.10.0
    • Jena 3.11.0
    • ARQ
    • None
    • Tested on Jena 3.9

    Description

      SPARQL 1.1 defines the [effective boolean value|https://www.w3.org/TR/sparql11-query/#ebv
      ] (EBV) of the special numeric value NaN as follows:

      If the argument is a numeric type or a typed literal with a datatype derived from a numeric type, and it has a valid lexical form, the EBV is false if the operand value is NaN or is numerically equal to zero; otherwise the EBV is true.

      Jena however treats it as true. The following queries both return true but should return false (using !(!expr)) to get the EBV):

      SELECT (!(!"NaN"^^<http://www.w3.org/2001/XMLSchema#double>) AS ?x) WHERE {}
      SELECT (!(!"NaN"^^<http://www.w3.org/2001/XMLSchema#float>) AS ?x) WHERE {}
      

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              cygri Richard Cyganiak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m