Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.Dataset.begin()


    private void testBeginBegin(ReadWrite mode1, ReadWrite mode2) {
        Dataset ds = create() ;
        ds.begin(mode1) ;
        try {
            ds.begin(mode2) ;
            fail("Expected transaction exception - begin-begin (" + mode1 + ", " + mode2 + ")") ;
        }
        catch (JenaTransactionException ex) {
            ds.end() ;
        }
View Full Code Here


        }
    }
   
    private void testCommitCommit(ReadWrite mode) {
        Dataset ds = create() ;
        ds.begin(mode) ;
        ds.commit() ;
        try {
            ds.commit() ;
            fail("Expected transaction exception - commit-commit(" + mode + ")") ;
        }
View Full Code Here

        }
    }

    private void testCommitAbort(ReadWrite mode) {
        Dataset ds = create() ;
        ds.begin(mode) ;
        ds.commit() ;
        try {
            ds.abort() ;
            fail("Expected transaction exception - commit-abort(" + mode + ")") ;
        }
View Full Code Here

        }
    }

    private void testAbortAbort(ReadWrite mode) {
        Dataset ds = create() ;
        ds.begin(mode) ;
        ds.abort() ;
        try {
            ds.abort() ;
            fail("Expected transaction exception - abort-abort(" + mode + ")") ;
        }
View Full Code Here

        }
    }

    private void testAbortCommit(ReadWrite mode) {
        Dataset ds = create() ;
        ds.begin(mode) ;
        ds.abort() ;
        try {
            ds.commit() ;
            fail("Expected transaction exception - abort-commit(" + mode + ")") ;
        }
View Full Code Here

    Dataset dataset = TDBFactory.createDataset(location);
   
    Dataset dataset1 = TDBFactory.createDataset(location);
   
    if ( bracketWithReader )
        dataset1.begin(ReadWrite.READ) ;
   
    for (int i = 0; i < TOTAL; i++) {
      List<String> lastProcessedUris = new ArrayList<>();
      for (int j = 0; j < 10*i; j++) {
        String lastProcessedUri = "http://test.net/xmlns/test/1.0/someUri" + j;
View Full Code Here

        Dataset ds2 = create() ;
       
        ds1.begin(WRITE) ;
        ds1.getDefaultModel().getGraph().add(triple1) ;
       
        ds2.begin(READ) ;
        assertTrue(ds2.getDefaultModel().isEmpty()) ;
        ds2.commit() ;
       
        ds1.commit() ;
View Full Code Here

        assertTrue(ds2.getDefaultModel().isEmpty()) ;
        ds2.commit() ;
       
        ds1.commit() ;

        ds2.begin(READ) ;
        assertFalse(ds2.getDefaultModel().isEmpty()) ;
        assertEquals(1, ds2.getDefaultModel().size()) ;
        ds2.commit() ;
    }
}
View Full Code Here

        assertTrue(dsgTxn2.contains(q1)) ;
        dsgTxn2.end() ;

        // Check API methods work.
        Dataset ds = TDBFactory.createDataset(loc) ;
        ds.begin(ReadWrite.READ) ;
        Model m = (q.isDefaultGraph() ? ds.getDefaultModel() : ds.getNamedModel("g")) ;
        assertEquals( nonTxnData ? 2 : 1 , m.size()) ;
        ds.end() ;
    }
View Full Code Here

    public static void main(String[] args) {
        String path = "target/tdb";
        FileOps.clearDirectory( path );
        Location location = new Location ( path );
        Dataset dataset = TDBFactory.createDataset ( location );
        dataset.begin ( ReadWrite.WRITE );
        try {
            DatasetGraph dsg = dataset.asDatasetGraph();
            DatasetGraph dsg2 = RiotLoader.datasetFromString("<http://example/org> <http://www.w3.org/2000/01/rdf-schema#label> \"Hello \n World!\" .", Lang.TURTLE, null);
            Iterator<Quad> quads = dsg2.find();
            while ( quads.hasNext() ) {
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.