Package com.hp.hpl.jena.sparql.core

Examples of com.hp.hpl.jena.sparql.core.Var


    }
    t = jj_consume_token(RBRACE);
  }

  final public void InlineDataFull() throws ParseException {
                          Var v ; Node n ; Token t ; int beginLine; int beginColumn;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case NIL:
      jj_consume_token(NIL);
      break;
    case LPAREN:
View Full Code Here


    }
    throw new Error("Missing return statement in function");
  }

  final public Element Assignment() throws ParseException {
                         Var v ; Expr expr ;
    jj_consume_token(LET);
    jj_consume_token(LPAREN);
    v = Var();
    jj_consume_token(ASSIGN);
    expr = Expression();
View Full Code Here

    public static void addAll(BindingMap dest, Binding src)
    {
        Iterator<Var> iter = src.vars() ;
        for ( ; iter.hasNext() ; )
        {
            Var v = iter.next() ;
            Node n = src.get(v) ;
            dest.add(v, n) ;
        }
    }
View Full Code Here

            while( ! lookingAt(TokenType.DOT) )
            {
                if ( i >= vars.size() )
                    exception(peekToken(), "Too many items in a line.  Expected "+vars.size()) ;
               
                Var v = vars.get(i) ;
               
                Token token = nextToken() ;
                if ( ! token.hasType(TokenType.MINUS ) )
                {
                    Node n ;
                    // One case; VARS line then *
                    if ( token.hasType(TokenType.STAR ) || ( token.isCtlCode() && token.getCntrlCode() == -1 ) )
                        n = lastLine.get(v) ;
                    else if ( token.hasType(TokenType.BNODE) )
                        n = NodeFactory.createAnon(new AnonId(NodeFmtLib.decodeBNodeLabel(token.getImage()))) ;
                    else
                        n = profile.create(null, token) ;
                    binding.add(v, n) ;
                }
                i++ ;
            }
            if ( eof() )
                exception(peekToken(), "Line does not end with a DOT") ;
           
            Token dot = nextToken() ;
           
            if ( i != vars.size() )
            {
                Var v = vars.get(vars.size()-1) ;
                exception(dot, "Too many items in a line.  Expected "+vars.size()) ;
            }
            lastLine = binding ;
            return binding ;
        }
View Full Code Here

            while (! eof() && ! lookingAt(DOT) )
            {
                Token t = nextToken() ;
                if ( ! t.hasType(TokenType.VAR) )
                    exception(t, "VARS requires a list of variables (found '"+t+"')") ;
                Var v = Var.alloc(t.getImage()) ;
                vars.add(v) ;
            }
            nextToken() ;   // DOT
        }
View Full Code Here

            Evaluator e2 = EvaluatorFactory.create(execCxt2) ;
            return eval(e2, opGraph.getSubOp()) ;
        }
       
        // Graph node is a variable.
        Var gVar = Var.alloc(opGraph.getNode()) ;
        Table current = null ;
        for ( Iterator<Node> iter = execCxt.getDataset().listGraphNodes() ; iter.hasNext() ; )
        {
            Node gn = iter.next();
            Graph graph = execCxt.getDataset().getGraph(gn) ;
View Full Code Here

            return TableFactory.create(qIter) ;
        }
        else
        {
            // Variable.
            Var gVar = Var.alloc(opQuad.getGraphNode()) ;
            // Or just just devolve to OpGraph and get OpUnion chain of OpJoin
            QueryIterConcat concat = new QueryIterConcat(cxt) ;
            for ( Iterator<Node> graphNodes = cxt.getDataset().listGraphNodes() ; graphNodes.hasNext(); )
            {
                Node gn = graphNodes.next() ;
View Full Code Here

       
        @Override
        public void visit(P_FixedLength pFixedLength)
        {
            Op op = null ;
            Var v1 = null ;
            for ( int i = 0 ; i < pFixedLength.getCount() ; i++ )
            {
                Var v2 = varAlloc.allocVar() ;
                Node s = (v1 == null) ? subject : v1 ;
                Node o = (i == pFixedLength.getCount()-1) ? object : v2 ;
                Op op1 = transformPath(null, s, pFixedLength.getSubPath() , o) ;
                op = join(op,  op1) ;
                v1 = v2 ;
View Full Code Here

        }
       
        @Override
        public void visit(P_Seq pathSeq)
        {
            Var v = varAlloc.allocVar() ;
            Op op1 = transformPath(null, subject, pathSeq.getLeft() , v) ;
            Op op2 = transformPath(null, v, pathSeq.getRight() , object) ;
            result = join(op1, op2) ;
        }
View Full Code Here

        List<Binding> results = new ArrayList<Binding>() ;
       
        if (! Var.isVar(endNode))
            throw new ARQInternalErrorException("Non-variable endnode in _execTriplePath") ;
       
        Var var = Var.alloc(endNode) ;
        // Assign.
        for (; iter.hasNext();)
        {
            Node n = iter.next() ;
            results.add(BindingFactory.binding(binding, var, n)) ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.core.Var

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.