API Guide

HTTP API

This page describes how you can query BabelNet through an HTTP interface that returns JSON. You can append the key parameter to the HTTP requests as shown in the examples below. To obtain an API key please read the key & limits page. All requests must be executed using the GET method and they should include the Accept-Encoding: gzip header in order to obtain compressed content.

LICENSES: All the data of the external resources are released under the terms of the respective owners' licenses.

Retrieve BabelNet version

Parameters

Name Type Description
key string

Required. API key obtained after signing up to BabelNet (see key & limits)

Response example

{
    "version": "v5_1"
}

Retrieve the IDs of the Babel synsets (concepts) denoted by a given word

Parameters

Name Type Description
lemma string

Required. The word you want to search for

searchLang Language

Required. The language of the word. Accepts multiple values.

Example https://babelnet.io/v7/getSynsetIds?lemma=apple&searchLang=EN&searchLang=IT&pos=NOUN&key=<your_key>

targetLang Language

The languages in which the data are to be retrieved.

Default value is the search language and accepts not more than 3 languages except the search language.

Example https://babelnet.io/v7/getSynsetIds?lemma=apple&searchLang=EN&targetLang=DE&targetLang=IT&pos=NOUN&key=<your_key>

pos UniversalPOS

Returns only the synsets containing this part of speech (NOUN, VERB, etc). Accepts multiple values.

Example https://babelnet.io/v7/getSynsetIds?lemma=plan&searchLang=EN&pos=NOUN&pos=VERB&key=<your_key>

source Source

Returns only the synsets containing these sources (WIKT, WIKIDATA, etc). Accepts multiple values.

Example https://babelnet.io/v7/getSynsetIds?lemma=apple&searchLang=EN&source=WIKT&source=WIKIDATA&key=<your_key>

key string

Required. API key obtained after signing up to BabelNet (see key & limits )

Response example

[
    {
        "id": "bn:00289737n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:26774334v",
        "pos": "VERB",
        "source": "BABELNET"
    },
    {
        "id": "bn:26558969n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00005054n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00005076n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00615676n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00319426n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:14792761n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:03174949n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:03740610n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00353687n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:14289548n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:03176270n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:03739345n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:23848255n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00005055n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00955003n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:16695930n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:14128513n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:26774335v",
        "pos": "VERB",
        "source": "BABELNET"
    },
    {
        "id": "bn:26326418n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:03686542n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:03283215n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:01132880n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:22068804n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:03345384n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:02506104n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:01783257n",
        "pos": "NOUN",
        "source": "BABELNET"
    },
    {
        "id": "bn:00512973n",
        "pos": "NOUN",
        "source": "BABELNET"
    }
]

Code samples

import urllib2
import urllib
import json
import gzip

from StringIO import StringIO

service_url = 'https://babelnet.io/v7/getSynsetIds'

lemma = 'apple'
lang = 'EN'
key  = 'KEY'

params = {
        'lemma' : lemma,
        'searchLang' : lang,
        'key'  : key
}

url = service_url + '?' + urllib.urlencode(params)
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)

if response.info().get('Content-Encoding') == 'gzip':
        buf = StringIO( response.read())
        f = gzip.GzipFile(fileobj=buf)
        data = json.loads(f.read())
        for result in data:
                print result['id']require "net/http"
require 'json'

uri = URI("https://babelnet.io/v7/getSynsetIds?")

params = {
  :lemma => 'apple',
  :searchLang => 'EN',
  :key  => 'KEY'
}

uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(Net::HTTP::Get.new(uri.request_uri))

if response.is_a?(Net::HTTPSuccess)
  json = JSON.parse(response.body)
  json.each do |entry|
    puts entry['id']
  end
end<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"><script>
</head>
<body>
<script>
    var service_url = 'https://babelnet.io/v7/getSynsetIds';
    var lemma = 'apple'
    var lang = 'EN'
    var key  = 'KEY'

    var params = {
        'lemma': lemma,
    'searchLang': lang,
    'key' : key
    };

    $.getJSON(service_url + "?", params, function(response) {
        $.each(response, function(key, val) {
            $('<div>', {text:val['id']}).appendTo(document.body);
        });
    });
</script>
</body>
</html><!DOCTYPE html>
<html>
<body>
<?php

  $service_url = 'https://babelnet.io/v7/getSynsetIds';

  $lemma = 'apple';
  $lang = 'EN';
  $key  = 'KEY';

  $params = array(
    'lemma' => $lemma,
    'searchLang'  => $lang,
    'key'   => $key
  );

  $url = $service_url . '?' . http_build_query($params);

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
  $response = json_decode(curl_exec($ch), true);
  curl_close($ch);

  foreach($response as $result) {
    echo $result['id'] . '<br/>';
  }
?>
</body>
</html>

Retrieve the information of a given synset

Parameters

Name Type Description
id string

Required. id of the synset you want to retrieve (can also be a WordNet id "wn:")

key string

Required. API key obtained after signing up to BabelNet (see key & limits )

targetLang Language

The languages in which the data are to be retrieved.

Default value is the English and accepts not more than 3 languages except the default language.

Example https://babelnet.io/v7/getSynset?id=bn:14792761n&targetLang=IT&key=<your_key>

Response example

