// Create a SPARQL-DL query execution for the given query and
// ontology model
QueryExecution qe = SparqlDLExecutionFactory.create( q, m );
// We want to execute a SELECT query, do it, and return the result set
ResultSet rs = qe.execSelect();
// There are different things we can do with the result set, for
// instance iterate over it and process the query solutions or, what we
// do here, just print out the results
ResultSetFormatter.out( rs );