Package com.hp.hpl.jena.sparql.engine.binding

Examples of com.hp.hpl.jena.sparql.engine.binding.Binding


        // -------- Either read the query iterator directly ...
        if ( false )
        {
            for ( ; qIter.hasNext() ; )
            {
                Binding b = qIter.nextBinding() ;
                Node n = b.get(var_x) ;
                System.out.println(FmtUtils.stringForNode(n)) ;
                System.out.println(b) ;
            }
            qIter.close() ;
        }
View Full Code Here


        QueryIterator qIter = Algebra.exec(op, Ex1.createModel()) ;
       
        // Results
        for ( ; qIter.hasNext() ; )
        {
            Binding b = qIter.nextBinding() ;
            System.out.println(b) ;
        }
        qIter.close() ;
    }
View Full Code Here

        if ( ! node.isURI() ) return ;
        Node localname = Node.createLiteral(node.getLocalName()) ;
        if ( nodeLocalname.isVariable() )
        {
            // Object is an unbound variable.
            Binding b = new BindingMap(input) ;
            // Bind a pair for subject and object variables
            b.add(Var.alloc(subjVar), node) ;
            b.add(Var.alloc(nodeLocalname), localname) ;
            bindings.add(b) ;
            return ;
        }
       
        // Object is a value / bound variable.
        if ( ! nodeLocalname.sameValueAs(localname) )
            return ;
        // Bind subject to this node.
        Binding b = BindingFactory.binding(input, subjVar, node) ;
        bindings.add(b) ;
    }
View Full Code Here

   
    @Override
    public QueryIterator iterator(ExecutionContext execCxt)
    {
        // BindingRoot?
        Binding binding = BindingFactory.binding() ;
        return QueryIterSingleton.create(binding, execCxt) ;
    }
View Full Code Here

                throw new NoSuchElementException(Utils.className(this)) ;
           
            if ( ! hasNextBinding() )
                throw new NoSuchElementException(Utils.className(this)) ;
   
            Binding obj = moveToNextBinding() ;
            if ( obj == null )
                throw new NoSuchElementException(Utils.className(this)) ;
           
            if ( shouldCancel && ! finished )
            {
View Full Code Here

        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

        List<Binding> x = new ArrayList<Binding>() ;
        Set<Binding> seen = new HashSet<Binding>() ;
       
        for ( ; results.hasNext() ; )
        {
            Binding b = results.nextBinding() ;
            if ( seen.contains(b) )
                continue ;
            seen.add(b) ;
            x.add(b) ;
        }
View Full Code Here

        Var cVar = Var.alloc(containerNode) ;
        for ( Iterator<Node> iter = c.iterator() ; iter.hasNext() ; )
        {
            Node cn = iter.next() ;
            //Binding the container node.
            Binding b = BindingFactory.binding(binding, cVar, cn) ;
            Node m = member ;
            // Special case of ?x rdfs:member ?x
            if ( Var.isVar(member) && member.equals(cVar) )
                m = cn ;
           
View Full Code Here

        List<Binding> bindings = new ArrayList<Binding>() ;
        for ( Iterator<Node> iter = x.iterator() ; iter.hasNext() ; )
        {
            Node n = iter.next() ;
            Binding b = BindingFactory.binding(binding, memberVar, n) ;
            bindings.add(b) ;
        }
       
        // Turn into a QueryIterator of extra bindings.
        return new QueryIterPlainWrapper(bindings.iterator(), execCxt) ;
View Full Code Here

        // -------- Either read the query iterator directly ...
        if ( false )
        {
            for ( ; qIter.hasNext() ; )
            {
                Binding b = qIter.nextBinding() ;
                Node n = b.get(var_x) ;
                System.out.println(NodeFmtLib.displayStr(n)) ;
                System.out.println(b) ;
            }
            qIter.close() ;
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.engine.binding.Binding

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.