commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
1.02k stars 1.23k forks source link

In Contributions list, add an icon for images uploaded via Nearby that allows users to use that image in associated Wikipedia article(s) #872

Closed misaochan closed 4 years ago

misaochan commented 7 years ago

As discussed in #252, we might want to allow the user to edit the associated Wikipedia article to add the image, after the user has successfully uploaded a pic for a Wikidata item. This would complete the "chain" of seamless workflow after the other improvements at #252 are completed during the renewal - users can browse the places that need photos, select one and move to the location, directly upload the photo after taking it (with suggested titles and categories based on the Wikidata item), and THEN add it to the Wikipedia article that is associated with that item.

We could see if the Wikipedia app allows us to do that, or otherwise link to the web view. Otherwise, we could also implement the functionality in our own app if other options don't suit (last resort).

Considerations:

Edit 30 Jan 2020:

Scope of task:

sivaraam commented 7 years ago

Copying from my comment on #865

We could see if the Wikipedia app allows us to do that,

Could you describe a little more about what you expect the app to allow you to do? This might help in assessing the feasibility.

Adding one more,

we could also implement the functionality in our own app if other options don't suit (last resort).

I guess such a situation wouldn't happen.

mithlesh4257 commented 6 years ago

I like to handle it.

misaochan commented 6 years ago

@mithlesh4257 , we really appreciate the offer, but you currently have 2 PRs in the works that have changes requested (for fairly basic things). I would strongly recommend focusing on those, and on learning as much as you can about Git and Android development. You will be able to contribute much more after you do that. ;)

This particular issue is an extremely involved one that we are still unclear on how to best implement (and it is also impossible to implement before #252 is complete). You could try if you really wanted to, but my suggestion is that your effort would be best spent on the things I mentioned.

@sivaraam Sorry I didn't get back to you on that! This has been pushed to the back burner a bit since we have been very busy with the grant tasks and sorting out the urgent crashes, Will have a think on it and get back to you ASAP.

mithlesh4257 commented 6 years ago

Thanks @misaochan :-)

misaochan commented 6 years ago

I was playing around a bit with the Wikipedia links from our Nearby items and noted that 8/10 of the Wikipedia articles that I randomly chose to view actually HAD images. :/ Not just that, but the Commons category that the articles linked to had several other pictures that weren't displayed in the article! I wonder why this isn't reflected in our wikidata items.

This makes me wonder if this is truly a good idea for our next grant. If the majority of articles already have pictures, us directing the user to the mobile edit page might potentially cause more harm than good? Besides, how will they know which section to add the image to?

@sivaraam To answer the question of what we need the Wikipedia app to do, I think that depends on what the "best practices" of adding an image to an article is. My initial thought was that we would want to bring the user to the edit page of a Wikipedia article, and have the text '[[File:name of file that was just uploaded.jpg|thumb|Description that was just given to file]]' in a dialog for them to copy and paste.

misaochan commented 6 years ago

To solve this problem, perhaps a more conservative approach might be warranted. Is there a way to check whether the Wikipedia article associated with that Wikidata item has pictures or not? If we can do that, then maybe we can only prompt the user if the article has no pictures, and not otherwise. And see how that goes.

@VojtechDostal @nicolas-raoul What do you guys think?

VojtechDostal commented 6 years ago

@misaochan The way Wikipedia images in articles and infoboxes are handles differs wildly between language versions of Wikipedia. In the case of Czech Wikipedia, finding a suitable picture (either in the Wikipedia article or in the corresponding Commons category) which is not associated with the corresponding Wikidata item, is extremely rare, especially for items located in the Czech Republic. The data are quite tidy now. In other parts of the world, the integration of Wikipedia/Commons/Wikidata is not on that level yet.

