From Query to Logic: Ontology-Driven Multi-Hop Reasoning in LLMs