Muinaismuistotinfo.info sofware project (autumn 2022)

From mediawiki.org

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[edit]

  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.
    • the pre-filled information would be: suggested title, description text, coordinates, date, categories.
    • Coordinates need to be converted to WGS84?
  5. Write a test case for the button
  6. 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[edit]

Web site
Source code

SPARQL[edit]

Finding Wikidata item for Helsinki-Malmi Airport ( Q662434) with RKY national built heritage environment ID (P4009) = 1560.

SELECT ?item ?itemLabel ?commonscat WHERE {
    ?item wdt:P4009 "1560" .
    ?item wdt:P373 ?commonscat .
   SERVICE wikibase:label { bd:serviceParam wikibase:language "fi,en". }
}

Try it!

Getting value as JSON

Upload Wizard[edit]

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 = title + link to the RKY
  • lat = 61.49642
  • lon = 23.74801
  • categories = =Schools|Tampere|Educational_institutions ("|" is separator for categories)