Hello What is the problem in this query: 'Male' is string literal here. (The query works inside Protege)
CONSTRUCT { ?x mo:hasUncle ?y } WHERE { ?x mo:hasParents ?z .?z mo:Gender 'Male' . ?z mo:hasBrother ?y} Query query = QueryFactory.create(str); QueryExecution qexec = QueryExecutionFactory.create(query, model) ; ResultSet results = (ResultSet) qexec.execConstruct() ; while (results.hasNext()) { QuerySolution binding = results.nextSolution(); Literal lit = binding.get("z").asLiteral();