Package com.hp.hpl.jena.sparql.sse

Examples of com.hp.hpl.jena.sparql.sse.ItemList


{
      
    public static ResultSet build(Item item)
    {
        BuilderLib.checkTagged(item, Tags.tagResultSet, "Not a (resultset ...)") ;
        ItemList list = item.getList() ;
       
        List<Var> vars = BuilderNode.buildVarList(list.get(1)) ;
        // skip tag, skip vars.
        int start = 2 ;

        List<Binding> bindings = new ArrayList<>() ;
        for ( int i = start ; i < list.size() ; i++ )
        {
            Item itemRow = list.get(i) ;
            Binding b = BuilderBinding.build(itemRow) ;
            bindings.add(b) ;
        }
       
        QueryIterator qIter = new QueryIterPlainWrapper(bindings.listIterator()) ;
View Full Code Here


    {
        if ( ! item.isTagged(Tags.tagBGP) )
            BuilderLib.broken(item, "Not a basic graph pattern") ;
        if ( ! item.isList() )
            BuilderLib.broken(item, "Not a list for a basic graph pattern") ;
        ItemList list = item.getList() ;
        return buildBGP(list) ;
       
    }
View Full Code Here

    public static ExprList buildExprList(Item item)
    {
        if ( ! item.isTagged(Tags.tagExprList) )
            BuilderLib.broken(item, "Not tagged exprlist") ;
       
        ItemList list = item.getList() ;
        return buildExprListUntagged(list, 1) ;
    }
View Full Code Here

    public static VarExprList buildNamedExprOrExprList(Item item)
    {
        if ( ! item.isList() )
            BuilderLib.broken(item, "Not a var expr list") ;
       
        ItemList list = item.getList() ;
       
        if ( list.isEmpty() )
            return new VarExprList() ;
       
        if ( list.car().isList() )
            // List of lists
            return buildNamedExprList(list) ;
        // One item
        return buildNamedExpr(item) ;
    }
View Full Code Here

            return ;
        }
        if ( !item.isList() || item.getList().size() != 2 )
            BuilderLib.broken(item, "Not a var or var/expression pair") ;

        ItemList list = item.getList() ;

        if ( list.size() == 1 )
        {
            Var v = BuilderNode.buildVar(list.car()) ;
            varExprList.add(v) ;
            return ;
        }
       
        if ( list.size() != 2 )
            BuilderLib.broken(list, "Not a var or var/expression pair") ;
        Var var = BuilderNode.buildVar(list.get(0)) ;
        Expr expr = BuilderExpr.buildExpr(list.get(1)) ;
        varExprList.add(var, expr)
    }
View Full Code Here

    {
        Expr expr = null ;
   
        if ( item.isList() )
        {
            ItemList list = item.getList() ;
           
            if ( list.size() == 0 )
                BuilderLib.broken(item, "Empty list for expression") ;
           
            Item head = list.get(0) ;
           
            if ( head.isNode() )
            {
                if ( head.getNode().isVariable() && list.size() == 1 )
                {
                    // The case of (?z)
                    return new ExprVar(Var.alloc(head.getNode())) ;
                }
                return buildFunctionCall(list) ;
            }
            else if ( head.isList() )
                BuilderLib.broken(item, "Head is a list") ;
            else if ( head.isSymbol() )
            {
                if ( item.isTagged(Tags.tagExpr) )
                {
                    BuilderLib.checkLength(2, list, "Wrong length: "+item.shortString()) ;
                    item = list.get(1) ;
                    return buildItem(item) ;
                }
               
                return buildKnownFunction(list) ;               
            }
View Full Code Here

    private void init(Item stats)
    {
        if ( !stats.isTagged(STATS) )
            throw new ARQException("Not a tagged '"+STATS+"'") ;

        ItemList list = stats.getList().cdr();      // Skip tag
       
        if ( list.car().isTagged(META) )
        {       
            // Process the meta tag.
            Item elt1 = list.car();
            list = list.cdr();      // Move list on

            // Get count.
            Item x = Item.find(elt1.getList(), COUNT) ;
            if ( x != null )
                count = x.getList().get(1).asInteger() ;
        }
      
        while (!list.isEmpty())
        {
            Item elt = list.car() ;
            list = list.cdr();
            onePattern(elt) ;
        }
    }
View Full Code Here

    static abstract class BuildAggCommon implements Build
    {
        @Override
        public final Expr make(ItemList list)
        {
            ItemList x = list.cdr();    // drop "sum"
            boolean distinct = startsWithDistinct(x) ;
            if ( distinct )
                x = x.cdr();
            BuilderLib.checkLength(1, x, "Broken syntax: "+list.shortString()) ;
            // (sum ?var)
            Expr expr = buildExpr(x.get(0)) ;
            return make(distinct, expr) ;
        }
View Full Code Here

    }
   
    public static List<Node> buildNodeList(Item item)
    {
        BuilderLib.checkList(item) ;
        ItemList list = item.getList() ;
        return buildNodeList(list) ;
    }
View Full Code Here

    }
   
    public static List<Var> buildVarList(Item item)
    {
        BuilderLib.checkList(item) ;
        ItemList list = item.getList() ;
        return buildVarList(list) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.sse.ItemList

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.