[English] | 中文
This project aims to explore the method of generating Gremlin queries from natural language text and verify its feasibility.
Make sure you have Python and pip installed, then run:
pip install -r requirements.txtThe Gremlin-related grammar files have already been processed using ANTLR4 and are located in the ./gremlin directory. You can directly use them. If you want to process your own .g4 grammar files, you need to install JDK and ANTLR4:
# Update package list
sudo apt update
# Install OpenJDK 21
sudo apt install openjdk-21-jdk
# Verify installation
java -version
javac -versionThe ANTLR4 JAR file (antlr-4.13.1-complete.jar) has already been downloaded and is located in the ./gremlin directory.
After that, run the build.sh script to process .g4 files with ANTLR4 and generate parser code:
cd Text2Gremlin
sh ./build.shThis stage is only based on testing the implementation of Text2Gremli using AST, and has no practical implementation significance
python ./gremlin_ast_gen.pypython ./gremlin_grammar_test.pypython ./gremlin_ast_generator.pyRelated code is located in ./schema_gremlin.
Will be updated soon ...