{"id":280,"date":"2020-01-13T16:14:03","date_gmt":"2020-01-13T16:14:03","guid":{"rendered":"http:\/\/wikidata.wwwnlsrc4.supercp.com\/?page_id=280"},"modified":"2022-05-25T09:42:05","modified_gmt":"2022-05-25T09:42:05","slug":"retrieving-a-statement-value","status":"publish","type":"post","link":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/retrieving-statements-values\/retrieving-a-statement-value\/","title":{"rendered":"Retrieving a statement value"},"content":{"rendered":"\n<h2>Queries retrieving a statement value&nbsp;<\/h2>\n\n\n\n<p>As noted in the <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/introduction\/introduction-to-wikidata\/\">introduction<\/a>, Wikidata stores information in the form of statements that have an Item-Property-Value structure.<\/p>\n\n\n\n<p>In our <a href=\"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/simple-queries\/the-simplest-query\/basic-sparql-query\/\">first example<\/a>, our query returns Wikidata items that match our query pattern: they match a specific combination of Property and Value, namely, they have a P179 property (part of a series) with a value of Q22092344 (Star Wars film series). In other words, the variable with the name \u201citem\u201d collects those Wikidata items that have a statement which matches the pattern:<\/p>\n\n\n\n<p>?item &#8211; has property:part of a series &#8211; with value:Star Wars (film series)<br><\/p>\n\n\n\n<p>In this case, the <strong>item<\/strong> part of a matching statement is retrieved.&nbsp;But queries do not necessarily have to return the first part (Item) of statements.<\/p>\n\n\n\n<p>In the following query the ?actor variable collects <strong>values <\/strong>of the property cast member (P161) of the item Star Wars Episode IV: A New Hope (Q17738). That is to say, the variable collects the third part (the object) of the statements:<\/p>\n\n\n\n<iframe style=\"width:100%;max-width:100%;height:450px\" src=\"https:\/\/query.wikidata.org\/#%23Actors%20in%20Star%20Wars%20Episode%20IV%3A%20A%20New%20Hope%0A%0ASELECT%20%3Factor%20%3FactorLabel%20%0AWHERE%20%0A%7B%20%0A%20%20wd%3AQ17738%20wdt%3AP161%20%3Factor.%20%0ASERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22%5BAUTO_LANGUAGE%5D%22.%20%7D%0A%7D%0A\" class=\"\" frameborder=\"0\"><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>Queries retrieving a statement value&nbsp; As noted in the introduction, Wikidata stores information in the form of statements that have an Item-Property-Value structure. In our first example, our query returns Wikidata items that match our query pattern: they match a specific combination of Property and Value, namely, they have a P179 property (part of a [&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":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/280"}],"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=280"}],"version-history":[{"count":13,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/280\/revisions"}],"predecessor-version":[{"id":2531,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/posts\/280\/revisions\/2531"}],"wp:attachment":[{"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/media?parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/categories?post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wdqs-tutorial.toolforge.org\/index.php\/wp-json\/wp\/v2\/tags?post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}