{
    "senses": [
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple-designed_processors",
                "simpleLemma": "apple-designed_processors",
                "lemma": {
                    "lemma": "Apple-designed_processors",
                    "type": "HIGH_QUALITY"
                },
                "source": "WIKI",
                "senseKey": "32327247",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 123090446,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Ax",
                "simpleLemma": "apple_ax",
                "lemma": {
                    "lemma": "Apple_Ax",
                    "type": "HIGH_QUALITY"
                },
                "source": "WIKIDATA",
                "senseKey": "Q97362379",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 388832871,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Silicon",
                "simpleLemma": "apple_silicon",
                "lemma": {
                    "lemma": "Apple_Silicon",
                    "type": "HIGH_QUALITY"
                },
                "source": "WIKIDATA",
                "senseKey": "Q406283",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 368613751,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple-designed_processors",
                "simpleLemma": "apple-designed_processors",
                "lemma": {
                    "lemma": "Apple-designed_processors",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIDATA_ALIAS",
                "senseKey": "Q406283",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 368613745,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Ax_series,_A_series",
                "simpleLemma": "apple_ax_series,_a_series",
                "lemma": {
                    "lemma": "Apple_Ax_series,_A_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIDATA_ALIAS",
                "senseKey": "Q97362379",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 388832861,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_System_on_Chips",
                "simpleLemma": "apple_system_on_chips",
                "lemma": {
                    "lemma": "Apple_System_on_Chips",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIDATA_ALIAS",
                "senseKey": "Q406283",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 368613746,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_(system_on_chip)",
                "simpleLemma": "apple",
                "lemma": {
                    "lemma": "Apple",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "41339485",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": [
                        "/ˈæ.pəl/"
                    ]
                },
                "bKeySense": false,
                "idSense": 124297211,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_a",
                "simpleLemma": "apple_a",
                "lemma": {
                    "lemma": "Apple_a",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "37097202",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 124401249,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_A_series",
                "simpleLemma": "apple_a_series",
                "lemma": {
                    "lemma": "Apple_A_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "56592099",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 279423564,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Ax",
                "simpleLemma": "apple_ax",
                "lemma": {
                    "lemma": "Apple_Ax",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "37195889",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 122309949,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Ax_(System_on_Chip)",
                "simpleLemma": "apple_ax",
                "lemma": {
                    "lemma": "Apple_Ax",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "33306895",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 123780870,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_designed_processors",
                "simpleLemma": "apple_designed_processors",
                "lemma": {
                    "lemma": "Apple_designed_processors",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "64393009",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 348349116,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Firestorm",
                "simpleLemma": "apple_firestorm",
                "lemma": {
                    "lemma": "Apple_Firestorm",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "65889127",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 531017185,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_H1",
                "simpleLemma": "apple_h1",
                "lemma": {
                    "lemma": "Apple_H1",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "60282221",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 298135437,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_H_series",
                "simpleLemma": "apple_h_series",
                "lemma": {
                    "lemma": "Apple_H_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "60289099",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 298135438,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Icestorm",
                "simpleLemma": "apple_icestorm",
                "lemma": {
                    "lemma": "Apple_Icestorm",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "65889128",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 531017184,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_M_series",
                "simpleLemma": "apple_m_series",
                "lemma": {
                    "lemma": "Apple_M_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "65815956",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 530409300,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_mobile_application_processors",
                "simpleLemma": "apple_mobile_application_processors",
                "lemma": {
                    "lemma": "Apple_mobile_application_processors",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "56163196",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 270769675,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_S5",
                "simpleLemma": "apple_s5",
                "lemma": {
                    "lemma": "Apple_S5",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "62183919",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 320544139,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_S6",
                "simpleLemma": "apple_s6",
                "lemma": {
                    "lemma": "Apple_S6",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "65355815",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 359802429,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_S_series",
                "simpleLemma": "apple_s_series",
                "lemma": {
                    "lemma": "Apple_S_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "56592101",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 279423563,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_Silicon",
                "simpleLemma": "apple_silicon",
                "lemma": {
                    "lemma": "Apple_Silicon",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "64664430",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 353322792,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_silicon",
                "simpleLemma": "apple_silicon",
                "lemma": {
                    "lemma": "Apple_silicon",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "64351102",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 348270602,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_System_on_a_Chip",
                "simpleLemma": "apple_system_on_a_chip",
                "lemma": {
                    "lemma": "Apple_System_on_a_Chip",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "38095173",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 123529285,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_system_on_a_chip",
                "simpleLemma": "apple_system_on_a_chip",
                "lemma": {
                    "lemma": "Apple_system_on_a_chip",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "48160976",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 124294075,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_System_on_Chips",
                "simpleLemma": "apple_system_on_chips",
                "lemma": {
                    "lemma": "Apple_System_on_Chips",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "39827565",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 123626836,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_system_on_chips",
                "simpleLemma": "apple_system_on_chips",
                "lemma": {
                    "lemma": "Apple_system_on_chips",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "37827287",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 124126688,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_T2",
                "simpleLemma": "apple_t2",
                "lemma": {
                    "lemma": "Apple_T2",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "56049249",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 270335107,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_T_series",
                "simpleLemma": "apple_t_series",
                "lemma": {
                    "lemma": "Apple_T_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "56592102",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 279423562,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_U1",
                "simpleLemma": "apple_u1",
                "lemma": {
                    "lemma": "Apple_U1",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "62183908",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 320544138,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_U_series",
                "simpleLemma": "apple_u_series",
                "lemma": {
                    "lemma": "Apple_U_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "64350870",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 348270603,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_W3",
                "simpleLemma": "apple_w3",
                "lemma": {
                    "lemma": "Apple_W3",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "58586013",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 295255888,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "Apple_W_series",
                "simpleLemma": "apple_w_series",
                "lemma": {
                    "lemma": "Apple_W_series",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "56592100",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 279423565,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "BridgeOS_1",
                "simpleLemma": "bridgeos_1",
                "lemma": {
                    "lemma": "BridgeOS_1",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "59249156",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 296556820,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "BridgeOS_2",
                "simpleLemma": "bridgeos_2",
                "lemma": {
                    "lemma": "BridgeOS_2",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "58586151",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 295255893,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "BridgeOS_2.0",
                "simpleLemma": "bridgeos_2.0",
                "lemma": {
                    "lemma": "BridgeOS_2.0",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "58586148",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 295255890,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "EOS_1",
                "simpleLemma": "eos_1",
                "lemma": {
                    "lemma": "EOS_1",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "58586141",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 295255889,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "List_of_Apple_system_on_a_chips",
                "simpleLemma": "list_of_apple_system_on_a_chips",
                "lemma": {
                    "lemma": "List_of_Apple_system_on_a_chips",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "37287006",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 123592689,
                "tags": {}
            }
        },
        {
            "type": "BabelSense",
            "properties": {
                "fullLemma": "List_of_Apple_system_on_chips",
                "simpleLemma": "list_of_apple_system_on_chips",
                "lemma": {
                    "lemma": "List_of_Apple_system_on_chips",
                    "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
                },
                "source": "WIKIRED",
                "senseKey": "37441728",
                "frequency": 0,
                "language": "EN",
                "pos": "NOUN",
                "synsetID": {
                    "id": "bn:14792761n",
                    "pos": "NOUN",
                    "source": "BABELNET"
                },
                "translationInfo": "",
                "pronunciations": {
                    "audios": [],
                    "transcriptions": []
                },
                "bKeySense": false,
                "idSense": 122356978,
                "tags": {}
            }
        }
    ],
    "wnOffsets": [],
    "glosses": [
        {
            "source": "WIKI",
            "sourceSense": 123090446,
            "language": "EN",
            "gloss": "Apple-designed processors, marketed for the Macintosh as Apple Silicon, are system on a chip and system in a package processors designed by Apple Inc., mainly using the ARM architecture.",
            "tokens": [
                {
                    "start": 76,
                    "end": 91,
                    "id": {
                        "id": "bn:00123813n",
                        "pos": "NOUN",
                        "source": "BABELNET"
                    },
                    "word": "system on a chip"
                },
                {
                    "start": 15,
                    "end": 24,
                    "id": {
                        "id": "bn:00014395n",
                        "pos": "NOUN",
                        "source": "BABELNET"
                    },
                    "word": "processors"
                },
                {
                    "start": 117,
                    "end": 126,
                    "id": {
                        "id": "bn:00014395n",
                        "pos": "NOUN",
                        "source": "BABELNET"
                    },
                    "word": "processors"
                },
                {
                    "start": 140,
                    "end": 149,
                    "id": {
                        "id": "bn:03739345n",
                        "pos": "NOUN",
                        "source": "BABELNET"
                    },
                    "word": "Apple Inc."
                },
                {
                    "start": 169,
                    "end": 184,
                    "id": {
                        "id": "bn:03437029n",
                        "pos": "NOUN",
                        "source": "BABELNET"
                    },
                    "word": "ARM architecture"
                }
            ]
        },
        {
            "source": "WIKIDATA",
            "sourceSense": 264582065,
            "language": "EN",
            "gloss": "Processor chips designed by Apple Inc. for use in their product portfolio.",
            "tokens": []
        }
    ],
    "examples": [],
    "images": [
        {
            "name": "Apple_A4_Chip.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Apple_A4_Chip.jpg/200px-Apple_A4_Chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/1/17/Apple_A4_Chip.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A6_Chip.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Apple_A6_Chip.jpg/200px-Apple_A6_Chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/b/bd/Apple_A6_Chip.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A5X_Chip.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/Apple_A5X_Chip.jpg/200px-Apple_A5X_Chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/4/47/Apple_A5X_Chip.jpg",
            "badImage": false
        },
        {
            "name": "S5L8900.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/S5L8900.jpg/200px-S5L8900.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/f/fe/S5L8900.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A5_Chip.jpg#WIKI",
            "languages": [
                "NL",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Apple_A5_Chip.jpg/200px-Apple_A5_Chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/4/41/Apple_A5_Chip.jpg",
            "badImage": false
        },
        {
            "name": "S5L8922.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/S5L8922.jpg/200px-S5L8922.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/f/fe/S5L8922.jpg",
            "badImage": false
        },
        {
            "name": "S5L8720.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/S5L8720.jpg/200px-S5L8720.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/e/e5/S5L8720.jpg",
            "badImage": false
        },
        {
            "name": "Apple-A5-APL2498.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Apple-A5-APL2498.jpg/200px-Apple-A5-APL2498.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/1/15/Apple-A5-APL2498.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A7_chip.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "DE",
                "HU",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7f/Apple_A7_chip.jpg/200px-Apple_A7_chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/7/7f/Apple_A7_chip.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A6X_chip.jpg#WIKI",
            "languages": [
                "NL",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/23/Apple_A6X_chip.jpg/200px-Apple_A6X_chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/2/23/Apple_A6X_chip.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A8X_system-on-a-chip.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "HU",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/72/Apple_A8X_system-on-a-chip.jpg/200px-Apple_A8X_system-on-a-chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/7/72/Apple_A8X_system-on-a-chip.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A10_Fusion_APL1W24.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "HU",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Apple_A10_Fusion_APL1W24.jpg/200px-Apple_A10_Fusion_APL1W24.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/2/2e/Apple_A10_Fusion_APL1W24.jpg",
            "badImage": false
        },
        {
            "name": "S5L8920.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO",
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/7b/S5L8920.jpg/200px-S5L8920.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/7/7b/S5L8920.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A8_system-on-a-chip.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "HU",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Apple_A8_system-on-a-chip.jpg/200px-Apple_A8_system-on-a-chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Apple_A8_system-on-a-chip.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A9X.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "HU",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Apple_A9X.jpg/200px-Apple_A9X.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/e/e6/Apple_A9X.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A10X_Fusion.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Apple_A10X_Fusion.jpg/200px-Apple_A10X_Fusion.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/4/4c/Apple_A10X_Fusion.jpg",
            "badImage": false
        },
        {
            "name": "Apple_logo_black.svg#WIKI",
            "languages": [
                "NL",
                "VI",
                "TH",
                "ZH",
                "JA",
                "FA",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg",
            "badImage": false
        },
        {
            "name": "Apple_A11.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Apple_A11.jpg/200px-Apple_A11.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/6/6f/Apple_A11.jpg",
            "badImage": false
        },
        {
            "name": "Apple-A5-APL7498.jpg#WIKI",
            "languages": [
                "NL",
                "FR",
                "ES",
                "DE",
                "HU",
                "FA",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Apple-A5-APL7498.jpg/200px-Apple-A5-APL7498.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/7/73/Apple-A5-APL7498.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A9_APL0898.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "HU",
                "EN",
                "KO",
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Apple_A9_APL0898.jpg/200px-Apple_A9_APL0898.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/e/e6/Apple_A9_APL0898.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A12.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "ES",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Apple_A12.jpg/200px-Apple_A12.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/2/2c/Apple_A12.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A7_S5L9865_chip.jpg#WIKI",
            "languages": [
                "NL",
                "FR",
                "ES",
                "DE",
                "HU",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ad/Apple_A7_S5L9865_chip.jpg/200px-Apple_A7_S5L9865_chip.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/a/ad/Apple_A7_S5L9865_chip.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A9_APL1022.jpg#WIKI",
            "languages": [
                "NL",
                "FR",
                "ES",
                "HU",
                "EN",
                "KO",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/18/Apple_A9_APL1022.jpg/200px-Apple_A9_APL1022.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/1/18/Apple_A9_APL1022.jpg",
            "badImage": false
        },
        {
            "name": "Apple_A12X.jpg#WIKI",
            "languages": [
                "NL",
                "VI",
                "FR",
                "EN",
                "KO",
                "IT",
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Apple_A12X.jpg/200px-Apple_A12X.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/d/df/Apple_A12X.jpg",
            "badImage": false
        },
        {
            "name": "Apple_S1_module.png#WIKI",
            "languages": [
                "VI",
                "FR",
                "ES",
                "HU",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/bb/Apple_S1_module.png/200px-Apple_S1_module.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/b/bb/Apple_S1_module.png",
            "badImage": false
        },
        {
            "name": "Apple_T2_APL1027.jpg#WIKI",
            "languages": [
                "VI",
                "FR",
                "ES",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Apple_T2_APL1027.jpg/200px-Apple_T2_APL1027.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_T2_APL1027.jpg",
            "badImage": false
        },
        {
            "name": "Apple_S1P_module.png#WIKI",
            "languages": [
                "VI",
                "FR",
                "ES",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Apple_S1P_module.png/200px-Apple_S1P_module.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Apple_S1P_module.png",
            "badImage": false
        },
        {
            "name": "Apple_S3_module.png#WIKI",
            "languages": [
                "VI",
                "FR",
                "ES",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b7/Apple_S3_module.png/200px-Apple_S3_module.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/b/b7/Apple_S3_module.png",
            "badImage": false
        },
        {
            "name": "Apple_S2_module.png#WIKI",
            "languages": [
                "VI",
                "FR",
                "ES",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/03/Apple_S2_module.png/200px-Apple_S2_module.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/0/03/Apple_S2_module.png",
            "badImage": false
        },
        {
            "name": "Apple_T1_APL1023.jpg#WIKI",
            "languages": [
                "VI",
                "FR",
                "ES",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/Apple_T1_APL1023.jpg/200px-Apple_T1_APL1023.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/f/f3/Apple_T1_APL1023.jpg",
            "badImage": false
        },
        {
            "name": "Apple_S4_module.png#WIKI",
            "languages": [
                "VI",
                "FR",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b8/Apple_S4_module.png/200px-Apple_S4_module.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/b/b8/Apple_S4_module.png",
            "badImage": false
        },
        {
            "name": "Apple_W1_343S00130.jpg#WIKI",
            "languages": [
                "FR",
                "ES",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Apple_W1_343S00130.jpg/200px-Apple_W1_343S00130.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/e/e4/Apple_W1_343S00130.jpg",
            "badImage": false
        },
        {
            "name": "Apple-W2-338S00348.jpg#WIKI",
            "languages": [
                "FR",
                "ES",
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Apple-W2-338S00348.jpg/200px-Apple-W2-338S00348.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/0/0f/Apple-W2-338S00348.jpg",
            "badImage": false
        },
        {
            "name": "IPhone_4S_No_shadow.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d2/IPhone_4S_No_shadow.png/200px-IPhone_4S_No_shadow.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/d/d2/IPhone_4S_No_shadow.png",
            "badImage": false
        },
        {
            "name": "IPhone_5s.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/IPhone_5s.png/200px-IPhone_5s.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/5/5e/IPhone_5s.png",
            "badImage": false
        },
        {
            "name": "IPad_Air.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/IPad_Air.png/200px-IPad_Air.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/8/8d/IPad_Air.png",
            "badImage": false
        },
        {
            "name": "IPhone_5C_(blue).svg#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/9/97/IPhone_5C_%28blue%29.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/9/97/IPhone_5C_%28blue%29.svg",
            "badImage": false
        },
        {
            "name": "IPad_Pro_Mockup.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/IPad_Pro_Mockup.png/200px-IPad_Pro_Mockup.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/7/74/IPad_Pro_Mockup.png",
            "badImage": false
        },
        {
            "name": "IPadminiWhite.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/IPadminiWhite.png/200px-IPadminiWhite.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/4/43/IPadminiWhite.png",
            "badImage": false
        },
        {
            "name": "IPhone_5.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/IPhone_5.png/200px-IPhone_5.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/f/fa/IPhone_5.png",
            "badImage": false
        },
        {
            "name": "IPad_Air_2.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/38/IPad_Air_2.png/200px-IPad_Air_2.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/3/38/IPad_Air_2.png",
            "badImage": false
        },
        {
            "name": "IPhone6_silver_frontface.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/01/IPhone6_silver_frontface.png/200px-IPhone6_silver_frontface.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/0/01/IPhone6_silver_frontface.png",
            "badImage": false
        },
        {
            "name": "IPad_3.png#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/IPad_3.png/200px-IPad_3.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/a/a4/IPad_3.png",
            "badImage": false
        },
        {
            "name": "Pink_iPod_touch_6th_generation.svg#WIKI",
            "languages": [
                "EN",
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/1/19/Pink_iPod_touch_6th_generation.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/1/19/Pink_iPod_touch_6th_generation.svg",
            "badImage": false
        },
        {
            "name": "IOS_wordmark_(2017).svg#WIKI",
            "languages": [
                "FA",
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/63/IOS_wordmark_%282017%29.svg/200px-IOS_wordmark_%282017%29.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/6/63/IOS_wordmark_%282017%29.svg",
            "badImage": false
        },
        {
            "name": "IPad_Mini_3_Gold.png#WIKI",
            "languages": [
                "EN"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/en/thumb/2/22/IPad_Mini_3_Gold.png/200px-IPad_Mini_3_Gold.png",
            "url": "https://upload.wikimedia.org/wikipedia/en/2/22/IPad_Mini_3_Gold.png",
            "badImage": false
        },
        {
            "name": "IPhone_6S_Rose_Gold.png#WIKI",
            "languages": [
                "EN"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/IPhone_6S_Rose_Gold.png/200px-IPhone_6S_Rose_Gold.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/a/a7/IPhone_6S_Rose_Gold.png",
            "badImage": false
        },
        {
            "name": "Samsung_S5L8930.jpg#WIKI",
            "languages": [
                "DE"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/7/7b/Samsung_S5L8930.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/7/7b/Samsung_S5L8930.jpg",
            "badImage": false
        },
        {
            "name": "Cyclone_e_net.jpg#WIKI",
            "languages": [
                "DE"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/61/Cyclone_e_net.jpg/200px-Cyclone_e_net.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/6/61/Cyclone_e_net.jpg",
            "badImage": false
        },
        {
            "name": "Infuturo2.svg#WIKI",
            "languages": [
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/it/f/ff/Infuturo2.svg",
            "url": "https://upload.wikimedia.org/wikipedia/it/f/ff/Infuturo2.svg",
            "badImage": false
        },
        {
            "name": "Crystal_Clear_app_mymac_new.png#WIKI",
            "languages": [
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/0/0b/Crystal_Clear_app_mymac_new.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/0/0b/Crystal_Clear_app_mymac_new.png",
            "badImage": false
        },
        {
            "name": "IPhone_X_vector.svg#WIKI",
            "languages": [
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/IPhone_X_vector.svg/200px-IPhone_X_vector.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/3/32/IPhone_X_vector.svg",
            "badImage": false
        },
        {
            "name": "IPhone_6s_vector.svg#WIKI",
            "languages": [
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/IPhone_6s_vector.svg/200px-IPhone_6s_vector.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/9/9b/IPhone_6s_vector.svg",
            "badImage": false
        },
        {
            "name": "Apple_Computer_Logo_rainbow.svg#WIKI",
            "languages": [
                "FR"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/8/84/Apple_Computer_Logo_rainbow.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/8/84/Apple_Computer_Logo_rainbow.svg",
            "badImage": false
        },
        {
            "name": "IPhone_8_vector.svg#WIKI",
            "languages": [
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5d/IPhone_8_vector.svg/200px-IPhone_8_vector.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/5/5d/IPhone_8_vector.svg",
            "badImage": false
        },
        {
            "name": "Exquisite-Modem.png#WIKI",
            "languages": [
                "IT"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/c/cb/Exquisite-Modem.png",
            "url": "https://upload.wikimedia.org/wikipedia/commons/c/cb/Exquisite-Modem.png",
            "badImage": false
        },
        {
            "name": "IPhone_XR_Blue.svg#WIKI",
            "languages": [
                "KO"
            ],
            "urlSource": "WIKI",
            "license": "OTHER",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/IPhone_XR_Blue.svg/200px-IPhone_XR_Blue.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/e/e9/IPhone_XR_Blue.svg",
            "badImage": false
        },
        {
            "name": "ARM-Cortex-A9.gif#WIKI",
            "languages": [
                "DE"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/ARM-Cortex-A9.gif/200px-ARM-Cortex-A9.gif",
            "url": "https://upload.wikimedia.org/wikipedia/commons/3/3b/ARM-Cortex-A9.gif",
            "badImage": false
        },
        {
            "name": "AppleA9.jpg#WIKI",
            "languages": [
                "RU"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a6/AppleA9.jpg/200px-AppleA9.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/a/a6/AppleA9.jpg",
            "badImage": false
        },
        {
            "name": "ARM-Cortex-A8.gif#WIKI",
            "languages": [
                "DE"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/ARM-Cortex-A8.gif/200px-ARM-Cortex-A8.gif",
            "url": "https://upload.wikimedia.org/wikipedia/commons/f/f5/ARM-Cortex-A8.gif",
            "badImage": false
        },
        {
            "name": "Samsung_S5L8701.jpg#WIKI",
            "languages": [
                "DE"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/98/Samsung_S5L8701.jpg/200px-Samsung_S5L8701.jpg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/9/98/Samsung_S5L8701.jpg",
            "badImage": false
        },
        {
            "name": "S5L8960-SoC-Apple-A6.JPG#WIKI",
            "languages": [
                "DE"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/19/S5L8960-SoC-Apple-A6.JPG/200px-S5L8960-SoC-Apple-A6.JPG",
            "url": "https://upload.wikimedia.org/wikipedia/commons/1/19/S5L8960-SoC-Apple-A6.JPG",
            "badImage": false
        },
        {
            "name": "Apple_Swift_(Vermutung).JPG#WIKI",
            "languages": [
                "DE"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Apple_Swift_%28Vermutung%29.JPG/200px-Apple_Swift_%28Vermutung%29.JPG",
            "url": "https://upload.wikimedia.org/wikipedia/commons/c/c4/Apple_Swift_%28Vermutung%29.JPG",
            "badImage": false
        },
        {
            "name": "Poznamka.svg#WIKI",
            "languages": [
                "NL"
            ],
            "urlSource": "WIKI",
            "license": "CC_BY_SA_30",
            "thumbUrl": "https://upload.wikimedia.org/wikipedia/commons/0/02/Poznamka.svg",
            "url": "https://upload.wikimedia.org/wikipedia/commons/0/02/Poznamka.svg",
            "badImage": false
        }
    ],
    "synsetType": "CONCEPT",
    "categories": [
        {
            "category": "ARM_architecture",
            "language": "EN"
        },
        {
            "category": "Apple_Inc._processors",
            "language": "EN"
        },
        {
            "category": "Articles_with_short_description",
            "language": "EN"
        },
        {
            "category": "Computer-related_introductions_in_2011",
            "language": "EN"
        },
        {
            "category": "2011_introductions",
            "language": "EN"
        },
        {
            "category": "System_on_a_chip",
            "language": "EN"
        },
        {
            "category": "Microprocessors",
            "language": "EN"
        }
    ],
    "translations": {},
    "domains": {
        "COMPUTING": 0.40721815824508667
    },
    "lnToCompound": {},
    "lnToOtherForm": {
        "EN": [
            "Ax"
        ]
    },
    "filterLangs": [
        "EN"
    ],
    "tags": [
        "CONCEPT",
        "COMPUTING",
        {
            "CLASSNAME": "it.uniroma1.lcl.babelnet.data.BabelCategory",
            "DATA": {
                "category": "ARM_architecture",
                "language": "EN"
            }
        },
        {
            "CLASSNAME": "it.uniroma1.lcl.babelnet.data.BabelCategory",
            "DATA": {
                "category": "Apple_Inc._processors",
                "language": "EN"
            }
        },
        {
            "CLASSNAME": "it.uniroma1.lcl.babelnet.data.BabelCategory",
            "DATA": {
                "category": "Articles_with_short_description",
                "language": "EN"
            }
        },
        {
            "CLASSNAME": "it.uniroma1.lcl.babelnet.data.BabelCategory",
            "DATA": {
                "category": "Computer-related_introductions_in_2011",
                "language": "EN"
            }
        },
        {
            "CLASSNAME": "it.uniroma1.lcl.babelnet.data.BabelCategory",
            "DATA": {
                "category": "2011_introductions",
                "language": "EN"
            }
        },
        {
            "CLASSNAME": "it.uniroma1.lcl.babelnet.data.BabelCategory",
            "DATA": {
                "category": "System_on_a_chip",
                "language": "EN"
            }
        },
        {
            "CLASSNAME": "it.uniroma1.lcl.babelnet.data.BabelCategory",
            "DATA": {
                "category": "Microprocessors",
                "language": "EN"
            }
        }
    ],
    "bkeyConcepts": false
}

Code samples

import urllib2
import urllib
import json
import gzip

from StringIO import StringIO

service_url = 'https://babelnet.io/v7/getSynset'

id = 'bn:14792761n'
key  = 'KEY'

params = {
    'id' : id,
    'key'  : key
}

url = service_url + '?' + urllib.urlencode(params)
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)

if response.info().get('Content-Encoding') == 'gzip':
    buf = StringIO( response.read())
    f = gzip.GzipFile(fileobj=buf)
    data = json.loads(f.read())

    # retrieving BabelSense data
    senses = data['senses']
    for result in senses:
        lemma = result.get('lemma')
        language = result.get('language')
        print language.encode('utf-8') + "\t" + str(lemma.encode('utf-8'))

    print '\n'
    # retrieving BabelGloss data
    glosses = data['glosses']
    for result in glosses:
        gloss = result.get('gloss')
        language = result.get('language')
        print language.encode('utf-8') + "\t" + str(gloss.encode('utf-8'))

    print '\n'
    # retrieving BabelImage data
    images = data['images']
    for result in images:
        url = result.get('url')
        language = result.get('language')
        name = result.get('name')
        print language.encode('utf-8') +"\t"+ str(name.encode('utf-8')) +"\t"+ str(url.encode('utf-8'))
		require "net/http"
require 'json'

uri = URI("https://babelnet.io/v7/getSynset?")

params = {
  :id => 'bn:14792761n',
  :key  => 'KEY'
}

uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(Net::HTTP::Get.new(uri.request_uri))

if response.is_a?(Net::HTTPSuccess)
  json = JSON.parse(response.body)

  # retrieving BabelSense data
  json['senses'].each do |entry|
    lemma = entry['lemma']
    language = entry['language']
    puts language + "\t" + lemma
  end

  puts "\n"
  # retrieving BabelGloss data
  json['glosses'].each do |entry|
    gloss = entry['gloss']
    language = entry['language']
    puts language + "\t" + gloss
  end

  puts "\n"
  # retrieving BabelImage data
  json['images'].each do |entry|
    url = entry['url']
    language = entry['language']
    name = entry['name']
    puts language + "\t" + name + "\t" + url
  end
end
		<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<script>
    var service_url = 'https://babelnet.io/v7/getSynset';
    var id = 'bn:14792761n'
    var key = 'KEY'

    var params = {
        'id'  : id,
        'key' : key
    };

    $.getJSON(service_url + "?", params, function(response) {

        $.each(response['senses'], function(key, val) {
            var entry = "Language: " + val['language']
                + "<br/>Lemma: " + val['lemma'] + "<br/><br/>";

            $('<div>', {html:entry}).appendTo(document.body);
        });

        $.each(response['glosses'], function(key, val) {
            var entry = "Language: " + val['language']
                + "<br/>Gloss: " + val['gloss'] + "<br/><br/>";

            $('<div>', {html:entry}).appendTo(document.body);
        });

        $.each(response['images'], function(key, val) {
            var entry = "Language: " + val['language'] + "<br/>Name: "
                + val['name'] + "<br/>Url: " + val['url'] + "<br/><br/>";

            $('<div>', {html:entry}).appendTo(document.body);
        });

    });
</script>
</body>
</html><!DOCTYPE html>
<html>
<body>
<?php

  $service_url = 'https://babelnet.io/v7/getSynset';

  $id = 'bn:14792761n';
  $key  = 'KEY';

  $params = array(
    'id'    => $id,
    'key'   => $key
  );

  $url = $service_url . '?' . http_build_query($params);

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
  $response = json_decode(curl_exec($ch), true);
  curl_close($ch);

  # retrieving BabelSense data
  foreach($response['senses'] as $result) {
    $lemma = $result['lemma'];
    $language = $result['language'];
    echo "Language: " . $language
        . "<br/>Lemma: " . $lemma . "<br/><br/>";
  }

  # retrieving BabelGloss data
  foreach($response['glosses'] as $result) {
    $gloss = $result['gloss'];
    $language = $result['language'];
    echo "Language: " . $language
        . "<br/>Gloss: " . $gloss . "<br/><br/>";
  }

  # retrieving BabelImage data
  foreach($response['images'] as $result) {
    $url = $result['url'];
    $language = $result['language'];
    $name = $result['name'];
    echo "Language: " . $language
        . "<br/>Name: " . $name
        . "<br/>Url: " . $url . "<br/><br/>";
  }

?>
</body>
</html>

Retrieve the senses of a given word

Parameters

Name Type Description
lemma string

Required. The word you want to search for

searchLang Language

Required. The language of the word

targetLang Language

The languages in which the data are to be retrieved.

Default value is the search language and accepts not more than 3 languages except the search language.

Example https://babelnet.io/v7/getSenses?lemma=BabelNet&searchLang=EN&pos=VERB&targetLang=IT&key=<your_key>

pos UniversalPOS

Returns only the synsets containing this part of speech (NOUN, VERB, etc). Accepts multiple values.

Example https://babelnet.io/v7/getSenses?lemma=BabelNet&searchLang=EN&pos=VERB&key=<your_key>

source Source

Returns only the synsets containing these sources (WIKT, WIKIDATA, etc). Accepts multiple values.

Example https://babelnet.io/v7/getSenses?lemma=BabelNet&searchLang=EN&source=WIKT&source=WIKIDATA&key=<your_key>

key string

Required. API key obtained after signing up to BabelNet (see key & limits )

Response example


[
    {
        "type": "BabelSense",
        "properties": {
            "fullLemma": "BabelNet",
            "simpleLemma": "babelnet",
            "lemma": {
                "lemma": "BabelNet",
                "type": "HIGH_QUALITY"
            },
            "source": "WIKI",
            "senseKey": "37291130",
            "frequency": 0,
            "language": "EN",
            "pos": "NOUN",
            "synsetID": {
                "id": "bn:03083790n",
                "pos": "NOUN",
                "source": "BABELNET"
            },
            "translationInfo": "",
            "pronunciations": {
                "audios": [],
                "transcriptions": []
            },
            "bKeySense": false,
            "idSense": 70973330,
            "tags": {}
        }
    },
    {
        "type": "BabelSense",
        "properties": {
            "fullLemma": "BabelNet",
            "simpleLemma": "babelnet",
            "lemma": {
                "lemma": "BabelNet",
                "type": "HIGH_QUALITY"
            },
            "source": "WIKIDATA",
            "senseKey": "Q4837690",
            "frequency": 0,
            "language": "EN",
            "pos": "NOUN",
            "synsetID": {
                "id": "bn:03083790n",
                "pos": "NOUN",
                "source": "BABELNET"
            },
            "translationInfo": "",
            "pronunciations": {
                "audios": [],
                "transcriptions": []
            },
            "bKeySense": false,
            "idSense": 521355878,
            "tags": {}
        }
    },
    {
        "type": "BabelSense",
        "properties": {
            "fullLemma": "BabelNet",
            "simpleLemma": "babelnet",
            "lemma": {
                "lemma": "BabelNet",
                "type": "HIGH_QUALITY"
            },
            "source": "OMWIKI",
            "senseKey": "1499705",
            "frequency": 0,
            "language": "EN",
            "pos": "NOUN",
            "synsetID": {
                "id": "bn:03083790n",
                "pos": "NOUN",
                "source": "BABELNET"
            },
            "translationInfo": "",
            "pronunciations": {
                "audios": [],
                "transcriptions": []
            },
            "bKeySense": false,
            "idSense": 70973352,
            "tags": {}
        }
    },
    {
        "type": "BabelSense",
        "properties": {
            "fullLemma": "babelnet.org",
            "simpleLemma": "babelnet.org",
            "lemma": {
                "lemma": "babelnet.org",
                "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
            },
            "source": "WIKIDATA_ALIAS",
            "senseKey": "Q4837690",
            "frequency": 0,
            "language": "EN",
            "pos": "NOUN",
            "synsetID": {
                "id": "bn:03083790n",
                "pos": "NOUN",
                "source": "BABELNET"
            },
            "translationInfo": "",
            "pronunciations": {
                "audios": [],
                "transcriptions": []
            },
            "bKeySense": false,
            "idSense": 521355876,
            "tags": {}
        }
    },
    {
        "type": "BabelSense",
        "properties": {
            "fullLemma": "Babelnet",
            "simpleLemma": "babelnet",
            "lemma": {
                "lemma": "Babelnet",
                "type": "POTENTIAL_NEAR_SYNONYM_OR_WORSE"
            },
            "source": "WIKIRED",
            "senseKey": "37291418",
            "frequency": 0,
            "language": "EN",
            "pos": "NOUN",
            "synsetID": {
                "id": "bn:03083790n",
                "pos": "NOUN",
                "source": "BABELNET"
            },
            "translationInfo": "",
            "pronunciations": {
                "audios": [],
                "transcriptions": []
            },
            "bKeySense": false,
            "idSense": 70973337,
            "tags": {}
        }
    }
]

Code samples

import urllib2
import urllib
import json
import gzip

from StringIO import StringIO

service_url = 'https://babelnet.io/v7/getSenses'

lemma = 'BabelNet'
lang = 'EN'
key  = 'KEY'

params = {
    'lemma' : lemma,
    'searchLang' : lang,
    'key'  : key
}

url = service_url + '?' + urllib.urlencode(params)
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)

if response.info().get('Content-Encoding') == 'gzip':
    buf = StringIO( response.read())
    f = gzip.GzipFile(fileobj=buf)
    data = json.loads(f.read())

    # retrieving BabelSense data
    for result in data:
        lemma = result.get('lemma')
        language = result.get('language')
        source = result.get('source')
        print language.encode('utf-8') \
            +"\t"+ str(lemma.encode('utf-8')) \
            +"\t"+ str(source.encode('utf-8'))
require "net/http"
require 'json'

uri = URI("https://babelnet.io/v7/getSenses?")

params = {
  :lemma => 'BabelNet',
  :searchLang => 'EN',
  :key  => 'KEY'
}

uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(Net::HTTP::Get.new(uri.request_uri))

if response.is_a?(Net::HTTPSuccess)
  json = JSON.parse(response.body)
  json.each do |entry|
    lemma = entry['lemma']
    language = entry['language']
    source = entry['source']
    puts language +"\t"+ lemma +"\t"+ source
  end
end
<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<script>
    var service_url = 'https://babelnet.io/v7/getSenses';
    var lemma = 'BabelNet'
    var lang = 'EN'
    var key  = 'KEY'

    var params = {
        'lemma': lemma,
        'searchLang': lang,
        'key' : key
    };

    $.getJSON(service_url + "?", params, function(response) {
        $.each(response, function(key, val) {
            var entry = "Language: " + val['language']
                + "<br/>Lemma: " + val['lemma']
                + "<br/>Source: " + val['source'] + "<br/><br/>";
            $('<div>', {html:entry}).appendTo(document.body);
        });
    });
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<?php

  $service_url = 'https://babelnet.io/v7/getSenses';

  $lemma = 'BabelNet';
  $lang = 'EN';
  $key  = 'KEY';

  $params = array(
    'lemma'  => $lemma,
    'searchLang'  => $lang,
    'key'   => $key
  );

  $url = $service_url . '?' . http_build_query($params);

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
  $response = json_decode(curl_exec($ch), true);
  curl_close($ch);

  foreach($response as $result) {
    $lemma = $result['lemma'];
    $language = $result['language'];
    $source = $result['source'];
    echo "Language: " . $language
        . "<br/>Lemma: " . $lemma
        . "<br/>Source: " . $source . "<br/><br/>";
  }
?>
</body>
</html>

Retrieve a list of BabelNet IDs given a resource identifier

Parameters

This method must be accessed differently according to the resource identifier that is being used. For resources that have a unique identifier for each item (e.g. Wikidata) the only required parameter is the id; this holds for all the resources except Wikipedia and Wikiquote, where a single page title is not unique across different languages: this is why when using a Wikipedia ID (i.e., page title) it is mandatory to include the search language and, optionally, the POS tag. Both calls have other mandatory parameters (source and API key), explained in the tables below.

Parameters for Wikipedia and Wikiquote.

Name Type Description
id string

Required. The page title you want to search for

searchLang Language

The language of the word

targetLang Language

The languages in which the data are to be retrieved.

Default value is the search language and accepts not more than 3 languages except the search language.

Example https://babelnet.io/v7/getSynsetIdsFromResourceID?id=BabelNet&searchLang=EN&pos=NOUN&source=WIKI&targetLang=IT&key=<your_key>

pos UniversalPOS

Returns only the synsets containing this part of speech (NOUN, VERB, etc). Accepts multiple values.

source Source

Required. The resource of the page title specified. Accepts only the values WIKI or WIKIQU.

key string

Required. API key obtained after signing up to BabelNet (see key & limits )

Parameters for the all remaining resources.

Name Type Description
id string

Required. id of the synset you want to retrieve (bn:03083790n, Q4837690, etc.)

targetLang Language

The languages in which the data are to be retrieved.

Default value is the English and accepts not more than 3 languages except the default language.

Example https://babelnet.io/v7/getSynsetIdsFromResourceID?id=Q4837690&source=WIKIDATA&targetLang=ITkey=<your_key>

source Source

Required. The resource of the identifier specified. Accepts all the resource values except WIKI and WIKIQU.

wnVersion string

If the value of the parameter source is WN (WordNet), using this field allow to specify the WordNet version of the parameter id.

Example https://babelnet.io/v7/getSynsetIdsFromResourceID?id=wn:02398357v&wnVersion=WN_21&source=WN&key=<your_key>

key string

Required. API key obtained after signing up to BabelNet (see key & limits )

Response example

[
    {
        "id": "bn:03083790n",
        "pos": "NOUN",
        "source": "BABELNET"
    }
]

Code samples

import urllib2
import urllib
import json
import gzip

from StringIO import StringIO

service_url = 'https://babelnet.io/v7/getSynsetIdsFromResourceID'

id      = 'BabelNet'
lang    = 'EN'
pos     = 'NOUN'
source  = 'WIKI'
key 	= 'KEY'

params = {
        'id'     : id,
        'searchLang'   : lang,
        'pos'    : pos,
        'source' : source,
        'key'    : key
}

url = service_url + '?' + urllib.urlencode(params)
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)

if response.info().get('Content-Encoding') == 'gzip':
    buf = StringIO( response.read())
    f = gzip.GzipFile(fileobj=buf)
    data = json.loads(f.read())
    for result in data:
        print result['id']
require "net/http"
require 'json'

uri = URI("https://babelnet.io/v7/getSynsetIdsFromResourceID?")

params = {
  :id     => 'BabelNet',
  :searchLang   => 'EN',
  :pos    => 'NOUN',
  :source => 'WIKI',
  :key    => 'KEY'
}

uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(Net::HTTP::Get.new(uri.request_uri))

if response.is_a?(Net::HTTPSuccess)
  json = JSON.parse(response.body)
  json.each do |entry|
    puts entry['id']
  end
end
<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<script>
    var service_url = 'https://babelnet.io/v7/getSynsetIdsFromResourceID';
    var id      = 'BabelNet'
    var lang    = 'EN'
    var pos     = 'NOUN'
    var source  = 'WIKI'
    var key     = 'KEY'

    var params = {
        'id'     : id,
        'searchLang'   : lang,
        'pos'    : pos,
        'source' : source,
        'key'    : key
    };

    $.getJSON(service_url + "?", params, function(response) {
        $.each(response, function(key, val) {
            $('<div>', {text:val['id']}).appendTo(document.body);
        });
    });
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<?php

  $service_url = 'https://babelnet.io/v7/getSynsetIdsFromResourceID';

  $id     = 'BabelNet';
  $lang   = 'EN';
  $pos    = 'NOUN';
  $source = 'WIKI';
  $key    = 'KEY';

  $params = array(
    'lemma'     => $lemma,
    'searchLang'     => $lang,
    'pos'      => $pos,
    'source'   => $source,
    'key'      => $key
  );

  $url = $service_url . '?' . http_build_query($params);

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
  $response = json_decode(curl_exec($ch), true);
  curl_close($ch);

  foreach($response as $result) {
    echo $result['id'] . '<br/>';
  }
?>
</body>
</html>

Retrieve edges of a given BabelNet synset

Parameters

Name Type Description
id string

Required. id of the synset you want to retrieve

key string

Required. API key obtained after signing up to BabelNet (see key & limits )

Response example

[
    {
        "language": "MUL",
        "pointer": {
            "fSymbol": "wdp31",
            "name": "instance_of",
            "shortName": "instance_of",
            "relationGroup": "HYPERNYM",
            "isAutomatic": false
        },
        "target": "bn:00021497n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "MUL",
        "pointer": {
            "fSymbol": "wdp31",
            "name": "instance_of",
            "shortName": "instance_of",
            "relationGroup": "HYPERNYM",
            "isAutomatic": false
        },
        "target": "bn:00047172n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "MUL",
        "pointer": {
            "fSymbol": "wdp31",
            "name": "instance_of",
            "shortName": "instance_of",
            "relationGroup": "HYPERNYM",
            "isAutomatic": false
        },
        "target": "bn:00059033n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "MUL",
        "pointer": {
            "fSymbol": "wdp31",
            "name": "instance_of",
            "shortName": "instance_of",
            "relationGroup": "HYPERNYM",
            "isAutomatic": false
        },
        "target": "bn:02275757n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "MUL",
        "pointer": {
            "fSymbol": "wdp31",
            "name": "instance_of",
            "shortName": "instance_of",
            "relationGroup": "HYPERNYM",
            "isAutomatic": false
        },
        "target": "bn:02290297n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "@w",
            "name": "Hypernym",
            "shortName": "is-a",
            "relationGroup": "HYPERNYM",
            "isAutomatic": true
        },
        "target": "bn:02275757n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00000657n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00004785n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00020452n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00021547n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00025928n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00026967n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00030862n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00031339n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00044458n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00049910n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00050161n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00050901n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00054468n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00059033n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00059123n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00064421n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00075735n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00081546n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00240337n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00356605n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00370400n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00683882n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00685308n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00790971n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00987447n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:01391386n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:01669841n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:01801234n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:01925466n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02202384n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02275757n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02290297n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02440726n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02514363n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02637743n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02886551n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03217333n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03313533n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03335263n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03335629n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03387875n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03388996n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03488806n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03683294n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:10083342n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:15173814n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:16845612n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:16847651n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:17317913n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:17388870n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:17643841n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:17738885n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:23635940n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "EN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:26907216n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "AF",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00045156n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "AF",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00047172n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "AF",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03288118n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "AF",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03814713n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "BN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00024746n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "BN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00073092n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "BN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03159815n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "BN",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:20277502n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "CA",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00079080n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "CA",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03164081n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "CA",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:15133936n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "FR",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00003266n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "FR",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00025333n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "FR",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00029344n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "FR",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00050906n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "FR",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00052570n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "FR",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00777246n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "FR",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:06797405n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "IT",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00046139n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "IT",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00597954n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "IT",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00800146n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "IT",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:01009911n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "IT",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:02612327n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "PT",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03688518n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "PT",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:10842586n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "ES",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00015605n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "ES",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:00028143n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "ES",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:01178863n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "ES",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:03869203n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "ES",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:05270372n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "ES",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:14788478n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    },
    {
        "language": "ES",
        "pointer": {
            "fSymbol": "r",
            "name": "Semantically related form",
            "shortName": "related",
            "relationGroup": "OTHER",
            "isAutomatic": false
        },
        "target": "bn:16241759n",
        "weight": 0.0,
        "normalizedWeight": 0.0
    }
]

Code samples

import urllib2
import urllib
import json
import gzip

from StringIO import StringIO

service_url = 'https://babelnet.io/v7/getOutgoingEdges'

id = 'bn:03083790n'
key  = 'KEY'

params = {
    'id' : id,
    'key'  : key
}

url = service_url + '?' + urllib.urlencode(params)
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)

if response.info().get('Content-Encoding') == 'gzip':
    buf = StringIO( response.read())
    f = gzip.GzipFile(fileobj=buf)
    data = json.loads(f.read())

    # retrieving Edges data
    for result in data:
        target = result.get('target')
        language = result.get('language')

        # retrieving BabelPointer data
        pointer = result['pointer']
        relation = pointer.get('name')
        group = pointer.get('relationGroup')

        print language.encode('utf-8') \
          + "\t" + str(target.encode('utf-8')) \
          + "\t" + str(relation.encode('utf-8')) \
          + "\t" + str(group.encode('utf-8'))
require "net/http"
require 'json'

uri = URI("https://babelnet.io/v7/getOutgoingEdges?")

params = {
  :id => 'bn:14792761n',
  :key  => 'KEY'
}

uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(Net::HTTP::Get.new(uri.request_uri))

if response.is_a?(Net::HTTPSuccess)
  json = JSON.parse(response.body)

  # retrieving Edges data
  json.each do |entry|
    target = entry['target']
    language = entry['language']

    # retrieving BabelPointer data
    pointer = entry['pointer']
    relation = pointer['name']
    group = pointer['relationGroup']

    puts language + "\t" + target + "\t" + relation + "\t" + group
  end

end
		<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<script>
    var service_url = 'https://babelnet.io/v7/getOutgoingEdges';
    var id = 'bn:14792761n'
    var key = 'KEY'

    var params = {
        'id': id,
        'key' : key
    };

    $.getJSON(service_url + "?", params, function(response) {

        $.each(response, function(key, val) {
            var pointer = val['pointer'];
            var entry = "Language: " + val['language']
                + "<br/>Target: " + val['target']
                + "<br/>Relation: " + pointer['name']
                + "<br/>Relation group: " + pointer['relationGroup'] + "<br/><br/>";
            $('<div>', {html:entry}).appendTo(document.body);
        });

    });
</script>
</body>
</html>
		<!DOCTYPE html>
<html>
<body>
<?php

  $service_url = 'https://babelnet.io/v7/getOutgoingEdges';

  $id = 'bn:03083790n';
  $key  = 'KEY';

  $params = array(
    'id'  => $id,
    'key' => $key
  );

  $url = $service_url . '?' . http_build_query($params);

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
  $response = json_decode(curl_exec($ch), true);
  curl_close($ch);

  # retrieving edges data
  foreach($response as $result) {
    $target = $result['target'];
    $language = $result['language'];

    $pointer = $result['pointer'];
    $relation = $pointer['name'];
    $group = $pointer['relationGroup'];
    echo "Language: " . $language
        . "<br/>Target: " . $target
        . "<br/>Relation: " . $relation
        . "<br/>Relation group: " . $group . "<br/><br/>";
  }

?>
</body>
</html>

Retrieve hypernyms, hyponyms and antonyms of a given BabelNet synset

Code samples

import urllib2
import urllib
import json
import gzip

from StringIO import StringIO

service_url = 'https://babelnet.io/v7/getOutgoingEdges'

id = 'bn:00007287n'
key  = 'KEY'

params = {
    'id' : id,
    'key'  : key
}

url = service_url + '?' + urllib.urlencode(params)
request = urllib2.Request(url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)

if response.info().get('Content-Encoding') == 'gzip':
    buf = StringIO( response.read())
    f = gzip.GzipFile(fileobj=buf)
    data = json.loads(f.read())

    # retrieving Edges data
    for result in data:
        target = result.get('target')
        language = result.get('language')

        # retrieving BabelPointer data
        pointer = result['pointer']
        relation = pointer.get('name')
        group = pointer.get('relationGroup')

        # Types of relationGroup: HYPERNYM,  HYPONYM, MERONYM, HOLONYM, OTHER
        if ('hypernym' in group.lower() or 'hyponym' in group.lower()):
                print (str(language) + "\t" + str(target) + "\t" + str(relation) + "\t" + str(group))
        elif ('antonym' in relation.lower()):
                print (str(language) + "\t" + str(target) + "\t" + str(relation) + "\t" + str(group))
		require "net/http"
require 'json'

uri = URI("https://babelnet.io/v7/getOutgoingEdges?")

params = {
  :id => 'bn:00007287n',
  :key  => 'KEY'
}

uri.query = URI.encode_www_form(params)

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(Net::HTTP::Get.new(uri.request_uri))

if response.is_a?(Net::HTTPSuccess)
  json = JSON.parse(response.body)

  # retrieving Edges data
  json.each do |entry|
    target = entry['target']
    language = entry['language']

    # retrieving BabelPointer data
    pointer = entry['pointer']
    relation = pointer['name']
    group = pointer['relationGroup']

    # Types of relationGroup: HYPERNYM,  HYPONYM, MERONYM, HOLONYM, OTHER
    if group.downcase.include? "hypernym" or group.downcase.include? "hyponym"
        puts language + "\t" + target + "\t" + relation + "\t" + group
    elsif relation.downcase.include? "antonym"
        puts language + "\t" + target + "\t" + relation + "\t" + group
    end
  end

end
		<!DOCTYPE html>
<html>
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<script>
    var service_url = 'https://babelnet.io/v7/getOutgoingEdges';
    var id = 'bn:00007287n'
    var key = 'KEY'

    var params = {
        'id': id,
    'key' : key
    };

    $.getJSON(service_url + "?", params, function(response) {

        $.each(response, function(key, val) {

        var pointer = val['pointer'];
        var relation = pointer['name'];
        var group = pointer['relationGroup'];

        # Types of relationGroup: HYPERNYM,  HYPONYM, MERONYM, HOLONYM, OTHER
        if ((group.toLowerCase().indexOf("hypernym") > -1)
            || (group.toLowerCase().indexOf("hyponym") > -1)
            || (relation.toLowerCase().indexOf("antonym") > -1)) {
            var entry = "Language: " + val['language']
                + "<br/>Target: " + val['target']
                + "<br/>Relation: " + relation
                + "<br/>Relation group: " + group + "<br/><br/>";
            $('<div>', {html:entry}).appendTo(document.body);
            }
        });
    });
</script>
</body>
</html>
		<!DOCTYPE html>
<html>
<body>
<?php

  $service_url = 'https://babelnet.io/v7/getOutgoingEdges';

  $id = 'bn:00007287n';
  $key  = 'KEY';

  $params = array(
    'id'  => $id,
    'key' => $key
  );

  $url = $service_url . '?' . http_build_query($params);

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
  $response = json_decode(curl_exec($ch), true);
  curl_close($ch);

  # retrieving edges data
  foreach($response as $result) {
    $target = $result['target'];
    $language = $result['language'];

    $pointer = $result['pointer'];
    $relation = $pointer['name'];
    $group = $pointer['relationGroup'];

    # Types of relationGroup: HYPERNYM,  HYPONYM, MERONYM, HOLONYM, OTHER
    if ((strpos(strtolower($group), "hypernym") !== FALSE)
        || (strpos(strtolower($group), "hyponym") !== FALSE)
        || (strpos(strtolower($relation), "antonym") !== FALSE)) {

        echo "Language: " . $language
            . "<br/>Target: " . $target
            . "<br/>Relation: " . $relation
            . "<br/>Relation group: " . $group . "<br/><br/>";
    }
  }


?>
</body>
</html>

HTTP request error

Below, an example of an error message returned after a wrong call:

Response example

HTTP/1.1 400 Bad Request
Content-Length: 52

{"message":"Wrong parameters."}

Related Project

BabelNet.js - a wrapper for the BabelNet HTTP API to be used from the browser and from Node.js.

Usage

First, bundle all dependencies into one file with browserify. Make sure to create a .env file with your API key before. You can simply rename and modify the file .env.example from the repo.

$ npm run browserify

Second, you can use the created file in the browser as follows.

BabelNet.getSynsetIds({
    word: 'apple',
    language: 'EN'
  }, function(err, results) {
    if (err) {
      throw(err);
    }
    console.log(JSON.stringify(results));
  });

The API is modeled along the BabelNet HTTP API and offers the following methods:

getSynsetIds
getSynset
getSenses
getSynsetIdsFromWikipediaTitle
getEdges

Java API

The BabelNet Java API requires JRE 1.8 or above.

NOTE: Since the BabelNet 3.5 release, any data retrieved with the API is by default only in the search language. Should one want to retrieve other languages, it is possible to use the method to, defined in the BabelNetQuery.Builder, passing the parameter Collection<Language> langs. It is not possible to retrieve more than three languages other than the search language. For more details see this example.

Here you can access the javadoc for the API. To work with the Java API, unpack the zip file with:

unzip BabelNet-API-5.1.zip

The file is available the download section.

Configuration

The first important step is the configuration of the properties files located inside the BabelNet API folder.

For instance, assuming you received by email the following key (see key & limits): abcdefghilmnopqrstuvz

  1. Edit the babelnet.var.properties files inside BabelNet-API-5.1/config/

Add the following line intobabelnet.var.properties:

babelnet.key=abcdefghilmnopqrstuvz

Running the BabelNet demo

Now, you can test that everything works simply issuing the run-babelnetdemo command within the main BabelNet-API folder. Otherwise, you can start the demo with the command line:

java -classpath lib/*:babelnet-api-5.1.jar:config it.uniroma1.lcl.babelnet.demo.BabelNetDemo

NOTE: If you are running out of Java heap space, you will need to add an argument like -Xmx1024M on your java command line:

java -Xmx1024M -classpath lib/*:babelnet-api-5.1.jar:config it.uniroma1.lcl.babelnet.demo.BabelNetDemo

Working with Eclipse and Netbeans

In order to use the BabelNet API within an Eclipse or Netbeans project, you need to carry out the following steps (select either Eclipse or Netbeans):

Eclipse
Netbeans

For Scala users: install the Scala plugin for Eclipse or download the Scala IDE for Eclipse - http://scala-ide.org/

For Groovy users: install the Groovy plugin for Eclipse!

  1. Create your Eclipse project (File -> New -> Java (or Scala) project, give the project a name and press Finish). This creates a new folder with the project name under your Eclipse workspace folder
  2. Copy the config/ folder from the BabelNet-API-5.1 folder into your workspace/projectFolder/
  3. Now we need to include all the lib/*.jar files and the babelnet-api-5.1.jar file in the project build classpath:
    1. Select the project from Package Explorer tree view
    2. From the top bar click on Project and then Properties
    3. Once inside the Properties section click on Java build path and select the Libraries tab
    4. From the right menu click on the Add External JARs button
    5. Browse to the downloaded BabelNet-API-5.1 folder, and select all the lib/*.jar files along with the babelnet-api-5.1.jar file
  4. Next we need to Include the config/ folder in the project build classpath:
    1. Select the project from Package Explorer tree view
    2. From the top bar click on File and then Refresh
    3. From the Java build path (see point 3 above) select the Source tab
    4. Once in the Source tab, click on Add Folder from the right sidebar and select the downloaded config/ folder
  5. Happy coding!! ;-)

For Scala users: install the Scala plugin for Netbeans - http://wiki.netbeans.org/Scala

For Groovy users: install the Groovy plugin for Netbeans!

  1. Create your Netbeans project (File -> New Project -> Java (or Scala), give the project a name and press Finish). This creates a new folder with the project name under your NetBeans workspace folder
  2. Copy the config/ folder from the BabelNet-API-5.1 folder into your projectFolder/
  3. Now we need to include all the lib/*.jar files and the babelnet-api-5.1.jar file, along with the config/ folder in the project build classpath:
    1. Right click on the name of the project in the left tree view, click on Properties and then click on Categories
    2. Once in the Categories section select Libraries and click on the compiles button where you can add JARs and folders through the Add JAR/Folder button
    3. Browse to the downloaded BabelNet folder, and select all the lib/*.jar files along with the babelnet-api-5.1.jar file
    4. Next select the config/ folder and add that as well
  4. Happy coding!! ;-)

Code

Let's now look at the main classes in the BabelNet API. For more details, see the API javadoc.

Main classes

The main classes of BabelNet are:

  • BabelNet, the entry point to BabelNet
  • BabelSynset, a concept or named entity identified by a set of multilingual lexicalizations (each being a BabelSense)
  • BabelSense, a lexicalization of a given concept (BabelSynset)

BabelNet

The BabelNet class is used as the entry point to access all the content available in BabelNet. The class is implemented through the singleton pattern, where we restrict the instantiation of the BabelNet class to one object. You can obtain a reference to the only instance of the BabelNet class with the following line:

val bn = BabelNet.getInstance()val bn = BabelNet.getInstanceBabelNet bn = BabelNet.getInstance();

Now you are ready to use the BabelNet object to work with the BabelNet API.

BabelSynset

A BabelSynset is a set of multilingual lexicalizations that are synonyms expressing a given concept or named entity. For instance, the synset for car in the motorcar sense looks like this. After creating the BabelNet object which we call bn , we can use its methods to retrieve one or many BabelSynset objects. For instance, to retrieve all the synsets containing car we can call the BabelNet#getSynsets method:

// Given a word in a certain language,
// returns the concepts (`BabelSynsets`) denoted by the word.
val query = BabelNetQuery.Builder("car")
    .from(Language.EN)
    .build()
val byl = bn.getSynsets(query)// Given a word in a certain language,
// returns the concepts (`BabelSynsets`) denoted by the word.
val query = new BabelNetQuery.Builder("car")
    .from(Language.EN)
    .build
val byl = bn.getSynsets(query)// Given a word in a certain language,
// returns the concepts (`BabelSynsets`) denoted by the word.
BabelNetQuery query = new BabelNetQuery.Builder("car")
    .from(Language.EN)
    .build();
List<BabelSynset> byl = bn.getSynsets(query);

We can also specify which of the parts of speech we are interested in and obtain only synsets for the specified part of speech. In the following example we retrieve all the verbal synsets containing the English lexicalization run :

// Given a word in a certain language and pos (part of speech),
// returns the concepts denoted by the word.
val query = BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .build()
val byl = bn.getSynsets(query)// Given a word in a certain language and pos (part of speech),
// returns the concepts denoted by the word.
val query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .build
val byl = bn.getSynsets(query)// Given a word in a certain language and pos (part of speech),
// returns the concepts denoted by the word.
BabelNetQuery query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .build();
List<BabelSynset> byl = bn.getSynsets(query);

The list of UniversalPOS values includes:

public enum UniversalPOS
{
	 NOUN,
	 ADJ,
	 VERB,
	 ADV,
	 INTJ,
	 DET,
	 CCONJ,
	 PRON,
	 ...
}

However, only the open-class (i.e., top 4) parts of speech are available.

Due to the nature of BabelNet, a BabelSynset may contain lexicalizations from different sources. You can restrict your search only to your sources of interest. For instance:

// Given a word in a certain language, returns the concepts
// for the word available in the given sense sources.
val query = BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.NOUN)
    .sources(Arrays.asList(BabelSenseSource.WIKI, BabelSenseSource.OMWIKI))
    .build()
val byl = bn.getSynsets(query)// Given a word in a certain language, returns the concepts
// for the word available in the given sense sources.
val query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.NOUN)
    .sources(Arrays.asList(BabelSenseSource.WIKI,BabelSenseSource.OMWIKI))
    .build()
val byl = bn.getSynsets(query)// Given a word in a certain language, returns the concepts
// for the word available in the given sense sources.
BabelNetQuery query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.NOUN)
    .sources(Arrays.asList(BabelSenseSource.WIKI,BabelSenseSource.OMWIKI))
    .build();
List<BabelSynset> byl = bn.getSynsets(query);

The full list of sources is:

public enum BabelSenseSource
{
    BABELNET,	    //BabelNet
    WN,	            //WordNet 3.0
    IWN,	        //Italian WordNet
    WONEF,	        //WordNet du Français
    WIKI,	        //Wikipedia page
    WIKIDIS,	    //Wikipedia disambiguation pages
    WIKIDATA,	    //Wikidata
    OMWIKI,	        //OmegaWiki
    WIKICAT,	    //Wikipedia category
    WIKIRED,	    //Wikipedia redirections
    WIKT,	        //Wiktionary
    WIKTLB, 	    //Wiktionary translation label
    GEONM,	        //GeoNames
    WNTR,	        //Translations of WordNet senses
    WIKITR,	        //Translations of Wikipedia links
    MCR_EU,	        //Basque Open Multilingual WordNet
    OMWN_HR,	    //Croatian Open Multilingual WordNet
    SLOWNET,	    //Slovenian Open Multilingual WordNet
    OMWN_ID,	    //Bahasa Open Multilingual WordNet
    OMWN_IT,	    //Italian Open Multilingual WordNet
    MCR_GL,	        //Galician Open Multilingual WordNet
    ICEWN,	        //Icelandic (IceWordNet) Open Multilingual WordNet
    OMWN_ZH,	    //Chinese Open Multilingual WordNet
    OMWN_NO,	    //Norwegian Open Multilingual WordNet
    OMWN_NN,	    //Norwegian Open Multilingual WordNet
    SALDO,	        //Swedish Open Multilingual WordNet
    OMWN_JA,	    //Japanese Open Multilingual WordNet
    MCR_CA,	        //Catalan Open Multilingual WordNet
    OMWN_PT,	    //Portuguese Open Multilingual WordNet
    OMWN_FI,	    //Finnish Open Multilingual WordNet
    OMWN_PL,	    //Poland Open Multilingual WordNet
    OMWN_TH,	    //Thai Open Multilingual WordNet
    OMWN_SK,	    //Slovak Open Multilingual WordNet
    OMWN_LT,	    //Lithuanian Open Multilingual WordNet
    OMWN_NL,	    //Dutch Open Multilingual WordNet
    OMWN_AR,	    //Arabic Open Multilingual WordNet
    OMWN_FA,	    //Persian Open Multilingual WordNet
    OMWN_EL,	    //Greek Open Multilingual WordNet
    MCR_ES,	        //Spanish Open Multilingual WordNet
    OMWN_RO,	    //Romanian Open Multilingual WordNet
    OMWN_SQ,	    //Albanian (AlbaNet) Open Multilingual WordNet
    OMWN_DA,	    //Danish (DanNet) Open Multilingual WordNet
    OMWN_FR,	    //French (WOLF) Open Multilingual WordNet
    OMWN_MS,	    //Bahasa Open Multilingual WordNet
    OMWN_BG,	    //Bulgarian (BulTreeBank) Open Multilingual WordNet
    OMWN_HE,	    //Hebrew Open Multilingual WordNet
    OMWN_KO,	    //Korean WordNet
    MCR_PT,	        //Portuguese from Multilingual Central Repository
    OMWN_GAE,	    //Irish (GAWN) WordNet
    WORD_ATLAS, 	//WordAtlas
    WIKIDATA_ALIAS,	//Wikidata Alias
    WN2020	        //WordNet 2020
}

Each BabelSynset has an ID that univocally identifies the synset and that can be obtained via the BabelSynset#getID method. If we have an ID and want to retrieve the corresponding synset, we can use the overloaded BabelNet#getSynset method. For instance:

// Gets a BabelSynset from a concept identifier (Babel synset ID).
val by: BabelSynset? = bn.getSynset(BabelSynsetID("bn:03083790n"))// Gets a BabelSynset from a concept identifier (Babel synset ID).
val by = bn.getSynset(new BabelSynsetID("bn:03083790n"))// Gets a BabelSynset from a concept identifier (Babel synset ID).
BabelSynset by = bn.getSynset(new BabelSynsetID("bn:03083790n"));

returns the BabelSynset corresponding to ID bn:03083790n, that is, the synset about BabelNet.

If we want to retrieve the BabelSynset corresponding to a given WordNet 3.0 ID, we can use another overloaded version of the BabelNet#getSynset method:

// Gets the BabelSynsets corresponding to an input WordNet offset.
val by: BabelSynset? = bn.getSynset(WordNetSynsetID("wn:06879521n"))// Gets the BabelSynsets corresponding to an input WordNet offset.
val by = bn.getSynset(new WordNetSynsetID("wn:06879521n"))// Gets the BabelSynsets corresponding to an input WordNet offset.
BabelSynset by = bn.getSynset(new WordNetSynsetID("wn:06879521n"));

If we want to retrieve the BabelSynset corresponding to a given Wikidata page ID, we can use another overloaded version of the BabelNet#getSynset method:

// Gets the BabelSynsets corresponding to an input Wikidata page ID.
val by: BabelSynset? = bn.getSynset(WikidataID("Q4837690"))// Gets the BabelSynsets corresponding to an input Wikidata page ID.
val by = bn.getSynset(new WikidataID("Q4837690"))// Gets the BabelSynsets corresponding to an input Wikidata page ID.
BabelSynset by = bn.getSynset(new WikidataID("Q4837690"));

If we want to retrieve the BabelSynsets containing a given Wikipedia page title, we can use the method BabelNet#getSynsets:

// Given a Wikipedia title, returns the BabelSynsets which contain it.
val by = bn.getSynsets(WikipediaID("Men in Black (film 1997)", Language.IT, UniversalPOS.NOUN))// Given a Wikipedia title, returns the BabelSynsets which contain it.
val byl = bn.getSynsets(new WikipediaID("Men in Black (film 1997)", Language.IT, UniversalPOS.NOUN))// Given a Wikipedia title, returns the BabelSynsets which contain it.
List<BabelSynset> byl = bn.getSynsets(new WikipediaID("Men in Black (film 1997)", Language.IT, UniversalPOS.NOUN));

BabelSense

A BabelSense is a term (either word or multi-word expression) in a given language occurring in a certain BabelSynset. Each occurrence of the same term (e.g., car) in different synsets is therefore a different BabelSense of that term.

Now let's look at the methods to retrieve a BabelSense using the bn object we created earlier:

//Returns the senses for the word in a certain language.
val query = BabelNetQuery.Builder("run")
    .from(Language.EN)
    .build()
val senses = bn.getSensesFrom(query)

//Returns the senses for the word in a certain language and Part-Of-Speech.
val query = BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .build()
val senses = bn.getSensesFrom(query)

//Returns the senses for the word with the given constraints.
val query = BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .sources(Arrays.asList(BabelSenseSource.WIKI, BabelSenseSource.OMWIKI))
    .build()
val senses = bn.getSensesFrom(query)// Returns the senses for the word in a certain language.
val query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .build
val senses = bn.getSensesFrom(query)

// Returns the senses for the word in a certain language and Part-Of-Speech.
val query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .build
val senses = bn.getSensesFrom(query)

// Returns the senses for the word with the given constraints.
val query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .sources(Arrays.asList(BabelSenseSource.WIKI,BabelSenseSource.OMWIKI))
    .build
val senses = bn.getSensesFrom(query)// Returns the senses for the word in a certain language.
BabelNetQuery query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .build();
List<BabelSense> senses = bn.getSensesFrom(query);

// Returns the senses for the word in a certain language and Part-Of-Speech.
BabelNetQuery query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .build();
List<BabelSense> senses = bn.getSensesFrom(query);

// Returns the senses for the word with the given constraints.
BabelNetQuery query = new BabelNetQuery.Builder("run")
    .from(Language.EN)
    .POS(UniversalPOS.VERB)
    .sources(Arrays.asList(BabelSenseSource.WIKI,BabelSenseSource.OMWIKI))
    .build();
List<BabelSense> senses = bn.getSensesFrom(query);

Once we have a BabelSense, we can go back to the synset it belongs to using the BabelSense#getSynset method:

val by = sense.getSynset()val by: BabelSynset = sense.getSynsetBabelSynset by = sense.getSynset();

We can view the BabelSynset as a container of BabelSense s, i.e., the lexicalizations in the various languages contained in the synset that express its concept or named entity.

Some methods of BabelSynset and BabelSense

We are now going into details about important methods of the BabelSynset and BabelSense classes.

Main BabelSynset methods

BabelSynset is composed of various elements which we describe below. Furthermore, a BabelSynset is connected to other BabelSynset objects. The main components of a BabelSynset are objects of the following types:

  1. BabelSense (a lexicalization of the concept, see above)
  2. UniversalPOS (the synset's part of speech)
  3. BabelGloss (a definition of the concept in a given language)
  4. BabelExample (an example sentence of the meaning expressed by the synset)
  5. BabelImage (an image depicting the concept)
  6. BabelSynsetRelation (an edge semantically connecting the synset to another synset)

Let's take a look at the main methods of a BabelSynset object which we call by . Note: to obtain BabelSynset objects we can also use the above examples.

// Gets a BabelSynset from a concept identifier (Babel synset ID).
val by = bn.getSynset(BabelSynsetID("bn:03083790n"))

// Most relevant BabelSense to this BabelSynset for a given language.
val bs = by.getMainSense(Language.ZH).get()

// Gets the part of speech of this BabelSynset.
val pos = by.getPOS()

// True if the BabelSynset is a key concept
val iskeyConcept = by.isKeyConcept

// Gets the senses contained in this BabelSynset.
val senses = by.getSenses()

// Collects all BabelGlosses in the given source for this BabelSynset.
val glosses = by.getGlosses()

// Collects all BabelExamples for this BabelSynset.
val examples = by.getExamples()

// Gets the images (BabelImages) of this BabelSynset.
val images = by.getImages()

// Collects all the edges incident on this BabelSynset.
val edges = by.getOutgoingEdges()

// Gets the BabelCategory objects of this BabelSynset.
val cats = by.getCategories()// Gets a BabelSynset from a concept identifier (Babel synset ID).
val by = bn.getSynset(new BabelSynsetID("bn:03083790n"))

// Most relevant BabelSense to this BabelSynset for a given language.
val bs = by.getMainSense(Language.EN)

// Gets the part of speech of this BabelSynset.
val pos = by.getPOS

// True if the BabelSynset is a key concept
val iskeyConcept = by.isKeyConcept

// Gets the senses contained in this BabelSynset.
val senses = by.getSenses

// Collects all BabelGlosses in the given source for this BabelSynset.
val glosses = by.getGlosses

// Collects all BabelExamples for this BabelSynset.
val examples = by.getExamples

// Gets the images (BabelImages) of this BabelSynset.
val images = by.getImages

// Collects all the edges incident on this BabelSynset.
val edges = by.getOutgoingEdges

// Gets the BabelCategory objects of this BabelSynset.
val cats = by.getCategories// Gets a BabelSynset from a concept identifier (Babel synset ID).
BabelSynset by = bn.getSynset(new BabelSynsetID("bn:03083790n"));

// Most relevant BabelSense to this BabelSynset for a given language.
Optional<BabelSense> bs = by.getMainSense(Language.EN);

// Gets the part of speech of this BabelSynset.
POS pos = by.getPOS();

// True if the BabelSynset is a key concept
boolean iskeyConcept = by.isKeyConcept();

// Gets the senses contained in this BabelSynset.
List<BabelSense> senses = by.getSenses();

// Collects all BabelGlosses in the given source for this BabelSynset.
List<BabelGloss> glosses = by.getGlosses();

// Collects all BabelExamples for this BabelSynset.
List<BabelExample> examples = by.getExamples();

// Gets the images (BabelImages) of this BabelSynset.
List<BabelImage> images = by.getImages();

// Collects all the edges incident on this BabelSynset.
List<BabelSynsetRelation> edges = by.getOutgoingEdges();

// Gets the BabelCategory objects of this BabelSynset.
List<BabelCategory> cats = by.getCategories();

Main BabelSense methods

We now have a look at the BabelSense methods. The main components of a BabelSense are:

  1. BabelSynset (the synset the sense belongs to)
  2. UniversalPOS (its part-of-speech tag)
  3. the lemma string (the lexicalization of the sense)
  4. BabelSensePhonetics (the written and audio pronunciations of this sense)
  5. BabelSenseSource (the source of the sense, e.g.: Wikipedia, WordNet, etc., see above)

Some code retrieving the above information follows:

val bs = by.getMainSense(Language.EN).get();

// Gets the language of this BabelSense
val lang = bs.getLanguage()

// Gets the part-of-speech tag of this BabelSense
val pos = bs.getPOS()

// True if the BabelSense is a key concept
val iskeyConcept = bs.isKeySense()

// Gets the lemma of this BabelSense
val lemma = bs.getFullLemma()

// Gets the simple lemma of this sense (i.e., without parentheses, etc.)
val simpleLemma = bs.getNormalizedLemma()

// Gets the pronunciations of this sense
val pronunciations = bs.getPronunciations()

// Collects all the sources of the sense; ex: Wikipedia, WordNet, etc.
val source = bs.getSource()
val bs = by.getMainSense(Language.EN).get;

// Gets the language of this BabelSense
val lang = bs.getLanguage

// Gets the part-of-speech tag of this BabelSense
val pos = bs.getPOS

// True if the BabelSense is a key concept
val iskeyConcept = bs.isKeySense

// Gets the lemma of this BabelSense
val lemma = bs.getFullLemma

// Gets the simple lemma of this sense (i.e., without parentheses, etc.)
val simpleLemma = bs.getNormalizedLemma

// Gets the pronunciations of this sense
val pronunciations = bs.getPronunciations

// Collects all the sources of the sense; ex: Wikipedia, WordNet, etc.
val source = bs.getSourceBabelSense bs = by.getMainSense(Language.EN).get();

// Gets the language of this BabelSense
Language lang = bs.getLanguage();

// Gets the part-of-speech tag of this BabelSense
POS pos = bs.getPOS();

// True if the BabelSense is a key concept
boolean iskeyConcept = bs.isKeySense();

// Gets the lemma of this BabelSense
String lemma = bs.getFullLemma();

// Gets the simple lemma of this sense (i.e., without parentheses, etc.)
String simpleLemma = bs.getNormalizedLemma();

// Gets the pronunciations of this sense
BabelSensePhonetics pronunciations = bs.getPronunciations();

// Collects all the sources of the sense; ex: Wikipedia, WordNet, etc.
BabelSenseSource source = bs.getSource();

Usage examples

Here we show full examples that show how you can use the BabelNet API to accomplish several tasks.

Retrieve all BabelSynset objects for a specific word

import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.jlt.util.Language

object Example {
    @JvmStatic
    fun main(args: Array<String>) {
        val bn = BabelNet.getInstance()
        for (synset in bn.getSynsets("home", Language.EN))
            println("Synset ID: " + synset.getID())
    }
}import scala.collection.JavaConverters._
import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.jlt.util.Language

object Example extends App {
    val bn = BabelNet.getInstance
    for (synset <- bn.getSynsets("home", Language.EN))
        System.out.println("Synset ID: " + synset.getID)
}
    import it.uniroma1.lcl.babelnet.BabelNet;
import it.uniroma1.lcl.babelnet.BabelSynset;
import it.uniroma1.lcl.jlt.util.Language;

public class Example {
    public static void main(String[] args) {
        BabelNet bn = BabelNet.getInstance();
        for (BabelSynset synset : bn.getSynsets("home", Language.EN)) {
            System.out.println("Synset ID: " + synset.getID());
        }
    }
}

For a specific word retrieves all BabelSynset objects in English, Italian and French.

import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelNetQuery
import it.uniroma1.lcl.jlt.util.Language
import java.util.*

object Example {
    @JvmStatic
    fun main(args: Array<String>) {
        val bn = BabelNet.getInstance()
        val query =  BabelNetQuery.Builder("home")
                .from(Language.EN)
                .to(Arrays.asList(Language.IT, Language.FR))
                .build()
        for (synset in bn.getSynsets(query))
            println("Synset ID: " + synset.getID())
    }
}
import scala.collection.JavaConverters._
import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelNetQuery
import it.uniroma1.lcl.jlt.util.Language

object Example extends App {
    val bn = BabelNet.getInstance
    val query =  new BabelNetQuery.Builder("home")
            .from(Language.EN)
            .to(Arrays.asList(Language.IT, Language.FR))
            .build
    for (synset <- bn.getSynsets(query).asScala)
        System.out.println("Synset ID: " + synset.getID)
}
import it.uniroma1.lcl.babelnet.BabelNet;
import it.uniroma1.lcl.babelnet.BabelSynset;
import it.uniroma1.lcl.babelnet.BabelNetQuery;
import it.uniroma1.lcl.jlt.util.Language;
import java.util.Arrays;

public class Example {
    public static void main(String[] args) {
        BabelNet bn = BabelNet.getInstance();
        BabelNetQuery query = new BabelNetQuery.Builder("home")
            .from(Language.EN)
            .to(Arrays.asList(Language.IT, Language.FR))
            .build();
        for (BabelSynset synset : bn.getSynsets(query)) {
            System.out.println("Synset ID: " + synset.getID());
        }

    }
}

Retrieve all BabelSense objects for a specific BabelSynset object

import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelSynsetID

object Example {
    @JvmStatic
    fun main(args: Array<String>) {
        val bn = BabelNet.getInstance()
        for (sense in bn.getSynset(BabelSynsetID("bn:00000356n")).senses) {
            println("Sense: " + sense.fullLemma
                    + "\tLanguage: " + sense.language
                    + "\tSource: " + sense.source)
            val phonetic = sense.pronunciations
            for (audio in phonetic.audioItems)
                println("Audio URL " + audio.validatedUrl)
        }
    }
}import scala.collection.JavaConverters._
import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelSynsetID

object Example extends App {
    val bn = BabelNet.getInstance
    for (sense <- bn.getSynset(new BabelSynsetID("bn:00000356n")).getSenses.asScala) {
      println("Sense: " + sense.getFullLemma
        + "\tLanguage: " + sense.getLanguage.toString
        + "\tSource: " + sense.getSource.toString)
      val phonetic = sense.getPronunciations
      for (audio <- phonetic.getAudioItems.asScala) {
        println("Audio URL " + audio.getUrl)
      }
    }
}
import it.uniroma1.lcl.babelnet.BabelNet;
import it.uniroma1.lcl.babelnet.BabelSense;
import it.uniroma1.lcl.babelnet.BabelSynsetID;
import it.uniroma1.lcl.babelnet.data.BabelAudio;
import it.uniroma1.lcl.babelnet.data.BabelSensePhonetics;

public class Example {
    public static void main(String[] args) {
        BabelNet bn = BabelNet.getInstance();
        for (BabelSense sense : bn.getSynset(new BabelSynsetID("bn:00000356n")).getSenses()) {
            System.out.println("Sense: " + sense.getFullLemma()
                            + "\tLanguage: " + sense.getLanguage().toString()
                            + "\tSource: " + sense.getSource().toString());
            BabelSensePhonetics phonetic = sense.getPronunciations();
            for (BabelAudio audio : phonetic.getAudioItems()) {
                System.out.println("Audio URL " + audio.getUrl());
            }
        }
    }
}

Retrieve all BabelSense objects for a specific Wikidata page id

import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.resources.WikidataID

object Example {
    @JvmStatic
    fun main(args: Array<String>) {
        val bn = BabelNet.getInstance()
        for (sense in bn.getSynset(WikidataID("Q4837690")).senses) {
            println("Sense: " + sense.fullLemma
                    + "\tLanguage: " + sense.language
                    + "\tSource: " + sense.source)
            val phonetic = sense.pronunciations;
            for (audio in phonetic.audioItems)
                println("Audio URL " + audio.validatedUrl)
        }
    }
}
import scala.collection.JavaConverters._
import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.resources.WikidataID

object Example extends App {
    val bn = BabelNet.getInstance
    for (sense <- bn.getSynset(new WikidataID("Q4837690")).getSenses.asScala) {
      println("Sense: " + sense.getFullLemma
        + "\tLanguage: " + sense.getLanguage.toString
        + "\tSource: " + sense.getSource.toString)
      val phonetic = sense.getPronunciations
      for (audio <- phonetic.getAudioItems.asScala) {
        println("Audio URL " + audio.getUrl)
      }
    }
}
import it.uniroma1.lcl.babelnet.BabelNet;
import it.uniroma1.lcl.babelnet.BabelSense;
import it.uniroma1.lcl.babelnet.data.BabelAudio;
import it.uniroma1.lcl.babelnet.data.BabelSensePhonetics;
import it.uniroma1.lcl.babelnet.resources.WikidataID;


public class Example {
    public static void main(String[] args) {
        BabelNet bn = BabelNet.getInstance();
        for (BabelSense sense : bn.getSynset(new WikidataID("Q4837690")).getSenses()) {
            System.out.println("Sense: " + sense.getFullLemma()
                            + "\tLanguage: " + sense.getLanguage().toString()
                            + "\tSource: " + sense.getSource().toString());
            BabelSensePhonetics phonetic = sense.getPronunciations();
            for (BabelAudio audio : phonetic.getAudioItems()) {
                System.out.println("Audio URL " + audio.getUrl());
            }
        }
    }
}

Retrieve Wikidata id for each BabelSense in a BabelSynset

import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelSynsetID
import it.uniroma1.lcl.babelnet.data.BabelSenseSource

object Example {
    @JvmStatic
    fun main(args: Array<String>) {
        val bn = BabelNet.getInstance()
        val by = bn.getSynset(BabelSynsetID("bn:03083790n"))
        for (sense in by.getSenses(BabelSenseSource.WIKIDATA)) {
            val senseKey = sense.sensekey
            println("Sense: " + sense.fullLemma
                    + "\tLanguage: " + sense.language
                    + "\tSensekey: " + senseKey)
        }
    }
}
	import scala.collection.JavaConverters._
import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelSynsetID
import it.uniroma1.lcl.babelnet.data.BabelSenseSource;

object Example extends App {
    val bn = BabelNet.getInstance
    val by = bn.getSynset(new BabelSynsetID("bn:03083790n"))
    for (sense <- by.getSenses(BabelSenseSource.WIKIDATA).asScala) {
      val sensekey = sense.getSensekey
      println("Sense: " + sense.getFullLemma
        + "\tLanguage: " + sense.getLanguage.toString
        + "\tSensekey: " + sensekey)
    }
}
import it.uniroma1.lcl.babelnet.BabelNet;
import it.uniroma1.lcl.babelnet.BabelSense;
import it.uniroma1.lcl.babelnet.BabelSynset;
import it.uniroma1.lcl.babelnet.BabelSynsetID;
import it.uniroma1.lcl.babelnet.data.BabelSenseSource;

public class Example {
    public static void main(String[] args) {
       BabelNet bn = BabelNet.getInstance();
       BabelSynset by = bn.getSynset(new BabelSynsetID("bn:03083790n"));
       for (BabelSense sense : by.getSenses(BabelSenseSource.WIKIDATA)) {
           String sensekey = sense.getSensekey();
           System.out.println(sense.getFullLemma() + "\t" + sense.getLanguage() + "\t" + sensekey);
       }
   }
}

Retrieve neighbors of a BabelSynset object

import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelSynsetID
import it.uniroma1.lcl.jlt.util.Language

object Example {
    @JvmStatic
    fun main(args: Array<String>) {
        val bn = BabelNet.getInstance()
        val by = bn.getSynset(BabelSynsetID("bn:00044492n"))
        for(edge in by.outgoingEdges) {
            println(by.getID().id + "\t" + by.getMainSense(Language.EN).get().fullLemma + " - "
                    + edge.pointer + " - "
                    + edge.babelSynsetIDTarget)
        }
    }
}
import scala.collection.JavaConverters._
import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.babelnet.BabelSynsetID
import it.uniroma1.lcl.jlt.util.Language

object Example extends App {
    val bn = BabelNet.getInstance
    val by = bn.getSynset(new BabelSynsetID("bn:00044492n"))
    for(edge <- by.getOutgoingEdges.asScala) {
      println(by.getID + "\t" + by.getMainSense(Language.EN).get.getFullLemma + " - "
        + edge.getPointer + " - "
        + edge.getBabelSynsetIDTarget)
    }
}
import it.uniroma1.lcl.babelnet.BabelNet;
import it.uniroma1.lcl.babelnet.BabelSynset;
import it.uniroma1.lcl.babelnet.BabelSynsetID;
import it.uniroma1.lcl.babelnet.BabelSynsetRelation;
import it.uniroma1.lcl.babelnet.data.BabelPointer;
import it.uniroma1.lcl.jlt.util.Language;

public class Example {
    public static void main(String[] args) {
        BabelNet bn = BabelNet.getInstance();
        BabelSynset by = bn.getSynset(new BabelSynsetID("bn:00015556n"));
        for(BabelSynsetRelation edge : by.getOutgoingEdges(BabelPointer.ANY_HYPERNYM)) {
            System.out.println(by.getID()+"\t"+by.getMainSense(Language.EN).get().getFullLemma()+" - "
                + edge.getPointer()+" - "
                + edge.getBabelSynsetIDTarget());
        }
    }
}

Retrieve the distribution of relationships (frequency of each BabelPointer type) for a specific word

import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.jlt.util.Language

object Example {
    @JvmStatic
    fun main(args: Array<String>) {
        val bn = BabelNet.getInstance()
        val synsetsList = bn.getSynsets("car", Language.EN)

        val totalByDept = synsetsList.flatMap { it.outgoingEdges }
            .map { it.pointer.symbol }.groupBy { it }.mapValues { it.value.size }.toList().sortedBy { it.second }

        totalByDept.forEach{pointer -> println(pointer.first + "\t" + pointer.second)}
    }
}
	import scala.collection.JavaConverters._
import it.uniroma1.lcl.babelnet.BabelNet
import it.uniroma1.lcl.jlt.util.Language

object Example extends App {

    val bn = BabelNet.getInstance
    val synsetsList = bn.getSynsets("car", Language.EN).asScala

    val totalByDept = synsetsList.flatMap(s => s.getOutgoingEdges.asScala)
      .map(_.getPointer.getSymbol).groupBy(identity).mapValues(_.size).toSeq.sortBy(_._2)

    totalByDept.foreach(pointer => println(pointer._1 + "\t" + pointer._2))
}
		import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

import it.uniroma1.lcl.babelnet.BabelNet;
import it.uniroma1.lcl.babelnet.BabelSynset;
import it.uniroma1.lcl.jlt.util.Language;

public class Example {
    public static void main(String[] args) {

        BabelNet bn = BabelNet.getInstance();
        List<BabelSynset> synsets = bn.getSynsets("car", Language.EN);

        Map<String, Long> totalByDept = synsets.parallelStream()
            .flatMap(synset ->  synset.getOutgoingEdges().parallelStream())
            .map(edge -> edge.getPointer().getSymbol())
            .collect(Collectors.groupingByConcurrent(Function.identity(), Collectors.counting()));

        totalByDept.forEach((pointer, freq) -> System.out.println(pointer + "\t" + freq));
    }
}

Obtain a BabelNet Java instance in a webapp environment

// The code supposes that the BabelNet "config/" folder are inside the "/WEB-INF/" folder of your web application.

Configuration jltConfiguration = Configuration.getInstance();
jltConfiguration.setConfigurationFile(new File(getServletContext().getRealPath("/") + "WEB-INF/config/jlt.properties"));

BabelNetConfiguration bnconf = BabelNetConfiguration.getInstance();
bnconf.setConfigurationFile(new File(getServletContext().getRealPath("/") + "/WEB-INF/config/babelnet.properties"));
bnconf.setBasePath(getServletContext().getRealPath("/") + "/WEB-INF/");
BabelNet bn =  BabelNet.getInstance();

// your BabelNet code here

Python API

The BabelNet Python API requires Python 3.8. The Python package is available on PyPI and here you can access the pydoc for the API.

It can be used in two different modalities:

Online Mode: uses the online REST service to retrieve the data. To use this mode you need an internet connection and a valid API key. You can install it via pip with the following command:

pip install babelnet

RPC Mode: reads data directly from a local copy of the BabelNet indices, making it more suitable for heavy workloads than the online mode since it is faster and doesn't have usage limits. To use this mode you need the BabelNet indices and Docker installed in your system. The RPC server controller (see below) requires additional dependencies that can be installed with the following pip command:

pip install babelnet[rpc]

Further details on how to use these modes are provided in the following sections.

Version compatibility

BabelNet Python API can be used with BabeNet 4.0 and above.

Configuration

After the installation, the first step to take when you want to use BabelNet in another project (or in the REPL) is to create a file called babelnet_conf.yml in the current working directory. Alternatively, the path of the configuration file can be specified using the BABELNET_CONF environment variable.

The content of the babelnet_conf.yml should vary according to the usage mode of choice: online or RPC.

Online Mode

This is the simplest version to use, since it requires only a valid API key. Assuming you have received by e-mail the key 3x54mp13-8au0-o97q-9vzz-3vakcpec8w4p, add the following line to babelnet_conf.yml:

RESTFUL_KEY: '3x54mp13-8au0-o97q-9vzz-3vakcpec8w4p'

This will automatically be used to authenticate you on the official BabelNet REST service.

The supported REST endpoints are:

  • https://babelnet.io/v7/service for BabelNet 5.1 (default)
  • https://babelnet.io/v6/service for BabelNet 5.0
  • https://babelnet.io/v5/service for BabelNet 4.0

If you want to use a different REST endpoint, add the following line to babelnet_conf.yml:

# BabelNet 5.1 REST endpoint
RESTFUL_URL: 'https://babelnet.io/v7/service'

RPC Mode

To use the RPC mode you need a local copy of the BabelNet indices. To download them, follow the procedure in the downloads section. This can be considered a full mode, because it has no usage limit and faster responses.

BabelNet Python API requires PyLucene, which has a dependency on Lucene itself. The installation process of Lucene can be tricky since it has many dependencies that need compiling. Because of this, we moved this PyLucene build and install process to a simple Docker image. In the RPC mode, the Remote Procedure Call paradigm is applied in calling this Docker container as a remote service, effectively decoupling PyLucene and BabelNet.

To configure the APIs in RPC mode, you just need to add one of these lines to your babelnet_conf.yml, depending on which protocol you want to use.

The default protocol used by the RPC server is TCP. You can specify the URL where the server is listening with the following configuration line.

# TCP URL example
RPC_URL: "tcp://127.0.0.1:7790"

If the RPC server has the optional IPC protocol enabled, you can use it with the following configuration line.

# IPC URL example
RPC_URL: "ipc:///home/user/your_ipc_dir/socket"

Important: to use lambdas in RPC mode, the client code must be run using the same Python version of the server, i.e. Python 3.8, and the same (or older) version of cloudpickle, i.e. 2.1.0.

To start the server, you can either use the RPC server controller or manually start the Docker. In any case you need Docker to be installed in your system. The controller is described in the following section; for details on how to directly use the Docker image, please follow the documentation on the Docker Hub page.

Note: when you update the API to a newer version, you need to either restart the server using the controller or pull the new docker from the hub and start a new server with the updated image.

RPC server controller

To simplify the management of the RPC server, you can use the babelnet-rpc command.

The additional dependencies required by the controller can be installed with the command:

pip install babelnet[rpc]

For Windows users: if you are working in an Anaconda environment, you need to install pywin32 using anaconda with the following command:

conda install pywin32=227

Documentation

Once the server is started, the documentation of the Python API will be available at http://localhost:7780, or alternatively to the port defined by the arguments of the start command.

Start the server

To start the server, you can use the command babelnet-rpc start. If no arguments are provided, it will start in interactive mode, in which you will be prompted to provide the required values.

$ babelnet-rpc start

BabelNet indices path: /home/user/BabelNet-5.1
Port for documentation ([7780], -1 to ignore): 8080
RPC mode ([tcp]/ipc/all): all
Port for TCP mode ([7790]): 
IPC directory: your_ipc_dir
Starting server...
Server started

BabelNet Python API documentation is available at http://localhost:8080

To use BabelNet in RPC mode, add one of these lines in your babelnet_conf.yml file
RPC_URL: "tcp://127.0.0.1:7790"
RPC_URL: "ipc:///home/user/your_ipc_dir/socket"

Alternatively, the values can be passed as arguments. The available arguments are:

  • --bn <path> required, the BabelNet indices path
  • --doc <port> port for the BabelNet API documentation (default 7780)
  • --no-doc disable the documentation port
  • -m, --mode the RPC mode enabled on the server (tcp, ipc or all, default tcp). On Windows the only available mode is tcp.
  • --tcp <port> the port for TPC mode (default 7790)
  • --ipc <path> the IPC directory (required with mode ipc or all)
  • --print print the command instead of executing it

Examples of usage

Basic usage
$ babelnet-rpc start --bn /home/user/BabelNet-5.1 

Starting server...
Server started

BabelNet Python API documentation will be available at http://localhost:7790

To use BabelNet in RPC mode, add this line in your babelnet_conf.yml file
RPC_URL: "tcp://127.0.0.1:7790"
IPC mode without documentation
$ babelnet-rpc start --bn /home/user/BabelNet-5.1 --no-doc -m ipc --ipc your_ipc_dir

Starting server...
Server started

To use BabelNet in RPC mode, add this line in your babelnet_conf.yml file
RPC_URL: "ipc:///home/user/your_ipc_dir/socket"
Custom TCP port, print docker command
$ babelnet-rpc start --bn /home/user/BabelNet-5.1 --print --tcp 1234

To start the RPC server, run the following command:
docker run -d --name babelnet-rpc -p 7780:8000 -p 1234:1234 -v "/home/user/BabelNet-5.1:/root/babelnet" babelscape/babelnet-rpc:latest

BabelNet Python API documentation will be available at http://localhost:7780

To use BabelNet in RPC mode, add this line in your babelnet_conf.yml file
RPC_URL: "tcp://127.0.0.1:1234"

Stop the server

To stop a running RPC server, run the command:

babelnet-rpc stop

Code

Assuming the installation and configuration phases have been completed, you can start working with BabelNet.

The entry point in the library is the babelnet package. It contains a set of functions that query the available content. You can import the package by calling:

import babelnet as bn

The two main classes of BabelNet are:

  • BabelSynset (a concept or named entity identified by a set of multilingual lexicalizations, each being a BabelSense)
  • BabelSense (a lexicalization of a given concept, i.e. a BabelSynset)

For more details, see the API documentation at https://babelnet.org/pydoc/1.0/.

BabelSynset

A BabelSynset is a set of multilingual lexicalizations that are synonyms expressing a given concept or named entity. For instance, the synset for car in the motorcar sense looks like this. After importing babelnet as bn we can use its functions to retrieve one or many BabelSynset objects. For instance, to retrieve all the synsets containing car we can call get_synsets:

from babelnet.language import Language

# Given a word in a certain language,
# returns the concepts (BabelSynsets) denoted by the word.
byl = bn.get_synsets('car', from_langs=[Language.EN])

We can also specify which of the parts of speech we are interested in and obtain only synsets for the specified part of speech. In the following example, we retrieve all the verbal synsets containing the English lexicalization run :

from babelnet.language import Language
from babelnet.pos import POS

# Given a word in a certain language and pos (part of speech),
# returns the concepts denoted by the word.
byl = bn.get_synsets('run', from_langs=[Language.EN], poses=[POS.VERB])

Due to the nature of BabelNet, a BabelSynset may contain lexicalizations from different sources. You can restrict your search only to your sources of interest. For instance:

from babelnet.language import Language
from babelnet.pos import POS
from babelnet.data.source import BabelSenseSource

# Given a word in a certain language, returns the concepts
# for the word available in the given sense sources.
byl = bn.get_synsets('run', from_langs=[Language.EN], poses=[POS.NOUN],
                     sources=[BabelSenseSource.WIKI, BabelSenseSource.OMWIKI])

Each BabelSynset has an ID that univocally identifies the synset, and that can be obtained via the id attribute of BabelSynset instances. If we have an ID and want to retrieve the corresponding synset, we can use get_synset. For instance:

from babelnet.resources import BabelSynsetID

# Gets a BabelSynset from a concept identifier (Babel synset ID).
by = bn.get_synset(BabelSynsetID('bn:03083790n'))

returns the BabelSynset corresponding to ID bn:03083790n, that is, the synset about BabelNet.

If we want to retrieve the BabelSynset corresponding to a given WordNet 3.0 ID, we can do the following:

from babelnet.resources import WordNetSynsetID

# Gets the BabelSynsets corresponding to an input WordNet offset.
by = bn.get_synset(WordNetSynsetID('wn:06879521n'))

If we want to retrieve the BabelSynset corresponding to a given Wikidata page ID, we can do the following:

from babelnet.resources import WikidataID

# Gets the BabelSynsets corresponding to an input Wikidata page ID.
by = bn.get_synset(WikidataID('Q4837690'))

If we want to retrieve the BabelSynsets containing a given Wikipedia page title, we can use the function get_synsets:

from babelnet.language import Language
from babelnet.pos import POS
from babelnet.resources import WikipediaID

# Given a Wikipedia title, returns the BabelSynsets which contain it.
byl = bn.get_synsets(WikipediaID('Men in Black (film 1997)', Language.IT, POS.NOUN))

BabelSense

A BabelSense is a term (either word or multi-word expression) in a given language occurring in a certain BabelSynset . Each occurrence of the same term (e.g., car) in different synsets is, therefore, a different BabelSense of that term.

Now let's look at the functions to retrieve a BabelSense using the bn module we have imported earlier:

from babelnet.language import Language
from babelnet.pos import POS
from babelnet.data.source import BabelSenseSource

#  Returns the senses for the word in a certain language.
senses1 = bn.get_senses('run', from_langs=[Language.EN])

# Returns the senses for the word in a certain language and Part-Of-Speech.
senses2 = bn.get_senses('run', from_langs=[Language.EN], poses=[POS.VERB])

# Returns the senses for the word with the given constraints.
senses3 = bn.get_senses('run', from_langs=[Language.EN], poses=[POS.VERB],
                        sources=[BabelSenseSource.WIKI, BabelSenseSource.OMWIKI])

Once we have a BabelSense, we can go back to the synset it belongs with the synset property:

by = sense.synset

We can view the BabelSynset as a container of BabelSense s, i.e., the lexicalizations in the various languages contained in the synset that express its concept or named entity.

Some attributes of BabelSynset and BabelSense

We are now going into details about important attributes (methods, properties) of the BabelSynset and BabelSense classes.

BabelSynset

BabelSynset is composed of various elements, which we describe below. Furthermore, a BabelSynset is connected to other BabelSynset objects. The main components of a BabelSynset are objects of the following types:

  1. BabelSense (a lexicalization of the concept, see above)
  2. POS (the synset's part of speech)
  3. BabelGloss (a definition of the concept in a given language)
  4. BabelExample (an example sentence of the meaning expressed by the synset)
  5. BabelImage (an image depicting the concept)
  6. BabelSynsetRelation (an edge semantically connecting the synset to another synset)

Let's take a look at the main methods and properties of a BabelSynset object which we call by. Note: to obtain BabelSynset objects we can also use the above examples.

# Get a BabelSynset from a concept identifier (Babel synset ID).
by = bn.get_synset(BabelSynsetID('bn:03083790n'))

# Most relevant BabelSense to this BabelSynset for a given language.
bs = by.main_sense(Language.EN)

# The part of speech of this BabelSynset.
pos = by.pos

# True if the BabelSynset is a key concept
is_key_concept = by.is_key_concept

# Gets the senses contained in this BabelSynset.
senses = by.senses()

# Collects all BabelGlosses in the given source for this BabelSynset.
glosses = by.glosses()

# Collects all BabelExamples for this BabelSynset.
examples = by.examples()

# The images (BabelImages) of this BabelSynset.
images = by.images

# Collects all the edges incident on this BabelSynset.
edges = by.outgoing_edges()

# Gets the BabelCategory objects of this BabelSynset.
cats = by.categories()

BabelSense

We now have a look at the BabelSense attributes. The main components of a BabelSense are:

  1. BabelSynset (the synset the sense belongs to)
  2. POS (its part-of-speech tag)
  3. the lemma string (the lexicalization of the sense)
  4. BabelSensePhonetics (the written and audio pronunciations of this sense)
  5. BabelSenseSource (the source of the sense, e.g.: Wikipedia, WordNet, etc.)

Some code retrieving the above information follows:

bs = by.main_sense(Language.EN)

# The language of this BabelSense
lang = bs.language

# The part-of-speech tag of this BabelSense
pos = bs.pos

# True if the BabelSense is a key concept
is_key_concept = bs.is_key_sense

# The lemma of this BabelSense
lemma = bs.full_lemma

# The normalized lemma of this sense (i.e., lowercase, without parentheses, etc.)
normalized_lemma = bs.normalized_lemma

# The pronunciations of this sense
pronunciations = bs.pronunciations

# The source of the sense; ex: Wikipedia, WordNet, etc.
source = bs.source

Usage examples

Here we show full examples that show how you can use the BabelNet API to accomplish several tasks.

Retrieve all BabelSynset objects for a specific word

import babelnet as bn
from babelnet import Language

for synset in bn.get_synsets('home', from_langs=[Language.EN]):
    print('Synset ID:', synset.id)

For a specific word retrieves all BabelSynset objects in English, Italian and French

import babelnet as bn
from babelnet import Language

synsets = bn.get_synsets('home', from_langs=[Language.EN],
                         to_langs=[Language.IT, Language.FR])
for synset in synsets:
    print('Synset ID:', synset.id)

Retrieve all BabelSense objects for a specific BabelSynset object

import babelnet as bn
from babelnet import BabelSynsetID

synset = bn.get_synset(BabelSynsetID('bn:00000356n'))
# a synset is an iterator over its senses
for sense in synset:
    print('Sense: ' + sense.full_lemma,
          'Language: ' + str(sense.language),
          'Source: ' + str(sense.source), sep='\t')
    phonetic = sense.pronunciations
    for audio in phonetic.audios:
        print('Audio URL', audio.validated_url)

Retrieve all BabelSense objects for a specific Wikidata page id

import babelnet as bn
from babelnet.resources import WikidataID

synset = bn.get_synset(WikidataID('Q4837690'))
# a synset is an iterator over its senses
for sense in synset:
    print('Sense: ' + sense.full_lemma,
          'Language: ' + str(sense.language),
          'Source: ' + str(sense.source), sep='\t')
    phonetic = sense.pronunciations
    for audio in phonetic.audios:
        print('Audio URL', audio.validated_url)

Retrieve Wikidata id for each BabelSense in a BabelSynset

import babelnet as bn
from babelnet import BabelSynsetID, BabelSenseSource

by = bn.get_synset(BabelSynsetID('bn:00000356n'))
for sense in by.senses(source=BabelSenseSource.WIKIDATA):
    sensekey = sense.sensekey
    print(sense.full_lemma, sense.language, sensekey, sep='\t')

Retrieve neighbors of a BabelSynset object

import babelnet as bn
from babelnet import BabelSynsetID, Language
from babelnet.data.relation import BabelPointer

by = bn.get_synset(BabelSynsetID('bn:00015556n'))
for edge in by.outgoing_edges(BabelPointer.ANY_HYPERNYM):
    print(str(by.id) + '\t' + by.main_sense(Language.EN).full_lemma,
          edge.pointer, edge.id_target, sep=' - ')

Retrieve the distribution of relationships (frequency of each BabelPointer type) for a specific word

from itertools import groupby

import babelnet as bn
from babelnet import Language

synsets = bn.get_synsets('car', from_langs=[Language.EN])
li = [edge.pointer.symbol for synset in synsets for edge
      in synset.outgoing_edges()]
for p, l in groupby(sorted(li)):
    print(p, len(list(l)), sep='\t')

Multithreading

In online mode requests can come from different threads or processes and are elaborated concurrently.

In RPC mode, using the API simultaneously from multiple threads is discouraged due to Python's threading management and the limitations of the RPC library. Since sending concurrent requests to the server can lead to long response times, to avoid timeouts it is recommended to use a limited pool like in the following example.

import concurrent.futures
from datetime import datetime
from sys import stdout

import babelnet as bn
from babelnet import Language


# function called from the threads
def func(name: str, word: str):
    stdout.write(datetime.now().strftime("%H:%M:%S.%f") + " - Start - " + name + "\n")
    synsets = bn.get_synsets(word, from_langs=[Language.EN])
    glosses = []
    for synset in synsets:
        gloss = synset.main_gloss(Language.EN)
        if gloss:
            glosses.append(gloss.gloss)
    stdout.write(datetime.now().strftime("%H:%M:%S.%f") + " - End   - " + name + "\n")
    return {word: glosses}


word_list = ["vocabulary", "article", "time", "bakery", "phoenix", "stunning", "judge", "clause", "anaconda",
             "patience", "risk", "scribble", "writing", "zebra", "trade"]

with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
    future = []
    for i, w in enumerate(word_list):
        future.append(executor.submit(func, f'Thread {i} "{w}"', w))
    results = {}
    for f in future:
        results.update(f.result())

for w, gs in results.items():
    for g in gs:
        print(w, g, sep='\t')

SPARQL

You can query BabelNet via our SPARQL endpoint or via our Linked Data interface.

Data querying

In order to grasp the real power of the resource, we will now introduce some concrete SPARQL queries. Despite their simplicity, the following queries model very common patterns in the industrial panorama. These can then be extended and customized to your specific needs with very little effort.

Before you can run SPARQL queries you must obtain an API KEY by signing up here. You can then append the key parameter to the HTTP GET requests. Here is an example of a query: https://babelnet.org/sparql/?query=<your SPARQL query>&key=<your key>

Retrieve the senses of a lemma for a certain language

Given a word, e.g. home, retrieve all its senses and corresponding synsets in English:

SELECT DISTINCT ?sense ?synset WHERE {
    ?entries a lemon:LexicalEntry .
    ?entries lemon:sense ?sense .
    ?sense lemon:reference ?synset .
    ?entries rdfs:label "home"@en .
} LIMIT 10

Retrieve the translations of a given sense

Given a sense, we want to obtain all its translations: e.g., given the sense http://babelnet.org/rdf/home_EN/s00044488n:

SELECT ?translation WHERE {
    <http://babelnet.org/rdf/home_EN/s00044488n> a lemon:LexicalSense ;
        lexinfo:translation ?translation .
}

Retrieve license information about a sense

For instance, given the sense http://babelnet.org/rdf/home_EN/s00044488n:

SELECT ?license WHERE {
    <http://babelnet.org/rdf/home_EN/s00044488n> a lemon:LexicalSense ;
        dcterms:license ?license .
}

Retrieve the resources to which sense information belong

For instance, given the sense: http://babelnet.org/rdf/home_EN/s00044488n:

SELECT ?source WHERE {
    <http://babelnet.org/rdf/home_EN/s00044488n> a lemon:LexicalSense ;
        dc:source ?source .
}

Retrieve the textual definitions of a given synset in all languages

For instance, given the synset: http://babelnet.org/rdf/s00000356n:

SELECT DISTINCT ?language ?gloss ?license ?sourceurl WHERE {
    <http://babelnet.org/rdf/s00000356n> a skos:Concept ;
        bn-lemon:synsetID ?synsetID .
    OPTIONAL {
        <http://babelnet.org/rdf/s00000356n> bn-lemon:definition ?definition .
        ?definition lemon:language ?language .
        ?definition bn-lemon:gloss ?gloss .
        ?definition dcterms:license ?license .
        ?definition dc:source ?sourceurl .
    }
}

Retrieve the textual definitions of a given synset in a certain language

For instance, given the synset: http://babelnet.org/rdf/s00000356n:

SELECT DISTINCT ?gloss ?license ?sourceurl WHERE {
    <http://babelnet.org/rdf/s00000356n> a skos:Concept ;
        bn-lemon:synsetID ?synsetID .
    OPTIONAL {
        <http://babelnet.org/rdf/s00000356n> bn-lemon:definition ?definition .
        ?definition lemon:language "EN" .
        ?definition bn-lemon:gloss ?gloss .
        ?definition dcterms:license ?license .
        ?definition dc:source ?sourceurl .
    }
}

Retrieve a synset's hyponyms

For instance, given the synset: http://babelnet.org/rdf/s00000356n:

SELECT ?narrower WHERE {
    <http://babelnet.org/rdf/s00000356n> a skos:Concept .
        OPTIONAL { <http://babelnet.org/rdf/s00000356n> skos:narrower ?narrower }
}

Retrieve a synset's hypernyms

For instance, given the synset: http://babelnet.org/rdf/s00000356n:

SELECT ?broader WHERE {
    <http://babelnet.org/rdf/s00000356n> a skos:Concept .
	    OPTIONAL { <http://babelnet.org/rdf/s00000356n> skos:broader ?broader }
}

Retrieve all the RDF information of a synset

For instance, given the synset http://babelnet.org/rdf/s00000356n:

DESCRIBE <http://babelnet.org/rdf/s00000356n>

How do I obtain a BabelNet API key?

To obtain an API key you must register an account on BabelNet: https://babelnet.org/register . At the end of the registration process, you will receive an email with your API key. Information about how to use the API key is available on the HTTP API and Java API pages.

What is a Babelcoin?

Babelcoins are used as an internal credit system to keep track of the requests made against our APIs.

1 Babelcoin represents the ability to make 1 query against either the BabelNet or the Babelfy API. For instance, if you have 187 Babelcoins left in your account, it means you can only perform 187 query requests. Note that your Babelcoins will be reset daily back to 1000 credits.

How many Babelcoins are given with a base account?

When you first register on BabelNet, you will be given 1000 Babelcoins per day.

How can I increase the Babelcoins daily limit?

We provide the possibility of increasing the Babelcoins daily limit, normally set to 1000, to people wanting to use BabelNet for research purposes. You can make an increment request using the form in your private area of the BabelNet website (https://babelnet.org/login).

How can I download the BabelNet indices?

If you are a Ph.D. student or a researcher affiliated with a research institution and you need to use the BabelNet indices for your non-commercial research project, please make a request for downloading the indices through the Sapienza NLP resource repository.

IMPORTANT: The email used in your BabelNet account registration must belong to your research institution.
NOTE: Each request is subject to approval and fulfillment is based on the above conditions.

How can I use BabelNet commercially?

BabelNet is now a self-sustained project. It is, and always will be, free for research purposes, including download. Babelscape is BabelNet's commercial support arm: it offers professional solutions for multilingual Natural Language Processing, thanks to which the BabelNet project will be continued and improved over time.