[openstreetmap-website] Link prefixed Wikidata-tags to wikidata.org (#788)

Florian Schäfer notifications at github.com
Tue Jul 22 22:41:11 UTC 2014


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 ;-).
You can merge this Pull Request by running:

  git pull https://github.com/floscher/openstreetmap-website wikidata-links

Or you can view, comment on it, or merge it online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/788

-- Commit Summary --

  * Link the prefixed wikidata-tags to wikidata.org
  * Added tests for prefixed wikidata-tags

-- File Changes --

    M app/helpers/browse_helper.rb (37)
    M test/helpers/browse_helper_test.rb (80)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/788.patch
https://github.com/openstreetmap/openstreetmap-website/pull/788.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/788
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20140722/0662216e/attachment.html>


More information about the rails-dev mailing list