9. A computer program product for driving a sensor based application, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising: generating a context hierarchy for the sensor based application, wherein the context hierarchy comprises a plurality of contexts, each context being either a static context having no associated sensors from a sensor network or a dynamic context having at least one associated sensor from the sensor network, wherein the plurality of contexts includes at least one static context and at least one dynamic context; discovering a set of sensors from the sensor network using the context hierarchy, wherein each sensor included in the discovered set of sensors is associated with a dynamic context from among the plurality of contexts, wherein the discovered set of sensors includes only sensors from the sensor network that are needed to meet a goal of the sensor based application; reading data values from the discovered set of sensors; applying the data values read from the discovered set of sensors in the sensor based application; setting a priority for the at least one dynamic context of the plurality of contexts, wherein the priority of the at least one dynamic context is set by a superior context within the context hierarchy, and the priority does not exceed a priority of the superior context; and adjusting the priority of the at least one dynamic context based on an amount of use of the at least one associated sensor corresponding to the at least one dynamic context.
9. A computer program product for driving a sensor based application, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising: generating a context hierarchy for the sensor based application, wherein the context hierarchy comprises a plurality of contexts, each context being either a static context having no associated sensors from a sensor network or a dynamic context having at least one associated sensor from the sensor network, wherein the plurality of contexts includes at least one static context and at least one dynamic context; discovering a set of sensors from the sensor network using the context hierarchy, wherein each sensor included in the discovered set of sensors is associated with a dynamic context from among the plurality of contexts, wherein the discovered set of sensors includes only sensors from the sensor network that are needed to meet a goal of the sensor based application; reading data values from the discovered set of sensors; applying the data values read from the discovered set of sensors in the sensor based application; setting a priority for the at least one dynamic context of the plurality of contexts, wherein the priority of the at least one dynamic context is set by a superior context within the context hierarchy, and the priority does not exceed a priority of the superior context; and adjusting the priority of the at least one dynamic context based on an amount of use of the at least one associated sensor corresponding to the at least one dynamic context. 13. The computer program product of claim 9 , wherein the method further comprises: reacting data values of sensors from the sensor network associated with a parent context, wherein the parent context is a dynamic context; and modifying a child context of the parent context, automatically by the parent context, based on the data values of the sensors from the sensor network associated with the parent context.