Package com.hp.hpl.jena.update

Examples of com.hp.hpl.jena.update.GraphStore


                                 new Triple(s,p,NodeFactoryExtra.parseNode("123")))) ;
    }
   
    @Test public void testUpdateScript7()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "data-4.ru") ;
        assertTrue(graphContains(gStore.getDefaultGraph(),
                                 new Triple(s,p,NodeFactoryExtra.parseNode("123")))) ;
        Graph g = gStore.getGraph(graphIRI) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI),
                                 new Triple(s,p,o2))) ;
    }
View Full Code Here


    @Test public void testUpdateBad2()      { testBad("bad-2.ru", 1) ; }
    @Test public void testUpdateBad3()      { testBad("bad-3.ru", 0) ; }

    private void testBad(String file, int expectedSize)
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, file) ;
        assertEquals(expectedSize, countQuads(gStore)) ;
    }
View Full Code Here

public class TestUpdateGraphMem extends AbstractTestUpdateGraph
{
    @Override
    protected GraphStore getEmptyGraphStore()
    {
        GraphStore gStore = GraphStoreFactory.create() ;
        return gStore ;
    }
View Full Code Here

public class TestUpdateGraphMgtMem extends AbstractTestUpdateGraphMgt
{
    @Override
    protected GraphStore getEmptyGraphStore()
    {
        GraphStore gStore = GraphStoreFactory.create() ;
        return gStore ;
    }
View Full Code Here

    protected static Graph graph1 = data1() ;
    protected static Node graphIRI = NodeFactoryExtra.parseNode("<http://example/graph>") ;
   
    @Test public void testInsertData1()
    {
    GraphStore gStore = getEmptyGraphStore() ;
    defaultGraphData(gStore, graph1) ;
    QuadDataAcc acc = new QuadDataAcc() ;
    acc.addTriple(triple2) ;
        UpdateDataInsert insert = new UpdateDataInsert(acc) ;
        UpdateProcessor uProc = UpdateExecutionFactory.create(insert, gStore) ;
        uProc.execute();
       
        assertFalse(graphEmpty(gStore.getDefaultGraph())) ;
        assertTrue(graphContains(gStore.getDefaultGraph(), triple1)) ;
        assertTrue(graphContains(gStore.getDefaultGraph(), triple2)) ;
    }
View Full Code Here

        assertTrue(graphContains(gStore.getDefaultGraph(), triple2)) ;
    }

    @Test public void testDeleteData1()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, graph1) ;
        QuadDataAcc acc = new QuadDataAcc() ;
        acc.addTriple(triple2) ;
        UpdateDataDelete delete = new UpdateDataDelete(acc) ;
        UpdateProcessor uProc = UpdateExecutionFactory.create(delete, gStore) ;
        uProc.execute();

        assertFalse(graphEmpty(gStore.getDefaultGraph())) ;
        assertTrue(graphContains(gStore.getDefaultGraph(), triple1)) ;
        assertFalse(graphContains(gStore.getDefaultGraph(), triple2)) ;
    }
View Full Code Here

        assertFalse(graphContains(gStore.getDefaultGraph(), triple2)) ;
    }

    @Test public void testDeleteData2()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, graph1) ;
        QuadDataAcc acc = new QuadDataAcc() ;
        acc.addTriple(triple1) ;
        UpdateDataDelete delete = new UpdateDataDelete(acc) ;
        UpdateProcessor uProc = UpdateExecutionFactory.create(delete, gStore) ;
        uProc.execute();

        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
        assertFalse(graphContains(gStore.getDefaultGraph(), triple1)) ;
    }
View Full Code Here

        assertFalse(graphContains(gStore.getDefaultGraph(), triple1)) ;
    }
   
    @Test public void testInsert1()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        UpdateModify insert = new UpdateModify() ;
        UpdateAction.execute(insert, gStore) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
View Full Code Here

        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
   
    @Test public void testInsert2()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        UpdateModify insert = new UpdateModify() ;
        insert.getInsertAcc().addTriple(triple1) ;
        UpdateAction.execute(insert, gStore) ;
        assertTrue(graphContains(gStore.getDefaultGraph(), triple1)) ;
    }
View Full Code Here

        assertTrue(graphContains(gStore.getDefaultGraph(), triple1)) ;
    }
   
    @Test public void testInsert3()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        gStore.addGraph(graphIRI, Factory.createDefaultGraph()) ;
        UpdateModify insert = new UpdateModify() ;
        insert.getInsertAcc().addQuad(new Quad(graphIRI, triple1)) ;
        UpdateAction.execute(insert, gStore) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI), triple1)) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.update.GraphStore

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.