query-838c609b51d2cd1d70c9e04416636504

rq turtle/ttl

Selects all human who died in 1948 and shows

their paintings that are part of a collection (with possible coordinates) as well as the possible placement with country and possible image

SELECT ?deathdate ?person ?personLabel ?work ?workLabel ?objectname ?objectnameLabel ?image ?coll ?collLabel ?collcoord ?collcountryLabel ?placeLabel ?placecountryLabel WHERE { VALUES ?year { 1948 } # add more years like VALUES ?year { 1948 1949 } ?person wdt:P31 wd:Q5. ?person p:P570/psv:P570 [wikibase:timeValue ?tv; wikibase:timePrecision ?tp] . FILTER(year(?tv)=?year)

truncate the display of dates given with year och month precision

BIND(IF(?tp=9,substr(?tv,1,4),IF(?tp=10,substr(str(?tv),1,7),substr(str(?tv),1,10))) AS ?deathdate) ?work wdt:P170 ?person . ?work wdt:P195 ?coll . OPTIONAL { ?work wdt:P18 ?image } OPTIONAL { ?work wdt:P31 ?objectname }

FILTER(!BOUND(?image)) # uncommment this if only paintings without image are wanted

OPTIONAL { ?coll wdt:P625 ?collcoord } OPTIONAL { ?coll wdt:P17 ?collcountry } OPTIONAL { ?coll wdt:P276 ?place . OPTIONAL { ?place wdt:P17 ?placecountry } } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl,pl,ca". } } ORDER BY ?tv ?personLabel ?workLabel

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#>
#Selects all human who died in 1948 and shows 
#their paintings that are part of a collection (with possible coordinates) as well as the possible placement with country and possible image 
SELECT ?deathdate ?person ?personLabel ?work ?workLabel ?objectname ?objectnameLabel ?image ?coll ?collLabel ?collcoord ?collcountryLabel ?placeLabel ?placecountryLabel WHERE {
  VALUES ?year { 1948 }  # add more years like VALUES ?year { 1948 1949 }
  ?person wdt:P31 wd:Q5.
  ?person p:P570/psv:P570 [wikibase:timeValue ?tv; wikibase:timePrecision ?tp] .
  FILTER(year(?tv)=?year)
#truncate the display of dates given with year och month precision
  BIND(IF(?tp=9,substr(?tv,1,4),IF(?tp=10,substr(str(?tv),1,7),substr(str(?tv),1,10))) AS ?deathdate)
  ?work wdt:P170 ?person .
  ?work wdt:P195 ?coll .
  OPTIONAL { ?work wdt:P18 ?image }
  OPTIONAL { ?work wdt:P31 ?objectname }
#  FILTER(!BOUND(?image))  # uncommment this if only paintings without image are wanted
  OPTIONAL { ?coll wdt:P625 ?collcoord }
  OPTIONAL { ?coll wdt:P17 ?collcountry }
  OPTIONAL { ?coll wdt:P276 ?place . OPTIONAL { ?place wdt:P17 ?placecountry } }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl,pl,ca". }
}
ORDER BY ?tv ?personLabel ?workLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?coll"):::projected v12("?collcoord"):::projected v13("?collcountry") v7("?deathdate"):::projected v10("?image"):::projected v11("?objectname"):::projected v5("?person"):::projected v2("?personLabel"):::projected v14("?place") v15("?placecountry") v6("?tp") v1("?tv") v8("?work"):::projected v3("?workLabel"):::projected v5("?year") a2((" ")) a1((" ")) c16(["#91;AUTO_LANGUAGE#93;,en,nl,pl,ca"]):::literal c14(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri f0[["year-from-dateTime(?tv) = ?year"]] f0 --> v1 f0 --> v5 bind1[/VALUES ?year/] bind1-->v5 bind10(["1948^^xsd:integer"]) bind10 --> bind1 v5 --"p:direct/P31"--> c2 a1 --"wikibase:timeValue"--> v1 a1 --"wikibase:timePrecision"--> v6 v5 --"p:P570"--> a2 a2 --"p:statement/value/P570"--> a1 bind2[/"if(?tp = '9^^xsd:integer',substring(?tv,'1^^xsd:integer','4^^xsd:integer'),if(?tp = '10^^xsd:integer',substring(str(?tv),'1^^xsd:integer','7^^xsd:integer'),substring(str(?tv),'1^^xsd:integer','10^^xsd:integer')))"/] v6 --o bind2 v1 --o bind2 bind2 --as--o v7 v8 --"p:direct/P170"--> v5 v8 --"p:direct/P195"--> v9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P18".-> v10 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P31".-> v11 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:direct/P625".-> v12 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:direct/P17".-> v13 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:direct/P276".-> v14 subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v14 -."p:direct/P17".-> v15 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end