download_entity_ttl#

wikibaseintegrator.wbi_helpers.download_entity_ttl(entity, wikibase_url=None, user_agent=None)[source]#

Downloads the TTL (Terse RDF Triple Language) content of a specific entity from a Wikibase instance.

Parameters:
  • entity (str) – The identifier of the entity to download the TTL content for.

  • wikibase_url (str | None, default: None) – The base URL of the Wikibase instance. Default: config[‘WIKIBASE_URL’]

  • user_agent (str | None, default: None) – The user agent string used in the HTTP request headers. Default: config[‘USER_AGENT’], if set

Return type:

str

Returns:

The TTL content of the requested entity.

Raises:

requests.HTTPError – If the HTTP request to retrieve the TTL content fails (status code other than 2xx).