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

Tom Hughes notifications at github.com
Thu Jul 24 21:47:38 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

Is openstreetmap really the correct place to be building an inventory of all the brands sold by a shop though?!?

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


More information about the rails-dev mailing list