Guide
Knowledge Graph

Translate descriptions for a given list of entities

This example shows how to translate entities descriptions from English to other languages.

POST /kg/entities/bulk

Input parameters

  • entities_ids: List of unique identifiers, separated with a comma.
  • uuids: List of companies uuids to look for, separated with a comma.
  • properties_list: List of properties of interest separated with a comma.
    • Default value depends on source:
      • corporate_kg
        • ["chief_executive_officer", "domain", "founders", "legal_name", "subsidiaries", "ticker"].
      • general_kg
  • uuid: Whether to return company uuid or not
    • Defaults: False
  • language: Target language of the translation.
    • Defaults: english
  • source: The type of the knowledge graph you want to request.
    • Accepted values: general_kg, corporate_kg.
    • Defaults: corporate_kg

Either entities_ids or uuids must be provided.

example_request.py
import json
import requests
 
# Functions found in the section 'Quick start' under 'Getting started'
from connect_v2 import read_config, get_token
 
 
config = read_config()
host = config['api']['host']
 
entities_ids = ['casinos-austria', 'wirecard']
properties_list = ['subsidiaries', 'chief_executive_officer', 'founders', 'legal_name']
source = 'corporate_kg'
language = 'french'
token = get_token(config)
 
endpoint = f'{host}/api/2.0/kg/entities/bulk'
 
payload = json.dumps({
    'entities_ids': entities_ids,
    'source': source,
    'language': language,
    'properties_list': properties_list
})
 
headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Bearer {token}'
}
 
response = requests.post(endpoint, headers=headers, data=payload)
print(response.json())

Result

result.json
[
  {
    "context": "Casinos Austria maintient des positions dominantes sur le marché autrichien autorisé des casinos, des jeux en ligne et des machines de jeu.",
    "entity_of_interest": "casinos-austria",
    "keywords": ["Hilbet", "170Hilbet", "Casinos Austria"]
  },
  {
    "context": "Wirecard est la plateforme numérique qui connaît la croissance la plus rapide dans le domaine du commerce financier.",
    "entity_of_interest": "wirecard",
    "keywords": ["Wirecard", "WDI"]
  }
]