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

Florian Schäfer notifications at github.com
Thu Jul 24 21:55:48 UTC 2014


>          :url => "//www.wikidata.org/wiki/#{value}?uselang=#{I18n.locale}",
>          :title => value
> -      }
> +      }]
> +    elsif (
> +      # Key has to be one of the accepted wikidata-tags
> +      key =~ /(architect|artist|brand|operator|subject):wikidata/ and
> +      # Value has to be a semicolon-separated list of wikidata-IDs (whitespaces allowed before and after semicolons)
> +      value =~ /^[Qq][1-9][0-9]*(\s*;\s*[Qq][1-9][0-9]*)*$/
> +    )
> +      # Splitting at every semicolon to get an array of wikidata-IDs (some will be surrounded by whitespaces)
> +      ids = value.split(";")
> +      result = []
> +      for id in ids
> +        # Add a hash to the result-array for every wikidata-ID

I think it's an important information. For car-shops, when you want to buy a car model from a certain manufacturer and search for the next location to buy one.
Or if you want to find the next fuel-station it's for example even more important for map users to know which brand is sold there.

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


More information about the rails-dev mailing list