query-2b3d80508103e199b6132ba5b918462e

rq turtle/ttl

TEMPLATE={"template":"Information about the ?series video games series","variables":{"?series":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q7058673. }"} } } SELECT ?series ?seriesLabel ?first_gameLabel ?first_game_date ?latest_gameLabel (GROUP_CONCAT(DISTINCT ?genreLabel; SEPARATOR = ", ") AS ?genres) (GROUP_CONCAT(DISTINCT ?platformLabel; SEPARATOR = ", ") AS ?platforms) (GROUP_CONCAT(DISTINCT ?developerLabel; SEPARATOR = ", ") AS ?developers) WHERE { BIND(wd:Q289129 AS ?series) OPTIONAL { ?series wdt:P136 ?genre. ?genre rdfs:label ?genreLabel. FILTER((LANG(?genreLabel)) = "en") } ?games wdt:P179 ?series; wdt:P400 ?platform; wdt:P178 ?developer. OPTIONAL { ?first_game p:P179 ?seriesStatement. ?seriesStatement ps:P179 ?series; rdf:type wdno:P155. ?first_game wdt:P577 ?first_game_date } OPTIONAL { ?latest_game p:P179 ?seriesStatement2. ?seriesStatement2 ps:P179 ?series; rdf:type wdno:P156. ?latest_game wdt:P577 ?latest_game_date } ?platform rdfs:label ?platformLabel. FILTER((LANG(?platformLabel)) = "en") ?developer rdfs:label ?developerLabel. FILTER((LANG(?developerLabel)) = "en") SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?series ?seriesLabel ?first_gameLabel ?first_game_date ?latest_gameLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#TEMPLATE={"template":"Information about the ?series video games series","variables":{"?series":{"query":" SELECT ?id WHERE { ?id wdt:P31 wd:Q7058673. }"} } }
SELECT ?series ?seriesLabel ?first_gameLabel ?first_game_date ?latest_gameLabel 
  (GROUP_CONCAT(DISTINCT ?genreLabel; SEPARATOR = ", ") AS ?genres)
  (GROUP_CONCAT(DISTINCT ?platformLabel; SEPARATOR = ", ") AS ?platforms) (GROUP_CONCAT(DISTINCT ?developerLabel; SEPARATOR = ", ") AS ?developers)
WHERE {
  BIND(wd:Q289129 AS ?series)
  OPTIONAL {
    ?series wdt:P136 ?genre.
    ?genre rdfs:label ?genreLabel.
    FILTER((LANG(?genreLabel)) = "en")
  }
  ?games wdt:P179 ?series;
    wdt:P400 ?platform;
    wdt:P178 ?developer.
  OPTIONAL {
    ?first_game p:P179 ?seriesStatement.
    ?seriesStatement ps:P179 ?series;
      rdf:type wdno:P155.
    ?first_game wdt:P577 ?first_game_date
  }
  OPTIONAL {
    ?latest_game p:P179 ?seriesStatement2.
    ?seriesStatement2 ps:P179 ?series;
      rdf:type wdno:P156.
    ?latest_game wdt:P577 ?latest_game_date
  }
  ?platform rdfs:label ?platformLabel.
  FILTER((LANG(?platformLabel)) = "en")
  ?developer rdfs:label ?developerLabel.
  FILTER((LANG(?developerLabel)) = "en")
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?series ?seriesLabel ?first_gameLabel ?first_game_date ?latest_gameLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?developer") v1("?developerLabel"):::projected v17("?developers") v9("?first_game") v11("?first_game_date"):::projected v6("?games") v5("?genre") v3("?genreLabel"):::projected v15("?genres") v12("?latest_game") v14("?latest_game_date") v7("?platform") v2("?platformLabel"):::projected v16("?platforms") v4("?series"):::projected v10("?seriesStatement") v13("?seriesStatement2") c10(["p:novalue/P155"]):::iri c12(["p:novalue/P156"]):::iri c14(["bd:serviceParam"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?developerLabel = 'en'"]] f0 --> v1 f1[["?platformLabel = 'en'"]] f1 --> v2 bind2[/"'wd:Q289129'"/] bind2 --as--o v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P136".-> v5 v5 --"rdfs:label"--> v3 end v6 --"p:direct/P179"--> v4 v6 --"p:direct/P400"--> v7 v6 --"p:direct/P178"--> v8 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:P179".-> v10 v10 --"p:statement/P179"--> v4 v10 --"a"--> c10 v9 --"p:direct/P577"--> v11 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v12 -."p:P179".-> v13 v13 --"p:statement/P179"--> v4 v13 --"a"--> c12 v12 --"p:direct/P577"--> v14 end v7 --"rdfs:label"--> v2 v8 --"rdfs:label"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end bind6[/"?genreLabel"/] v3 --o bind6 bind6 --as--o v15 bind7[/"?platformLabel"/] v2 --o bind7 bind7 --as--o v16 bind8[/"?developerLabel"/] v1 --o bind8 bind8 --as--o v17