diff --git a/rock_paper_sand/wikidata.py b/rock_paper_sand/wikidata.py index e82ee87..91d7159 100644 --- a/rock_paper_sand/wikidata.py +++ b/rock_paper_sand/wikidata.py @@ -545,6 +545,19 @@ def _tv_episode_parent_classes(self) -> Set[wikidata_value.ItemRef]: *self._tv_season_part_classes, } + @functools.cached_property + def _tv_episode_segment_classes(self) -> Set[wikidata_value.ItemRef]: + return self._api.transitive_subclasses( + wikidata_value.Q_SEGMENT_OF_A_TELEVISION_EPISODE + ) + + @functools.cached_property + def _tv_episode_segment_parent_classes(self) -> Set[wikidata_value.ItemRef]: + return { + *self._tv_episode_parent_classes, + *self._tv_episode_classes, + } + @functools.cached_property def _tv_pilot_classes(self) -> Set[wikidata_value.ItemRef]: return self._api.transitive_subclasses( @@ -599,6 +612,7 @@ def _unlikely_to_be_processed_classes(self) -> Set[wikidata_value.ItemRef]: *self._tv_season_classes, *self._tv_season_part_classes, *self._tv_episode_classes, + *self._tv_episode_segment_classes, *self._api.transitive_subclasses( wikidata_value.Q_WEB_SERIES_SEASON ), @@ -637,6 +651,10 @@ def _integral_child_classes( self._tv_season_part_parent_classes, self._tv_season_part_classes, ) + yield ( + self._tv_episode_segment_parent_classes, + self._tv_episode_segment_classes, + ) yield (self._web_series_classes, self._web_series_child_classes) yield (self._video_classes, self._video_classes) yield (self._video_classes, self._music_classes) diff --git a/rock_paper_sand/wikidata_value.py b/rock_paper_sand/wikidata_value.py index c19a8c7..d0e5821 100644 --- a/rock_paper_sand/wikidata_value.py +++ b/rock_paper_sand/wikidata_value.py @@ -152,6 +152,9 @@ def human_readable_url_prefix(cls) -> str: Q_PLACEHOLDER_NAME = _i("https://www.wikidata.org/wiki/Q1318274") Q_PROLEPTIC_GREGORIAN_CALENDAR = _i("https://www.wikidata.org/wiki/Q1985727") Q_RELEASE_GROUP = _i("https://www.wikidata.org/wiki/Q108346082") +Q_SEGMENT_OF_A_TELEVISION_EPISODE = _i( + "https://www.wikidata.org/wiki/Q29555881" +) Q_TELEVISION_FILM = _i("https://www.wikidata.org/wiki/Q506240") Q_TELEVISION_PILOT = _i("https://www.wikidata.org/wiki/Q653916") Q_TELEVISION_SERIES = _i("https://www.wikidata.org/wiki/Q5398426")