I am failing to execute the cipher query through java while creating a relationship. It is not throwing any error, but no relationships are created. Tried with other cipher query to return a node, which is returning perfectly. But unable to figure-out the reason for relationships not being created.
Here goes my code:
public static void addrelation(String node1, String node2, int cocr) {
try (Transaction tx = graphdb.beginTx();
Result result = graphdb.execute("MATCH(a{word:\"" + node1
+ "\"}),(b{word:\"" + node2 + "\"})"
+ "CREATE a-[r:coocr{val:" + cocr + "}]->(b)"
+ "CREATE a<-[s:coocr{val:" + cocr + "}]-(b)"
+ "RETURN r,s")) {
}
}