{"id":461,"date":"2020-01-15T15:28:44","date_gmt":"2020-01-15T15:28:44","guid":{"rendered":"http:\/\/wikidata.wwwnlsrc4.supercp.com\/?page_id=461"},"modified":"2020-07-29T14:39:23","modified_gmt":"2020-07-29T14:39:23","slug":"another-exercise","status":"publish","type":"post","link":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/adding-variables\/another-exercise\/","title":{"rendered":"Another exercise"},"content":{"rendered":"\n<h4>| Exercise: Show director and cost (P2130) of each film in the Star Wars series<\/h4>\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\/#%23Star%20Wars%20films%0A%0ASELECT%20%3Fitem%20%20%3FitemLabel%20%3FdirectorLabel%20%3Fcost%0AWHERE%20%0A%7B%20%0A%20%20%3Fitem%20wdt%3AP179%20wd%3AQ22092344.%20%23%20item%20is%20part%20of%20the%20series%20Star%20Wars%20%28film%20series%29%0A%20%20%3Fitem%20wdt%3AP57%20%3Fdirector.%20%20%20%20%20%23%20item%E2%80%99s%20director%20property%E2%80%99s%20value%20is%20collected%20by%20the%20director%20variable%0A%20%20%3Fitem%20wdt%3AP2130%20%3Fcost.%20%20%20%20%20%20%20%23%20item%27s%20cost%20property%27s%20value%20is%20collected%20by%20the%20cost%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> or using a different syntax (see the explanation <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/adding-match-patterns\/two-or-more-match-patterns\/#syntax\">here<\/a>): <\/p>\n\n\n\n<iframe class=\"\" src=\"https:\/\/query.wikidata.org\/#%23Star%20Wars%20films%0A%0ASELECT%20%3Fitem%20%20%3FitemLabel%20%3FdirectorLabel%20%3Fcost%0AWHERE%20%0A%7B%20%0A%20%20%3Fitem%20wdt%3AP179%20wd%3AQ22092344%3B%20%23%20item%20is%20part%20of%20the%20series%20Star%20Wars%20%28film%20series%29%0A%20%20%20%20%20%20%20%20wdt%3AP57%20%3Fdirector%3B%20%20%20%20%20%23%20item%E2%80%99s%20director%20property%E2%80%99s%20value%20is%20collected%20by%20the%20director%20variable%0A%20%20%20%20%20%20%20%20wdt%3AP2130%20%3Fcost.%20%20%20%20%20%20%20%23%20item%27s%20cost%20property%27s%20value%20is%20collected%20by%20the%20cost%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>A\u00a0<a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/adding-variables\/query-with-more-than-one-variable\/\">previous query<\/a>\u00a0which retrieved each Star Wars film and its director returned 9 results. This current query only returns 8 results. Why? <br><br>Because some items don\u2019t have cost (P2130)\u00a0as a property, and are therefore ignored by the query.\u00a0 <\/p>\n<\/div><\/details><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>| Exercise: Show director and cost (P2130) of each film in the Star Wars series<\/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":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/461"}],"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=461"}],"version-history":[{"count":18,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":1463,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/461\/revisions\/1463"}],"wp:attachment":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}