AVG function does not work


(Johan Kumps) #1

Hi,

Can somebody shed a light on why this query is working

select (MAX(?v) as ?value)
where {
?o a sosa:Observation .
?o sosa:hasResult ?r .
?r qudt:numericValue ?v
}

and this is not

select (AVG(?v) as ?value)
where {
?o a sosa:Observation .
?o sosa:hasResult ?r .
?r qudt:numericValue ?v
}

I’m issuing the query in the console of Stardog 5.2.2

Kind regards,


(Pavel Klinov) #2

Hi,

What exactly happens? What happens if you run the same query via command line?

Best,
Pavel


(Johan Kumps) #3

Hi Pavel,

Within the console I don’t get any error nor result. Using the CLI I get the expected result:

D:\software\copyable\stardog-5.2.2\bin>stardog query semantic -u john -p john “prefix sosa: http://www.w3.org/ns/sosa/ prefix qudt: http://qudt.org/schema/qudt# select (MAX(?v) as ?value) where {?o a sosa:Observation . ?o sosa:hasResult ?r . ?r qudt:numericValue ?v }”
±------+
| value |
±------+
| “2.5” |
±------+

Query returned 1 results in 00:00:00.318

Johan


(system) #5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.