query-6a377799987f5a76dd151a26ba4cd847

rq turtle/ttl

What do you think about adding of this query to examples?

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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?person ?personLabel ?birthDate ?earliestDate ?latestDate WHERE {
  ?person wdt:P31 wd:Q5.
  ?person wdt:P27 wd:Q170072.
  ?person p:P569 ?birthStatement.
  ?birthStatement ps:P569 ?birthDate.
  OPTIONAL { ?birthStatement pq:P1319 ?earliestDate. }
  OPTIONAL { ?birthStatement pq:P1326 ?latestDate. }
  FILTER((YEAR(?birthDate) = 1605) ||
         (?earliestDate <= "1605-01-01T00:00:00Z"^^xsd:dateTime && ?latestDate >= "1605-12-31T23:59:59Z"^^xsd:dateTime))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ?birthDate

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?birthDate"):::projected v5("?birthStatement") v2("?earliestDate"):::projected v3("?latestDate"):::projected v4("?person"):::projected c7(["wd:Q170072"]):::iri c13(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri c15(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["(year-from-dateTime(?birthDate) = '1605^^xsd:integer' || ?earliestDate <= '1605-01-01T00:00:00Z^^xsd:dateTime'?latestDate >= '1605-12-31T23:59:59Z^^xsd:dateTime')"]] f0 --> v1 f0 --> v2 f0 --> v3 v4 --"p:direct/P31"--> c5 v4 --"p:direct/P27"--> c7 v4 --"p:P569"--> v5 v5 --"p:statement/P569"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:qualifier/P1319".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."p:qualifier/P1326".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end