Querying data through ontologies