Package org.openrdf.repository

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


    @Override
    public final void removeAll() throws YardException {
        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            con.clear(contexts); //removes everything
            con.commit();
        } catch (RepositoryException e) {
            throw new YardException("Unable to remove parsed Representations", e);
        } finally {
View Full Code Here


    }
    protected final Iterable<Representation> store(Iterable<Representation> representations,boolean allowCreate) throws IllegalArgumentException, YardException{
        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            ArrayList<Representation> added = new ArrayList<Representation>();
            for(Representation representation : representations){
                if(representation != null){
                    Representation stored = store(con, representation,allowCreate,false); //reassign
                    //to check if the store was successful
View Full Code Here

     */
    protected final Representation store(Representation representation,boolean allowCreate,boolean canNotCreateIsError) throws IllegalArgumentException, YardException{
        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            Representation added = store(con,representation,allowCreate,canNotCreateIsError);
            con.commit();
            return added;
        } catch (RepositoryException e) {
            throw new YardException("Unable to remove parsed Representations", e);
View Full Code Here

        final SparqlFieldQuery query = SparqlFieldQueryFactory.getSparqlFieldQuery(parsedQuery);
        RepositoryConnection con = null;
        TupleQueryResult results = null;
        try {
            con = repository.getConnection();
            con.begin();
            //execute the query
            int limit = QueryUtils.getLimit(query, getConfig().getDefaultQueryResultNumber(),
                getConfig().getMaxQueryResultNumber());
            results = executeSparqlFieldQuery(con, query, limit, false);
            //parse the results
View Full Code Here

        final SparqlFieldQuery query = SparqlFieldQueryFactory.getSparqlFieldQuery(parsedQuery);
        RepositoryConnection con = null;
        TupleQueryResult results = null;
        try {
            con = repository.getConnection();
            con.begin();
            //execute the query
            int limit = QueryUtils.getLimit(query, getConfig().getDefaultQueryResultNumber(),
                getConfig().getMaxQueryResultNumber());
            results = executeSparqlFieldQuery(con,query, limit, false);
            //parse the results and generate the Representations
View Full Code Here

        final SparqlFieldQuery query = SparqlFieldQueryFactory.getSparqlFieldQuery(parsedQuery);
        RepositoryConnection con = null;
        TupleQueryResult results = null;
        try {
            con = repository.getConnection();
            con.begin();
            //execute the query
            int limit = QueryUtils.getLimit(query, getConfig().getDefaultQueryResultNumber(),
                getConfig().getMaxQueryResultNumber());
            results = executeSparqlFieldQuery(con,query, limit, true);
            //parse the results and generate the Representations
View Full Code Here

        loader.load(dataFile.getAbsolutePath(), RDFFormat.RDFXML, false);

        final RepositoryConnection con = loader.getRepository().getConnection();
        try {
            con.begin();
            testRepoContent(con);
            con.commit();
        } finally {
            if (con.isActive()) {
                con.rollback();
View Full Code Here

        loader.load(gz.getAbsolutePath(), RDFFormat.RDFXML, true);

        final RepositoryConnection con = loader.getRepository().getConnection();
        try {
            con.begin();
            testRepoContent(con);
            con.commit();
        } finally {
            if (con.isActive()) {
                con.rollback();
View Full Code Here

        loader.load(new FileInputStream(dataFile), RDFFormat.RDFXML);

        final RepositoryConnection con = loader.getRepository().getConnection();
        try {
            con.begin();
            testRepoContent(con);
            con.commit();
        } finally {
            if (con.isActive()) {
                con.rollback();
View Full Code Here

        String path = LdpTestCases.ROOT_PATH + LdpTestCases.MANIFEST_CACHE + ".ttl";
        try {
            Repository repo = LdpTestCasesUtils.loadData(path, RDFFormat.TURTLE);
            RepositoryConnection conn = repo.getConnection();
            try {
                conn.begin();

                //TODO: this query is not final, it needs to evolve in parallel with the test cases
                String testCasesQuery = LdpTestCasesUtils.getNormativeNamespacesSparql() + "\n" +
                        "SELECT ?tc ?label \n" +
                        "WHERE { \n" +
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.