Relations

Create Annotation Relation

POST https://api.annolab.ai/v1/relation/create

Create a new relation between two annotations. If a relation of the type already exists between the two annotation ids, then the existing relation will be returned and a duplicate will not be created.

Headers

Request Body

{
  "id": 72,
  "successorId": 44,
  "predecessorId": 12,
  "typeName": "Coreference",
  "typeId": 112,
  "value": '',
 }

Examples of how to make a layer create request

import requests

ANNO_LAB_API_KEY = 'XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX'

relation = {
  'relationTypeName': 'Coreference',
  'projectIdentifier': 'New NER Project',
  'successorId': 112,
  'predecessorId': 141,
}

headers = {
  'Authorization': 'Api-Key '+ANNO_LAB_API_KEY,
}

url = 'https://api.annolab.ai/v1/relation/create'

response = requests.post(url, headers=headers, json=relation)

print(response.json())

Last updated