Package com.hp.hpl.jena.update

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


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


   
    @Override
    protected GraphStore getEmptyGraphStore()
    {
        Store store = SDBTestUtils.createInMemoryStore() ;
        GraphStore graphStore = SDBFactory.connectGraphStore(store) ;
        return graphStore ;
    }
View Full Code Here

{
    static final Node graphIRI = Node.createURI("http://example/graph") ;
   
    @Test public void testCreateDrop1()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        Update u = new UpdateCreate(graphIRI) ;
        UpdateAction.execute(u, gStore) ;
        assertTrue(gStore.containsGraph(graphIRI)) ;
        assertTrue(graphEmpty(gStore.getGraph(graphIRI))) ;

        // With "auto SILENT" then these aren't errors.
        boolean silentMode = true ;
       
        if ( ! silentMode )
        {
            // try again - should fail (already exists)
            try {
                UpdateAction.execute(u, gStore) ;
                fail() ;
            } catch (UpdateException ex) {}
        }
       
        // Drop it.
        u = new UpdateDrop(graphIRI) ;
        UpdateAction.execute(u, gStore) ;
        assertFalse(gStore.containsGraph(graphIRI)) ;
       
        if ( ! silentMode )
        {
            // Drop it again. - should fail
            try {
View Full Code Here

   
    @Override
    protected GraphStore getEmptyGraphStore()
    {
        Store store = SDBTestUtils.createInMemoryStore() ;
        GraphStore graphStore = SDBFactory.connectGraphStore(store) ;
        return graphStore ;
    }
View Full Code Here

       
    }

    @Test public void testCreateDrop2()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        Update u = new UpdateCreate(graphIRI) ;
        UpdateAction.execute(u, gStore) ;
       
        u = new UpdateCreate(graphIRI, true) ;
        UpdateAction.execute(u, gStore) ;
       
        assertTrue(gStore.containsGraph(graphIRI)) ;
        assertTrue(graphEmpty(gStore.getGraph(graphIRI))) ;
       
        u = new UpdateDrop(graphIRI) ;
        UpdateAction.execute(u, gStore) ;
        assertFalse(gStore.containsGraph(graphIRI)) ;
        u = new UpdateDrop(graphIRI, true) ;
        UpdateAction.execute(u, gStore) ;

    }
View Full Code Here

    }
   
    @Test public void testCreateDrop3()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "create-1.ru") ;
        assertTrue(gStore.containsGraph(graphIRI)) ;
        assertTrue(graphEmpty(gStore.getGraph(graphIRI))) ;
    }
View Full Code Here

        assertTrue(graphEmpty(gStore.getGraph(graphIRI))) ;
    }

    @Test public void testCreateDrop4()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        gStore.addGraph(graphIRI, GraphFactory.createDefaultGraph()) ;
        script(gStore, "drop-1.ru") ;
        assertFalse(gStore.containsGraph(graphIRI)) ;
    }
View Full Code Here

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


    private void update(Dataset dataset, String string)
    {
        UpdateRequest req = UpdateFactory.create(string) ;
        GraphStore gs = GraphStoreFactory.create(dataset) ;
        UpdateProcessor proc = UpdateExecutionFactory.create(req, gs) ;
        proc.execute() ;
    }
View Full Code Here

public class UpdateExecuteOperations
{
    public static void main(String []args)
    {
        // Create an empty GraphStore (has an empty default graph and no named graphs)
        GraphStore graphStore = GraphStoreFactory.create() ;
        ex1(graphStore) ;
        ex2(graphStore) ;
        ex3(graphStore) ;
    }
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.