private int executeQuery(String q) throws OWLException {
    String prefix =
        "PREFIX : <http://it.unibz.krdb/obda/ontologies/quest-typing-test.owl#> \n PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> \n PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>";
    String query = prefix + " " + q;

    QuestOWLResultSet res = st.executeTuple(query);
    int count = 0;
    int columns = res.getColumCount();
    while (res.nextRow()) {
      for (int i = 0; i < columns; i++) {
        OWLObject o = res.getOWLObject(i + 1);
        System.out.println(o.toString());
      }
      count += 1;
    }
    res.close();
    return count;
  }
 private QuestOWLResultSet executeQuery(String sparql) throws Exception {
   conn = reasoner.getConnection();
   stmt = conn.createStatement();
   return stmt.executeTuple(sparql);
 }