ingester

Take soweego output into Wikidata items.

wikidata_bot

mix_n_match_client

A client that uploads non-confident links to the Mix’n’match tool for curation.

It inserts data in the catalog and entry tables of the s51434__mixnmatch_p database located in ToolsDB under the Wikimedia Toolforge infrastructure. See how to connect.

soweego.ingester.mix_n_match_client.activate_catalog(catalog_id, catalog, entity)[source]

Activate a catalog.

Parameters
  • catalog_id (int) – the catalog id field of the catalog table in the s51434__mixnmatch_p Toolforge database

  • catalog (str) – {'discogs', 'imdb', 'musicbrainz', 'twitter'}. A supported catalog

  • entity (str) – {'actor', 'band', 'director', 'musician', 'producer', 'writer', 'audiovisual_work', 'musical_work'}. A supported entity

Return type

None

soweego.ingester.mix_n_match_client.add_catalog(catalog, entity)[source]

Add or update a catalog.

Parameters
  • catalog (str) – {'discogs', 'imdb', 'musicbrainz', 'twitter'}. A supported catalog

  • entity (str) – {'actor', 'band', 'director', 'musician', 'producer', 'writer', 'audiovisual_work', 'musical_work'}. A supported entity

Return type

int

Returns

the catalog id field of the catalog table in the s51434__mixnmatch_p Toolforge database

soweego.ingester.mix_n_match_client.add_matches(file_path, catalog_id, catalog, entity, confidence_range)[source]

Add or update matches to an existing catalog. Curated matches found in the catalog are kept as is.

Parameters
  • file_path (str) – path to a file with matches

  • catalog_id (int) – the catalog id field of the catalog table in the s51434__mixnmatch_p Toolforge database

  • catalog (str) – {'discogs', 'imdb', 'musicbrainz', 'twitter'}. A supported catalog

  • entity (str) – {'actor', 'band', 'director', 'musician', 'producer', 'writer', 'audiovisual_work', 'musical_work'}. A supported entity

  • confidence_range (Tuple[float, float]) – a pair of floats indicating the minimum and maximum confidence scores of matches that will be added/updated.

Return type

None