eMoflon / emoflon-neo

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

Problem with fwd_opt #298

Open anthonyanjorin opened 4 years ago

anthonyanjorin commented 4 years ago

The current example is a very simple TGG.

In src/bag2bag.runtime/...GEN_Run.java the model generator is already configured to apply each TGG rule only once and then finally to delete the target model. There's a flag in the code to either (1) delete the target model node too, or (2) delete only all target elements but leave the target model.

Ideally, this shouldn't make a difference and we should be able to cope with both scenarios. At the moment however:

  1. Nothing happens (no non-trivial matches)
  2. Matches are collected (seems to make sense), but then the following exception is thrown:
    13631 [main] ERROR on.neo.cypher.models.NeoCoreBuilder  - org.neo4j.driver.v1.exceptions.ClientException: Node(934) already exists with label `NeoCore__Model` and property `ename` = 'Bag2Bag_Target'
    org.neo4j.driver.v1.exceptions.ClientException: Node(934) already exists with label `NeoCore__Model` and property `ename` = 'Bag2Bag_Target'
    at org.neo4j.driver.internal.util.Futures.blockingGet(Futures.java:122)
    at org.neo4j.driver.internal.ExplicitTransaction.close(ExplicitTransaction.java:117)
    at org.emoflon.neo.cypher.models.NeoCoreBuilder.executeQuery(NeoCoreBuilder.java:130)
    at org.emoflon.neo.cypher.rules.NeoRule.applyBatch(NeoRule.java:138)
    at org.emoflon.neo.cypher.rules.NeoRule.applyAll(NeoRule.java:119)
    at org.emoflon.neo.engine.modules.NeoGenerator.applyMatches(NeoGenerator.java:158)
    at org.emoflon.neo.engine.generator.Generator.lambda$0(Generator.java:75)
    at java.base/java.util.Map.forEach(Map.java:661)
    at org.emoflon.neo.engine.generator.Generator.generate(Generator.java:74)
    at bag2bag.runtime.Bag2Bag_FWD_OPT_Run.run(Bag2Bag_FWD_OPT_Run.java:60)
    at bag2bag.runtime.Bag2Bag_FWD_OPT_Run.main(Bag2Bag_FWD_OPT_Run.java:46)

fwd_opt_problem.zip