use of org.apache.jena.sparql.algebra.op.OpPropFunc in project jena by apache.
the class PropertyFunctionGenerator method makeStages.
private static Op makeStages(BasicPattern triples, Map<Triple, PropertyFunctionInstance> pfInvocations) {
// Step 3 : Make the operation expression.
// For each property function, insert the implementation
// For each block of non-property function triples, make a BGP.
Op op = null;
BasicPattern pattern = null;
for (Triple t : triples) {
if (pfInvocations.containsKey(t)) {
op = flush(pattern, op);
pattern = null;
PropertyFunctionInstance pfi = pfInvocations.get(t);
OpPropFunc opPF = new OpPropFunc(t.getPredicate(), pfi.getSubjectArgList(), pfi.getObjectArgList(), op);
op = opPF;
continue;
}
// Regular triples - make sure there is a basic pattern in progress.
if (pattern == null)
pattern = new BasicPattern();
pattern.add(t);
}
op = flush(pattern, op);
return op;
}
Aggregations