query-056f857154f9a84e4a4e33e3c05d532a

rq turtle/ttl

Series display items. (Q7058673)video game series I would like to enrich the display on : (Q99431276)Dark Souls Currently, it would display the games part of the series ; on eg (2016)(Q20112508)Dark Souls III (2014)(Q3702740)Dark Souls II (2011)(Q1166232)Dark Souls . With the same example that would be: (P8646)expansion of ) to enrich that with the expansions of each game (the things linked to each item with what IGDB doesI would like (inspired by (Q55381943)Dark Souls III: The Ringed City (Q113283443)Dark Souls III: Ashes of Ariandel (2016) (Q20112508)Dark Souls III (Q102277373)Dark Souls II: Crown of the Sunken King (Q102277371)Dark Souls II: Crown of the Old Iron King (Q102277574)Dark Souls II: Crown of the Ivory King (2014) (Q3702740)Dark Souls II (Q50296391)Dark Souls: Artorias of the Abyss (2011) (Q1166232)Dark Souls Here would be a query that retrieves the data:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (MIN(YEAR(?date)) AS ?year) ?game WHERE {
  {
    ?item wdt:P179 wd:Q99431276.
    VALUES ?type {
      wd:Q7889
      wd:Q16070115
      wd:Q4393107
      wd:Q65963104
    }
    ?item wdt:P31 ?type.
  }
  UNION
  {
    ?item wdt:P8646 ?game.
    ?game wdt:P179 wd:Q99431276.
  }
  OPTIONAL { ?item wdt:P577 ?date. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?game
ORDER BY (?year)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?date"):::projected v4("?game"):::projected v2("?item"):::projected v3("?type") v6("?year") c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q99431276"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P8646"--> v4 v4 --"wdt:P179"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P179"--> c2 bind0[/VALUES ?type/] bind0-->v3 bind00(["wd:Q7889"]) bind00 --> bind0 bind01(["wd:Q16070115"]) bind01 --> bind0 bind02(["wd:Q4393107"]) bind02 --> bind0 bind03(["wd:Q65963104"]) bind03 --> bind0 v2 --"wdt:P31"--> v3 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P577".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end bind2[/"min(year-from-dateTime(?date))"/] v5 --o bind2 bind2 --as--o v6