query-8379aeefec46c92fb779c2e27853e782

rq turtle/ttl

based on a query by User:Lepticed7: https://w.wiki/ewx SELECT ?item ?itemLabel ?y ?start ?end ?countryLabel ?surfaceLabel ?locationLabel ?unit ?prize ?partof ?partofLabel ?partof2 ?partof2Label WHERE { ?item wdt:P31 wd:Q47345468; wdt:P361 wd:Q1134303. OPTIONAL { ?item wdt:P585 ?y0 . BIND(YEAR(?y0) as ?y) } OPTIONAL { ?item wdt:P580 ?start. } OPTIONAL { ?item wdt:P582 ?end. } OPTIONAL { ?item wdt:P17 ?country. } OPTIONAL { ?item wdt:P765 ?surface. } OPTIONAL { ?item wdt:P276 ?location. } OPTIONAL { ?item p:P2121/psv:P2121 ?st . ?st wikibase:quantityAmount ?prize . OPTIONAL { ?st wikibase:quantityUnit/wdt:P498 ?unit } } OPTIONAL { ?item wdt:P361 ?partof . FILTER( ?partof != wd:Q1134303) } OPTIONAL { ?item wdt:P31 ?partof2 . FILTER( ?partof2 != wd:Q47345468) } 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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#based on a query by User:Lepticed7: https://w.wiki/ewx
SELECT ?item ?itemLabel ?y ?start ?end ?countryLabel ?surfaceLabel ?locationLabel ?unit ?prize ?partof ?partofLabel ?partof2 ?partof2Label
WHERE
{
  ?item wdt:P31 wd:Q47345468;
    wdt:P361 wd:Q1134303.
  OPTIONAL { ?item wdt:P585 ?y0 . BIND(YEAR(?y0) as ?y) }
  OPTIONAL { ?item wdt:P580 ?start. }
  OPTIONAL { ?item wdt:P582 ?end. }
  OPTIONAL { ?item wdt:P17 ?country. }
  OPTIONAL { ?item wdt:P765 ?surface. }
  OPTIONAL { ?item wdt:P276 ?location. }
  OPTIONAL { ?item p:P2121/psv:P2121 ?st . ?st wikibase:quantityAmount ?prize . OPTIONAL { ?st wikibase:quantityUnit/wdt:P498 ?unit }  } 
  OPTIONAL { ?item wdt:P361 ?partof . FILTER( ?partof != wd:Q1134303)  }
  OPTIONAL { ?item wdt:P31 ?partof2 . FILTER( ?partof2 != wd:Q47345468)  }
  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; v8("?country") v7("?end"):::projected v3("?item"):::projected v10("?location") v2("?partof"):::projected v1("?partof2"):::projected v12("?prize"):::projected v11("?st") v6("?start"):::projected v9("?surface") v13("?unit"):::projected v5("?y"):::projected v4("?y0") a1((" ")) a2((" ")) c2(["wd:Q1134303"]):::iri c17(["bd:serviceParam"]):::iri c19(["#91;AUTO_LANGUAGE#93;,en"]):::literal c1(["wd:Q47345468"]):::iri v3 --"p:direct/P31"--> c1 v3 --"p:direct/P361"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P585".-> v4 bind0[/"year-from-dateTime(?y0)"/] v4 --o bind0 bind0 --as--o v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P580".-> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P582".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P17".-> v8 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P765".-> v9 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P276".-> v10 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P2121".-> a1 a1 --"p:statement/value/P2121"--> v11 v11 --"wikibase:quantityAmount"--> v12 subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v11 -."wikibase:quantityUnit".-> a2 a2 --"p:direct/P498"--> v13 end end subgraph optional8["(optional)"] style optional8 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P361".-> v2 end subgraph optional9["(optional)"] style optional9 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P31".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c17 --"wikibase:language"--> c19 end