Loading JSON-LD by sending data to REST API

Hi there,

New to tigergraph, but I have the following scenario:

  • Event based architecture
  • Events handled by Kafka
  • Want to create materialised view in tigergraph
  • Event data in the format of json-ld
  • One event per record
  • Want to listen for these events, and update tigergraph.

Can I load json-ld, or provide a mapping? How? Does Tigergraph support loading data from a REST API without first having to save to a file amd send the file reference to tigergraphs load command?

Many thanks for the assist.

H

Hi Sparklingideas,

It sounds like our Kafka loader will accomplish what you’re looking for.
https://docs.tigergraph.com/dev/data-loader-guides/kafka-loader-user-guide

You’ll set up the loading job to point to your Kafka config and once you run the job, it will process any messages incoming on the specified topics and load the data as specified in the loading job (it can also be configured to one-time load up to the current message).

Let me know if you have any additional questions!

Thanks,
Dan

1 Like

Hi Dan,

many thanks for the response. Looking at your example at that URL, it looks like it is expecting the event / message to contain data in the form of CSV:

CREATE LOADING JOB load_person FOR GRAPH test_graph {
  DEFINE FILENAME f1 = "$k1:topic_partition_config.json";
  LOAD f1
      TO VERTEX Person VALUES ($2, $0, $1),
      TO EDGE Person2Comp VALUES ($0, $1, $2)
      USING SEPARATOR=",";
}

But how would this work, if the incoming event contained JSON, and specifically JSON-LD (which is a Linked Data / RDF format)?

Hope you can help.

Many thanks!

Henrik