SAMURAI: A batch and streaming context architecture for large-scale intelligent applications and environments