query-a0ef825b1d0aa19b05d855088a2cf49e
Rear Admiral of the Squadron issue SELECT DISTINCT ?person ?personLabel ?givenLabel ?familyLabel ?timeVice ?timeRear ?timeCaptain ?timeDeath ?threeID WHERE { # restrict to known case of Paul Minchin # BIND (wd:Q75707296 AS ?person) . # restrict to known case of Isaac Coffin # BIND (wd:Q7527341 AS ?person) . VALUES ?person {wd:Q75707296 wd:Q7527341 wd:Q75245560}
# Human ?person wdt:P31 wd:Q5 .
# branch of service is Royal Navy ?person wdt:P241 wd:Q172771 .
optional { # given name ?person wdt:P735 ?given . }
optional { # family name ?person wdt:P734 ?family . }
optional { # Three Decks person ID ?person wdt:P7389 ?threeID . }
# There should only be one date for captain (or post captain) optional { ?person p:P410 ?stmtCaptain . ?stmtCaptain ps:P410/wdt:P279* wd:Q5036514 . ?stmtCaptain pq:P580 ?timeCaptain . }
# There may be several dates for rear admiral optional { # ?person p:P410 ?stmtRear . # ?stmtRear ps:P410/wdt:P279 wd:Q15615347 . # ?stmtRear pq:P580 ?timeRear . SELECT ?person (MIN(?dRear) AS ?timeRear) WHERE { ?person p:P410 ?stmtRear . ?stmtRear ps:P410/wdt:P279 wd:Q15615347 . ?stmtRear pq:P580 ?dRear . } GROUP BY ?person }
# There may be several dates for vice admiral optional { SELECT ?person (MIN(?dVice) AS ?timeVice) WHERE { ?person p:P410 ?stmtVice . ?stmtVice ps:P410/wdt:P279* wd:Q4902790 . ?stmtVice pq:P580 ?dVice . } GROUP BY ?person }
optional { ?person wdt:P570 ?timeDeath . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } } ORDER BY ?timeDeath
Use at
- https://query.wikidata.org/sparql
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#>
# Rear Admiral of the Squadron issue
SELECT DISTINCT ?person ?personLabel ?givenLabel ?familyLabel ?timeVice ?timeRear ?timeCaptain ?timeDeath ?threeID WHERE {
# restrict to known case of Paul Minchin
# BIND (wd:Q75707296 AS ?person) .
# restrict to known case of Isaac Coffin
# BIND (wd:Q7527341 AS ?person) .
VALUES ?person {wd:Q75707296 wd:Q7527341 wd:Q75245560}
# Human
?person wdt:P31 wd:Q5 .
# branch of service is Royal Navy
?person wdt:P241 wd:Q172771 .
optional {
# given name
?person wdt:P735 ?given .
}
optional {
# family name
?person wdt:P734 ?family .
}
optional {
# Three Decks person ID
?person wdt:P7389 ?threeID .
}
# There should only be one date for captain (or post captain)
optional {
?person p:P410 ?stmtCaptain .
?stmtCaptain ps:P410/wdt:P279* wd:Q5036514 .
?stmtCaptain pq:P580 ?timeCaptain .
}
# There may be several dates for rear admiral
optional {
# ?person p:P410 ?stmtRear .
# ?stmtRear ps:P410/wdt:P279* wd:Q15615347 .
# ?stmtRear pq:P580 ?timeRear .
SELECT ?person (MIN(?dRear) AS ?timeRear) WHERE {
?person p:P410 ?stmtRear .
?stmtRear ps:P410/wdt:P279* wd:Q15615347 .
?stmtRear pq:P580 ?dRear .
} GROUP BY ?person
}
# There may be several dates for vice admiral
optional {
SELECT ?person (MIN(?dVice) AS ?timeVice) WHERE {
?person p:P410 ?stmtVice .
?stmtVice ps:P410/wdt:P279* wd:Q4902790 .
?stmtVice pq:P580 ?dVice .
} GROUP BY ?person
}
optional {
?person wdt:P570 ?timeDeath .
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
ORDER BY ?timeDeath