query-06739e5d30739336d661ecb4ff67831e

rq turtle/ttl

TODO

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?s ?desc ?dob WHERE {
  ?s wdt:P31 wd:Q5.                           # must be human
  ?s  p:P569/psv:P569 [wikibase:timePrecision ?precision; wikibase:timeValue ?birth]
  bind(if(?precision=11,?birth,if(?precision=10,concat(month(?birth)," ",year(?birth)),year(?birth))) as ?dob)                
  ?s wdt:P19 ?place.                         # must have a place of birth
  ?place (wdt:P131*/wdt:P706*) wd:Q5705.     # place of birth must be located within or on Catelonia
  MINUS { ?s wdt:P570 _:b5. }                # must be alive - no date of death
  ?s rdfs:label ?desc.                       # must have a label ...
  FILTER((LANG(?desc)) = "ca")               # label must be in Catalan
  ?article schema:about ?s.                  # must have a sitelink
  ?article schema:inLanguage "ca".           # sitelink must be (by inference) to the Catalan wikipedia
  FILTER((?birth > "1898-01-01"^^xsd:dat) && (?birth < "1918-01-01"^^xsd:dat))
}
GROUP BY ?s ?desc ?dob                       # right now the group by serves no purpose whatsoever - there are to aggregates in the select
LIMIT 100                                    # obvs, only give me 100 results

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?article") v1("?birth") v2("?desc"):::projected v5("?dob"):::projected v6("?place") v4("?precision") v3("?s"):::projected a4((" ")) a2((" ")) a1((" ")) a3((" ")) c13(["wd:Q5705"]):::iri c5(["wd:Q5"]):::iri c3(["ca"]):::literal f0[["?birth > s1898-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'?birth < s1918-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f0 --> v1 f1[["?desc = 'ca'"]] f1 --> v2 v3 --"p:direct/P31"--> c5 a1 --"wikibase:timePrecision"--> v4 a1 --"wikibase:timeValue"--> v1 v3 --"p:P569"--> a2 a2 --"p:statement/value/P569"--> a1 bind2[/"if(?precision = '11^^xsd:integer',?birth,if(?precision = '10^^xsd:integer',concat(month-from-dateTime(?birth),' ',year-from-dateTime(?birth)),year-from-dateTime(?birth)))"/] v4 --o bind2 v1 --o bind2 bind2 --as--o v5 v3 --"p:direct/P19"--> v6 v6 --"p:direct/P131"--> a3 a3 --"p:direct/P706"--> c13 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v3 --"p:direct/P570"--> a4 end v3 --"rdfs:label"--> v2 v7 --"schema:about"--> v3 v7 --"schema:inLanguage"--> c3