An Ambient Intelligence Architecture for Extracting Knowledge from Distributed Sensors