<p>This is a follow-up to <a href="https://github.com/openstreetmap/openstreetmap-website/pull/786" class="issue-link" title="Add Wikidata-links to browse-helper">#786</a>, in which I've linked the basic wikidata-tags to <a href="https://wikidata.org">wikidata.org</a></p>

<p>With this pull-request, also the other wikidata-tags (see <a href="https://wiki.openstreetmap.org/wiki/Proposed_features/Wikidata">the proposal's wiki-page</a>) get linked.</p>

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

<p>So tags with the following keys are the only ones that get linked:</p>

<ul class="task-list">
<li>architect:wikidata</li>
<li>artist:wikidata</li>
<li>brand:wikidata</li>
<li>name:etymology:wikidata</li>
<li>old_name:etymology:wikidata</li>
<li>operator:wikidata</li>
<li>subject:wikidata</li>
</ul><p>The reason that it took so long to implement it, was the following:<br>
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.<br>
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, …</p>

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

<p>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.</p>

<p>I hope you like it as much as I do ;-).</p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/floscher/openstreetmap-website wikidata-links</pre>
<p>Or view, comment on, or merge it at:</p>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/788'>https://github.com/openstreetmap/openstreetmap-website/pull/788</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Link the prefixed wikidata-tags to wikidata.org</li>
  <li>Added tests for prefixed wikidata-tags</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/788/files#diff-0">app/helpers/browse_helper.rb</a>
    (37)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/788/files#diff-1">test/helpers/browse_helper_test.rb</a>
    (80)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/788.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/788.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/788.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/788.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/openstreetmap/openstreetmap-website/pull/788">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/1419053__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMTY4ODA3MSwiZGF0YSI6eyJpZCI6Mzc2ODAyMTl9fQ==--7d6854dc197e1a08d0e91386ff1fcafe86fc0960.gif" width="1" /></p>