Also, when you add a picture to Wikidata, any language version of Wikipedia can use this picture automatically using Wikidata modules integrated in infoboxes. Such infoboxes look for locally "added" pictures and if they don't find them, they'll search the corresponding Wikidata item. This means that automatic addition to Wikidata is an adequate solution for Czech Wikipedia. Other Wikipedias might struggle reading those data but it would be very difficult to automate appropriate editing of Wikipedia pages because:

So to sum up, I'd currently recommend rather that Wikipedias try to synchronize their image data with Wikidata (there is actually ongoing work on this in many places) and that they automate the display of Wikidata images in infoboxes.

misaochan commented 6 years ago

Thanks so much for the clarification, @VojtechDostal ! :) I guess in that case it is more of an upstream thing, and there isn't really anything efficient that can be done in our app for this purpose?

nicolas-raoul commented 6 years ago

Indeed in some parts of the world Wikipedia has a picture and Wikidata does not. However:

As @VojtechDostal wrote, the ideal (from a technical point of view) would be for infoboxes/etc to transclude directly from Wikidata. BUT most local communities are rather suspicious of Wikidata (because they don't control it fully), and would rather copy-paste filenames manually. I actually thought of writing a webapp to add pictures to articles suggested by P18s. But the picture's uploader is the best person for that, though, as they know exactly where/when the picture was taken and maybe a bit of backstory. So the present issue makes sense. Another argument against automatic transclusion is that pictures need a human-written caption (even in infoboxes). Examples of captions:

VojtechDostal commented 6 years ago

Thanks @nicolas-raoul for your insight.

Out of topic: One interesting improvement to consider would be to insert image descriptions into Wikidata as qualifiers. This is quite often done using property P2096. Infoboxes could then read this description when transcluding images from WD. However we'd have to start specifying language of description (our app currently does not do this, right? is there a Github issue for that?)

sivaraam commented 6 years ago

Is there a way to check whether the Wikipedia article associated with that Wikidata item has pictures or not?

I think you could use the MediaWiki API could be used to get a set of images that belong to a Wikipedia page:

https://www.mediawiki.org/wiki/API:Imageinfo

An example query: https://en.wikipedia.org/w/api.php?action=query&format=json&prop=imageinfo&titles=Imperative+programming&generator=images

sivaraam commented 6 years ago

Sorry, here's a better example:

https://en.wikipedia.org/w/api.php?action=query&format=json&prop=imageinfo&titles=A._P._J._Abdul_Kalam&generator=images

There's a little issue with the API. It seems to return every single image on the page. See, https://phabricator.wikimedia.org/T174564

sivaraam commented 6 years ago

You could even try out the new /page/media Restbase API which shouldn't have the issue that the MediaWiki API has per comment T174564#4118458

See the /page/media/{title}{/revision} section of https://en.wikipedia.org/api/rest_v1/

nicolas-raoul commented 6 years ago

Wonderful tip @sivaraam !

Here is a long list of images that are often used as stub/portal/etc icons, and can thus be considered as unrelated to the topic of the article: https://www.wikidata.org/w/index.php?title=User:Magnus_Manske/FIST_icons&action=raw It is kept up-to-date by FIST/WDFIST users, including me :-)

So the app could download this list once (and maybe update it every month). Then to check whether a Wikipedia article has a picture, call https://en.wikipedia.org/w/api.php?action=query&format=json&prop=imageinfo&titles=A._P._J._Abdul_Kalam&generator=images and remove the images found in FIST_icons.

sivaraam commented 6 years ago

@nicolas-raoul How about using the /page/media/ RESTBase endpoint instead as note in my comment above regardless of the fact that it's still experimental? The task that developed the endpoint has the following as one of it's requirements:

Identifying images that are too small for a gallery

I thought the app could be one of the early adopters for the endpoint ?? It might help reduce the unwanted work of finding the relevant images to the article from the list of all images.

@nicolas-raoul One possibly off-topic question. Why are the following images part of FIST icons? Moreover, they seem to qualify as a relevant image for an article. What images are FIST icons, anyway (any description/definition)?

Charles_Darwin_1880.jpg Beli-hibiskus.jpg

nicolas-raoul commented 6 years ago

I tried the /page/media API, here is the query:

https://en.wikipedia.org/api/rest_v1/page/media/Luca_Ghini

and the result:

{"revision":"787592027","tid":"86d49989-29d8-11e8-a11a-d92a163afa50","items":[{"section_id":0,"type":"image","caption":{"html":"Luca Ghini.","text":"Luca Ghini."},"titles":{"canonical":"File:Ghini.jpg","normalized":"File:Ghini.jpg","display":"File:Ghini.jpg"},"thumbnail":{"source":"http://upload.wikimedia.org/wikipedia/commons/7/70/Ghini.jpg","width":292,"height":412,"mime":"image/jpeg"},"original":{"source":"http://upload.wikimedia.org/wikipedia/commons/7/70/Ghini.jpg","width":292,"height":412,"mime":"image/jpeg"},"file_page":"https://commons.wikimedia.org/wiki/File:Ghini.jpg","artist":{"html":"<span class=\"fn value\"><span lang=\"en\">Unknown</span></span>"},"credit":"From sv: Wikipedia. Originally uploaded 27 februari 2006 kl.11.52 by <a href=\"https://sv.wikipedia.org/wiki/User:213.101\" class=\"extiw\" title=\"sv:User:213.101\">213.101</a> från <a rel=\"nofollow\" class=\"external autonumber\" href=\"http://www.sma.unibo.it/mm/Ghini.JPG\">[1]</a>","license":{"type":"Public domain"}}]}

The result only contains Ghini.jpg and does not contains Beli-hibiskus.jpg (which is used as a thumbnail), so it is the perfect solution indeed, thanks @sivaraam :-) I would be in favor of using it even if it is experimental.

