Package org.apache.marmotta.kiwi.reasoner.persistence

Examples of org.apache.marmotta.kiwi.reasoner.persistence.KiWiReasoningConnection.commit()


            Assert.assertEquals("list of original programs differs from list of database",programs,dbPrograms1);

            // delete all programs and check if the database does not contain any remaining entries in the different tables
            for(Program p : programs) {
                connection.deleteProgram(p);
                connection.commit();
            }
            List<Program> dbPrograms2 = asList(connection.listPrograms());
            Assert.assertEquals(0, dbPrograms2.size());

            PreparedStatement listPrograms = connection.getJDBCConnection().prepareStatement("SELECT count(*) AS count FROM reasoner_programs");
View Full Code Here


            ResultSet resultListPrograms = listPrograms.executeQuery();

            Assert.assertTrue(resultListPrograms.next());
            Assert.assertEquals(0, resultListPrograms.getInt("count"));
            resultListPrograms.close();
            connection.commit();

            PreparedStatement listRules = connection.getJDBCConnection().prepareStatement("SELECT count(*) AS count FROM reasoner_rules");
            ResultSet resultListRules = listRules.executeQuery();

            Assert.assertTrue(resultListRules.next());
View Full Code Here

            ResultSet resultListRules = listRules.executeQuery();

            Assert.assertTrue(resultListRules.next());
            Assert.assertEquals(0, resultListRules.getInt("count"));
            resultListRules.close();
            connection.commit();

            PreparedStatement listNamespaces = connection.getJDBCConnection().prepareStatement("SELECT count(*) AS count FROM reasoner_program_namespaces");
            ResultSet resultListNamespaces = listNamespaces.executeQuery();

            Assert.assertTrue(resultListNamespaces.next());
View Full Code Here

            ResultSet resultListNamespaces = listNamespaces.executeQuery();

            Assert.assertTrue(resultListNamespaces.next());
            Assert.assertEquals(0, resultListNamespaces.getInt("count"));
            resultListNamespaces.close();
            connection.commit();

            PreparedStatement listProgramRules = connection.getJDBCConnection().prepareStatement("SELECT count(*) AS count FROM reasoner_program_rules");
            ResultSet resultListProgramRules = listProgramRules.executeQuery();

            Assert.assertTrue(resultListProgramRules.next());
View Full Code Here

            ResultSet resultListProgramRules = listProgramRules.executeQuery();

            Assert.assertTrue(resultListProgramRules.next());
            Assert.assertEquals(0, resultListProgramRules.getInt("count"));
            resultListProgramRules.close();
            connection.commit();

        } finally {
            connection.close();
        }
    }
View Full Code Here

                        cleanupUnsupported(connection);

                        // and finally garbage collect those triples that are inferred and deleted
                        // garbage collection is now carried out by a thread in the triple store
                        //garbageCollectTriples();
                        connection.commit();
                    } catch (SQLException ex) {
                        connection.rollback();
                        throw ex;
                    } finally {
                        connection.close();
View Full Code Here

                cleanupUnsupported(connection);

                // and finally garbage collect those triples that are inferred and deleted
                // garbage collection is now carried out by a thread in the triple store
                //garbageCollectTriples();
                connection.commit();
            } catch (SQLException ex) {
                connection.rollback();
                throw ex;
            } finally {
                connection.close();
View Full Code Here

                        // persist the justifications that have been created in the rule processing
                        if(baseJustifications.size() > 0) {
                            connection.storeJustifications(baseJustifications);
                        }
                        connection.commit();
                        sail.begin();
                    } finally {
                        persistenceLock.unlock();
                    }
                    justifications.clear();
View Full Code Here

                }

                log.debug("{} justifications added after resolving inferred triples", baseJustifications.size());

                Iterations.closeCloseable(bodyResult);
                connection.commit();
            } finally {
                persistenceLock.unlock();
            }
        } catch(SailException | SQLException | ReasoningException ex) {
            log.error("REASONING ERROR: could not process rule, database state will be inconsistent! Message: {}",ex.getMessage());
View Full Code Here

        KiWiReasoningConnection connection = rpersistence.getConnection();
        try {
            // should not throw an exception and the program should have a database ID afterwards
            connection.storeProgram(p);
            connection.commit();
        } finally {
            connection.close();
        }

        // instantiate reasoning engine, will load the programs into memory
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.