{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapping/issues/242","repository_url":"https://api.github.com/repos/mapbox/mapping","labels_url":"https://api.github.com/repos/mapbox/mapping/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapping/issues/242/comments","events_url":"https://api.github.com/repos/mapbox/mapping/issues/242/events","html_url":"https://github.com/mapbox/mapping/issues/242","id":185579165,"number":242,"title":"Joining Wikidata IDs to OSM","user":{"login":"abhisheksaikia","id":13744156,"avatar_url":"https://avatars.githubusercontent.com/u/13744156?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksaikia","html_url":"https://github.com/abhisheksaikia","followers_url":"https://api.github.com/users/abhisheksaikia/followers","following_url":"https://api.github.com/users/abhisheksaikia/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksaikia/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksaikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksaikia/subscriptions","organizations_url":"https://api.github.com/users/abhisheksaikia/orgs","repos_url":"https://api.github.com/users/abhisheksaikia/repos","events_url":"https://api.github.com/users/abhisheksaikia/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksaikia/received_events","type":"User","site_admin":false},"labels":[{"id":282636188,"url":"https://api.github.com/repos/mapbox/mapping/labels/tagging","name":"tagging","color":"fef2c0","default":false},{"id":230225762,"url":"https://api.github.com/repos/mapbox/mapping/labels/task","name":"task","color":"009800","default":false}],"state":"open","locked":false,"assignee":{"login":"bsrinivasa","id":17143802,"avatar_url":"https://avatars.githubusercontent.com/u/17143802?v=3","gravatar_id":"","url":"https://api.github.com/users/bsrinivasa","html_url":"https://github.com/bsrinivasa","followers_url":"https://api.github.com/users/bsrinivasa/followers","following_url":"https://api.github.com/users/bsrinivasa/following{/other_user}","gists_url":"https://api.github.com/users/bsrinivasa/gists{/gist_id}","starred_url":"https://api.github.com/users/bsrinivasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsrinivasa/subscriptions","organizations_url":"https://api.github.com/users/bsrinivasa/orgs","repos_url":"https://api.github.com/users/bsrinivasa/repos","events_url":"https://api.github.com/users/bsrinivasa/events{/privacy}","received_events_url":"https://api.github.com/users/bsrinivasa/received_events","type":"User","site_admin":false},"assignees":[{"login":"bsrinivasa","id":17143802,"avatar_url":"https://avatars.githubusercontent.com/u/17143802?v=3","gravatar_id":"","url":"https://api.github.com/users/bsrinivasa","html_url":"https://github.com/bsrinivasa","followers_url":"https://api.github.com/users/bsrinivasa/followers","following_url":"https://api.github.com/users/bsrinivasa/following{/other_user}","gists_url":"https://api.github.com/users/bsrinivasa/gists{/gist_id}","starred_url":"https://api.github.com/users/bsrinivasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsrinivasa/subscriptions","organizations_url":"https://api.github.com/users/bsrinivasa/orgs","repos_url":"https://api.github.com/users/bsrinivasa/repos","events_url":"https://api.github.com/users/bsrinivasa/events{/privacy}","received_events_url":"https://api.github.com/users/bsrinivasa/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2016-10-27T05:52:23Z","updated_at":"2016-11-18T06:19:36Z","closed_at":null,"body":"**Objective**: Joining matched wikidata id's to OSM City and Towns POIs\r\n\r\n**Worksheet** https://docs.google.com/spreadsheets/d/1Gh2-T20DuXMoRhUwx_L6FYcaHufOwcwpHm-fe0gkRxI/edit#gid=0 - [View](https://docs.google.com/spreadsheets/d/1Gh2-T20DuXMoRhUwx_L6FYcaHufOwcwpHm-fe0gkRxI/pubhtml)\r\n\r\n**OSM Diary** [Scaling multilingual name tags with Wikidata](https://www.openstreetmap.org/user/PlaneMad/diary/39846)\r\n\r\n---\r\n\r\n### Why join wikidata and OSM?\r\n\r\nAn OpenStreetMap feature linked to a wikidata item is augmented with extra information that is stored in the wikidata database. The level of information that can be gathered for an OSM feature when it is linked to wikidata is immense. For example, you can get name translations from Wikidata for places in OSM, find population of countries - all using the API. \r\n### Workflow:\r\n\r\nWe have created spreadsheets for OSM city and town features which have corresponding wikidata entries with exact name matches.\r\n1. Click on a link in the `JOSM` column, the OSM feature with it's corresponding wikidata tag is displayed in JOSM. Click on `add selected tags` to add the wikidata tag\r\n\r\n![wikidata20](https://cloud.githubusercontent.com/assets/13744156/19756005/5bf3b6a2-9c37-11e6-94df-adea59d678b8.gif)\r\n1. Before uploading check:\r\n2. Case 1: Match distance is close to 0\r\n   - Wikidata type matches to a City> Town> Commune> human settlement > Municipality\r\n   - Check if the address matches in both OSM and Wikidata\r\n   - Check the description matches to a city or town\r\n   - Case 1A: There is only one match candidate, add the `wikidata` tag to OSM\r\n   - Case 1B: If there is still more than one match, Wikidata has duplicate entries for the place. eg.  OSM Feature id [958710338](http://localhost:8111/load_object?new_layer=true&objects=n958710338&addtags=wikidata=Q1993763); Wikidata entries: Q1993763, Q2001643\r\n- Case 2: Match distance is high (>10km)\r\n  - Wikidata type matches to a City> Town> Commune> human settlement > Municipality\r\n  - Check if the address matches in both OSM and WIkidata\r\n  - Case2A: If only one match, coordinate in Wikidata is wrong, add the `wikidata` id to OSM\r\n- Case 3: Anything else has no match in Wikidata. Manual matching has to be done to find out if a Wikidata entry exists or not.\r\n\r\n**Changeset comment:** `Adding Wikidata tag to Cities and Towns https://github.com/mapbox/mapping/issues/242`\r\n**Changeset source:** `Wikidata`\r\n\r\nIn the `added` column in the spreadsheet, enter: \r\n\r\n`yes`=added the match, `manual`=added a wikidata match after a manual search, `no`=did not add a wikidata tag\r\n### Resources:\r\n- Adding wikidata entries through ID: https://www.mapbox.com/blog/id-wikidata/\r\n- Linking wikidata to OSM through JOSM plugins: http://wiki.openstreetmap.org/wiki/Key:wikidata\r\n\r\ncc @mapbox/team-data \r\n"},"comment":{"url":"https://api.github.com/repos/mapbox/mapping/issues/comments/261457939","html_url":"https://github.com/mapbox/mapping/issues/242#issuecomment-261457939","issue_url":"https://api.github.com/repos/mapbox/mapping/issues/242","id":261457939,"user":{"login":"DenisCarriere","id":550895,"avatar_url":"https://avatars.githubusercontent.com/u/550895?v=3","gravatar_id":"","url":"https://api.github.com/users/DenisCarriere","html_url":"https://github.com/DenisCarriere","followers_url":"https://api.github.com/users/DenisCarriere/followers","following_url":"https://api.github.com/users/DenisCarriere/following{/other_user}","gists_url":"https://api.github.com/users/DenisCarriere/gists{/gist_id}","starred_url":"https://api.github.com/users/DenisCarriere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenisCarriere/subscriptions","organizations_url":"https://api.github.com/users/DenisCarriere/orgs","repos_url":"https://api.github.com/users/DenisCarriere/repos","events_url":"https://api.github.com/users/DenisCarriere/events{/privacy}","received_events_url":"https://api.github.com/users/DenisCarriere/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T06:19:36Z","updated_at":"2016-11-18T06:19:36Z","body":"@maning Thanks for the post, we've also started doing all of Africa. We've only been mapping for about 1-2 hours at 3-5 people and we've gotten pretty far so far.\r\n\r\nhttp://tasks.osmcanada.ca/project/42\r\n\r\nUsing `Add #wikidata to #Africa places` to track our changesets.\r\n\r\nHere's the SPARQL query we are running:\r\n\r\nhttp://tinyurl.com/zhs93zu\r\n\r\n```sql\r\nSELECT DISTINCT ?place ?location ?distance ?placeDescription ?name_en ?name_fr ?name_es ?name_de ?name_it ?name_ru WHERE { \r\n  # Search Instance of & Subclasses\r\n  ?place wdt:P31/wdt:P279* ?subclass\r\n  FILTER (?subclass in (wd:Q486972))\r\n  \r\n  # Search by Nearest\r\n  SERVICE wikibase:around { \r\n    ?place wdt:P625 ?location . \r\n    bd:serviceParam wikibase:center \"Point(13.397 52.514)\"^^geo:wktLiteral .\r\n    bd:serviceParam wikibase:radius \"15\" . \r\n    bd:serviceParam wikibase:distance ?distance .\r\n  }\r\n    \r\n  # Filter by Exact Name\r\n  OPTIONAL {?place rdfs:label ?name_en FILTER (lang(?name_en) = \"en\") . }\r\n  OPTIONAL {?place rdfs:label ?name_fr FILTER (lang(?name_fr) = \"fr\") . }\r\n  OPTIONAL {?place rdfs:label ?name_es FILTER (lang(?name_es) = \"es\") . }\r\n  OPTIONAL {?place rdfs:label ?name_de FILTER (lang(?name_de) = \"de\") . }\r\n  OPTIONAL {?place rdfs:label ?name_it FILTER (lang(?name_it) = \"it\") . }\r\n  OPTIONAL {?place rdfs:label ?name_ru FILTER (lang(?name_ru) = \"ru\") . }\r\n\r\n  FILTER (regex(?name_en, \"^Berlin$\") || regex(?name_fr, \"^Berlin$\") || regex(?name_es, \"^Berlin$\") || regex(?name_de, \"^Berlin$\") || regex(?name_it, \"^Berlin$\") || regex(?name_ru, \"^Berlin$\")) .\r\n\r\n  # Get Descriptions\r\n  SERVICE wikibase:label {\r\n    bd:serviceParam wikibase:language \"en,fr,es,de,it,ru\"\r\n  }\r\n\r\n} ORDER BY ASC(?dist)\r\n```\r\n\r\nWe decided to do 15km since a lot of cities weren't getting tagged, we could always drop it down to 10km if we wanted to, it's a parameter.\r\n\r\nI've built a Javascript Geocoder that runs the SPARQL query mentioned above.\r\n\r\nhttps://github.com/deniscarriere/geocoder-geojson\r\n\r\n```bash\r\n$ geocode -p wikidata --nearest [-75.7,45.4] Ottawa | jq .features[0].id\r\n\"Q1930\"\r\n```"}}
{"actor":{"display_login":"DenisCarriere"}}