{"id":834,"date":"2020-01-27T17:00:37","date_gmt":"2020-01-27T17:00:37","guid":{"rendered":"http:\/\/wikidata.wwwnlsrc4.supercp.com\/?p=834"},"modified":"2020-07-29T14:50:36","modified_gmt":"2020-07-29T14:50:36","slug":"coordinates","status":"publish","type":"post","link":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/where-queries\/coordinates\/","title":{"rendered":"Coordinates"},"content":{"rendered":"\n<h2>Where queries: coordinates<\/h2>\n\n\n\n<p>&#8220;Where&#8221; queries refer to retrieving geographical locations which can be expressed in coordinates. It is then possible to present this information in the form of a map.  <\/p>\n\n\n\n<p>We recommend going over the <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/introduction\/introduction-to-wikidata\/\">introduction to Wikidata<\/a> and learning about the <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/introduction\/the-structure-of-wikidata\/\">structure of Wikidata<\/a>, as well as the section regarding <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/the-simplest-query\/basic-sparql-query\/\">the simplest query<\/a> before proceeding.<\/p>\n\n\n\n<p>Let\u2019s start with a simple example: Where did aviation accidents happen?<\/p>\n\n\n\n<iframe class=\"\" src=\"https:\/\/query.wikidata.org\/#%23Locations%20of%20aviation%20accidents%0A%0ASELECT%20%3Fitem%20%3FitemLabel%20%3Fcoords%0AWHERE%0A%7B%0A%20%20%20%3Fitem%20wdt%3AP31%20wd%3AQ744913.%20%20%20%20%20%20%23%20item%20is%20an%20instance%20of%20an%20aviation%20accident%0A%20%20%20%3Fitem%20wdt%3AP625%20%3Fcoords.%20%20%20%20%20%20%20%20%23%20item%27s%20coordinates%20are%20collected%20by%20the%20%3Fcoords%20variable%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%2Cen%22.%20%7D%0A%7D\" style=\"width:100%;max-width:100%;height:450px\" frameborder=\"0\"><\/iframe>\n\n\n\n<p>After running the query, scroll to the results. Above the table, click on the arrow next to the eye. A drop-down menu will pop up. Choose \u201cMap\u201d from the menu, and WDQS will display the locations on a map. You can click on each point to see the item&#8217;s label and the associated coordinates.<\/p>\n\n\n\n<p>Another way to display the results in the Map view is to specify it in the query itself. The code on line 2, after the hashtag sign, tells the query that the query results should be shown not as a table, but as a map.<\/p>\n\n\n\n<iframe class=\"\" src=\"https:\/\/query.wikidata.org\/#%23Locations%20of%20aviation%20accidents%0A%23defaultView%3AMap%0A%0ASELECT%20%3Fitem%20%3FitemLabel%20%3Fcoords%0AWHERE%0A%7B%0A%20%20%20%3Fitem%20wdt%3AP31%20wd%3AQ744913.%20%20%20%20%20%20%23%20item%20is%20an%20instance%20of%20an%20aviation%20accident%0A%20%20%20%3Fitem%20wdt%3AP625%20%3Fcoords.%20%20%20%20%20%20%20%20%23%20item%27s%20coordinates%20are%20collected%20by%20the%20%3Fcoords%20variable%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%7D\" style=\"width:100%;max-width:100%;height:450px\" frameborder=\"0\"><\/iframe>\n\n\n\n<p> You don\u2019t need to remember the exact code for the map view: thanks to the\u00a0<a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/the-simplest-query\/autocompletion\/\">autocompletion\u00a0<\/a>function of WDQS, once you type a hashtag in the query window, a drop-down menu will suggest the different display options.  <\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Where queries: coordinates &#8220;Where&#8221; queries refer to retrieving geographical locations which can be expressed in coordinates. It is then possible to present this information in the form of a map. We recommend going over the introduction to Wikidata and learning about the structure of Wikidata, as well as the section regarding the simplest query before [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/834"}],"collection":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/comments?post=834"}],"version-history":[{"count":11,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":1471,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/834\/revisions\/1471"}],"wp:attachment":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/media?parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/categories?post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/tags?post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}