This paper presents a novel self-learning data classification mechanism for wide area sensor networks. The mechanism combines Self-Organizing Maps (SOMs), P2P technologies, and emerging Internet Engineering Task Force (IETF) standards, including the Constrained Application Protocol (CoAP), REsource LOcation And Discovery (RELOAD), and the CoAP usage for RELOAD (CoAP-RELOAD). Sensor nodes participating in our system organize in a RELOAD-based P2P overlay network. Nodes sharing similar properties further organize in P2P data sharing groups and share data using CoAP. To achieve self-learning and self-configuration, our mechanism utilizes SOMs. P2P data sharing is used to speed up the training of SOMs. The mechanism makes use of two levels of SOMs, one for filtering and one for classification. We evaluate the performance of the mechanism through simulations and measurements and show that the mechanism enables a considerable performance improvement and is feasible to run on embedded systems.