1

This SUM aggregate function is not working. It gives no result.

select  (SUM(?p) as ?prcc) ?sune

where { 

?inl Sp:hasp ?p.

     ?inl Sp:hassuid ?supid.

?supid Sp:hassune ?sune.

}
GROUP BY ?sune

The data in "p" is in double format. So when i change my query to

select  (SUM(xsd:double(?p)) as ?prcc) ?sune

or select  (SUM(xsd:integer(?p)) as ?prcc) ?sune

It does not perform SUM on values with decimal point.

Ameya Deshpande
  • 3,580
  • 4
  • 30
  • 46
Rashmi Dubey
  • 11
  • 1
  • 2
  • 3
    Please show some sample triples – Tomasz Pluskiewicz Sep 14 '15 at 14:34
  • 3
    **`The data in "p" is in double format.** Do you mean the literals are actually datatyped literals with the datatype xsd:double, or that they're strings whose characters are suitable lexical forms for an xsd:double? As @TomaszPluskiewicz says, you need to show some data, or else we can't really help. – Joshua Taylor Sep 14 '15 at 14:43

1 Answers1

2
select  (SUM(?p))
WHERE
{
  VALUES (?p) {
         (10.5) 
         (20.5)
  }
}

I tried this on online editor SPARQL online editor it works fine..may be u can try it on your sample data.

Batman22
  • 376
  • 4
  • 25