public static QueryProcess create(Producer p) { Matcher match; if (p instanceof ProducerImpl) { ProducerImpl prod = (ProducerImpl) p; match = MatcherImpl.create(prod.getGraph()); prod.set(match); if (prod.isMatch()) { // there is local match in Producer // create global match with Relax mode match = MatcherImpl.create(prod.getGraph()); match.setMode(Matcher.RELAX); } } else { match = MatcherImpl.create(Graph.create()); match.setMode(Matcher.RELAX); } QueryProcess exec = QueryProcess.create(p, match); return exec; }