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[edit]
- fork muinamusitot.info on GitHub as your own repository
- Add a button with the label "Save photo" to the item's detailed view. (translations: Swedish, Finnish)
- 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.
- 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?
- Write a test case for the button
- Make a pull request to Muinaismuistot info for merging the button to the upstream
- Additional step
- 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.
- 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". }
}
Getting value as JSON
Upload Wizard[edit]
- 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)