module documentation

This module handles the RESTful communication of the online BabelNet API.

Class RESTfulCallType Enum that contains all the available restful call type that can be used in order to interrogate the BabelNet RESTful online indexes service.
Class RESTfulPacket BabelNet RESTful request object.
Class RFParameter A RESTful parameter.
Function check_error_code Check the error code of the response received from BabelNet RESTful service.
Function print_error_message Warnings: It has to be called after check_error_code has returned True with the same response string.
Function send_request Send a request to the BabelNet RESTful service.
Variable session Undocumented
def check_error_code(response):

Check the error code of the response received from BabelNet RESTful service.

Parameters
response:bytesthe response
Returns
boolTrue if the message field is in the response and is not empty.
def print_error_message(response):

Warnings: It has to be called after check_error_code has returned True with the same response string.

Parameters
response:bytesthe response
Returns
boolThe error message
def send_request(packet):

Send a request to the BabelNet RESTful service.

Parameters
packet:RESTfulPacketthe RESTfulPacket to send
Returns
Optional[bytes]the response as an Optional[bytes]
Raises
ValueErrorif the restful key is not set
RuntimeErrorif there is a problem while trying to contact the BabelNet RESTful service
session =

Undocumented