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

graphdb2rdb's People

Contributors

kazumatsudo avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

horiuchi-masato

graphdb2rdb's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency io.github.etspaceman:scalacheck-faker to v8.0.4
  • chore(deps): update dependency org.janusgraph:janusgraph-driver to v1.1.0-20240513-104331.cff9793
  • chore(deps): update dependency scala to v2.13.14
  • chore(deps): update dependency com.mysql:mysql-connector-j to v8.4.0
  • chore(deps): update dependency sbt/sbt to v1.10.0
  • chore(deps): update mysql docker tag to v8.4.0
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
  • janusgraph/janusgraph 1.1.0-20240105-102008.1270818
  • mysql 8.3.0-oraclelinux8
github-actions
.github/workflows/scala.yml
  • actions/checkout v4
  • actions/setup-java v4
  • codecov/codecov-action v3
  • stefanzweifel/git-auto-commit-action v5
  • mysql 8.3.0-oraclelinux8
sbt
build.sbt
  • scala 2.13.13
  • ch.qos.logback:logback-classic 1.5.4
  • com.michaelpollmeier:gremlin-scala 3.5.3.7
  • com.typesafe:config 1.4.3
  • com.typesafe.scala-logging:scala-logging 3.9.5
  • io.circe:circe-core 0.14.6
  • io.circe:circe-generic 0.14.6
  • io.circe:circe-parser 0.14.6
  • org.apache.tinkerpop:gremlin-driver 3.7.1
  • org.apache.tinkerpop:tinkergraph-gremlin 3.7.1
  • org.janusgraph:janusgraph-driver 1.1.0-20240424-103106.1c53402
  • com.h2database:h2 2.2.224
  • com.mysql:mysql-connector-j 8.3.0
  • com.typesafe.slick:slick 3.5.0
  • com.typesafe.slick:slick-hikaricp 3.5.0
  • io.github.etspaceman:scalacheck-faker 8.0.3
  • org.scalatest:scalatest 3.2.18
project/build.properties
  • sbt/sbt 1.9.9
project/plugins.sbt
  • org.scalameta:sbt-scalafmt 2.5.2
  • org.wartremover:sbt-wartremover 3.1.6
  • org.scoverage:sbt-scoverage 2.0.11
scalafmt
.scalafmt.conf
  • scalafmt 3.7.17

  • Check this box to trigger a request for Renovate to run again on this repository

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.