query-b6cff7916a3b2f1e21960dbf3170dc57

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).

  # Not published before 2019
  MINUS {FILTER(?publication < "2019-01-01"^^xsd:dat).} # doesn't work

  # 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; v3("?game"):::projected v1("?gameLabel"):::projected v2("?publication") a2((" ")) a1((" ")) c7(["wd:Q7889"]):::iri c13(["wd:Q19610114"]):::iri f0[["regex(?gameLabel,'^#91;^ #93;+ +#91;^ #93;+$')"]] f0 --> v1 f1[["?gameLabel = 'en'"]] f1 --> v1 f2[["'2019-01-01^^xsd:date' <= ?publication?publication < s2020-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f2 --> v2 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c7 v3 --"wdt:P577"--> v2 v3 --"rdfs:label"--> v1 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; f4[["?publication < s2019-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f4 --> v2 end subgraph minus5["MINUS"] style minus5 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P179"--> a2 end subgraph minus6["MINUS"] style minus6 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P400"--> c13 end