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

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


            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

                            // 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 ex) {
                connection.rollback();
View Full Code Here

            KiWiTriple justification = results.get(0).getJustifications().iterator().next();
            Assert.assertEquals(subject, justification.getSubject());
            Assert.assertEquals(predicate, justification.getPredicate());
            Assert.assertEquals(object, justification.getObject());

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

                KiWiTriple justification = results.get(i).getJustifications().iterator().next();
                Assert.assertEquals(predicate, justification.getPredicate());
            }

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

            Assert.assertEquals(OBJECT2, results.get(0).getBindings().get(z).stringValue());

            KiWiTriple justification1 = results.get(0).getJustifications().iterator().next();
            Assert.assertEquals(predicate1, justification1.getPredicate());

            connection.commit();
        } finally {
            connection.close();
        }

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.