Extension:WikidataShow

This extension for mediawiki adds data to a wiki page based on a link set in the Semantic MediaWiki and grabs data from wikidata. It is bascially developed for the project school archives and handles the following information from wikidata. You can also use it as a blueprint to write your own extension to get data from wikidata. Supported items:


 * P18 (picture)
 * P6375 (adress)
 * P856 (website)
 * P625 (coordinates)
 * P1448 (names)
 * P1249 (earliest written record)
 * P571 (inception)
 * P31 (instance of)
 * P137 (operator)
 * Link to wikipedia
 * P227: Link to GND (German national library)

The extension adds two magic words to your mediawiki:

Using wikidatashow results in this table:
 * wikidatashow: creates a box like to one in the example
 * wikidatashowlite: takes in the p-value you want to show and only shows this information (fits great if you want to display local data from semantic mediawiki together with data from wikidata)

Installation

 * Add "freearhey/wikidata": "3.2" to your composer.json of the wiki in the section "require"
 * Run composer update --no-dev

Usage
You can use the extension by simply adding the magic work wikidatashow or wikidatashowlite to the wiki. You can provide the wikidata ID, but you do not have to. If you do not provide the wikidata ID, the extension tries to grab the wikidata ID via the attribute Wikidata ID. You need to have Semantic Mediawiki installed for this to work. Examples:
 * -> gives you P227 of the wikidata ID Q1533809
 * --> gives you P227 and gets the wikidata ID automatically -> this makes it work very well inside a template
 * -> gives you a box with all defined attributes for Q1533809
 * --> gives you the same box and gets wikidata ID automatically