Git Product home page Git Product logo

graphdb2rdb's Introduction

GraphDB2RDB

generate RDB DDL/DML from GraphDB (Tinkerpop).

Latest GitHub release License codecov workflow

Demo

demo2

Features

  • this script generate 4 SQL files.
    1. [DDL] CREATE TABLE "vertex_${vertex label}"
      • the columns are as follows.
        • id
        • property_${all property keys}
    2. [DDL] CREATE TABLE "edge_${edge label}from${out vertex label}to${in vertex label}"
      • the columns are as follows.
        • id
        • id_in_v (= vertex_{vertex label}.id)
        • id_out_v (= vertex_{vertex label}.id)
        • property_${all property keys}
    3. [DML] INSERT INTO "vertex_${vertex label}"
    4. [DML] INSERT INTO "edge_${edge label}from${out vertex label}to${in vertex label}"

Prerequisites

  • Java 11
  • Scala 2.13
  • sbt 1.9.8

Installation

  1. checkout this repository
    gh repo clone kazumatsudo/GraphDB2RDB

Usage

  1. launch your GraphDB Server

    docker compose up -d
  2. select analysis method
    choose analysis method to search Vertex/Edge algorithm.

    • "by_exhaustive_search" (default)
    • "using_specific_key_list"

    please see following passage if you want to change method.

    % export ANALYSIS_METHOD=by_exhaustive_search
  3. execute the script by sbt

    sbt run
  4. generate SQL files

    • sql/ddl_edge.sql
    • sql/ddl_vertex.sql
    • sql/insert_edge.sql
    • sql/insert_vertex.sql

Analysis method

by_exhaustive_search using_specific_key_list
summary analyze all Vertices and Edges.
Sequence Diagram
analyze specific vertices searched by keys.
Sequence Diagram
pros no advance preparation required faster than by_exhaustive_search (enable to search by index)
cons inefficient (execute full search all vertices and edges count times) required to prepare search condition

How to choose

by_exhaustive_search

no advance preparation required because it's selected by default.

using_specific_key_list
  1. set environment variable "ANALYSIS_METHOD" to "using_specific_key_list"
    % export ANALYSIS_METHOD=using_specific_key_list
  2. set target vertex label, property key, and its values in using_key_list_file.json

Settings

You can define following settings as you like.

  • GraphDB connection settings
  • output SQL directory

The settings you can be changed are summarized in application.conf.

Code of Conduct

Contributing

License

Authors

Contributors

  • xxx

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.