Changes between Version 2 and Version 3 of Ticket #18542, comment 13


Ignore:
Timestamp:
2020-01-21T03:37:37+01:00 (6 years ago)
Author:
nyurik

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18542, comment 13

    v2 v3  
    11I have been trying to wrap by head around the goal and approach of this ticket, and still highly confused.
    22
    3 If the goal is to get the right value->URL formatter in tag2link, the easiest is to follow the same scheme as what iD does (see [https://github.com/openstreetmap/iD/blob/189a3f87e389f9c2745a9c25b98ec0e4823776dc/modules/services/osm_wikibase.js#L183 code]). Steps:
    4 1. convert key to a "sitelink":   `("Key:" + key).replace('_', ' ')` (replace underscores with spaces)
    5 1. call `www.osm.org/w/api.php?action=wbgetentities&...` to get the data items for each of the sitelinks. You should pass all sitelinks to it in a single call, rather than calling it multiple times. See above code link.
     3If the goal is to get the right value->URL formatter in tag2link, the easiest is to follow the same scheme as what iD does:
     41. convert key to a "sitelink":   `("Key:" + key).replace('_', ' ')` (replace underscores with spaces). See [https://github.com/openstreetmap/iD/blob/189a3f87e389f9c2745a9c25b98ec0e4823776dc/modules/services/osm_wikibase.js#L116 iD code].
     51. call `www.osm.org/w/api.php?action=wbgetentities&...` to get the data items for each of the sitelinks. You should pass all sitelinks to it in a single call, rather than calling it multiple times. See [https://github.com/openstreetmap/iD/blob/189a3f87e389f9c2745a9c25b98ec0e4823776dc/modules/services/osm_wikibase.js#L183 iD code].
    661. check if [https://wiki.openstreetmap.org/wiki/Property:P8 P8 property] claim is defined on each of the resulting data items, and if so, use it.
    77