For my project in GraphDB 9.4.1 I created a repository with owl rl (optimized).
In my data I need to query the average value of a data property. When I follow the steps according to SPARQL instruction, the result is empty. I used the following Query:
PREFIX : <http://www.BLB.de/Ontologie#>
select ?s (AVG(?TP) as ?AP) where {
?s a :MachinestatusID .
?s :hastotalpower_Kalender ?TP.
?s <http://www.BLB.de/Ontologie#Is_switched_on_Kalender> ?K
} Group by ?s ?K
Result:
s AP
http://www.BLB.de/Daten/Anlagenstatus/id/1
http://www.BLB.de/Daten/Anlagenstatus/id/2
http://www.BLB.de/Daten/Anlagenstatus/id/3
To validate the data, I already selected the data without the aggregate function. Al ?TP are values between 0 and 5000. There is no data format specified. ?K is 1 or 0. Due to GraphDB documentation AVG function is support.
s TP K
http://www.BLB.de/Daten/Anlagenstatus/id/1 4186 1
http://www.BLB.de/Daten/Anlagenstatus/id/2 4183 1
http://www.BLB.de/Daten/Anlagenstatus/id/3 4177 1
http://www.BLB.de/Daten/Anlagenstatus/id/4 4171 1
Is there any solution to get the real average as output?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…