query-3873ca9dbbc26d826bb376da92e9eddb

rq turtle/ttl

results: 44 SELECT DISTINCT ?item ?itemLabel ?location ?locationLabel ?inTokyo ?when ?start ?end WHERE { ?item wdt:P31/wdt:P279 wd:Q1656682. ?item wdt:P17 wd:Q17.
?item rdfs:label ?l . FILTER( lang(?l)="en" && CONTAINS( str(?l), "2002") ) OPTIONAL { ?item wdt:P276 ?location } OPTIONAL { ?item wdt:P276 / wdt:P131
wd:Q1490 . BIND("Y" as ?inTokyo) } OPTIONAL { ?item wdt:P585 ?when } OPTIONAL { ?item wdt:P580 ?start } OPTIONAL { ?item wdt:P582 ?end } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
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#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#results: 44
SELECT DISTINCT ?item ?itemLabel ?location ?locationLabel ?inTokyo ?when ?start ?end 
WHERE
{
  ?item wdt:P31/wdt:P279* wd:Q1656682. 
  ?item wdt:P17 wd:Q17.   
  ?item rdfs:label ?l . FILTER( lang(?l)="en" && CONTAINS( str(?l), "2002") )
  OPTIONAL { ?item wdt:P276 ?location } 
  OPTIONAL { ?item wdt:P276 / wdt:P131* wd:Q1490 . BIND("Y" as ?inTokyo) } 
  OPTIONAL { ?item wdt:P585 ?when }
  OPTIONAL { ?item wdt:P580 ?start } 
  OPTIONAL { ?item wdt:P582 ?end }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?end"):::projected v4("?inTokyo"):::projected v2("?item"):::projected v1("?l") v3("?location"):::projected v6("?start"):::projected v5("?when"):::projected a1((" ")) a2((" ")) c5(["wd:Q1656682"]):::iri c7(["wd:Q17"]):::iri c16(["bd:serviceParam"]):::iri c11(["wd:Q1490"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?l = 'en'contains(str(?l),'2002')"]] f0 --> v1 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c5 v2 --"wdt:P17"--> c7 v2 --"rdfs:label"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P276".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P276".-> a2 a2 --"wdt:P131"--> c11 bind1[/"'Y'"/] bind1 --as--o v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P585".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P580".-> v6 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P582".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end