mex.extractors.wikidata package

Submodules

mex.extractors.wikidata.helpers module

mex.extractors.wikidata.helpers.get_wikidata_extracted_organization_id_by_name(name: str) MergedOrganizationIdentifier | None

Use helper function to look up an organization and return its stableTargetId.

An organization searched by its Wikidata id on Wikidata and loaded into the configured sink. Also it’s stable target id is returned.

Returns:

ExtractedOrganization stableTargetId if one matching organization is found. None if multiple matches / no match is found

mex.extractors.wikidata.helpers.get_wikidata_organization_by_id(wikidata_id: str) ExtractedOrganization | None

Get and load a wikidata item details by its ID.

Parameters:

wikidata_id – wikidata ID of organization

Returns:

extracted organization if found in wikidata

mex.extractors.wikidata.helpers.get_wikidata_organization_ids_by_label() dict[str, str]

Extract dict of already defined wikidata ids by labels.

mex.extractors.wikidata.settings module

class mex.extractors.wikidata.settings.WikidataSettings(*, mapping_path: AssetsPath = AssetsPath('mappings/wikidata'))

Bases: BaseModel

Wikidata settings submodel definition for the Wikidata extractor.

mapping_path: AssetsPath
model_config: ClassVar[ConfigDict] = {'extra': 'ignore', 'populate_by_name': True, 'str_max_length': 100000, 'str_min_length': 1, 'str_strip_whitespace': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Module contents