kgdata.wikidata.datasets.entity_redirections#

Functions

entity_redirections()

Wikidata entity redirections.

extract_id(row)

postprocess_groupby(record)

entity_redirections() Dataset[Tuple[str, str]][source]#

Wikidata entity redirections. It combines two datasets: page_ids and entity_redirection_dump. The first one contains mapping from page_id => entity_id (can be old id). The second one contains mapping from page_id => final entity_id.

We did a join between two datasets based on page_id so we can get the mapping from old entity_id to the final entity_id.

Finally, we check if the final entity id is in the entity_ids dataset. If not, we remove the mapping.

Returns:

Dataset[tuple[str, str]]

Return type:

Dataset[Tuple[str, str]]

extract_id(row: list) tuple[str, str] | None[source]#
Parameters:

row (list) –

Return type:

tuple[str, str] | None

postprocess_groupby(record)[source]#