Examples of GraphStore


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

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

    @Test public void testUpdateScript3()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "update-3.ru") ;
        assertTrue(graphEmpty(gStore.getGraph(Node.createURI("http://example/g1")))) ;
        assertTrue(graphEmpty(gStore.getDefaultGraph())) ;
    }
View Full Code Here

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

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

    @Test public void testUpdateScript4()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "data-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

                                 new Triple(s,p,NodeFactory.parseNode("123")))) ;
    }
   
    @Test public void testUpdateScript5()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        script(gStore, "data-2.ru") ;
       
       
        Graph g = GraphFactory.createPlainGraph() ;
        Node b = Node.createAnon() ;
       
        g.add(new Triple(s, p, b)) ;
        g.add(new Triple(b, q, v)) ;
        assertTrue(g.isIsomorphicWith(gStore.getDefaultGraph())) ;
    }
View Full Code Here

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

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

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

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

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

//        assertTrue(graphEmpty(graph)) ;
//    }
   
    @Test public void testUpdateInitialBinding4()
    {
        GraphStore gStore = getEmptyGraphStore() ;
        defaultGraphData(gStore, graph1) ;
        String update = "DELETE WHERE { ?x <http://example/p> 2007 } ; INSERT { ?x <http://example/p> 1999 } WHERE {}" ;
        UpdateRequest req = UpdateFactory.create(update) ;
       
        Binding b = BindingFactory.binding(Var.alloc("x"), s) ;
        UpdateAction.execute(req, gStore, b) ;
        assertEquals(1, gStore.getDefaultGraph().size()) ;
        assertTrue(gStore.getDefaultGraph().contains(s, p, NodeFactory.parseNode("1999"))) ;
    }
View Full Code Here

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

        searcher = new IndexSearcher(DirectoryReader.open(indexDir));
    }

    private void entailSKOSModel() {
        GraphStore graphStore = GraphStoreFactory.create(skosModel);
        String sparqlQuery =
                "PREFIX skos: <http://www.w3.org/2004/02/skos/core#>\n"
                + "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"
                + "INSERT { ?subject rdf:type skos:Concept }\n"
                + "WHERE {\n"
View Full Code Here

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

        //   existing writer finishes.
       
        dataset.begin(ReadWrite.WRITE) ;
        try
        {
            GraphStore graphStore = GraphStoreFactory.create(dataset) ;
            // Do a SPARQL Update.
            String sparqlUpdateString = StrUtils.strjoinNL(
                 "PREFIX . <http://example/>",
                 "INSERT { :s :p ?now } WHERE { BIND(now() AS ?now) }"
                 ) ;
View Full Code Here

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

    }
   
    @Override
    protected final void exec()
    {
        GraphStore graphStore = modGraphStore.getGraphStore() ;
        if ( graphStore.getDefaultGraph() == null )
            graphStore.setDefaultGraph(ModelFactory.createDefaultModel().getGraph());
        execUpdate(graphStore) ;
    }
View Full Code Here

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

    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
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.