lsiecker / R2PGDM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Release GitHub last commit GitHub commit activity GitHub commits since Issues GitHub pull requests GitHub Actions Workflow Status

MicrosoftSQLServer MySQL

R2PG-DM

R2PG-DM is a powerful tool that allows you to construct property graphs from relational databases.

Table of Contents

  1. Features
  2. Installation
  3. Configuration
  4. Usage
  5. Neo4j Integration
  6. Troubleshooting
  7. Contributing

Features

  • Convert relational databases into property graphs
  • Support for MySQL and Microsoft SQL Server databases
  • Generate CSV files for Neo4j graph database
  • Generate schema following PG-Schema language

Installation

To install R2PG-DM, follow these steps:

  1. Clone the repository: git clone https://github.com/lsiecker/r2pg-dm.git
  2. Navigate into the project directory: cd r2pg-dm
  3. Build the R2PG-DM using Maven: mvn clean build

Configuration

Before using R2PG-DM, you need to set up a config.ini file to specify the input database connections. Here's the format:

[input]
connectionString=jdbc:DRIVER://IP_ADDRESS:PORT/DATABASE_NAME?user=USER&password=PASSWORD
database=DATABASE_NAME
driver=DRIVER

[output]
connectionString=jdbc:DRIVER://IP_ADDRESS:PORT/DATABASE_NAME?user=USER&password=PASSWORD
database=DATABASE_NAME
driver=DRIVER

[mapping]
tables=true
views=true
schema=dbo
tableNames=*
deleteCopy=false

The connectionString should be in the JDBC connection string format. You can find more information about this format here. Furthermore there are some settings regarding the mapping. Boolean values for tables and views determine wheter or not to take into account these table types. Keep in mind that views do not include foreign key information, only column information. Schema is the schema in the source database that needs to be mapped. tableNames is a parameter that can be filled with several table/view names to specify that mapping. The names should be seperated with a comma not in quotes: country,countrylanguage,city.

Usage

To use R2PG-DM, follow these steps:

  1. Set up your config.ini file as described in the Configuration section.
  2. Run the application
  3. View the output in the output folder and in your target database tables. The output consists of
  • nodes.csv, edges.csv, properties.csv: The property graph divided in the different information types.
  • combined.json: All information from the nodes, edges and properties combined in one json to be imported by AvantGraph.
  • schema.pgs: Schema following PG-Schema language.

Neo4j Integration

R2PG-DM generates three CSV files: nodes.csv, edges.csv and properties.csv. You can use these files as input for a Neo4j instance by running the script in the script.cypher located in this repository.

For more information on how to install and setup a Neo4j instance refer to the Neo4j download page For information on where to place the CSV files, see Section 2 of this Neo4j tutorial. During this tutorial you can ignore the cypher (LOAD) queries and use the queries from script.cypher instead.

To use a Neo4j instance for visualization, you need the APOC plugin installed (dynamic labels).

Troubleshooting

If you encounter any issues while using R2PG-DM, please check the Issues page of this repository. If you don't find a solution there, feel free to open a new issue.

Contributing

We welcome contributions to R2PG-DM! If you'd like to contribute, please fork the repository, make your changes, and open a pull request.

About

License:MIT License


Languages

Language:Java 99.4%Language:Cypher 0.5%Language:Dockerfile 0.1%