Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Model.begin()


                        // create store                
                        store = StoreFactory.create(desc, sdbConn);
       
                        // save model
                        Model m = SDBFactory.connectDefaultModel(store) ;              
                        m.begin();
                        m.removeAll();
                        m.add(model);
                        m.commit();

                    } catch (Exception e) {
View Full Code Here


 
  @Test public void rollback() {
    Model model = SDBFactory.connectDefaultModel(store);
   
    assertTrue("Initially empty", model.isEmpty());
    model.begin();
    model.add(RDF.type, RDF.type, RDF.type);
    assertTrue("Uncommited triple can be seen", model.contains(RDF.type, RDF.type, RDF.type));
    model.abort();
    assertTrue("Nothing was added, the add aborted", model.isEmpty());
    model.add(RDF.type, RDF.type, RDF.type);
View Full Code Here

    assertTrue("Uncommited triple can be seen", model.contains(RDF.type, RDF.type, RDF.type));
    model.abort();
    assertTrue("Nothing was added, the add aborted", model.isEmpty());
    model.add(RDF.type, RDF.type, RDF.type);
    assertEquals("Model contains 1 triple", 1l, model.size());
    model.begin();
    model.remove(RDF.type, RDF.type, RDF.type);
    model.abort();
    assertEquals("Model still contains 1 triple", 1l, model.size());
  }
 
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.