Skip to content

Commit

Permalink
Ignore disambiguation pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dseomn committed Nov 11, 2023
1 parent 0332ff4 commit 1bcaac6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rock_paper_sand/wikidata.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ def _ignored_classes(self) -> Set[wikidata_value.ItemRef]:
# sometimes used for "followed by" statements, but it's not a useful
# thing to list, and it's connected to many unrelated things.
*self._api.transitive_subclasses(wikidata_value.Q_PLACEHOLDER_NAME),
# Disambiguation pages and the like are not media items.
*self._api.transitive_subclasses(
wikidata_value.Q_WIKIMEDIA_PAGE_OUTSIDE_THE_MAIN_KNOWLEDGE_TREE
),
}

def _ignored_classes_from_request(
Expand Down
3 changes: 3 additions & 0 deletions rock_paper_sand/wikidata_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def human_readable_url_prefix(cls) -> str:
Q_TELEVISION_SERIES_SEASON = _i("https://www.wikidata.org/wiki/Q3464665")
Q_TELEVISION_SPECIAL = _i("https://www.wikidata.org/wiki/Q1261214")
Q_TOMMY_WESTPHALL_UNIVERSE = _i("https://www.wikidata.org/wiki/Q95410310")
Q_WIKIMEDIA_PAGE_OUTSIDE_THE_MAIN_KNOWLEDGE_TREE = _i(
"https://www.wikidata.org/wiki/Q17379835"
)
del _i


Expand Down

0 comments on commit 1bcaac6

Please sign in to comment.