WikibaseManifest#
- class wikibaseintegrator.wbi_manifest.WikibaseManifest(name, root_script_url, main_page_url, mediawiki_api_url, mediawiki_rest_url, max_lag=None, sparql_endpoint_url=None, external_services=dict(), equiv_entities=dict(), local_rdf_namespaces=dict(), local_entities=dict(), oauth_registration_page=None, raw=dict())[source]#
Bases:
objectThe manifest of a Wikibase instance, as returned by get_manifest(). The optional parts of the format are omitted by the instances which don’t have them (e.g. no query service): their attribute is then None or empty.
- classmethod from_json(json_data)[source]#
Build the manifest from the JSON returned by the instance.
- apply(target=None)[source]#
Set the wbi_config values of this instance (see config()), the other options are kept.
- config()[source]#
The wbi_config values to use this instance: MEDIAWIKI_API_URL, MEDIAWIKI_REST_URL, MEDIAWIKI_INDEX_URL, WIKIBASE_URL and SPARQL_ENDPOINT_URL. The last two are left out when the manifest doesn’t give them.
- local_id(entity_id, hub='wikidata.org')[source]#
The local ID of an entity of another Wikibase instance, from the equivalences of the manifest.
- equiv_entities: dict[str, dict[str, dict[str, str]]]#
The local IDs of entities of other Wikibase instances, e.g. {‘wikidata.org’: {‘properties’: {‘P31’: ‘P1’}}}
- external_services: dict[str, str]#
The external services: queryservice, queryservice_ui, quickstatements, openrefine_reconcile…
- local_entities: dict[str, dict[str, Any]]#
The entity types of the instance and their namespace, e.g. {‘item’: {‘namespace_id’: 120, ‘namespace_name’: ‘Item’}}
- local_rdf_namespaces: dict[str, str]#
The RDF namespaces of the instance, by prefix (’’ for the entities, ‘p’, ‘ps’, ‘wdt’…)
- oauth_registration_page: str | None = None#
The page to register an OAuth consumer, if the OAuth extension is installed
- root_script_url: str#
The URL of the MediaWiki scripts (index.php, api.php…), e.g. ‘https://wikibase.world/w’
- property wikibase_url: str | None#
The Wikibase URL, as wbi_config[‘WIKIBASE_URL’] expects it: the concept URI of the entities without ‘/entity/’, e.g. ‘https://wikibase.world’ for ‘https://wikibase.world/entity/’. None if the concept namespace doesn’t end with ‘/entity/’.