REST API Endpoints

In addition to the Process Endpoint designed for ingesting data into the Writer, there is a selection of built-in exposed endpoints for you to call.

API

HTTP Request

URL Template

Description

Process

GET

/process?inputRdfURL=<input-rdf-file-url>

Tells the Writer to ingest the RDF file located at the specified URL location

Config

GET

/config

Displays all Writer configuration as JSON

GET

/config?paths=<config-options>

Displays all Writer configuration specified in param as a comma-separated list

Check Connection

GET

/checkConnection

Tests whether the Writer can establish a connection with the specific Knowledge Graph credentials

Update Config

PUT

/updateConfig?configEntry=<config-entry>&configValue=<config-value>

Update configuration options on a running Writer

Upload Config Backup

PUT

/uploadConfigBackup

Uploads the current configuration to the specified config backup location so that it can be restored at a later date

License

GET

/license

Displays license information

Restart Kafka

GET

/restartKafka

Turns the Writer’s Kafka connection on or off depending on its current state.

Config

The config endpoint is a GET request that allows you to view the configuration settings of a running Writer. By sending GET http://<writer-ip>:<writer-port>/config (for example http://127.0.0.1:8080/config), you will receive the entire configuration represented as a JSON object, as seen in this small snippet below.

 {
    "version": "2.1.0.0",
    "applicationName": "Graph-Writer",
    "friendlyName": "Graph-Writer",
    "graphBuildWriterConfig": {
        "provenance": {
            "recordProvo": false
        }..........

Update Config

PUT /updateConfig

The configuration on running Writer can now be edited without having to restart. This is done through the update config endpoint. For example, by running the following /updateConfig?configEntry=friendlyName&configValue=GraphBuilder we have changed the friendly name of the Writer to GraphBuilder. To see a list of the configuration entry names, consult the Graph Writer Configurable Options.

License

The license endpoint is a GET request that allows you to view information about your license key that is in use on a running Transformer or Writer. By sending GET http://<writer-ip>:<writer-port>/license (for example: http://127.0.0.1:8080/license), you will receive a JSON response containing the following values.

{
    "license": "# graphbuild License (id: xxx) xxxxxxxx",
    "licenseInformation": {
        "registeredTo": "Name - Company - [email protected]",
        "expires": "Thu Dec 31 00:01:00 GMT 2020 - (xxx days to go)",
        "productName": "graphbuild"
    },
    "validationStatus": "LICENSE_VALID"
}

Process

As previously outlined, using the process endpoint is one way of triggering the Writer to ingest your source data. When an execution of the Writer fails after being triggered in this way, the response will be a status 400 Bad Request and contain a response message similar to that sent to the dead letter queue.

{
    "name": "Graph-Writer",
	"time": "2023-03-09T11:41:28.374",
	"type": "Graph-Writer",
	"error": "Record '/var/local/basic-rdf.xyz' could not be processed due to: u.c.d.w.e.GraphWriterExecutionException: Input file is of an invalid file type: (.xyz) - Expected nq.",
	"version": "2.1.0.0",
	"entity": "/var/local/basic-rdf.xyz"
}

Last updated