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