query-cae20a8c7bfd589d0b038bc0e44ad79c

rq turtle/ttl

TODO

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#>
SELECT ?person ?personLabel ?_date_of_birth
(GROUP_CONCAT(?_occupationLabel; separator=', ') AS ?occupation)
(SAMPLE(?_countryLabel) AS ?country)

WHERE {
   {
  SELECT DISTINCT ?person {
    ?person wdt:P570 ?death .
    FILTER ( YEAR( ?death ) >= 1927 && YEAR( ?death ) < 1947 ) .
    ?person wdt:P106/wdt:P279* wd:Q483501 . #person with occupation (P106) any subclass(P279) of artist (Q483501)
  } # put a LIMIT here if it times out
}.
  OPTIONAL { ?person wdt:P27 ?_country } .
  OPTIONAL { ?person wdt:P106 ?_occupation } .
  OPTIONAL { ?person wdt:P569 ?_date_of_birth } .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
    ?person rdfs:label ?personLabel .
    ?_country rdfs:label ?_countryLabel .
    ?_occupation rdfs:label ?_occupationLabel .
  } .
} GROUP BY ?person ?personLabel ?_date_of_birth

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?_country") v7("?_countryLabel"):::projected v5("?_date_of_birth"):::projected v4("?_occupation") v8("?_occupationLabel"):::projected v10("?country") v1("?death") v9("?occupation") v2("?person"):::projected v6("?personLabel"):::projected a1((" ")) c6(["wd:Q483501"]):::iri c12(["en"]):::literal c10(["bd:serviceParam"]):::iri f0[["year-from-dateTime(?death) >= '1927^^xsd:integer'year-from-dateTime(?death) < '1947^^xsd:integer'"]] f0 --> v1 v2 --"wdt:P570"--> v1 v2 --"wdt:P106"--> a1 a1 --"wdt:P279"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P27".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P106".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P569".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 v2 --"rdfs:label"--> v6 v3 --"rdfs:label"--> v7 v4 --"rdfs:label"--> v8 end bind3[/"?_occupationLabel"/] v8 --o bind3 bind3 --as--o v9 bind4[/"sample(?_countryLabel)"/] v7 --o bind4 bind4 --as--o v10