Package org.openrdf.repository

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


            try {
              connection.begin();
              return listSubjectsInternal(connection, (org.openrdf.model.URI) property, object);
            } finally {
                connection.commit();
                connection.close();
            }
        } catch (RepositoryException e) {
            throw new RuntimeException("error while querying Sesame repository!",e);
        } catch (ClassCastException e) {
View Full Code Here


        BNode bnode2 = sesameFactory.createBNode();
        con.add(subject, property, bnode1);
        con.add(bnode1, property2, value);
        con.add(bnode1, loop1, bnode2);
        con.add(bnode2, loop2, bnode1);
        con.commit();
        con.close();
        Yard yard = getYard();
        Representation rep = yard.getRepresentation(subject.stringValue());
        Assert.assertTrue(rep instanceof RdfRepresentation);
        Model model = ((RdfRepresentation)rep).getModel();
View Full Code Here

        URI entity2 = sesameFactory.createURI("http://www.test.org/entity2");
        con.add(entity2,rdfType,skosConcept,CONTEXT2);
        con.add(entity2,skosPrefLabel,sesameFactory.createLiteral("test context two", EN),CONTEXT2);
        con.add(entity2,skosPrefLabel,sesameFactory.createLiteral("Test Context Zwei", DE),CONTEXT2);
        expectedEntities.put(entity2, Arrays.asList(yard2,unionYard));
        con.commit();
        con.close();
    }
    /**
     * Checks the expected visibility of Entities to the different yards
     * @throws YardException
View Full Code Here

        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            Representation rep = getRepresentation(con, sesameFactory.createURI(id), true);
            con.commit();
            return rep;
        } catch (RepositoryException e) {
            throw new YardException("Unable to get Representation "+id, e);
        } finally {
            if(con != null){
View Full Code Here

        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            boolean state = isRepresentation(con, sesameFactory.createURI(id));
            con.commit();
            return state;
        } catch (RepositoryException e) {
            throw new YardException("Unable to check for Representation "+id, e);
        } finally {
            if(con != null){
View Full Code Here

        RepositoryConnection con = null;
        try {
            con = repository.getConnection();
            con.begin();
            remove(con, sesameFactory.createURI(id));
            con.commit();
        } catch (RepositoryException e) {
            throw new YardException("Unable to remove for Representation "+id, e);
        } finally {
            if(con != null){
                try {
View Full Code Here

            for(String id : ids){
                if(id != null){
                    remove(con, sesameFactory.createURI(id));
                }
            }
            con.commit();
        } catch (RepositoryException e) {
            throw new YardException("Unable to remove parsed Representations", e);
        } finally {
            if(con != null){
                try {
View Full Code Here

        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 {
            if(con != null){
                try {
View Full Code Here

                        log.warn(String.format("Unable to update Representation %s in Yard %s because it is not present!",
                            representation.getId(),getId()));
                    }
                } //ignore null values in the parsed Iterable!
            }
            con.commit();
            return added;
        } catch (RepositoryException e) {
            throw new YardException("Unable to remove parsed Representations", e);
        } catch (IllegalArgumentException e) {
            try {
View Full Code Here

        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);
        } catch (IllegalArgumentException e) {
            try {
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.