The Phone Calls Java example showcases:
- basic migration of CSV, JSON and XML data into a TypeDB knowledge graph database
- writing and performing expressive TypeQL queries to gain insights over the dataset
- TypeDB v2.11.1
- Bazel v5.1.1 (alternatively, declare dependencies manually and run using Maven. See TypeDB Driver Java documentation for details.)
- Checkout this repository:
git clone https://github.com/vaticle/typedb-driver-examples && cd typedb-driver-examples
- Start the TypeDB Server.
- Go to the directory where you have your
typedb-all
distribution unarchived, and run:./typedb console
(ortypedb console
, if TypeDB was installed via a package manager) - Load the Phone Calls schema:
> database create phone_calls
> transaction phone_calls schema write
phone_calls::schema::write> source {path-to-the-cloned-repo}/phone_calls/schema.tql
phone_calls::schema::write*> commit
> exit
- Build the example:
bazel build //telecom/phone_calls/java/...
. - Migrate the dataset into TypeDB from any of the 3 supported formats: CSV, JSON, or XML, using any one of the following commands:
bazel run //telecom/phone_calls/java:csv-migration
,bazel run //telecom/phone_calls/java:json-migration
, orbazel run //telecom/phone_calls/java:xml-migration
.
- Launch the interactive query runner:
bazel run //telecom/phone_calls/java:queries
.