Loosely coupling ontological reasoning with an efficient middleware for context-awareness