If you have an OWL file then you can use the OWLAPI to programatically access, edit and query your ontology without having to use Protege. On the OWLAPI examples page there are code examples that describe how you would encode your query.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download
Email codedump link for How to use DL Query programmatically