Abstract-In semantic-based pervasive computing, annotated information is tied to micro-devices, such as RFID tags and wireless sensors, deployed in an environment. Compression techniques are essential, because of the verbosity of standard XMLbased languages for ontologies and semantic annotations. Beyond compression ratio, query efficiency is a key aspect. This paper presents a framework for querying knowledge bases expressed in OWL, serialized in RDF/XML syntax and compressed with a homomorphic encoding, in order to allow query evaluation without requiring decompression. Formalization of a significant set of queries demonstrates feasibility of the approach, while practical examples highlight its usefulness.