Query Processing for Sensornetworks