Package com.hp.hpl.jena.graph.impl

Examples of com.hp.hpl.jena.graph.impl.FileGraph


    public void testTransactionCommitThenAbort()
        {
        Graph initial = graphWith( "A pings B; B pings C" );
        Graph extra = graphWith( "C pingedBy B; fileGraph rdf:type Graph" );
        File foo = FileUtils.tempFileName( "fileGraph", ".nt" );
        Graph g = new FileGraph( foo, true, true );
        g.getTransactionHandler().begin();
        GraphUtil.addInto( g, initial );
        g.getTransactionHandler().commit();
        g.getTransactionHandler().begin();
        GraphUtil.addInto( g, extra );
        g.getTransactionHandler().abort();
        assertIsomorphic( initial, g );
        Model inFile = ModelFactory.createDefaultModel();
        inFile.read( "file:///" + foo, "N-TRIPLES" );
        assertIsomorphic( initial, inFile.getGraph() );
        }
View Full Code Here


            @Override
            public void notifyClosed( File f )
                { history.add( f ); }
            };
        File file = FileUtils.tempFileName( "fileGraph", ".nt" );
        Graph g = new FileGraph( n, file, true, true );
        assertEquals( new ArrayList<File>(), history );
        g.close();
        assertEquals( oneElementList( file ), history );
        }
View Full Code Here

        @Override
        public void runTest()
            {
            File foo = FileUtils.tempFileName( prefix, suffix );
            Graph original = graphWith( content );
            Graph g = new FileGraph( foo, true, true );
            GraphUtil.addInto( g, original );
            g.close();
            Graph g2 = new FileGraph( foo, false, true );
            assertIsomorphic( original, g2 );
            g2.close();
            }
View Full Code Here

        {
        FileModelAssembler a = new FileModelAssembler();
        File x = FileUtils.tempFileName( "fileModelAssembler", ".n3" );
        Model m = a.createFileModel( x, "N3", true, false);
        assertInstanceOf( FileGraph.class, m.getGraph() );
        FileGraph fg = (FileGraph) m.getGraph();
        assertEquals( x, fg.name );
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.impl.FileGraph

Copyright © 2018 www.massapicom. 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.