misaochan commented 6 years ago

@nicolas-raoul and @sivaraam Thanks for the pointers! Since checking for Wikipedia articles without pictures appears to be doable (via the /page/media/ endpoint), do you think it would be useful for the app to prompt the user to add their recently-uploaded picture to the Wikipedia article associated with that item, but ONLY if the article has no pictures? It will likely take a substantial amount of work (especially with the additional check), so we would need to decide if the outcome will be worth the while.

@VojtechDostal That is a great suggestion, IMO. Could you create a new issue for it, please? AFAIK, we don't specify language for descriptions.

sivaraam commented 6 years ago

@nicolas-raoul and @sivaraam Thanks for the pointers! Since checking for Wikipedia articles without pictures appears to be doable (via the /page/media/ endpoint), do you think it would be useful for the app to prompt the user to add their recently-uploaded picture to the Wikipedia article associated with that item, but ONLY if the article has no pictures?

Seems to be a good idea. I guess this would bother the users less and make them do things that add more value (adding a picture to a page that doesn't have any).

nicolas-raoul commented 6 years ago

I am also all for it :-) To increase usage of this feature, how about allowing users to do it afterward, not only immediately after uploading?

Scenario:

  1. I ride my bicycle between 15 nearby places and manage to take pictures of 10 of them
  2. Taking a break on the side of the road, in the app's gallery each picture associated to a Wikidata item has a small "TODO" icon, opening the picture shows more details about the TODO: "Do you want to add this picture to the Farsi language Wikipedia article? Yes/No"
VojtechDostal commented 6 years ago

This does sound really cool Nicolas.

misaochan commented 6 years ago

@nicolas-raoul Great idea! Indeed, I think that will be the best way to implement it, much less intrusive.

nicolas-raoul commented 6 years ago

