query-a4a19129ce789ea56867ee9aaf6121aa

rq turtle/ttl

Check citizenship (contemporaneity)

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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?rower ?rowerLabel ?dob ?dod ?state ?stateLabel ?inception ?dissolved WHERE {
  ?rower p:P106/ps:P106/wdt:P279* wd:Q26270618; wdt:P27 ?state .
  ?state wdt:P571 ?inception .
  OPTIONAL { ?state wdt:P576 ?dissolved }
  ?rower p:P569/psv:P569 [ wikibase:timeValue ?dob; wikibase:timePrecision ?dobPrecision ] . FILTER(?dobPrecision >= 9) .
  OPTIONAL { ?rower p:P570/psv:P570 [ wikibase:timeValue ?dod; wikibase:timePrecision ?dodPrecision ] . FILTER(?dodPrecision >= 9) }
  FILTER(?dissolved < ?dob|| ?inception > ?dod) . # completely out of bounds
#  FILTER(?dissolved < ?dod || ?inception > ?dob) . # partially out of bounds; yields a lot of results, and does not indicate what to do
  SERVICE wikibase:label { bd:serviceParam wikibase:language '[AUTO_LANGUAGE],en' }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?dissolved"):::projected v2("?dob"):::projected v5("?dobPrecision") v4("?dod"):::projected v6("?dodPrecision") v3("?inception"):::projected v7("?rower"):::projected v8("?state"):::projected a1((" ")) a2((" ")) a4((" ")) a3((" ")) a6((" ")) a5((" ")) c16(["bd:serviceParam"]):::iri c5(["wd:Q26270618"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["(?dissolved < ?dob || ?inception > ?dod)"]] f0 --> v1 f0 --> v2 f0 --> v3 f0 --> v4 f1[["?dobPrecision >= '9^^xsd:integer'"]] f1 --> v5 v7 --"p:P106"--> a1 a1 --"p:statement/P106"--> a2 a2 --"p:direct/P279"--> c5 v7 --"p:direct/P27"--> v8 v8 --"p:direct/P571"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P576".-> v1 end a3 --"wikibase:timeValue"--> v2 a3 --"wikibase:timePrecision"--> v5 v7 --"p:P569"--> a4 a4 --"p:statement/value/P569"--> a3 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; a5 -."wikibase:timeValue".-> v4 a5 --"wikibase:timePrecision"--> v6 v7 --"p:P570"--> a6 a6 --"p:statement/value/P570"--> a5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end