Giter VIP home page Giter VIP logo

sql2graph's Introduction

sql2graph

1. 项目打包

  • git clone [email protected]: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

sql2graph's People

Contributors

weston100721 avatar

Watchers

James Cloos avatar Andy Shar avatar GEOMETRYBASE avatar zizai avatar  avatar  avatar 刘天成 avatar Troy avatar Jian Cai avatar johnny lee avatar  avatar

sql2graph's Issues

add README.md

说清楚以下几个问题。

  • 如何打包。
  • 如何使用。
  • 如何配置。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.