Writing to Graph Databases
Graph Writer
To write to a graph database, you will need to use the Graph Writer. This applies to both Labelled Property Graphs and Semantic Graphs.
The Graph Writer supports Update and Insert modes.
Automatic processing with Kafka integration
If you have integrated Kafka into your stack, graph models can be automatically written, by the graph writer, to a configured target graph database. See Stack Run Configurations for examples.
The process is as follows:
A transformer successfully completes a transformation task, which results in
New graph models successfully written to disk or S3
New success message posted to Kafka "success" topic, containing the path to the new files
The writer, configured to listen to the Kafka 'success' topic, performs the following tasks
Consume a 'success' message from the Kafka topic
Read the new graph models into memory
Persist to the configured target graph database
Manual processing using the REST endpoint
If however you do not have a Kafka service running, or you wish to push data manually to your graph, you can use the Graph Writer's RESTful API endpoint.
Firstly, get the URL of the file you wish to import, ensuring that the Writer has direct access to it. If generated by the Transformers, this will be the same file URL shown in the successful transformation report. Using this file URL, run a GET request on the following endpoint:
http://<graph-writer-endpoint>:<graph-writer-port>/process?inputRdfURL=<graph-data-file-URL>
For example:
http://127.0.0.1:9610/process?inputRdfURL=s3://graphbuild/output/SS-Transformer-1234.nq
Upon completion, a processing report will be provided in the response message.
Last updated

