Which namespace for Math functions in SPARQL?

288 views Asked by At

I'm currently developing a project in which I use AllegroGraph as graph database. AllegroGraph provides full support for SPARQL 1.1 Query and Update. I'm trying to write a SPARQL query in which I need some math functions (such as square root and so on). The problem is that every namespace I found isn't working. For example, I tried to use the xpath namespace for the math functions (https://www.w3.org/2005/xpath-functions/math) in this way:

PREFIX func:<http://www.w3.org/2005/xpath-functions/math#>

SELECT ?res 
WHERE {
    BIND(func:sqrt(4) as ?res) .
}

but it doesn't work since I get the following error:

QUERY FAILED: URI function <http://www.w3.org/2005/xpath-functions/math#sqrt> is not defined

Can you help me to find a workaround please?

Thanks in advance!

0

There are 0 answers