@Test public void testEvaluationForProperties() { String queryString = "MATCH (a), (b), (c)" + "WHERE a=b AND a.name = \"Alice\" AND a.age > c.age"; QueryHandler query = new QueryHandler(queryString); CNF cnf = query.getPredicates(); GradoopId a = GradoopId.get(); GradoopId c = GradoopId.get(); PropertyValue[] propertiesA = new PropertyValue[]{ PropertyValue.create("Alice"), PropertyValue.create(42) }; Embedding embedding = new Embedding(); embedding.add( a, propertiesA ); PropertyValue[] propertiesB = new PropertyValue[]{PropertyValue.create(23)}; embedding.add(a); embedding.add( c, propertiesB ); EmbeddingMetaData metaData = new EmbeddingMetaData(); metaData.setEntryColumn("a", EntryType.VERTEX, 0); metaData.setEntryColumn("b", EntryType.VERTEX, 1); metaData.setEntryColumn("c", EntryType.VERTEX, 2); metaData.setPropertyColumn("a", "name", 0); metaData.setPropertyColumn("a", "age", 1); metaData.setPropertyColumn("c", "age", 2); assertTrue(cnf.evaluate(embedding, metaData)); }
@Override public boolean evaluate(Embedding embedding, EmbeddingMetaData metaData) { for (CNFElement element : predicates) { if (!element.evaluate(embedding, metaData)) { return false; } } return true; }
CNF extends PredicateCollection<CNFElement> { @Override public boolean evaluate(Embedding embedding, EmbeddingMetaData metaData) { for (CNFElement element : predicates) { if (!element.evaluate(embedding, metaData)) { return false; } } return true; } }
CNF extends PredicateCollection<CNFElement> { @Override public boolean evaluate(Embedding embedding, EmbeddingMetaData metaData) { for (CNFElement element : predicates) { if (!element.evaluate(embedding, metaData)) { return false; } } return true; } CNF();  CNF(List<CNFElement> predicates);  CNF(CNF copyValue); }
CNF extends PredicateCollection<CNFElement> { @Override public boolean evaluate(Embedding embedding, EmbeddingMetaData metaData) { for (CNFElement element : predicates) { if (!element.evaluate(embedding, metaData)) { return false; } } return true; } 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 boolean evaluate(Embedding embedding, EmbeddingMetaData metaData) { for (CNFElement element : predicates) { if (!element.evaluate(embedding, metaData)) { return false; } } return true; } 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);  }