Yesterday I uploaded a picture and linked it from Wikidata, and I was surprised to see the image appear instantly on the Arabic Wikipedia. So, it seems like while the big wikipedias do not transclude Wikidata images automatically (and probably won't in the future), some middle-sized wikipedias (probably to balance the lack of editors) have started to :-) By the way, there is a vote about this (for infoboxes) right now on the English Wikipedia: https://en.wikipedia.org/wiki/Wikipedia:Wikidata/2018_Infobox_RfC

misaochan commented 6 years ago

Out of topic: One interesting improvement to consider would be to insert image descriptions into Wikidata as qualifiers. This is quite often done using property P2096. Infoboxes could then read this description when transcluding images from WD. However we'd have to start specifying language of description (our app currently does not do this, right? is there a Github issue for that?)

The app now allows users to specify a language for their descriptions (in the current master, to be released in 2.9 :)). Would it be a good idea to include this in our 2019 plans?

misaochan commented 6 years ago

Also, another consideration: What do we do if the user does not have the Wikipedia app installed? Is editing a Wikipedia article via mobile web browser encouraged at all?

sivaraam commented 6 years ago

Also, another consideration: What do we do if the user does not have the Wikipedia app installed? Is editing a Wikipedia article via mobile web browser encouraged at all?

IMHO, it's better if we could direct users to web editing. For several reasons,

  1. The Wikipedia app editing experience is not great. That's because the app is focused more towards readers rather than editors (the syntax highlighting feature is the main culprit that kills the editing experience, IMO). That doesn't mean the mobile web editing experience is great, of course. But, it's a lot better. Some editors might even prefer to edit using the desktop version of Wikipedia in their mobile.
  2. It would be easier to redirect the user to the mobile editing link. The Wikipedia app already opens Wikipedia article links when opened in browsers such as Chrome. It could also open article editing links, if it wants to (does it already do it?).

So, editing links gives more flexibility to the user while making things simple for us.

misaochan commented 6 years ago

Interesting, so the mobile web version is preferable for editing? That would likely be the easier option for us indeed.

nicolas-raoul commented 6 years ago

Our Facebook page received this message:

it occurred me to directly try to use an uploaded image to an article in wp And when I tailored on the image I saw all the details... Plus a "nominate for deletion" option, but no "use this file" Wouldn't it be a good idea to have an automatically generated string [[file:... |right|thumb|description]] that will make the use of uploaded images through the app easier? Maybe even two more fields for project (like "bg.wp" for Bulgarian Wikipedia (search suggest?) and another field for the article name. In this way with the wiki code the user will be able to have the desired article opened in edit mode and just locate the place where to add the image uploaded through the app

neslihanturan commented 6 years ago

My question is, do we plan to include this feature for just our own images in our contributions list, or all images that we can browse via new browse feature?

nicolas-raoul commented 6 years ago

@neslihanturan I would be in favor of allowing it for any image, since the app is now also very convenient to search for a media.

misaochan commented 6 years ago

Being rather risk-averse (understatement? haha ;)), I would prefer to just enable it for own images first, collect statistics on how it is used, and then if statistics are good, enable it for all images (perhaps only for users with a certain level).

nicolas-raoul commented 6 years ago

I was talking about a text field to copy from the Commons app and paste into whatever wikipedia editing app/website Ilike. I believe this is pretty risk-free?

On Mon, Aug 20, 2018, 20:59 Josephine Lim notifications@github.com wrote:

Being rather risk-averse (understatement? haha ;)), I would prefer to just enable it for own images first, collect statistics on how it is used, and then if statistics are good, enable it for all images (perhaps only for users with a certain level).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/commons-app/apps-android-commons/issues/872#issuecomment-414291718, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGFBqYkdYovjOLYSo9B3CNI9WRdH8lsks5uSqShgaJpZM4PPhlf .

misaochan commented 6 years ago

Ah, I see! That would be somewhat different from this issue, right? Should we create another one?

VojtechDostal commented 6 years ago

Yeah, @nicolas-raoul 's idea sounds fairly straight-forward and potentially very useful :-)

maskaravivek commented 4 years ago

@misaochan Can you help in defining the scope of the task. It would be great if the opening comment could be edited to define the scope.

misaochan commented 4 years ago

