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

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


        {
            Log.warn(this, "Attempt to use OpFetch - need to enable first with a call to OpFetch.enable()") ;
            return OpLabel.create("fetch/"+serviceNode, OpTable.unit()) ;
        }
        Item item = Item.createNode(elt.getFetchNode()) ;
        ItemList args = new ItemList() ;
        args.add(item) ;
        return builder.make(args) ;
    }
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

    }
   
    @Override
    public void listStart(int line, int column)
    {
        ItemList list = new ItemList(line, column) ;
        pushList(list) ;
        setCurrentItem(Item.createList(list)) ;
    }
View Full Code Here

    }

    @Override
    public void listFinish(int line, int column)
    {
        ItemList list = popList() ;
        Item item = Item.createList(list) ;
        listAdd(item) ;
    }
View Full Code Here

            return ;
        }
       
        if ( item != null )
        {
            ItemList list = currentList() ;
            list.add(item) ;
        }
        setCurrentItem(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

    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

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.