Package org.openrdf.repository

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


                Value value = result.getValue(query.getRootVariableName());
                if(value instanceof Resource){
                    ids.add(value.stringValue());
                }
            }
            con.commit();
            return new QueryResultListImpl<String>(query,ids,String.class);
        } catch (RepositoryException e) {
            throw new YardException("Unable to execute findReferences query", e);
        } catch (QueryEvaluationException e) {
            throw new YardException("Unable to execute findReferences query", e);
View Full Code Here


                    RdfRepresentation rep = createRepresentationGraph(con, valueFactory, (URI)value);
                    model.add(queryRoot, queryResult, value); //link the result with the query result
                    representations.add(rep);
                } //ignore non URI results
            }
            con.commit();
            return new SesameQueryResultList(model, query, representations);
        } catch (RepositoryException e) {
            throw new YardException("Unable to execute findReferences query", e);
        } catch (QueryEvaluationException e) {
            throw new YardException("Unable to execute findReferences query", e);
View Full Code Here

                    }
                    //create a representation and add it to the results
                    representations.add(valueFactory.createRdfRepresentation(subject));
                } //ignore non URI results
            }
            con.commit();
            return new SesameQueryResultList(model, query, representations);
        } catch (RepositoryException e) {
            throw new YardException("Unable to execute findReferences query", e);
        } catch (QueryEvaluationException e) {
            throw new YardException("Unable to execute findReferences query", e);
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();
        }

        mysqlSleep();
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();
        }

        // update 2
View Full Code Here

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

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

        // list all versions
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

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

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

View Full Code Here

        // query all triples for http://marmotta.apache.org/testing/ns1/R2, should be zero
        List<Statement> s1_r2_triples = asList(snapshot1.getStatements(repository.getValueFactory().createURI("http://marmotta.apache.org/testing/ns1/R2"), null, null, true));
        Assert.assertEquals(0, s1_r2_triples.size());

        snapshot1.commit();
        snapshot1.close();

        // test snapshot connection for date3 (i.e. after first update)
        RepositoryConnection snapshot2 = repository.getSnapshot(date3);
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.