@maskaravivek Sorry for the delay, this actually required a lot more thought than I initially estimated, lol. I will try and get back to you by the weekend.

misaochan commented 4 years ago

Sorry for the delay @maskaravivek , I edited the opening comment. Feel free to let me know if you need clarification on anything. :)

misaochan commented 4 years ago

Additionally, there are two components of this that I'm not sure about, would greatly appreciate any suggestions @nicolas-raoul @VojtechDostal @dbrant @sivaraam

neslihanturan commented 4 years ago

For the icon, what about this idea: g927

misaochan commented 4 years ago

Hmmm. What is the white square for? I like the idea of using the Wikipedia icon though. :)

neslihanturan commented 4 years ago

I thought empty square indicates lack of image of an article, but considering your question it is not clear enough. I also thought putting a question mark inside the image field. What do you suggest?

misaochan commented 4 years ago

Maybe just the Wikipedia icon? Let's see what others say. :)

VojtechDostal commented 4 years ago

Maybe the Wikipedia icon and a plus sign? :)

misaochan commented 4 years ago

Oh yes, good idea IMO! The small plus sign can be on the upper right of the W icon perhaps?

sivaraam commented 4 years ago

The user's Wikipedia language version - I am not sure how we can find this. I guess a possible way could be to have a Setting that the user can choose. If we can't, or the user does not choose any setting, maybe we can default to En?

I think its fine to ask the Wikipedia language from the user via a setting. Even the Wikipedia app just asks the users to choose the languages in which the user would like to explore Wikipedia. Also, from my initial exploration I couldn't find an API which would give us that information. It would have been nice if there is a counterpart of Special:MyLanguage that redirects users across wikis 😉

Just to ensure I understand correctly, we're planning to use the Wikipedia language of the user to direct them to edit the article if it misses a picture in the chosen language and use the picture there. Is that correct?

Log (or tag) the edits that are made via our app - I am actually not sure if this can be done since there will be no server-side indication, to the best of my knowledge. From the server point of view, essentially it is just the same as any other mobile web edit

I suppose there might be a way to specify a list of tags using which the edit must be tagged by means of a URL parameter. 🤔 I'm not sure, though. I couldn't find anything in a cursory exploration. Have to dig into this a little more to see if something like that exists.

sivaraam commented 4 years ago

Regarding the icon, I really like both the ideas: using just a plain Wikipedia logo and a Wikipedia logo with a 'plus' sign that appears on the upper right of icon. It would be nice to actually compare both and decide which looks best.

misaochan commented 4 years ago

Just to ensure I understand correctly, we're planning to use the Wikipedia language of the user to direct them to edit the article if it misses a picture in the chosen language and use the picture there. Is that correct?

Yes. :) But I just realized that, AFAIK, when we do the checks on whether a Wikipedia article exists for that item, we only check the EN version (@maskaravivek can you confirm this?). So if we are to do this, we firstly will need an easy way for the user to choose their desired Wikipedia language while in Nearby, and we also need to modify the Nearby query to use that language to begin with.

neslihanturan commented 4 years ago

Here are some more, regarding to comments. My favourite is the first, rounded one.

add_wiki

misaochan commented 4 years ago

I actually vote for number 3 (from left to right), because the upload FAB is already a circle, haha. Also I feel they should be smaller than the FAB. But let's see what the others say...

sivaraam commented 4 years ago

Excuse my ignorance. Where are we actually thinking of placing this icon? :sweat_smile: Would it appear after tapping the FAB that appears after tapping on a Nearby place? Or would it appear somewhere else?

nicolas-raoul commented 4 years ago

AFAIK, when we do the checks on whether a Wikipedia article exists for that item, we only check the EN version

Apparently "we" are smarter :-) With my Android's locale set to Japanese, I tapped a pin in Japan, it had a Wikipedia icon. I tapped it, and it directed me to the Japanese Wikipedia article. By the way, that item also has an English Wikipedia article.