query-144c8c4a22faea3c9e5d4067403aefdc

rq turtle/ttl

Propertiesinstance of (P31)place of birth (P19)located in the administrative territorial entity (P131)native language (P103)languages spoken, written or signed (P1412)sex or gender (P21)occupation (P106)date of death (P570)

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 ?item ?statements ?linkcount ?itemLabel ?genderLabel (GROUP_CONCAT(DISTINCT ?occupationLabel; SEPARATOR = ", ") AS ?occupations) ?death
WHERE {
VALUES ?occupation { wd:Q482980 wd:Q36180 wd:Q6625963 wd:Q49757 wd:Q11774202 wd:Q214917 wd:Q753110 wd:Q488205 wd:Q4964182 wd:Q18939491 wd:Q1028181 wd:Q28389 wd:Q1930187 wd:Q201788 wd:Q3658608 } . #occupation: composer, poet, sculptor, writer, artist, painter
  ?item wdt:P31 wd:Q5. # all humans
  { ?item wdt:P19 wd:Q22424 }
    UNION  { ?item wdt:P19 ?pob . ?pob wdt:P131* wd:Q22424 } 
    UNION {?item wdt:P103 wd:Q58635 }
    UNION {?item wdt:P1412 wd:Q58635 }        
  ?item wdt:P21 ?gender.
  ?item wdt:P106 ?occupation.
  ?item wdt:P570 ?death.
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?item rdfs:label ?itemLabel.
    ?gender rdfs:label ?genderLabel.
    ?occupation rdfs:label ?occupationLabel.
  }
  FILTER((YEAR(?death)) < 1964)
  OPTIONAL { ?item wikibase:sitelinks ?linkcount. }  #count sitelinks 
?item wikibase:statements ?statements . # for counting statements
}
GROUP BY ?item ?statements ?linkcount ?itemLabel ?genderLabel ?death
ORDER BY DESC(?death)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?death"):::projected v5("?gender") v7("?genderLabel"):::projected v3("?item"):::projected v6("?itemLabel"):::projected v9("?linkcount"):::projected v2("?occupation") v8("?occupationLabel"):::projected v11("?occupations") v4("?pob") v10("?statements"):::projected c5(["wd:Q22424"]):::iri c14(["bd:serviceParam"]):::iri c3(["wd:Q5"]):::iri c8(["wd:Q58635"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["year-from-dateTime(?death) < '1964^^xsd:integer'"]] f0 --> v1 bind1[/VALUES ?occupation/] bind1-->v2 bind10(["wd:Q482980"]) bind10 --> bind1 bind11(["wd:Q36180"]) bind11 --> bind1 bind12(["wd:Q6625963"]) bind12 --> bind1 bind13(["wd:Q49757"]) bind13 --> bind1 bind14(["wd:Q11774202"]) bind14 --> bind1 bind15(["wd:Q214917"]) bind15 --> bind1 bind16(["wd:Q753110"]) bind16 --> bind1 bind17(["wd:Q488205"]) bind17 --> bind1 bind18(["wd:Q4964182"]) bind18 --> bind1 bind19(["wd:Q18939491"]) bind19 --> bind1 bind110(["wd:Q1028181"]) bind110 --> bind1 bind111(["wd:Q28389"]) bind111 --> bind1 bind112(["wd:Q1930187"]) bind112 --> bind1 bind113(["wd:Q201788"]) bind113 --> bind1 bind114(["wd:Q3658608"]) bind114 --> bind1 v3 --"wdt:P31"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P1412"--> c8 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P103"--> c8 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P19"--> v4 v4 --"wdt:P131"--> c5 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P19"--> c5 end union0r <== or ==> union0l end v3 --"wdt:P21"--> v5 v3 --"wdt:P106"--> v2 v3 --"wdt:P570"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 v3 --"rdfs:label"--> v6 v5 --"rdfs:label"--> v7 v2 --"rdfs:label"--> v8 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wikibase:sitelinks".-> v9 end v3 --"wikibase:statements"--> v10 bind3[/"?occupationLabel"/] v8 --o bind3 bind3 --as--o v11