Muinaismuistotinfo.info sofware project (autumn 2022)

Add save the image to Wikimedia Commons button to Muinaismuistot.info detailed information. Button opens the Wikimedia Commons Upload Wizard with prefilled information from Muinaismuistot

Steps

 * 1) fork muinamusitot.info on GitHub as your own repository
 * 2) Add a button with the label "Save photo" to the item's detailed view. (translations: Swedish, Finnish)
 * 3) When you press the button, the Wikidata identifier and Commons categories are retrieved from Wikidata using the object's registry identifier. Use SPARQL for retrieving the data.
 * 4) Open the Wikimedia Commons UploadWizard with pre-filled information. If the item has been found in Wikidata, the Commons categories and Wikidata identifiers are added to the data. The minimum information used is the information from Muinaismuistot.info.
 * 5) * the pre-filled information would be: suggested title, description text, coordinates, date, categories.
 * 6) * Coordinates need to be converted to WGS84?
 * 7) Write a test case for the button
 * 8) Make a pull request to Muinaismuistot info for merging the button to the upstream


 * Additional step
 * 1) Retriev Wikipedia page and Wikidata page from Wikidata using the object's registry identifier and add links to them to the Muinaismuistot.info user interface.
 * 2) Make a pull request to Muinaismuistot info for merging the button to the upstream

Muinaismuistot.info code

 * Web site
 * https://muinaismuistot.info
 * Source code
 * https://github.com/anttikekki/muinaismuistot

SPARQL
Finding Wikidata item for with  = 1560.

Getting value as JSON
 * https://query.wikidata.org/sparql?format=json&query=SELECT%20%3Fitem%20%3FitemLabel%20%3Fcommonscat%20WHERE%20%7B%0A%20%20%20%20%3Fitem%20wdt%3AP4009%20%221560%22%20.%0A%20%20%20%20%3Fitem%20wdt%3AP373%20%3Fcommonscat%20.%0A%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22fi%2Cen%22.%20%7D%0A%7D

Upload Wizard

 * Example url: https://commons.wikimedia.beta.wmflabs.org/w/index.php?title=Special:UploadWizard&campaign=wlm-fi-rephotography-wikidata&id=Q55025466&descriptionlang=fi&description=Entinen+reaalilyseo&lat=61.49642&lon=23.74801&categories=Schools%7CTampere%7CEducational_institutions


 * Parameters
 * campaign = not used now
 * id = Q55025466 (if there is Wikidata id)
 * descriptionlang = fi|sv (language depends on data source)
 * description = some description
 * lat = 61.49642
 * lon = 23.74801
 * categories = =Schools|Tampere|Educational_institutions ("|" is separator for categories)