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

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

Also, why do we want to allow a list of values here when we don't for the plain `wikidata` tag? Is that just left over from etymology support or do the other tags (reasonably) make use of that? 

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


More information about the rails-dev mailing list