query-be2d225396befdb224ab89b58276b0f2

rq turtle/ttl

TODO

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?game ?gameLabel
WHERE
{
  # All video games
  ?game wdt:P31/wdt:P279* wd:Q7889; 

    # having a date of publication
    wdt:P577 ?publication;
    # and a label
    rdfs:label $gameLabel.

  # Published in the year 2019
  FILTER("2019-01-01"^^xsd:date <= ?publication && ?publication < "2020-01-01"^^xsd:dat).

  FILTER NOT EXISTS 
  {
    ?game wdt:P577 ?publication2.
    FILTER(?publication2 < "2019-00-00"^^xsd:dat) 
    FILTER (?publication2 < ?publication)
  }

  # Not part of a series
  MINUS {?game wdt:P179 []}

  MINUS { # not on Nintendo Switch
    ?game wdt:P400 wd:Q19610114.
  }

  # List only games with English labels
  FILTER(LANG(?gameLabel) = "en").
  # "^\P{Zs}+\p{Zs}+\P{Zs}+$" doesn't work
  FILTER(REGEX(?gameLabel, "^[^ ]+ +[^ ]+$")).
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?game"):::projected v1("?gameLabel"):::projected v3("?publication") v2("?publication2") a2((" ")) a1((" ")) c9(["wd:Q7889"]):::iri c13(["wd:Q19610114"]):::iri f0[["regex(?gameLabel,'^#91;^ #93;+ +#91;^ #93;+$')"]] f0 --> v1 f1[["?gameLabel = 'en'"]] f1 --> v1 f2[["not "]] subgraph f2e0["Exists Clause"] e0f0[["?publication2 < ?publication"]] e0f0 --> e0v1 e0f0 --> e0v2 e0f1[["?publication2 < s2019-00-00^^<http://www.w3.org/2001/XMLSchema#dat>'"]] e0f1 --> e0v1 e0v3 --"wdt:P577"--> e0v1 e0v3("?game"):::projected e0v2("?publication"):::projected e0v1("?publication2"):::projected end f2--EXISTS--> f2e0 f2 --> v2 f2 --> v3 f2 --> v4 f2 --> c4 f3[["?publication2 < ?publication"]] f3 --> v2 f3 --> v3 f4[["?publication2 < s2019-00-00^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f4 --> v2 v4 --"wdt:P577"--> v2 f5[["'2019-01-01^^xsd:date' <= ?publication?publication < s2020-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f5 --> v3 v4 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c9 v4 --"wdt:P577"--> v3 v4 --"rdfs:label"--> v1 subgraph minus6["MINUS"] style minus6 stroke-width:6px,fill:pink,stroke:red; v4 --"wdt:P179"--> a2 end subgraph minus7["MINUS"] style minus7 stroke-width:6px,fill:pink,stroke:red; v4 --"wdt:P400"--> c13 end