hugegraph-loader is a customizable command line utility for loading small to medium size graph datasets into the HugeGraph database from multiple data sources with various input formats.
- Multiple data sources, such as local file(path), HDFS file(path), MySQL
- Various input formats, such as json, csv, and text with any delimiters.
- Diverse options, with which users can manage the data loading intuitively.
- Detecting schema from data automatically, reduce the complex work of schema management.
- Advanced customized operations with groovy script, users can configure how to construct vertices and edges by themselves.
There are three ways to get HugeGraph-Loader:
- Download the compiled tarball
- Clone source code then compile and install
- Use docker image (Convenient for Test/Dev)
And you can find more details in the doc
Download the latest version of the HugeGraph-Toolchain release package:
wget https://downloads.apache.org/incubator/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}.tar.gz
tar zxf *hugegraph*.tar.gz
Clone the latest version of HugeGraph-Loader source package:
# 1. get from github
git clone https://github.com/apache/hugegraph-toolchain.git
# 2. get from direct (e.g. here is 1.0.0, please choose the latest version)
wget https://downloads.apache.org/incubator/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}-src.tar.gz
Due to the license limitation of the Oracle OJDBC
, you need to manually install ojdbc to the local maven repository. Visit the Oracle jdbc downloads page. Select Oracle Database 12c Release 2 (12.2.0.1) drivers, as shown in the following figure.
After opening the link, select "ojdbc8.jar".
Install ojdbc8 to the local maven repository, enter the directory where ojdbc8.jar is located, and execute the following command.
mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar
Compile and generate tar package:
cd hugegraph-loader
mvn clean package -DskipTests
Use the command docker run -itd --name loader hugegraph/loader
to start loader.
If you want to load your data, you can mount the data folder like -v /path/to/data/file:/loader/file
The example docker-compose.yml
is here. Use the command docker-compose up -d
to deploy loader
with server
and hubble
.
Note:
The docker image of hugegraph-loader is a convenience release, not official distribution artifacts. You can find more details from ASF Release Distribution Policy.
Recommend to use
release tag
(like1.0.0
) for the stable version. Uselatest
tag to experience the newest functions in development.
notice: currently, version is
1.3.0
Download and unzip the compiled archive
wget https://downloads.apache.org/incubator/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}.tar.gz
tar zxf *hugegraph*.tar.gz
Then, load data with example file:
cd apache-hugegraph-toolchain-incubating-{version}
cd apache-hugegraph-loader-incubating-{version}
sh bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy
More details is in the doc
If the
loader
andserver
is in the same docker network (for example, you deployloader
andserver
withdocker-compose
), we can set-h {server_container_name}
. In our example, the container name ofserver
isgraph
If
loader
is deployed alone, the-h
should be set to the ip of the host ofserver
. Other parameter description is here
Visit doc for more details.
docker exec -it loader bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h graph -p 8080
The loader homepage contains more information about it.
hugegraph-loader is licensed under Apache 2.0 License.