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

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


    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

        BindingMap binding = BindingFactory.create() ;
        for ( int i = 1 ; i < list.size() ; i++ )
        {
            Item item = list.get(i) ;
            BuilderLib.checkList(item, "Attempt to build a binding pair from non-list: "+item) ;
            ItemList pair = item.getList() ;
            BuilderLib.checkLength(2, pair, "Need a pair for a binding") ;
           
            Var v = BuilderNode.buildVar(pair.get(0)) ;
            Item cdr = pair.get(1) ;
            // undef
            if ( cdr.isSymbolIgnoreCase(Tags.tagUndef) || cdr.isSymbolIgnoreCase(Tags.tagNull) )
                continue ;
           
            BuilderLib.checkNode(cdr) ;
View Full Code Here

        {
            if ( ! item.isTagged(Tags.tagGraph) )
                BuilderLib.broken(item, "Expected (graph ...) as elements of a dataset") ;
           
            Node name = null ;
            ItemList graphContent = item.getList().cdr();

            if ( !graphContent.isEmpty() && graphContent.car().isNode() )
            {
                name = graphContent.car().getNode();
                graphContent = graphContent.cdr() ;
            }
           
            Graph g ;
            if ( name == null )
            {
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

    {
        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

            BuilderLib.broken(item, "Attempt to build evaluation from a bare symbol") ;

        if ( ! item.isTagged(Tags.tagExec) )
            throw new BuildException("Wanted ("+Tags.tagExec+"...) : got: "+item.shortString());

        ItemList list = item.getList() ;
        BuilderLib.checkLength(3, list, item.shortString()+ " does not have 2 components");
       
        DatasetGraph dsg = BuilderGraph.buildDataset(list.get(1)) ;
        Op op = BuilderOp.build(list.get(2)) ;
        QueryExecUtils.execute(op, dsg, ResultsFormat.FMT_TEXT) ;
    }
View Full Code Here

    { super.listStart(line, column) ; }

    @Override
    public void listFinish(int line, int column)
    {
        ItemList list = currentList() ;

        if ( ! frameStack.isCurrent(list) )
        {
            // Nothing special - proceed as normal.
            super.listFinish(line, column) ;
View Full Code Here

    {
        // Always add to the current list, even for (base...) and (prefix...)
        // Then change the result list later.
        super.listAdd(item) ;
       
        ItemList list = super.currentList() ;
       
        if ( list == null )
            // Top level is outside a list.  Can't be a form.
            return ;

        Frame lastFrame = frameStack.getCurrent()  ;
       
        if ( ! inDecl && /*! sameAsLast &&*/ list.size() == 1 && isForm(list.getFirst() ) )
        {
            startForm(list) ;
            Frame f = new Frame(list) ;
            frameStack.push(f) ;
            inDecl = true ;
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.