@Test public void extractVariablesTest() { QueryHandler query = new QueryHandler("MATCH (a), (b) WHERE a=b OR a.name = \"Alice\""); CNFElement cnfElement = query.getPredicates().getPredicates().get(0); Set<String> reference = new HashSet<>(); reference.add("a"); reference.add("b"); assertEquals(reference, cnfElement.getVariables()); }
@Override public Set<String> getVariables() { Set<String> variables = new HashSet<>(); for (ComparisonExpression comparisonExpression : predicates) { variables.addAll(comparisonExpression.getVariables()); } return variables; }
CNFElement extends PredicateCollection<ComparisonExpression> { @Override public Set<String> getVariables() { Set<String> variables = new HashSet<>(); for (ComparisonExpression comparisonExpression : predicates) { variables.addAll(comparisonExpression.getVariables()); } return variables; } }
CNFElement extends PredicateCollection<ComparisonExpression> { @Override public Set<String> getVariables() { Set<String> variables = new HashSet<>(); for (ComparisonExpression comparisonExpression : predicates) { variables.addAll(comparisonExpression.getVariables()); } return variables; } CNFElement();  CNFElement(List<ComparisonExpression> predicates); }
CNFElement extends PredicateCollection<ComparisonExpression> { @Override public Set<String> getVariables() { Set<String> variables = new HashSet<>(); for (ComparisonExpression comparisonExpression : predicates) { variables.addAll(comparisonExpression.getVariables()); } return variables; } CNFElement();  CNFElement(List<ComparisonExpression> predicates); @Override boolean evaluate(Embedding embedding, EmbeddingMetaData metaData); @Override boolean evaluate(GraphElement element); @Override Set<String> getVariables(); @Override Set<String> getPropertyKeys(String variable); @Override String operatorName(); }
CNFElement extends PredicateCollection<ComparisonExpression> { @Override public Set<String> getVariables() { Set<String> variables = new HashSet<>(); for (ComparisonExpression comparisonExpression : predicates) { variables.addAll(comparisonExpression.getVariables()); } return variables; } CNFElement();  CNFElement(List<ComparisonExpression> predicates); @Override boolean evaluate(Embedding embedding, EmbeddingMetaData metaData); @Override boolean evaluate(GraphElement element); @Override Set<String> getVariables(); @Override Set<String> getPropertyKeys(String variable); @Override String operatorName();  }