Thank you, that link is useful! I’m sorry that I missed it.
It doesn’t seem like the problem (as far as I’ve looked into it) is an incompatibility between cypher-as-neo4j-implements-it and cypher-as-memgraph-implements-it.
I ran a minimal query manually and it worked as expected, while when my program runs it using the hasbolt library it does not fail, but the results are not as expected. Is there a way of logging the queries received by memgraph? The memgraph logs at /var/log/memgraph/memgraph.log only show connection information and snapshot creation information, nothing that seems useful (and verbosity seems to be at the maximum level, --min-log-level=0
)
I have logged the queries I have made and confirmed that they are the same ones I ran manually, but the hasbolt library might be adding something to them, and the transactions are not the same (when using hasbolt they are ran as one transaction while manually they run as separate transactions, but that shouldn’t change the output in this case.)
For reference, the queries are:
CREATE (crown:Crown)-[:Meta]->(root:Rule:Root {label: $label})-[:DerivedBy {name: "root"}]->(g:Goal {hyps: [], discards: []})-[:Meta]->(crown)
CREATE (n:Formula {formula: $rootFormula})
SET n.root = id(root)
CREATE (g)-[:Derives]->(n)
RETURN id(root) AS rootId, id(g) AS goalId
// id(root) was 48
MERGE (l:Formula {formula: "(-> 1 2)", root: 48})
MERGE (r:Formula {formula: "(-> (-> 1 (-> 2 3)) (-> 1 3))", root: 48})
MERGE (n:Formula {formula: "(-> (-> 1 2) (-> (-> 1 (-> 2 3)) (-> 1 3)))", root: 48})
MERGE (l)-[:Builds{ant: true}]->(n)<-[:Builds{csq: true}]-(r)
RETURN n
UNION ALL
MERGE (l:Formula {formula: "1", root: 48})
MERGE (r:Formula {formula: "2", root: 48})
MERGE (n:Formula {formula: "(-> 1 2)", root: 48})
MERGE (l)-[:Builds{ant: true}]->(n)<-[:Builds{csq: true}]-(r)
RETURN n
UNION ALL
MERGE (l:Formula {formula: "(-> 1 (-> 2 3))", root: 48})
MERGE (r:Formula {formula: "(-> 1 3)", root: 48})
MERGE (n:Formula {formula: "(-> (-> 1 (-> 2 3)) (-> 1 3))", root: 48})
MERGE (l)-[:Builds{ant: true}]->(n)<-[:Builds{csq: true}]-(r)
RETURN n
UNION ALL
MERGE (l:Formula {formula: "1", root: 48})
MERGE (r:Formula {formula: "(-> 2 3)", root: 48})
MERGE (n:Formula {formula: "(-> 1 (-> 2 3))", root: 48})
MERGE (l)-[:Builds{ant: true}]->(n)<-[:Builds{csq: true}]-(r)
RETURN n
UNION ALL
MERGE (l:Formula {formula: "2", root: 48})
MERGE (r:Formula {formula: "3", root: 48})
MERGE (n:Formula {formula: "(-> 2 3)", root: 48})
MERGE (l)-[:Builds{ant: true}]->(n)<-[:Builds{csq: true}]-(r)
RETURN n
UNION ALL
MERGE (l:Formula {formula: "1", root: 48})
MERGE (r:Formula {formula: "3", root: 48})
MERGE (n:Formula {formula: "(-> 1 3)", root: 48})
MERGE (l)-[:Builds{ant: true}]->(n)<-[:Builds{csq: true}]-(r)
RETURN n
(The second one doesn’t use parameters and is dynamically built from the response from the first query, which is bad practice, I know!)
When running manually I see all nodes as expected:
memgraph> MATCH (n) RETURN n;
+-------------------------------------------------------------------------------+
| n |
+-------------------------------------------------------------------------------+
| (:Crown) |
| (:Rule:Root {label: ""}) |
| (:Goal {discards: [], hyps: []}) |
| (:Formula {formula: "(-> (-> 1 2) (-> (-> 1 (-> 2 3)) (-> 1 3)))", root: 52}) |
| (:Formula {formula: "(-> 1 2)", root: 52}) |
| (:Formula {formula: "(-> (-> 1 (-> 2 3)) (-> 1 3))", root: 52}) |
| (:Formula {formula: "1", root: 52}) |
| (:Formula {formula: "2", root: 52}) |
| (:Formula {formula: "(-> 1 (-> 2 3))", root: 52}) |
| (:Formula {formula: "(-> 1 3)", root: 52}) |
| (:Formula {formula: "(-> 2 3)", root: 52}) |
| (:Formula {formula: "3", root: 52}) |
+-------------------------------------------------------------------------------+
12 rows in set (0.001 sec)
when using my app (and hasbolt):
memgraph> MATCH (n) RETURN n;
+-------------------------------------------------------------------------------+
| n |
+-------------------------------------------------------------------------------+
| (:Crown) |
| (:Rule:Root {label: ""}) |
| (:Goal {discards: [], hyps: []}) |
| (:Formula {formula: "(-> (-> 1 2) (-> (-> 1 (-> 2 3)) (-> 1 3)))", root: 48}) |
+-------------------------------------------------------------------------------+
4 rows in set (0.001 sec)