8000 GitHub - chaosbreakers/sql2graph: 将sql和nosql中的数据导入到图中。
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chaosbreakers/sql2graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sql2graph

1. 项目打包

  • git clone git@github.com:openmg/sql2graph.git
  • mvn clean package
  • tar -xvf ${BASEDIR}/target/sql2graph-1.0-SNAPSHOT-mysql2neo4j.tar.gz

2. 文件配置

配置sql数据库表的映射关系。

example:

{
  "dataSource": "mysql",
  "mysql": {
    "driver": "com.mysql.jdbc.Driver",
    "databaseURL": "jdbc:mysql://localhost/test",
    "user": "root",
    "password": "zhaoliang123",
    "tables": [
      {
        "tableName": "student",
        "columns": [
          {
            "name": "name",
            "valueType": "string"
          },
          {
            "name": "age",
            "valueType": "string"
          },
          {
            "name": "teacher",
            "valueType": "string"
          },
          {
            "name": "addr",
            "valueType": "string"
          }
        ]
      },
      {
        "tableName": "teacher",
        "columns": [
          {
            "name": "name",
            "valueType": "string"
          },
          {
            "name": "age",
            "valueType": "string"
          },
          {
            "name": "addr",
            "valueType": "string"
          }
        ]
      }
    ]
  },
  "neo4jGraph": {
    "gremlin.neo4j.directory": "/Users/zhaoliang/test/neo4j",
    "gremlin.graph": "org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph"
  },
  "csv": [
    {
      "path": "/Users/test/file.csv",
      "label": "student",
      "columns": [
        {
          "pos": 0,
          "name": "id",
          "valueType": "string"
        },
        {
          "pos": 1,
          "name": "id",
          "valueType": "string"
        },
        {
          "pos": 2,
          "name": "id",
          "valueType": "string"
        }
      ]
    },
    {
      "path": "/Users/test/file1.csv",
      "label": "teacher",
      "columns": [
        {
          "pos": 0,
          "name": "id",
          "valueType": "string"
        },
        {
          "pos": 1,
          "name": "id",
          "valueType": "string"
        },
        {
          "pos": 2,
          "name": "id",
          "valueType": "string"
        }
      ]
    }
  ]
}

3 使用

  • 解压打包好的文件。
  • 配置映射文件conf/sql2neo4j.json,注意配置文件中的dataSource的值现在支持csvmysql两种导入方式。
  • 执行:bin/main.sh

About

将sql和nosql中的数据导入到图中。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0