I have this sparql query:
SELECT DISTINCT (COUNT(?bw) AS ?total) (COUNT(?bw_bad) AS ?total_bad) WHERE
{
{
SELECT ?bw WHERE
{
?bw unt:has_bwid ?id
}
}
UNION
{
SELECT ?bw_bad WHERE
{
?bw_bad unt:has_rbdname ?rbd_name_bad .
?bw_bad unt:has_concie_0 ?concie_0 .
FILTER(?concie_0 > 40)
}
}
}
which gives:
total total_bad
"2155"^^<http://www.w3.org/2001/XMLSchema#integer> "46"^^<http://www.w3.org/2001/XMLSchema#integer>
I would like to calculate the percentage of them, which would give (46 / 2155 * 100) 2.13%. How can I do it? I do not care about performance.
My attempt:
SELECT ((COUNT(?bw_bad) AS ?total_bad)/(COUNT(?bw) AS ?total)*100) WHERE
which gives this syntax error:
Encountered " "as" "AS "" at line 10, column 34. Was expecting one of: ")" ... "=" ... "!=" ... ">" ... "<" ... "<=" ... ">=" ... "||" ... "&&" ... "+" ... "-" ... "*" ... "/" ... "in" ... "not in" ... ... ... ... ... ... ...