query-398dc0ff0013486e39c1a06166d6baa8

rq turtle/ttl

retired rear admirals SELECT ?rear ?rearLabel ?dateRear ?dateDeath WHERE { # BIND ("1769-01-01"^^xsd:dateTime as ?dateReport) . BIND ("1812-01-01"^^xsd:dateTime as ?dateReport) .

# a human ?rear wdt:P31 wd:Q5 .

# in the royal Navy ?rear wdt:P241 wd:Q172771 .

# with the rank of superannuated rear admiral ?rear p:P410 ?stmtRear. ?stmtRear ps:P410 wd:Q125940783 . ?stmtRear pq:P580 ?dateRear .

# promoted before the report date FILTER (?dateRear <= ?dateReport) .

?rear wdt:P570 ?dateDeath .

# still alive at report date FILTER (?dateDeath >= ?dateReport) .

SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ?dateRear

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#>
# retired rear admirals
SELECT ?rear ?rearLabel ?dateRear ?dateDeath WHERE {
  # BIND ("1769-01-01"^^xsd:date as ?dateReport) .
  BIND ("1812-01-01"^^xsd:date as ?dateReport) .

  # a human
  ?rear wdt:P31 wd:Q5 .

  # in the royal Navy
  ?rear wdt:P241 wd:Q172771 .

  # with the rank of superannuated rear admiral
  ?rear p:P410 ?stmtRear.
  ?stmtRear ps:P410 wd:Q125940783 .
  ?stmtRear pq:P580 ?dateRear .

  # promoted before the report date
  FILTER (?dateRear <= ?dateReport) .

  ?rear wdt:P570 ?dateDeath .

  # still alive at report date
  FILTER (?dateDeath >= ?dateReport) .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?dateRear

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?dateDeath"):::projected v1("?dateRear"):::projected v4("?dateReport") v4("?rear"):::projected v5("?stmtRear") c13(["en"]):::literal c7(["wd:Q125940783"]):::iri c11(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c4(["wd:Q172771"]):::iri f0[["?dateDeath >= ?dateReport"]] f0 --> v2 f0 --> v4 f1[["?dateRear <= ?dateReport"]] f1 --> v1 f1 --> v4 bind2[/"'1812-01-01^^xsd:date'"/] bind2 --as--o v4 v4 --"p:direct/P31"--> c2 v4 --"p:direct/P241"--> c4 v4 --"p:P410"--> v5 v5 --"p:statement/P410"--> c7 v5 --"p:qualifier/P580"--> v1 v4 --"p:direct/P570"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end