query-5648440b8379d6bf8944c3a8127d335c

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/>
SELECT (COUNT(DISTINCT ?item) as ?count)
WHERE
{
  { ?item wdt:P27 wd:Q38 } UNION { ?item wdt:P27 wd:Q172579 } UNION { ?item wdt:P19/wdt:P17 wd:Q38 } 
  ?item wdt:P31 wd:Q5 .
  { ?item wdt:P569 ?dob. FILTER( YEAR(?dob) > 1850 ) }
  UNION { ?item wdt:P570 ?dod. FILTER( YEAR(?dod) > 1850 )  }
  UNION { ?item wdt:P1317 ?dfl. FILTER( YEAR(?dfl) > 1850 )  }
  ?item wikibase:sitelinks ?sl . FILTER( ?sl != 0 ) 
  MINUS { ?item wikibase:sitelinks 1 ; wdt:P373 [] }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?count") v5("?dfl") v3("?dob") v4("?dod") v2("?item"):::projected v1("?sl") a2((" ")) a1((" ")) c3(["wd:Q38"]):::iri c14(["1^^xsd:integer"]):::literal c4(["wd:Q172579"]):::iri c8(["wd:Q5"]):::iri f0[["?sl != '0^^xsd:integer'"]] f0 --> v1 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; v2 --"wdt:P19"--> a1 a1 --"wdt:P17"--> c3 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P27"--> c4 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P27"--> c3 end union0r <== or ==> union0l end v2 --"wdt:P31"--> c8 subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; f1[["year-from-dateTime(?dfl) > '1850^^xsd:integer'"]] f1 --> v5 v2 --"wdt:P1317"--> v5 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; f2[["year-from-dateTime(?dod) > '1850^^xsd:integer'"]] f2 --> v4 v2 --"wdt:P570"--> v4 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; f3[["year-from-dateTime(?dob) > '1850^^xsd:integer'"]] f3 --> v3 v2 --"wdt:P569"--> v3 end union2r <== or ==> union2l end v2 --"wikibase:sitelinks"--> v1 subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v2 --"wikibase:sitelinks"--> c14 v2 --"wdt:P373"--> a2 end bind6[/"count(?item)"/] v2 --o bind6 bind6 --as--o v6