We tried to parse the cypher syntax used to add graph elements to neo4j. See Import from Arrow.
It offered to write this in cypher.
CREATE (n1:Person {name: "Patric Cunningham"})-[:Father]->(n0:Person {name: "Ward Cunningham"})<-[:Father]-(n2:Person {name: "Christopher Cunningham"})-[:Mother]->(n3:Person {name: "Karen Cunningham"})<-[:Mother]-(n1)-[:Residence]->(:Town {name: "Medford"}), (n0)-[:Residence]->(:Town {name: "Portland"})<-[:Residence]-(n3), (n2)-[:Residence]->(:Town {name: "Seattle"})
This looks pretty easy to parse either open coded as recursive descent or run through a PEG generator.
create = 'CREATE' path (',' path)* path = node (relation node)+ node = '(' id (':' label props? )? ')' relation = '-' rel? '->' | '<-' rel? '-' rel = '[' id (: type props?)? ')'
//wiki.ralfbarkow.ch/assets/pages/import-from-arrow/parse-cypher.html HEIGHT 400