Extracting Data from WSNs: A Data-Oriented Approach