Package com.hp.hpl.jena.query

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


public class Run3 {

    public static void main(String[] args) {
        Location location = new Location ( "target/tdb" );
        Dataset dataset = TDBFactory.createDataset ( location );
        dataset.begin ( ReadWrite.WRITE );
        try {
            DatasetGraph dsg = dataset.asDatasetGraph();
            DatasetGraph dsg2 = RiotLoader.load("src/main/resources/data/single-bad-triple.nt", Lang.NTRIPLES);
            Iterator<Quad> quads = dsg2.find();
            while ( quads.hasNext() ) {
View Full Code Here


    private static final String str_triple = "<s> <p> \"" + str_literal + "\" .";
  
    @Test public void test() {
        Location location = new Location ( path );
        Dataset dataset = TDBFactory.createDataset ( location );
        dataset.begin ( ReadWrite.WRITE );
        try {
            DatasetGraph dsg = dataset.asDatasetGraph();
            DatasetGraph dsg2 = RiotLoader.datasetFromString ( str_triple, Lang.TURTLE, null );
            Iterator<Quad> quads = dsg2.find();
            while ( quads.hasNext() ) {
View Full Code Here

   
    @Test public void test_03() {
        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 ( str_triple, Lang.TURTLE, null );
            Iterator<Quad> quads = dsg2.find();
            while ( quads.hasNext() ) {
View Full Code Here

        assertEquals ( 1, dataset.getDefaultModel().size() );
    }
   
    @Test public void test_04() {
        Dataset dataset = TDBFactory.createDataset ();
        dataset.begin ( ReadWrite.WRITE );
        try {
            DatasetGraph dsg = dataset.asDatasetGraph();
            DatasetGraph dsg2 = RiotLoader.datasetFromString ( str_triple, Lang.TURTLE, null );
            Iterator<Quad> quads = dsg2.find();
            while ( quads.hasNext() ) {
View Full Code Here

    public static void main(String[] args) {
        String value = "Hello \u0092 World!";
        Location location = new Location ( "target/tdb" );
        Dataset dataset = TDBFactory.createDataset ( location );
        dataset.begin ( ReadWrite.WRITE );
        try {
            Model model = dataset.getDefaultModel();
            model.add ( ResourceFactory.createResource(), RDFS.label, value, "en-gb" );
            dataset.commit();
        } finally {
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

    }
   
    @Test public void transaction_01()
    {
        Dataset ds = create() ;
        ds.begin(ReadWrite.READ) ;
        assertTrue(ds.isInTransaction()) ;
        ds.end() ;
        assertFalse(ds.isInTransaction()) ;
    }
View Full Code Here

    }

    @Test public void transaction_02()
    {
        Dataset ds = create() ;
        ds.begin(ReadWrite.WRITE) ;
        assertTrue(ds.isInTransaction()) ;
        ds.commit() ;
        assertFalse(ds.isInTransaction()) ;
    }
View Full Code Here

    }

    @Test public void transaction_03()
    {
        Dataset ds = create() ;
        ds.begin(ReadWrite.WRITE) ;
        assertTrue(ds.isInTransaction()) ;
        ds.abort() ;
        assertFalse(ds.isInTransaction()) ;
    }
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.