Home

Awesome

TypeDBLoader_icon


TypeDB Loader Test TypeDB Loader Build


If your TypeDB project

Use TypeDB Loader to take care of your data migration for you. TypeDB Loader streams data from files and migrates them into TypeDB at scale!

Features:

Create a Loading Configuration (example) and use TypeDB Loader

How it works:

To illustrate how to use TypeDB Loader, we will use a slightly extended version of the "phone-calls" example dataset and schema from the TypeDB developer documentation:

Configuration

The configuration file tells TypeDB Loader what things you want to insert for each of your data files and how to do it.

Here are some example:

For detailed documentation, please refer to the WIKI.

The config in the phone-calls test is a good starting example of a configuration.

Migrate Data

Once your configuration files are complete, you can use TypeDB Loader in one of two ways:

  1. As an executable command line interface - no coding required:
./bin/typedbloader load \
                -tdb localhost:1729 \
                -c /path/to/your/config.json \
                -db databaseName \
                -cm

See details here

  1. As a dependency in your own Java code:

import com.vaticle.typedb.osi.loader.cli.LoadOptions;
import com.vaticle.typedb.osi.loader.loader.TypeDBLoader;

public class LoadingData {

    public void loadData() {
        String uri = "localhost:1729";
        String config = "path/to/your/config.json";
        String database = "databaseName";

        String[] args = {
                "load",
                "-tdb", uri,
                "-c", config,
                "-db", database,
                "-cm"
        };

        LoadOptions options = LoadOptions.parse(args);
        TypeDBLoader loader = new TypeDBLoader(options);
        loader.load();
    }
}

See details here

Step-by-Step Tutorial

A complete tutorial for TypeDB version >= 2.5.0 is in work and will be published.

An example of configuration and usage of TypeDB Loader on real data can be found in the TypeDB Examples.

A complete tutorial for TypeDB (Grakn) version < 2.0 can be found on Medium.

There is an example repository for your convenience.

Connecting to TypeDB Cluster

To connect to TypeDB Cluster, a set of options is provided:

--typedb-cluster=<address:port>
--username=<username>
--password // can be asked for interactively
--tls-enabled
--tls-root-ca=<path/to/CA/cert>

Compatibility Table

Ranges are [inclusive, inclusive].

TypeDB LoaderTypeDB Driver (internal)TypeDBTypeDB Cloud
1.9.x2.26.62.25.x -2.25.x -
1.8.02.25.62.25.x -2.25.x -
1.7.02.18.12.18.x 2.23.x2.18.x 2.23.x
1.6.02.14.22.14.x - 2.17.x2.14.x - 2.16.x
1.2.0 - 1.5.x2.8.0 - 2.14.02.8.0 - 2.14.0N/A
1.1.0 - 1.1.x2.8.02.8.xN/A
1.0.02.5.0 - 2.7.12.5.x - 2.7.xN/A
0.1.12.0.0 - 2.4.x2.0.x - 2.4.xN/A
<0.11.8.01.8.xN/A

Find the Readme for GraMi for grakn < 2.0 here

Package hosting

Package repository hosting is graciously provided by Cloudsmith. Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that enables your organization to create, store and share packages in any format, to any place, with total confidence.

Contributions

TypeDB Loader was built @Bayer AG in the Semantic and Knowledge Graph Technology Group with the support of the engineers @Vaticle.

Licensing

This repository includes software developed at Bayer AG. It is released under the Apache License, Version 2.0.

Credits

Icon in banner by Freepik from Flaticon