{"id":559,"date":"2020-01-19T16:05:15","date_gmt":"2020-01-19T16:05:15","guid":{"rendered":"http:\/\/wikidata.wwwnlsrc4.supercp.com\/?p=559"},"modified":"2020-07-29T14:43:53","modified_gmt":"2020-07-29T14:43:53","slug":"image-grid-view","status":"publish","type":"post","link":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/adding-variables\/image-grid-view\/","title":{"rendered":"Image Grid View"},"content":{"rendered":"\n<h2>Image Grid View<\/h2>\n\n\n\n<p>WDQS can display the results of our queries in different formats. So far we have always seen the results in table format. Let&#8217;s look again at the previous exercise:<\/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%20%3Fduration%20%3Flogo%0AWHERE%20%0A%7B%20%0A%20%20%3Fitem%20wdt%3AP179%20wd%3AQ22092344.%20%20%20%20%20%20%20%20%20%20%20%20%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%20%20%20%20%20%20%20%20%20%20%20%20%23%20item%E2%80%99s%20director%20property%E2%80%99s%20value%20is%20collected%20by%20the%20director%20variable%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP2130%20%3Fcost.%7D%20%20%20%20%20%20%20%20%23%20item%27s%20cost%20property%27s%20value%2C%20if%20available%2C%20is%20collected%20by%20the%20cost%20variable%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP2047%20%3Fduration.%7D%20%20%20%20%23%20item%27s%20duration%20property%27s%20value%2C%20if%20available%2C%20is%20collected%20by%20the%20duration%20variable%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP154%20%3Flogo.%7D%20%20%20%20%20%20%20%20%20%23%20item%27s%20logo%2C%20if%20available%2C%20is%20collected%20by%20the%20logo%20variable%0A%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>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 &#8220;Image grid&#8221; from the menu, and WDQS will display each item&#8217;s logo, with each item&#8217;s results underneath.<\/p>\n\n\n\n<p>Another way to display the results in the Image grid view is to specify it in the query itself.  The code on line 1, after the hashtag sign, tells the query that the query results should be shown not as a table, but as a grid with images.<\/p>\n\n\n\n<iframe class=\"\" src=\"https:\/\/query.wikidata.org\/#%23defaultView%3AImageGrid%0A%23Star%20Wars%20films%0A%0ASELECT%20%3Fitem%20%20%3FitemLabel%20%3FdirectorLabel%20%3Fcost%20%3Fduration%20%3Flogo%0AWHERE%20%0A%7B%20%0A%20%20%3Fitem%20wdt%3AP179%20wd%3AQ22092344.%20%20%20%20%20%20%20%20%20%20%20%20%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%20%20%20%20%20%20%20%20%20%20%20%20%23%20item%E2%80%99s%20director%20property%E2%80%99s%20value%20is%20collected%20by%20the%20director%20variable%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP2130%20%3Fcost.%7D%20%20%20%20%20%20%20%20%23%20item%27s%20cost%20property%27s%20value%2C%20if%20available%2C%20is%20collected%20by%20the%20cost%20variable%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP2047%20%3Fduration.%7D%20%20%20%20%23%20item%27s%20duration%20property%27s%20value%2C%20if%20available%2C%20is%20collected%20by%20the%20duration%20variable%0A%20%20OPTIONAL%20%7B%3Fitem%20wdt%3AP154%20%3Flogo.%7D%20%20%20%20%20%20%20%20%20%23%20item%27s%20logo%2C%20if%20available%2C%20is%20collected%20by%20the%20logo%20variable%0A%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>You don&#8217;t need to remember the exact code for the image grid: thanks to the <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/the-simplest-query\/autocompletion\/\">autocompletion <\/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","protected":false},"excerpt":{"rendered":"<p>Image Grid View WDQS can display the results of our queries in different formats. So far we have always seen the results in table format. Let&#8217;s look again at the previous exercise: After running the query, scroll to the results. Above the table, click on the arrow next to the eye. A drop-down menu will [&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":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/559"}],"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=559"}],"version-history":[{"count":8,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/559\/revisions"}],"predecessor-version":[{"id":1466,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/559\/revisions\/1466"}],"wp:attachment":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/media?parent=559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/categories?post=559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/tags?post=559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}