You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## What is the goal of this PR?
We add CLI options that allow TypeDB Loader to connect to TypeDB Cluster.
## What are the changes implemented in this PR?
* Reformat README
* Add Cluster support
- load required/optional attributes of any TypeDB type (string, boolean, long, double, datetime)
27
32
- load required/optional role players (attribute / entity / relation)
28
-
- load list-like attribute columns as n attributes (recommended procedure until attribute lists are fully supported by TypeDB)
33
+
- load list-like attribute columns as n attributes (recommended procedure until attribute lists are fully supported
34
+
by TypeDB)
29
35
- load list-like player columns as n players for a relation
30
36
- load entity if not present - if present, either do not write or append attributes
31
-
-[Appending Attributes](https://github.com/typedb-osi/typedb-loader/wiki/05-Appending-Attributes) to existing things
32
-
-[Append-Attribute-Or-Insert-Entity](https://github.com/typedb-osi/typedb-loader/wiki/06-Append-Or-Insert) for entities
33
-
- Data Validation:
34
-
- validate input data rows and log issues for easy diagnosis input data-related issues (i.e. missing attributes/players, invalid characters...)
35
-
- Configuration Validation:
36
-
- write your configuration with confidence: warnings will display useful information for fine tuning, errors will let you know what you forgot. All BEFORE the database is touched.
37
-
- Performance:
38
-
- parallelized asynchronous writes to TypeDB to make the most of your hardware configuration, optimized with engineers @vaticle
39
-
- Stop/Restart (in re-implementation, currently NOT available):
37
+
-[Appending Attributes](https://github.com/typedb-osi/typedb-loader/wiki/05-Appending-Attributes) to existing things
38
+
-[Append-Attribute-Or-Insert-Entity](https://github.com/typedb-osi/typedb-loader/wiki/06-Append-Or-Insert) for entities
39
+
- Data Validation:
40
+
- validate input data rows and log issues for easy diagnosis input data-related issues (i.e. missing
41
+
attributes/players, invalid characters...)
42
+
- Configuration Validation:
43
+
- write your configuration with confidence: warnings will display useful information for fine tuning, errors will
44
+
let you know what you forgot. All BEFORE the database is touched.
45
+
- Performance:
46
+
- parallelized asynchronous writes to TypeDB to make the most of your hardware configuration, optimized with
47
+
engineers @vaticle
48
+
- Stop/Restart (in re-implementation, currently NOT available):
40
49
- tracking of your migration status to stop/restart, or restart after failure
41
50
42
-
-[Basic Column Preprocessing using RegEx's](https://github.com/typedb-osi/typedb-loader/wiki/08-Preprocessing)
51
+
-[Basic Column Preprocessing using RegEx's](https://github.com/typedb-osi/typedb-loader/wiki/08-Preprocessing)
43
52
44
-
Create a Loading Configuration ([example](https://github.com/typedb-osi/typedb-loader/blob/master/src/test/resources/phoneCalls/config.json)) and use TypeDB Loader
45
-
- as an [executable CLI](https://github.com/typedb-osi/typedb-loader/wiki/10-TypeDB-Loader-as-Executable-CLI) - no coding
46
-
- in [your own Java project](https://github.com/typedb-osi/typedb-loader/wiki/09-TypeDB-Loader-as-Dependency) - easy API
- as an [executable CLI](https://github.com/typedb-osi/typedb-loader/wiki/10-TypeDB-Loader-as-Executable-CLI) - no
58
+
coding
59
+
- in [your own Java project](https://github.com/typedb-osi/typedb-loader/wiki/09-TypeDB-Loader-as-Dependency) - easy API
47
60
48
61
## How it works:
49
62
50
-
To illustrate how to use TypeDB Loader, we will use a slightly extended version of the "phone-calls" example [dataset](https://github.com/typedb-osi/typedb-loader/tree/master/src/test/resources/phoneCalls) and [schema](https://github.com/typedb-osi/typedb-loader/blob/master/src/test/resources/phoneCalls/schema.gql) from the TypeDB developer documentation:
63
+
To illustrate how to use TypeDB Loader, we will use a slightly extended version of the "phone-calls"
64
+
example [dataset](https://github.com/typedb-osi/typedb-loader/tree/master/src/test/resources/phoneCalls)
65
+
and [schema](https://github.com/typedb-osi/typedb-loader/blob/master/src/test/resources/phoneCalls/schema.gql) from the
66
+
TypeDB developer documentation:
51
67
52
68
### Configuration
53
69
54
70
The configuration file tells TypeDB Loader what things you want to insert for each of your data files and how to do it.
-[Nested Relation - Match by Attribute(s) Example](https://github.com/typedb-osi/typedb-loader/wiki/04-Loading-Relations#loading-relations-with-entityrelation-players-matched-on-attribute-ownerships-incl-nested-relations)
62
-
-[Nested Relation - Match by Player(s) Example](https://github.com/typedb-osi/typedb-loader/wiki/04-Loading-Relations#loading-relations-relation-players-matching-on-players-in-playing-relation-incl-nested-relations)
-[Nested Relation - Match by Attribute(s) Example](https://github.com/typedb-osi/typedb-loader/wiki/04-Loading-Relations#loading-relations-with-entityrelation-players-matched-on-attribute-ownerships-incl-nested-relations)
78
+
-[Nested Relation - Match by Player(s) Example](https://github.com/typedb-osi/typedb-loader/wiki/04-Loading-Relations#loading-relations-relation-players-matching-on-players-in-playing-relation-incl-nested-relations)
-[Custom Migration Order Example](https://github.com/typedb-osi/typedb-loader/wiki/07-Custom-Load-Order)
65
81
66
82
For detailed documentation, please refer to the [WIKI](https://github.com/bayer-science-for-a-better-life/grami/wiki).
67
83
68
-
The [config](https://github.com/typedb-osi/typedb-loader/tree/master/src/test/resources/phoneCalls/config.json) in the phone-calls test is a good starting example of a configuration.
84
+
The [config](https://github.com/typedb-osi/typedb-loader/tree/master/src/test/resources/phoneCalls/config.json) in the
85
+
phone-calls test is a good starting example of a configuration.
69
86
70
87
### Migrate Data
71
88
72
89
Once your configuration files are complete, you can use TypeDB Loader in one of two ways:
73
90
74
-
1. As an executable command line interface - no coding required:
91
+
1. As an executable command line interface - no coding required:
75
92
76
93
```Shell
77
94
./bin/typedbloader load \
@@ -83,65 +100,83 @@ Once your configuration files are complete, you can use TypeDB Loader in one of
A complete tutorial for TypeDB version >= 2.5.0 is in work and will be published asap.
117
133
118
-
An example of configuration and usage of TypeDB Loader on real data can be found [in the TypeDB Examples](https://github.com/vaticle/typedb-examples/tree/master/biology/catalogue_of_life).
134
+
An example of configuration and usage of TypeDB Loader on real data can be
135
+
found [in the TypeDB Examples](https://github.com/vaticle/typedb-examples/tree/master/biology/catalogue_of_life).
119
136
120
-
A complete tutorial for TypeDB (Grakn) version < 2.0 can be found [on Medium](https://medium.com/@hkuich/introducing-grami-a-data-migration-tool-for-grakn-d4051582f867).
137
+
A complete tutorial for TypeDB (Grakn) version < 2.0 can be
138
+
found [on Medium](https://medium.com/@hkuich/introducing-grami-a-data-migration-tool-for-grakn-d4051582f867).
121
139
122
140
There is an [example repository](https://github.com/bayer-science-for-a-better-life/grami-example) for your convenience.
123
141
142
+
## Connecting to TypeDB Cluster
143
+
144
+
To connect to TypeDB Cluster, a set of options is provided:
| 1.2.0 to 1.6.0 | 2.8.0 - 2.14.0 | 2.8.0 to 2.14.0 | N/A |
161
+
| 1.1.0 to 1.2.0 | 2.8.0 | 2.8.x | N/A |
162
+
| 1.0.0 | 2.5.0 to 2.7.1 | 2.5.x to 2.7.x | N/A |
163
+
| 0.1.1 | 2.0.0 to 2.5.0 | 2.0.x to 2.4.x | N/A |
164
+
| <0.1 | 1.8.0 | 1.8.x | N/A |
132
165
133
166
*[Type DB](https://github.com/vaticle/typedb)
134
167
135
168
Find the Readme for GraMi for grakn < 2.0 [here](https://github.com/bayer-science-for-a-better-life/grami/blob/b3d6d272c409d6c40254354027b49f90b255e1c3/README.md)
136
169
137
170
## Contributions
138
171
139
-
TypeDB Loader was built @[Bayer AG](https://www.bayer.com/) in the Semantic and Knowledge Graph Technology Group with the support of the engineers @[Grakn Labs](https://github.com/orgs/vaticle/people).
172
+
TypeDB Loader was built @[Bayer AG](https://www.bayer.com/) in the Semantic and Knowledge Graph Technology Group with
173
+
the support of the engineers @[Vaticle](https://github.com/vaticle).
140
174
141
175
## Licensing
142
176
143
-
This repository includes software developed at [Bayer AG](https://www.bayer.com/). It is released under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
144
-
177
+
This repository includes software developed at [Bayer AG](https://www.bayer.com/). It is released under
178
+
the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
179
+
145
180
## Credits
146
181
147
182
Icon in banner by [Freepik](https://www.freepik.com") from [Flaticon](https://www.flaticon.com/)
@CommandLine.Option(names = {"-db", "--database"}, description = "target database in your grakn instance", required = true)
31
+
@CommandLine.Option(names = {"-db", "--database"}, description = "target database in your TypeDB instance", required = true)
30
32
publicStringdatabaseName;
31
33
32
-
@CommandLine.Option(names = {"-tdb", "--typedb"}, description = "optional - TypeDB server in format: server:port (default: localhost:1729)", defaultValue = "localhost:1729")
34
+
@CommandLine.Option(names = {"-tdb", "--typedb"}, description = "Connect to TypeDB Core server in format: server:port (default: localhost:1729)", defaultValue = "localhost:1729")
33
35
publicStringtypedbURI;
34
36
37
+
@CommandLine.Option(names = {"-tdbc", "--typedb-cluster"}, description = "Connect to TypeDB Cluster instead of TypeDB Core. Specify a cluster server with 'server:port'.")
@CommandLine.Option(names = {"--tls-enabled"}, description = "Connect to TypeDB Cluster with TLS encryption")
47
+
publicbooleantlsEnabled;
48
+
49
+
@CommandLine.Option( names = {"--tls-root-ca"}, description = "Path to the TLS root CA file")
50
+
public@NullableStringtlsRootCAPath;
51
+
35
52
@CommandLine.Option(names = {"-cm", "--cleanMigration"}, description = "optional - delete old schema and data and restart migration from scratch - default: continue previous migration, if exists", defaultValue = "false")
36
53
publicbooleancleanMigration;
37
54
@@ -74,7 +91,14 @@ public void print() {
74
91
spec.commandLine().getOut().println("TypeDB Loader started with parameters:");
0 commit comments