public boolean isEmpty() { return pattern.isEmpty() ; }
static private Op flush(BasicPattern bp, Op op) { if ( bp == null || bp.isEmpty() ) return op; OpBGP opBGP = new OpBGP(bp); op = OpSequence.create(op, opBGP); return op; }
private static Op flush(BasicPattern pattern, Op op) { if ( pattern == null || pattern.isEmpty() ) { if ( op == null ) return OpTable.unit() ; return op ; } OpBGP opBGP = new OpBGP(pattern) ; return OpSequence.create(op, opBGP) ; }
public static Op buildPropertyFunctions(PropertyFunctionRegistry registry, OpBGP opBGP, Context context) { if ( opBGP.getPattern().isEmpty() ) return opBGP ; return compilePattern(registry, opBGP.getPattern(), context) ; }
private static QueryIterator executeBGP(BasicPattern pattern, QueryIterator input, ExecutionContext execCxt) { if (pattern.isEmpty()) return input ; boolean hideBNodeVars = execCxt.getContext().isTrue(ARQ.hideNonDistiguishedVariables) ; StageGenerator gen = StageBuilder.executeInline ; QueryIterator qIter = gen.execute(pattern, input, execCxt) ; // Remove non-distinguished variables here. // Project out only named variables. if (hideBNodeVars) qIter = new QueryIterDistinguishedVars(qIter, execCxt) ; return qIter ; }
public static Element applyTransform(ElementTriplesBlock el, Map<Node, BinaryRelation> virtualPredicates, Generator<Var> rootVarGen) { BasicPattern bgp = el.getPattern(); BasicPattern newPattern = new BasicPattern(); List<Element> elements = new ArrayList<Element>(bgp.size()); for(Triple triple : bgp) { Generator<Var> varGen = rootVarGen.clone(); Element e = applyTransform(triple, virtualPredicates, varGen); if(e == null) { newPattern.add(triple); } else { elements.add(e); } } Iterable<Element> items = newPattern.isEmpty() ? elements : Iterables.concat(Collections.singleton(new ElementTriplesBlock(newPattern)), elements) ; Element result = ElementUtils.createElementGroup(items); return result; }
if ( triples.isEmpty() ) return;
if ( ((OpBGP)op).getPattern().isEmpty() ) noPattern = true ;
if ( ((OpBGP)op).getPattern().isEmpty() ) noPattern = true ;