Package org.openrdf.repository

Examples of org.openrdf.repository.RepositoryConnection.commit()


            connection2.add(subject,predicate,object);
            connection2.commit();

            Assert.assertTrue(connection2.hasStatement(subject,predicate,object,true));

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

    }
View Full Code Here


        assumeThat("Could not load test-data: demo-data.foaf", rdfXML, notNullValue(InputStream.class));

        RepositoryConnection connectionRDF = repository.getConnection();
        try {
            connectionRDF.add(rdfXML, "http://localhost/foaf/", RDFFormat.RDFXML);
            connectionRDF.commit();
        } finally {
            connectionRDF.close();
        }

View Full Code Here

        RepositoryConnection connectionUpdate = repository.getConnection();
        try {
            Update u = connectionUpdate.prepareUpdate(QueryLanguage.SPARQL, update);
            u.execute();
            connectionUpdate.commit();
        } finally {
            connectionUpdate.close();
        }

        // now there should be two triples
View Full Code Here

            Assert.assertTrue(connectionVerify.hasStatement(hans_meier,foaf_name,null, true));
            Assert.assertTrue(connectionVerify.hasStatement(hans_meier,foaf_based_near,traunstein, true));
            Assert.assertTrue(connectionVerify.hasStatement(hans_meier,foaf_interest,freebase_linux, true));

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

        RepositoryConnection connectionInsert = repository.getConnection();
        try {
            Update u = connectionInsert.prepareUpdate(QueryLanguage.SPARQL, insert);
            u.execute();
            connectionInsert.commit();
        } finally {
            connectionInsert.close();
        }

        //update quadruples
View Full Code Here

        RepositoryConnection connectionUpdate = repository.getConnection();
        try {
            Update u = connectionUpdate.prepareUpdate(QueryLanguage.SPARQL, update);
            u.execute();
            connectionUpdate.commit();
        } finally {
            connectionUpdate.close();
        }

        //check quadruples
View Full Code Here

            Assert.assertTrue(connectionVerify.hasStatement(video,hasFragment,fragment,true,video));
            Assert.assertTrue(connectionVerify.hasStatement(annotation,hasTarget,fragment,true,video));
            Assert.assertTrue(connectionVerify.hasStatement(annotation,hasBody,subject,true,video));
            Assert.assertTrue(connectionVerify.hasStatement(fragment,shows,subject,true,video));

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

            long end = System.currentTimeMillis();

            log.info("listed {} triples in {} ms", stmts, end-start);


            con.commit();
        } catch(RepositoryException ex) {
            con.rollback();
        } finally {
            con.close();
        }
View Full Code Here

        assumeThat("Could not load test-data: version-base.rdf", baseData, notNullValue(InputStream.class));

        RepositoryConnection connectionBase = repository.getConnection();
        try {
            connectionBase.add(baseData, "http://marmotta.apache.org/testing/ns1/", RDFFormat.RDFXML);
            connectionBase.commit();
        } finally {
            connectionBase.close();
        }

        Thread.sleep(1000);
View Full Code Here

        assumeThat("Could not load test-data: version-update1.rdf", update1Data, notNullValue(InputStream.class));

        RepositoryConnection connectionUpdate1 = repository.getConnection();
        try {
            connectionUpdate1.add(update1Data, "http://marmotta.apache.org/testing/ns1/", RDFFormat.RDFXML);
            connectionUpdate1.commit();
        } finally {
            connectionUpdate1.close();
        }

        Thread.sleep(1000);
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.