Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Graph.find()


                it = onFirstIterator ? rawGraph.find(resAsNode, Node.ANY, Node.ANY) : rawGraph.find(Node.ANY, Node.ANY, resAsNode) ;
                if ( onFirstIterator && !it.hasNext() )
                {
                    it.close() ;
                    onFirstIterator = false ;
                    it = rawGraph.find(Node.ANY, Node.ANY, resAsNode) ;
                }
            }
        }
        finally
        {
View Full Code Here


        assertTrue(safeGraph instanceof SafeGraph);
       
        Graph rawGraph = ((SafeGraph)safeGraph).getRawGraph();
        Triple deduction = new Triple(l.asNode(), q.asNode(), r.asNode());
        TestUtil.assertIteratorValues(this,
                rawGraph.find(Node.ANY, Node.ANY, Node.ANY),
                new Triple[]{deduction});
    }

}
View Full Code Here

    protected Iter<Quad> findInSpecificNamedGraph(Node g, Node s, Node p , Node o)
    {
        Graph graph = fetchGraph(g) ;
        if ( g == null )
            return Iter.nullIter() ;
        return triples2quads(g, graph.find(s, p, o)) ;
    }

    @Override
    protected Iterator<Quad> findInAnyNamedGraphs(Node s, Node p, Node o)
    {
View Full Code Here

            Node s2 = tripleNode(s) ;
            Node p2 = tripleNode(p) ;
            Node o2 = tripleNode(o) ;
            Graph graph = cxt.getActiveGraph() ;
           
            ExtendedIterator<Triple> iter = graph.find(s2, p2, o2) ;
           
            if ( false )
            {
                // Materialize the results now. Debugging only.
                List<Triple> x = iter.toList() ;
View Full Code Here

   
    @Test public void gr_union_01()
    {
        List<Node> gnodes = list(gn1, gn2) ;
        Graph g = new GraphUnionRead(dsg, gnodes) ;
        long x = Iter.count(g.find(null, null, null)) ;
        assertEquals(3, x) ;
    }
   
    @Test public void gr_union_02()
    {
View Full Code Here

    @Test public void gr_union_02()
    {
        List<Node> gnodes = list(gn1, gn2) ;
        Graph g = new GraphUnionRead(dsg, gnodes) ;
        Node s = Node.createURI("http://example/s") ;
        long x = Iter.count(g.find(s, null, null)) ;
        assertEquals(3, x) ;
    }

    @Test public void gr_union_03()
    {
View Full Code Here

    @Test public void gr_union_03()
    {
        List<Node> gnodes = list(gn1, gn2, gn9) ;
        Graph g = new GraphUnionRead(dsg, gnodes) ;
        Node o = Node.createLiteral("g2") ;
        long x = Iter.count(g.find(null, null, o)) ;
        assertEquals(1, x) ;
    }
   
    @Test public void gr_union_04()
    {
View Full Code Here

   
    @Test public void gr_union_04()
    {
        List<Node> gnodes = list(gn9) ;
        Graph g = new GraphUnionRead(dsg, gnodes) ;
        long x = Iter.count(g.find(null, null, null)) ;
        assertEquals(0, x) ;
    }

    @Test public void gr_union_05()
    {
View Full Code Here

    @Test public void gr_union_05()
    {
        List<Node> gnodes = list() ;
        Graph g = new GraphUnionRead(dsg, gnodes) ;
        long x = Iter.count(g.find(null, null, null)) ;
        assertEquals(0, x) ;
    }
   
    @Test public void gr_union_06()
    {
View Full Code Here

   
    @Test public void gr_union_06()
    {
        List<Node> gnodes = list(gn1, gn1) ;
        Graph g = new GraphUnionRead(dsg, gnodes) ;
        long x = Iter.count(g.find(null, null, null)) ;
        assertEquals(2, x) ;
    }

    static <T> List<T> list(/* Java 7 @SuppressWarnings("unchecked")*/ T...x)
    {
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.