Examples of GraphStore


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

        assertTrue(graphContains(gStore.getDefaultGraph(), triple2)) ;
    }
   
    @Test public void testDelete1()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        QuadAcc acc = new QuadAcc() ;
        UpdateDeleteWhere delete = new UpdateDeleteWhere(acc) ;
        UpdateAction.execute(delete, gStore) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
View Full Code Here

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

        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
   
    @Test public void testDelete2()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, graph1) ;
        QuadAcc acc = new QuadAcc() ;
        UpdateDeleteWhere delete = new UpdateDeleteWhere(acc) ;
        acc.addTriple(SSE.parseTriple("(?s ?p ?o)")) ;
        UpdateAction.execute(delete, gStore) ;
        assertTrue("Not empty", graphEmpty(gStore.getDefaultGraph())) ;
    }
View Full Code Here

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

        assertTrue("Not empty", graphEmpty(gStore.getDefaultGraph())) ;
    }
   
    @Test public void testDelete3()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, graph1) ;
        QuadDataAcc acc = new QuadDataAcc() ;
        UpdateDataDelete delete = new UpdateDataDelete(acc) ;
        acc.addTriple(triple1) ;
        UpdateAction.execute(delete, gStore) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
View Full Code Here

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

    }
   
   
    @Test public void testDelete4()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        namedGraphData(gStore, graphIRI, data1()) ;
       
        QuadDataAcc acc = new QuadDataAcc() ;
        UpdateDataDelete delete = new UpdateDataDelete(acc) ;
        acc.setGraph(graphIRI) ;
        acc.addTriple(triple1) ;
        UpdateAction.execute(delete, gStore) ;
        assertTrue(graphEmpty(gStore.getGraph(graphIRI))) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
View Full Code Here

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

        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
   
    @Test public void testDelete5()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, data2()) ;
        namedGraphData(gStore, graphIRI, data1()) ;
       
        UpdateModify modify = new UpdateModify() ;
        Element element = QueryFactory.createElement("{ ?s <http://example/p> ?o }" ) ;
        modify.setElement(element) ;
        modify.getDeleteAcc().addQuad(SSE.parseQuad("(<http://example/graph> ?s <http://example/p> 2007 )")) ;
        UpdateAction.execute(modify, gStore) ;

        assertTrue("Not empty", graphEmpty(gStore.getGraph(graphIRI))) ;
        assertFalse(graphEmpty(gStore.getDefaultGraph())) ;
    }
View Full Code Here

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

        assertFalse(graphEmpty(gStore.getDefaultGraph())) ;
    }

    @Test public void testModify1()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, data2()) ;
        namedGraphData(gStore, graphIRI, Factory.createDefaultGraph()) ;
       
        UpdateModify modify = new UpdateModify() ;
        Element element = QueryFactory.createElement("{ ?s <http://example/p> ?o }" ) ;
        modify.setElement(element) ;
        modify.getInsertAcc().addQuad(new Quad(graphIRI, triple1)) ;
        modify.getDeleteAcc().addTriple(SSE.parseTriple("(?s <http://example/p> ?o)")) ;
        modify.getDeleteAcc().addQuad(SSE.parseQuad("(<http://example/graph> ?s <http://example/p> ?o)")) ;
        UpdateAction.execute(modify, gStore) ;
       
        assertFalse(graphEmpty(gStore.getGraph(graphIRI))) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI), triple1)) ;
    }
View Full Code Here

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

    @Test public void testModify2()
    {
        // Use blank nodes (will expose any problems in serialization when spill occurs)
        Triple t =  new Triple(Node.createAnon(),p,o2);
       
        GraphStore gStore = getEmptyGraphStore() ;
        // Set the threshold to in order to force spill to disk
        gStore.getContext().set(ARQ.spillToDiskThreshold, 0L) ;
       
        defaultGraphData(gStore, data(t)) ;
        namedGraphData(gStore, graphIRI, data(t));
       
        UpdateModify modify = new UpdateModify() ;
        Element element = QueryFactory.createElement("{ ?s <http://example/p> ?o }" ) ;
        modify.setElement(element) ;
        modify.getInsertAcc().addQuad(new Quad(graphIRI, triple1)) ;
        modify.getDeleteAcc().addTriple(SSE.parseTriple("(?s <http://example/p> ?o)")) ;
        modify.getDeleteAcc().addQuad(SSE.parseQuad("(<http://example/graph> ?s <http://example/p> ?o)")) ;
        UpdateAction.execute(modify, gStore) ;
       
        assertFalse(graphEmpty(gStore.getGraph(graphIRI))) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI), triple1)) ;
        assertFalse(graphContains(gStore.getGraph(graphIRI), t));
    }
View Full Code Here

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

    {
        // Use blank nodes (will expose any problems in serialization when spill occurs)
        Triple t =  new Triple(Node.createAnon(),p,o2);
        Triple t2 = new Triple(Node.createAnon(),p,o1);
       
        GraphStore gStore = getEmptyGraphStore() ;
        // Set the threshold to in order to force spill to disk
        gStore.getContext().set(ARQ.spillToDiskThreshold, 0L) ;
       
        defaultGraphData(gStore, data(triple1, triple2, t)) ;
        namedGraphData(gStore, graphIRI, data(t2));
       
        UpdateCopy copy = new UpdateCopy(Target.DEFAULT, Target.create(graphIRI));
        UpdateAction.execute(copy, gStore);
       
        assertFalse(graphEmpty(gStore.getDefaultGraph())) ;
        assertFalse(graphEmpty(gStore.getGraph(graphIRI))) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI), triple1)) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI), triple2)) ;
        assertTrue(graphContains(gStore.getGraph(graphIRI), t)) ;
        assertFalse(graphContains(gStore.getGraph(graphIRI), t2)) ;
        assertTrue(gStore.getDefaultGraph().isIsomorphicWith(gStore.getGraph(graphIRI)));
    }
View Full Code Here

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

        assertTrue(gStore.getDefaultGraph().isIsomorphicWith(gStore.getGraph(graphIRI)));
    }

    @Test public void testUpdateScript1()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "update-1.ru") ;
        assertTrue(graphContains(gStore.getDefaultGraph(), new Triple(s,p,NodeFactory.parseNode("123")))) ;
    }
View Full Code Here

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

        assertTrue(graphContains(gStore.getDefaultGraph(), new Triple(s,p,NodeFactory.parseNode("123")))) ;
    }
   
    @Test public void testUpdateScript2()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "update-2.ru") ;
        assertTrue(graphContains(gStore.getGraph(Node.createURI("http://example/g1")),
                                 new Triple(s,p,NodeFactory.parseNode("123")))) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
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.