This is the cypher parser tool to convert cypher to query graph json as the input in PatMat Engine(https://github.com/UNSW-database/pattern_matching).
-
Install the
scala
andgradle
plugin in IDEA. -
Open the project as the following setting(no need to set
Gradle home
): -
Download slizaa library: https://drive.google.com/file/d/1XXXDttCAE50WEYCM23tD8SBU0Nu3EHJo/view?usp=sharing
-
Unzip the downloaded file
slizaa.zip
to your local maven repository directoryyour-user-dir/.m2/repository/org/
, for example,/Users/bob/.m2/repository/org/
. -
Right click
build.gradle
andRun build
. Then you can right clickCypherParserTest.scala
to run tests.
You can download the executable file from https://drive.google.com/drive/folders/1rbiIttvNTWfw5QK0LhfDV7Zd6CMm7fZd?usp=sharing, or you can build the project by yourself as follows:
-
Build the project: gradle build
-
Unzip the file build/distributions/cypherparser-1.0.SNAPSHOT.zip (ps: you can deploy the project using the artifact file build/distributions/cypherparser-1.0.SNAPSHOT.tar if you want to do so)
-
Go into the unzipped directory cypherparser-1.0.SNAPSHOT: cd build/distributions/cypherparser-1.0.SNAPSHOT/
-
Use command to parse your cypher: java -jar cypherparser.jar -c "YOUR CYPHER" -o "OUTPUT FILE".
For example: java -jar cypherparser.jar -c "Match (a:A)-[b:B]->(c:C) RETURN a,c" -o "out.json"
Or you can run the executable file in the bin directory: ./bin/cypherparser -c "Match (a:A)-[b:B]->(c:C) RETURN a,c" -o "out.json"