Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Triple


        return innerEconomizer.economize(n);
    }

    @Override
    public Triple economize(Triple that) {
        return new Triple(
                e(that.getSubject()),
                e(that.getPredicate()),
                e(that.getObject())
                );
    }
View Full Code Here


    }
   
    @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) ;
       
View Full Code Here

    }
   
    @Test public void testCopy()
    {
        // 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) ;
       
View Full Code Here

    @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

    @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

    @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

       
       
        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

    @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

    @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

        Node g = Node.createURI("g") ;

        // Assumes an empty graph is detectable
        dsg.addGraph(g, GraphFactory.createDefaultGraph());
        assertTrue(dsg.containsGraph(g)) ;
        Triple t = SSE.parseTriple("(<s> <p> <o>)") ;
       
        dsg.getGraph(g).add(t) ;
        assertTrue(dsg.getGraph(g).contains(t)) ;

       
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Triple

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.