Future IoT killer apps leveraging ubiquitous sensors and actuators will create value in
emergent properties of composition and contextual awareness. This thesis focuses on two
key aspects of principled IoT design: (1) using contextual information from the physical
world, and (2) enabling interaction and composition across distributed cyber physical systems.
These challenges are mutually intertwined. Acquiring contextual information about
the world (1) usually involves building applications to coordinate device interaction (2).
Similarly, the decision an application makes about which sensors and actuators to interact
with (2) should be governed by contextual information (1).
In this thesis I will present research in both directions: I propose semantic localization, a
logical language as the interface between spatial modeling and spatial programming. I will
present the accessors platform as a framework for building dynamic swarm applications, and
give an architecture for connected car service discovery with semantic accessors. I will show
how ontology matching adapters may be used to enhance distributed cyber physical system
interaction. Finally, I will give an SMT solving algorithm for spatial ontology verification in
sensor networks.