Page MenuHomePhabricator

Certain Commons file metadata is not available via API on non-Commons wikis
Closed, ResolvedPublic

Description

Possibly triggered by the move to incorporating some metadata from Wikidata on Commons.

For example, compare Artist.value on

https://en.wikipedia.org/w/api.php?action=query&format=json&formatversion=2&prop=imageinfo&iiprop=extmetadata&titles=File:Haeckel_Trochilidae.jpg

Artist": {
"value": "",
"source": "commons-desc-page"
}

vs.

https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2&prop=imageinfo&iiprop=extmetadata&titles=File:Haeckel_Trochilidae.jpg

"Artist": {
"value": "<bdi><a href=\"https://en.wikipedia.org/wiki/en:Ernst_Haeckel\" class=\"extiw\" title=\"w:en:Ernst Haeckel\">Ernst Haeckel</a>\n</bdi>",
"source": "commons-desc-page"
}

Event Timeline

See also T194465: When the author/source is indicated with a template, it is categorized as "Files with no machine-readable author/source". Parsing of those author boxes fails in some situations, but it's not clear which ones (although the failure seems deterministic).

Maybe the version used by CommonsMetadata and the one displayed on the file page fetch in a different language (both use File::getDescriptionText()) and that affects Wikibase queries somehow.

I'm not really sure... @Tgr what do you think?

Someone probably needs to walk through the parsing logic step by step on terbium to see what causes the difference in parsing the same HTML string with commons/enwiki config.

Officially, the extension is maintained by Multimedia. Unofficially, I was the last person to significantly touch it; I can look at it.

I chatted with Mark and he agrees you would probably be the best person to look at this initially.

@Tgr do you have an idea of how impactful this is for users? Is this breaking the mediaviewer info for commons files on the wiki for example? Just trying to understand so that we can set a priority appropriately.

It causes the author (or whatever metadata is missing) to be omitted in MediaViewer and similar tools. It might also mess up categorization by misapplying "Files with no machine-readable author" and similar tracking categories, although it's not clear that's caused by the same issue.

It's unclear how many pages this affects - the creator template is used on two million images, not sure how many of those take data from Wikidata (assuming the issue is is indeed related to Wikidata, which is as good a guess as any).

Vvjjkkii renamed this task from Certain Commons file metadata is not available via API on non-Commons wikis to nvcaaaaaaa.Jul 1 2018, 1:10 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from nvcaaaaaaa to Certain Commons file metadata is not available via API on non-Commons wikis.Jul 2 2018, 4:07 PM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

It seems this was either fixed or somehow resolved itself. The case in the description now shows populated artist info on both wikis.

Jhernandez claimed this task.

Weird... Let's reopen if it happens again.