Neo4j Runway is a Python library that simplifies the process of migrating your relational data into a graph. It provides tools that abstract communication with OpenAI to run discovery on your data and generate a data model, as well as tools to generate ingestion code and load your data into a Neo4j instance.
Our data model seems to address the three use cases we'd like answered:
If we would like the data model modified, we may request the LLM to make changes.
gdm.iterate_model(corrections="Create a Capital node from the capital property.")
gdm.current_model.visualize()
We can now use our data model to generate some ingestion code.
gen = PyIngestConfigGenerator(data_model=gdm.current_model,
username=os.environ.get("NEO4J_USERNAME"),
password=os.environ.get("NEO4J_PASSWORD"),
uri=os.environ.get("NEO4J_URI"),
database=os.environ.get("NEO4J_DATABASE"),
file_directory=data_directory, source_name="countries.csv")
pyingest_yaml = gen.generate_config_string()
We will use the generated PyIngest yaml config to ingest our data into our Neo4j instance.
PyIngest(config=pyingest_yaml, verbose=False)
We can also save this as a .yaml file and use with the original PyIngest.
gen.generate_config_yaml(file_name="countries.yaml")
Here's a snapshot of our new graph!
Runway offers a module for easily running analyics over an existing graph to gain insights such as finding isolated nodes and ranking top node degrees.
Check here for an example of Runway's GraphEDA
module.
Runway is currently in beta and under rapid development. Please raise GitHub issues and provide feedback on any features you'd like. The following are some of the current limitations: