Uploaded image for project: 'Marmotta'
  1. Marmotta
  2. MARMOTTA-627

Arithmetic operation in Sparql query not working properly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.0
    • Component/s: KiWi Triple Store
    • Labels:
    • Environment:
    • Flags:
      Important

      Description

      Hy,

      I'm trying to calculate some distances and I need to make some arithmetic operations with some numbers below 1.

      Unfortunately, this kind of operation seems not to work with the latest version of Apache Marmotta (I'm using Apache Marmotta built from repo).

      For example, the following query returns -39.5!!!!

      SELECT  (  (4.5-4.4)*0.1 as ?c)  WHERE {}

      I've tried many combinations with xsd:decimal, xsd:float, xsd:double, but the answer is or 1.000 or -39.5.

      Other examples:

      SELECT  (0.1*0.1 as ?c) WHERE {}   => 1.00
      SELECT  ( 0.10*0.01 as ?c) WHERE {} => 10.0 
      SELECT  ( 1.00*3.10 as ?c) WHERE {} => 0.32258064516129032258
      SELECT  ( 2.00*4.00 as ?c) WHERE {} => 0.500
      SELECT (xsd:decimal(2.80)*xsd:decimal(3.00) as ?c) WHERE {} => 0.9333

      Thank you,

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                wikier Sergio Fernández
                Reporter:
                banuj Rinciog Octavian
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 48h
                  48h
                  Remaining:
                  Remaining Estimate - 48h
                  48h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified