{"id":1200,"date":"2020-02-25T16:03:38","date_gmt":"2020-02-25T16:03:38","guid":{"rendered":"http:\/\/wikidata.wwwnlsrc4.supercp.com\/?p=1200"},"modified":"2020-11-29T15:02:43","modified_gmt":"2020-11-29T15:02:43","slug":"exercise-filter","status":"publish","type":"post","link":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/modifying-results\/exercise-filter\/","title":{"rendered":"Exercise: FILTER"},"content":{"rendered":"\n<h4>| Exercise: Write a query that shows sovereign states whose head of government was born in 1980 or later <\/h4>\n\n\n\n<p> Hint: select sovereign states (Q3624078) that have a head of government (P6) whose date of birth (P569) has the year 1980 or later, or  who have their birthday 01-01-1980 or later.<\/p>\n\n\n\n<iframe class=\"\" src=\"https:\/\/query.wikidata.org\/\" style=\"width:100%;max-width:100%;height:450px\" frameborder=\"0\"><\/iframe>\n\n\n\n<div class=\"wp-block-coblocks-accordion\">\n<div class=\"wp-block-coblocks-accordion-item\"><details><summary class=\"wp-block-coblocks-accordion-item__title\">show solution<\/summary><div class=\"wp-block-coblocks-accordion-item__content\">\n<p><\/p>\n\n\n\n<iframe class=\"\" src=\"https:\/\/query.wikidata.org\/#%23%20Heads%20of%20government%20of%20sovereign%20states%20born%20in%201980%20or%20later%0A%0ASELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20%3Fhead%20%3FheadLabel%20%3Fdob%0A%7B%0A%20%20%20%20%3Fitem%20wdt%3AP31%20wd%3AQ3624078.%20%20%20%23%20item%20is%20an%20instance%20of%20sovereign%20state%0A%20%20%20%20%20%3Fitem%20wdt%3AP6%20%3Fhead.%20%20%20%20%20%20%20%20%20%23%20item%27s%20head%20of%20government%20is%20collected%20by%20%3Fhead%20variable%0A%20%20%20%20%3Fhead%20wdt%3AP569%20%3Fdob.%20%20%20%20%20%20%20%20%20%23%20value%20of%20date%20of%20birth%20is%20collected%20by%20%3Fdate%20variable%20%0A%09FILTER%28YEAR%28%3Fdob%29%3E%3D1980%29%20%20%20%20%20%23%20select%20only%20those%20born%20in%201980%20or%20after%20%0ASERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%7D%0AORDER%20BY%20ASC%28%3Fdob%29\" style=\"width:100%;max-width:100%;height:450px\" frameborder=\"0\"><\/iframe>\n\n\n\n<p>Another way of writing this query is using the exact date format:<\/p>\n\n\n\n<iframe class=\"\" src=\"https:\/\/query.wikidata.org\/#%23%20Heads%20of%20government%20of%20sovereign%20states%20born%20in%201980%20or%20later%0A%0ASELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20%3Fhead%20%3FheadLabel%20%3Fdob%0A%7B%0A%20%20%20%20%3Fitem%20wdt%3AP31%20wd%3AQ3624078.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20item%20is%20an%20instance%20of%20sovereign%20state%0A%20%20%20%20%20%3Fitem%20wdt%3AP6%20%3Fhead.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20item%27s%20head%20of%20government%20is%20collected%20by%20%3Fhead%20variable%0A%20%20%20%20%3Fhead%20wdt%3AP569%20%3Fdob.%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20value%20of%20date%20of%20birth%20is%20collected%20by%20%3Fdate%20variable%20%0A%09FILTER%20%28%3Fdob%20%3E%3D%20%221980-01-01%22%5E%5Exsd%3AdateTime%29%20%20%20%20%20%20%23%20select%20only%20those%20born%2001-01-1980%20or%20after%20%0ASERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%7D%0AORDER%20BY%20ASC%28%3Fdob%29\" style=\"width:100%;max-width:100%;height:450px\" frameborder=\"0\"><\/iframe>\n<\/div><\/details><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>| Exercise: Write a query that shows sovereign states whose head of government was born in 1980 or later Hint: select sovereign states (Q3624078) that have a head of government (P6) whose date of birth (P569) has the year 1980 or later, or who have their birthday 01-01-1980 or later.<\/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":[18],"tags":[],"_links":{"self":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/1200"}],"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=1200"}],"version-history":[{"count":7,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/1200\/revisions"}],"predecessor-version":[{"id":1989,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/1200\/revisions\/1989"}],"wp:attachment":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/media?parent=1200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/categories?post=1200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/tags?post=1200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}