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) ; }
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) ; }
public static Graph buildGraph(Graph graph, ItemList list) { if ( ! list.isEmpty() && list.get(0).isSymbol() ) { if ( list.get(0).isSymbol(Tags.tagGraph) ) list = list.cdr(); } for (Item item : list) { BuilderLib.checkList(item) ; Triple triple = buildTriple(item.getList()) ; graph.add(triple) ; } return graph ; }
public static Graph buildGraph(Graph graph, ItemList list) { if ( ! list.isEmpty() && list.get(0).isSymbol() ) { if ( list.get(0).isSymbol(Tags.tagGraph) ) list = list.cdr(); } for (Item item : list) { BuilderLib.checkList(item) ; Triple triple = buildTriple(item.getList()) ; graph.add(triple) ; } return graph ; }
@Override public Op make(ItemList list) { BuilderLib.checkLength(3, 4, list, "leftjoin: wanted 2 or 3 arguments") ; Op left = build(list, 1) ; Op right = build(list, 2) ; ExprList expr = null ; if ( list.size() == 4 ) { Item exprItem = list.get(3) ; // Allow empty if ( exprItem.isList() && exprItem.getList().isEmpty() ) {} else expr = BuilderExpr.buildExprOrExprList(exprItem) ; } Op op = OpLeftJoin.create(left, right, expr) ; return op ; } } ;
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) ; } }
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) ; } }
ItemList graphContent = item.getList().cdr(); if ( !graphContent.isEmpty() && graphContent.car().isNode() )
ItemList graphContent = item.getList().cdr(); if ( !graphContent.isEmpty() && graphContent.car().isNode() )