LiveOntologyStatementExecutor implements StatementExecutor { @Override public void executeUpdate(final String update) throws OwlapiDriverException { connector.executeWrite(snapshot -> { if (snapshot.getReasoner() == null) { throw new ReasonerNotAvailableException("Cannot execute query without a reasoner."); } final OWLAPIv3OWL2Ontology ont = new OWLAPIv3OWL2Ontology(snapshot.getOntologyManager(), snapshot.getOntology(), snapshot.getReasoner()); OWL2QueryEngine.exec(update, ont); }); } LiveOntologyStatementExecutor(Connector connector); @Override ResultSet executeQuery(final String query, final Statement statement); @Override void executeUpdate(final String update);  }
@Test public void executeUpdatePassesConsumerFunctionToConnectorForExecutionInWriteMode() throws Exception { executor.executeUpdate(UPDATE); verify(connectorMock).executeWrite(any(Consumer.class)); }