Page MenuHomePhabricator

[Story] Add Wikibase support for PageImages
Closed, ResolvedPublic

Description

This would allow an image to appear in places like mobile search results and Special:Nearby.

  • Task: Create a ordered list of desired properties for an page image
  • Task: Choose the top ranked image from main statements of an item and put it to page props using visitor pattern from https://gerrit.wikimedia.org/r/#/c/243613/4

Event Timeline

aude created this task.Sep 17 2015, 10:17 AM
aude raised the priority of this task from to Normal.
aude updated the task description. (Show Details)
aude added projects: Wikidata, PageImages.
aude added a subscriber: aude.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 17 2015, 10:17 AM
aude set Security to None.Sep 17 2015, 10:17 AM
aude added a subscriber: Bene.
aude renamed this task from Add Wikibase support for PageImages to [Task] Add Wikibase support for PageImages.Sep 17 2015, 11:56 AM
Bene awarded a token.Sep 17 2015, 12:20 PM
Jonas renamed this task from [Task] Add Wikibase support for PageImages to [Story] Add Wikibase support for PageImages.Sep 25 2015, 1:54 PM

Decisions made with @Lydia_Pintscher:

  • No audio and video.
  • No images of graves, epitaphs and commemorative plaques.
  • Any image is better than no image, therefore we are adding maps and diagrams, even if they are unreadable in thumbnail sizes.

Order is roughly from complex to simple and from specific to generic:

  1. Photos
    1. image (P18)
  2. Complex graphics
    1. flag image (P41)
    2. coat of arms image (P94)
    3. logo image (P154)
    4. place name sign (P1766)
  3. Simple graphics
    1. highway marker (P14)
    2. seal image (P158)
    3. monogram (P1543)
    4. signature (P109)
    5. astronomic symbol image (P367)
  4. Multipage content
    1. scan file (Commons) (P996)
  5. Maps
    1. detail map (P1621)
    2. road map (P15)
    3. distribution map (P1846)
    4. taxon range map image (P181)
    5. locator map image (P242)
    6. relief location map (P1944)
    7. location map (P1943)
  6. Diagrams
    1. bathymetry image (P207)
    2. chemical structure (P117)
    3. Gene Atlas Image (P692)
    4. orbit diagram (P491)
Bene added a comment.Oct 2 2015, 8:01 AM

These properties should be stored in a config variable in that order I supppose?

Obviously, yes, very similar to wgPropertySuggesterClassifyingPropertyIds being an array of property ids (but I will obviously avoid numeric ids).

Change 243673 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
[WIP] Introduce PageImagesHookHandler for PageImages extension

https://gerrit.wikimedia.org/r/243673

All the extension does (besides the "pageimages" API module) is appending a page property called "page_image" for each page id to the page_props table, containing the pure file name without the namespace. (And it does that in a way that's not really applicable for our code base, by accessing LinksUpdate::$mProperties.) That's all. That's so simple, the only reason to bind to the PageImages extension is literally the constant PageImages::PROP_NAME with the "page_image" string. As far as I can see, not even major refactoring of the PageImages class would make it possible to reuse existing code.

I suggest to not bind against the PageImages extension but simply ... well, rely on class_exists( 'PageImages' )?

To do:

  • What about the wgPageImagesNamespaces setting? Problem is, the PageImages extension should not work on Wikibase namespaces. But at the same time it would be confusing to have two separate settings for the same thing.
  • What about the wgPageImagesBlacklist? Our code should respect this.
Jonas updated the task description. (Show Details)Oct 7 2015, 10:11 AM

Change 244165 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Add pageImagesPropertyIds configuration for Wikibase servers

https://gerrit.wikimedia.org/r/244165

Change 244175 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Add basic PHPUnit tests

https://gerrit.wikimedia.org/r/244175

Change 243673 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Introduce PageImagesDataUpdate for PageImages extension

https://gerrit.wikimedia.org/r/243673

Change 244175 merged by jenkins-bot:
Add basic PHPUnit tests

https://gerrit.wikimedia.org/r/244175

  • @Lydia_Pintscher's (product manager) decision: For now we will not support the wgPageImagesBlacklist setting. We will most probably never need it for our algorithm, which is not based on parsing wikitext but on ranked statements.
  • We are introducing a new Wikibase specific pageImagesPropertyIds setting in https://gerrit.wikimedia.org/r/243673 and https://gerrit.wikimedia.org/r/244165.
  • We do not need an additional boolean setting. Instead, pageImagesPropertyIds is empty by default. To enable the feature, add a list of image property ids.
  • We do not need to support the wgPageImagesNamespaces setting. Instead, when pageImagesPropertyIds is set the feature is enabled on all entity namespaces that support statements.
Bene added a comment.Oct 9 2015, 9:43 AM

Sounds good to me 👍

Change 244165 merged by jenkins-bot:
Add GeoData and PageImages configuration for Wikibase repo wikis

https://gerrit.wikimedia.org/r/244165

Change 243673 merged by jenkins-bot:
Introduce PageImagesDataUpdate for PageImages extension

https://gerrit.wikimedia.org/r/243673

JanZerebecki closed this task as Resolved.Oct 13 2015, 1:17 PM

Change 246192 had a related patch set uploaded (by Thiemo Mättig (WMDE)):
Rework standalone PageImagesDataUpdate into a ParserOutputDataUpdate

https://gerrit.wikimedia.org/r/246192

Change 246192 merged by jenkins-bot:
Rework standalone PageImagesDataUpdate into a ParserOutputDataUpdate

https://gerrit.wikimedia.org/r/246192