{"id":390,"date":"2020-01-14T16:56:19","date_gmt":"2020-01-14T16:56:19","guid":{"rendered":"http:\/\/wikidata.wwwnlsrc4.supercp.com\/?page_id=390"},"modified":"2020-11-25T12:23:22","modified_gmt":"2020-11-25T12:23:22","slug":"exercise-more-than-one-variable","status":"publish","type":"post","link":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/adding-variables\/exercise-more-than-one-variable\/","title":{"rendered":"Exercise: more than one variable"},"content":{"rendered":"\n<h4>| Exercise: Write a query to show the director and screenwriter (P58) of each film in the Star Wars film 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%3FscreenwriterLabel%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%20%0A%20%20%3Fitem%20wdt%3AP58%20%3Fscreenwriter.%20%23%20item%E2%80%99s%20screenwriter%20property%E2%80%99s%20value%20is%20collected%20by%20the%20screenwriter%20variable%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%20%20%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%3FscreenwriterLabel%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%20%0A%20%20%20%20%20%20%20%20wdt%3AP58%20%3Fscreenwriter.%20%23%20item%E2%80%99s%20screenwriter%20property%E2%80%99s%20value%20is%20collected%20by%20the%20screenwriter%20variable%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%20%20%0A%7D\" style=\"width:100%;max-width:100%;height:450px\" frameborder=\"0\"><\/iframe>\n\n\n\n<p>The <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/adding-variables\/query-with-more-than-one-variable\/\">previous query<\/a> which listed the director of each Star Wars film returned 9 results. This query returns 16 results. Why?<br><br>Because there are more than one screenwriter for some of the films. So we get one line for each screenwriter.<\/p>\n<\/div><\/details><\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>| Exercise: Write a query to show the director and screenwriter (P58) of each film in the Star Wars film 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\/390"}],"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=390"}],"version-history":[{"count":13,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":1796,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/390\/revisions\/1796"}],"wp:attachment":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}