openstreetmap/openstreetmap-website — pull request #788 by floscher (2014-07-22 22:41:10+00:00)
Title: Link prefixed Wikidata-tags to wikidata.org

This is a follow-up to #786, in which I've linked the basic wikidata-tags to [wikidata.org](https://wikidata.org)

With this pull-request, also the other wikidata-tags (see [the proposal's wiki-page](https://wiki.openstreetmap.org/wiki/Proposed_features/Wikidata)) get linked.

I decided against a catch-all to discourage misspelled keys. If other prefixes will get popular, one could add them easily in the future.

So tags with the following keys are the only ones that get linked:
* architect:wikidata
* artist:wikidata
* brand:wikidata
* name:etymology:wikidata
* old_name:etymology:wikidata
* operator:wikidata
* subject:wikidata

The reason that it took so long to implement it, was the following:
The basic tag allows only exactly one value, because both OSM and WikiData follow the rule, that one object in reality translates to exactly one object in the database. That makes it a simple 1:1-mapping.
But with the other tags it's more complicated, because one object can have multiple operators, can be named after more than one thing, can cover multiple subjects, …

The only example I currently found was a [cathedral named "Peter and Paul"](http://www.openstreetmap.org/way/38103012) after the apostles [Paul](https://www.wikidata.org/wiki/Q9200) and [Peter](https://www.wikidata.org/wiki/Q33923), which is perfectly valid.

It took some time until I got a satisfying solution, but finally I decided to allow a semicolon-separated list of wikidata-IDs and display them as multiple links to wikidata which are separated by semicolons.

I hope you like it as much as I do ;-).