eMoflon / emoflon-neo

A Neo4j-based implementation of eMoflon
Eclipse Public License 2.0
6 stars 2 forks source link

New solution for Implications in nested / concatenated constraints #140

Closed hijan94 closed 5 years ago

hijan94 commented 5 years ago

Possible queries, which allows correct evaluation of if/else constraint in nested/concatenated constraints:

// some other constraints
OPTIONAL MATCH (f:Field)
WITH count(f)>0 as m_0

// if/else constraint check
OPTIONAL MATCH (f1:Field)
OPTIONAL MATCH (f1:Field)-[f1_right_0_f2:right]->(f2:Field)
WITH m_0, f1, f1_right_0_f2, f2
WHERE  f1_right_0_f2 IS NULL OR f2 IS NULL 
WITH m_0, count(f1) > 0 as m_1

RETURN m_0, m_1

After each constraint OPTIONAL MATCH, return boolean expression instead of the counted number of matches. In the WHERE query only the boolean results will be inserted and evaluated only. If/else socntraint query itself must be changed slightly. As well: change WITH clause of positive and negative constraint.

Note: check if solution for conditions (with precondition) is suitable as well.

anthonyanjorin commented 5 years ago

I have decided to keep EMSL as it is and focus on getting this limited version scalable.