eMoflon / emoflon-neo

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

Remove NULL checks of precondition pattern elements in the condition checks #141

Closed hijan94 closed 5 years ago

anthonyanjorin commented 5 years ago

How can I reproduce this?

hijan94 commented 5 years ago

You can use any pattern with a condition. For example pattern oneSokobanSelectedFigureRequired when enforce selectedFigureRequired will create the following query:

MATCH 
(sokoban:Sokoban)
WITH sokoban

OPTIONAL MATCH 
(b_1:Board)-[b_1_selectedFigure_0_sokoban_1:selectedFigure]->(sokoban:Sokoban), 
(sokoban:Sokoban)

WITH sokoban, b_1, b_1_selectedFigure_0_sokoban_1
WHERE b_1 IS NOT NULL AND b_1_selectedFigure_0_sokoban_1  IS NOT NULL AND sokoban IS NOT NULL
WITH sokoban, b_1, b_1_selectedFigure_0_sokoban_1
RETURN sokoban

The last check AND sokoban IS NOT NULL is unnecessary.