SPARQL

Need to learn how to...

Collapse identical items

See Help:Merge.

Resolve part issues

Correct errors

The en.description for dusk is the end of astronomical twilight. It has the dusks (and presumably the dawns) be instants the same as sunrise and sunset. So meeting somebody at dawn is meeting them at first light (not anytime before sunrise). So dusks are moments when a twilight begins or ends. Twilights are time intervals. Google translate has German using twilight for dusk and dawn; dusk transliterates to evening twilight and dawn is morning twilight.

wikt:dawn is also troubling. It says sunrise is a synonym, dusk is an wikt:antonym, and twilight is a wikt:hypernym (less specific term). It says the civil dawn, astronomical dawn, and nautical dawn are wikt:hyponyms (more specific term). Sunrise is an instant near the end of civil twilight; civil dawn is the instant that marks the start of civil twilight. So dawn is start of morning twilight; dusk is the end of evening twilight. Common usage makes dusk and dawn intervals.

Royal Navy Flag List

Background

In the 1700s, the Royal Navy advancement to flag rank was by date of rank as captain (there were some exceptions).

Periodically, the Admiralty would publish a book that would list its officers. The book may have sections:

  • The flag officer list (admirals broken down by rank and squadron)
  • The superannuated admirals list (retired admirals)
  • The superannuated or retired captains list
  • The captains list
  • The lieutenants list

(The Admiralty also published other lists such as the surgeons list.)

The present goal is reproducing the flag officer list as a function of date around the time of Horatio Nelson. The task involves making a suitable query and finding or adding the person to WikiData. Once the person is in the database, make or improve claims about his rank, the date of rank, and the date of death. Those tasks involve challenges.

Some sources

Calendar

The calendar switch may be an issue. The Gregorian calendar switch was in October 1582, but it was not adopted by all countries. Scotland switched in 1600, England switched in September 1752, and Russia in January 1918.

For example, George Washington was born 11 February 1731 Julian, but that is 22 February 1732 Gregorian (extra year due to Great Britain incrementing year on 25 March instead of 1 January; see New Style below).

That may impact the flag list. If a date is after 1752, then it is clearly Gregorian. If the date is before the switch, then was the date left as Julian or was it corrected? If the date was left as Julian, was the year corrected for dates 1 January to 25 March?

Three Decks has some involved date notions.

  • https://threedecks.org/index.php?display_type=show_crewman&id=179
    <span title="27th January 1663 (NS 6th February 1664 (1664/02/16 NS))">27.1.1663/64</span>
    <span title="23rd February 1684 (NS 5th March 1685 (1685/03/15 NS))">23.2.1684/85</span>
    <span title="15th April 1687 (NS 25th April 1687 (1687/05/05 NS))">15.4.1687</span>
    <span title="1st March 1702 (NS 12th March 1703 (1703/03/23 NS))">1.3.1702/3</span>
    <span title="9th January 1707 (NS 20th January 1708 (1708/01/31 NS))">9.1.1707/8</span>
    <span title="14th February 1716 (NS 25th February 1717 (1717/03/08 NS))">14.2.1716/17</span>

The displayed date is the Julian date with a possible year increment (e.g., 14.2.1716/17). The tooltip gives the old-style date with a new style (Gregorian) date in parens. A second level of parens gives a doubly-incremented Gregorian date. Is that just for convenience? If one sees the second-level date, then it means a Gregorian date was entered as a Julian date?

Date Display

Dates on Three Decks are displayed using the format of DD.MM.YYYY (YYYY=Century+Year, MM=Month and DD=day of month). For example the 1st of February 1687 is displayed as '1.2.1687'. Where incomplete date information is available the display may be incomplete, e.g. '2.1687' means at sometime during February 1687, and '1687' means at sometime during 1687. Efforts have been made to show events with incomplete dates in chronological order, but this should not be relied on as absolutely accurate.

Julian calendar dates between 1st January and the Julian new year of 25th March, will additionally display a conversion to a Gregorian date equivalent E.g. Dates within February 1702 in the Julian calendar will be displayed as DD.MM.YYJJ/GG where JJ is the Julian year and GG the Gregorian. E.g. 1st February 1702 will be displayed as 1.2.1702/03. The Gregorian equivalent would be 12.2.1703.

All dates include a tool tip showing a text version of the date, with a Gregorian equivalent appended (indicate by the prefix NS) if appropriate. E.g. 1.2.1702/03 will have a tool tip of "1st February 1702 (NS 12th February 1703)".

Gregorian Date RangeJulian Date RangeDifference
15 October 1582 to 28 February 1700From 5 October 1582 to 18 February 170010 days
1 March 1700 to 28 February 1800From 19 February 1700 to 17 February 180011 days
1 March 1800 to 28 February 1900From 18 February 1800 to 16 February 190012 days
1 March 1900 to 28 February 2100From 17 February 1900 to 15 February 210013 days

The calendar date issue is more complicated because Wikidata does not have an old-style calendar. Consider Matthew Barton

who became a captain on OS 7 Feb 1746 Julian → 18 Feb 1747 Gregorian. However, Wikidata converts 7 Feb 1746 Julian to 18 Feb 1746 Gregorian. For dates, if they are entered as Julian, then they must use the incremented (i.e. Gregorian) year if present.

The calendar is explained at en:Calendar (New Style) Act 1750. That is why Three Decks uses NS.

Titles

The flag list uses titles.

Hierarchy (guess) See en:Landed gentry, en:Social class in the United Kingdom, en:Peerage, en:Nobility, en:Royal family

Properties

Promotion

In general, seniority is set by the date one became a captain.

There are some twists. Royalty got fast tracked. That means sorting strictly by captain date does not work.

There was also a strange case. I think the captain was retired but then brought back. That delayed his promotion to rear admiral, but the King set his seniority to the date he became a captain. Consequently, he will will not be on the flag list until he was unretired. His position in the admiral ranks is set by the date of his captaincy. That means sorting by the date of becoming a RA messes things up.

This reference describes strict promotion, what the admiralty did with infirm captains, and the "yellow" squadron. In 1747, a captain could be promoted to "Rear-Admiral without distinction of squadron".

Significantly, it describes distribution at particular times.

In 1769,

  • honorary Vice Admiral of Great Britain, Admiral of the Fleet Edward Hawke, 1st Baron Hawke (1705-1781), appointed 1765
  • (1) Admiral of the Fleet: Edward Hawke, 1st Baron Hawke (1705-1781) 15 January 1768
  • (7) Admirals
    • (3) of the White
    • (4) of the Blue
  • (10) Vice Admirals
    • (3) of the Red
    • (3) of the White
    • (4) of the Blue
  • (11) Rear Admirals (the source says 11 rear admirals and breaks them down as 4 Red + 4 White + 5 Blue, which totals 13 rear admirals!
    • (4) of the Red
    • (4) of the White
    • (5) of the Blue
  • (22) Superannuated Rear Admirals (were these never advanced through the squadrons?)

In 1812 (see also https://babel.hathitrust.org/cgi/pt?id=nyp.33433008433462&view=1up&seq=12),

  • First Lord of the Admiralty, Charles Philip Yorke (1764-1834) and Robert Dundas, 2nd Viscount Melville (1771-1851)
  • (1) Admiral of the Fleet: HRH the Duke of Clarence (1765-1837), appointed 1811
  • (61) Admirals
    • (21) of the Red (created in 1805)
    • (20) of the White
    • (20) of the Blue
  • (65) Vice Admirals
    • (22) of the Red
    • (19) of the White
    • (24) of the Blue
  • (64) Rear Admirals
    • (19) of the Red
    • (17) of the White
    • (24) of the Blue
  • (31) Superannuated Rear Admirals

Superannuated rear admirals

# 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
Try it!

Royal Navy rank, military branch, and occupation

A rank specific to the Royal Navy implies a military branch. Also check for occupation, branch, and dates.

# rank implies branch
SELECT DISTINCT ?person ?personLabel ?occupationLabel ?branchLabel ?birthDate ?rankLabel ?rankDate ?threeID
{ 
  # military rank -- should have a start time

  # select a rank

  # admiral of the fleet wd:Q842486 .
  # admiral of the fleet (Royal Navy) wd:Q2501631
  BIND (wd:Q2501631 AS ?rank) .

  # admiral
  # admiral (Royal Navy) wd:Q2916006
  # BIND (wd:Q2916006 AS ?rank) .

  # vice admiral wd:Q214443 .
  # vice admiral (Royal Navy) wd:Q4902790
  # BIND (wd:Q4902790 AS ?rank) .

  # rear admiral wd:Q156945
  # rear admiral (Royal Navy) wd:Q15615347
  # BIND (wd:Q15615347 AS ?rank) .

  # captain
  # captain (Royal Navy) wd:Q5036514
  # BIND (wd:Q5036514 AS ?rank) .

  # flag officer (watch out: rear admiral is an instance of military rank) wd:Q977459 .

  # human instead of fictional
  ?person wdt:P31 wd:Q5 .
  
  # person has that rank
  ?person p:P410 ?stmtRank .
  ?stmtRank ps:P410 ?rank .
  optional {
    # date of rank if known
    ?stmtRank pq:P580 ?rankDate .
  }
  
  # person in Royal Navy
  # FILTER not exists {?person wdt:P241 wd:Q172771 .}.
  optional {
    ?person wdt:P241 ?branch .
  }
  
  # occupation is naval officer
  # FILTER not exists {?person wdt:P106 wd:Q10669499 .}.
  optional {
    # occupation
    ?person wdt:P106 ?occupation .
  }

  # get the Three Decks people Id if available
  optional {
    ?person wdt:P7389 ?threeID .
  } .

  # order by birthdate
  optional {
    ?person wdt:P569 ?birthDate .
  }

  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .} .
  
} ORDER BY ?birthDate
Try it!

Find a person

# Find a person
SELECT ?person ?personLabel ?timeCaptain ?timeDeath ?threeID WHERE {
  BIND("1800-12-01"^^xsd:dateTime AS ?dateDeath) .
  ?person wdt:P31 wd:Q5 .
  
  # ?person wdt:P570 ?dateDeath .
  
  # Three Decks person ID
  ?person wdt:P7389 ?threeID .

  # ?person wdt:P410 ?rank .
  
  optional {
    ?person wdt:P570 ?timeDeath .
    } .
  
  optional {
      ?person p:P410 ?stmtCaptain .
      ?stmtCaptain ps:P410 wd:Q5036514 .
      ?stmtCaptain pq:P580 ?timeCaptain .
    } .
  
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY ?timeDeath
Try it!

Find a person by date

# Find a person by matching a date
SELECT DISTINCT ?person ?personLabel ?timeDeath ?threeID
{ 
  # set the relevant date
  BIND ("1816-02-16"^^xsd:dateTime AS ?timeDeath) .
  
  # human instead of fictional
  ?person wdt:P31 wd:Q5 .
  
  # match the date of death
  ?person wdt:P570 ?timeDeath .

  optional {
    # Three Decks ID
    ?person wdt:P7389 ?threeID .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .} .
  
} ORDER BY ?timeDeath
Try it!

Find a person by name

# Find a person by name
SELECT DISTINCT ?person ?personLabel ?occupationLabel ?rankLabel ?dateBirth ?dateDeath ?peerID ?threeID
{ 
  # human instead of fictional
  ?person wdt:P31 wd:Q5 .
  
  # family name Taylor
  # ?person wdt:P734 wd:Q15080511 .
  # family name West
  # ?person wdt:P734 wd:Q2564123 .
  # family name Deans
  # ?person wdt:P734 wd:Q37431737 .
  # family name Brenton
  # ?person wdt:P734 wd:Q21492004 .
  # family name Bowen
  # ?person wdt:P734 wd:Q2688708 .
  # family name Wickey
  # ?person wdt:P734 wd:Q37268547 .
  # family name Kempthorne
  # ?person wdt:P734 wd:Q6387140 .
  # family name Brine
  # ?person wdt:P734 wd:Q16860457 .
  # family name Douglas
  # ?person wdt:P734 wd:Q2677358 .
  # family name Cromwell
  # ?person wdt:P734 wd:Q16865886 .
  # family name Edwards
  # ?person wdt:P734 wd:Q2691159 .
  # family name Fergusson
  # ?person wdt:P734 wd:Q29708964 .
  # family name Ferguson
  # ?person wdt:P734 wd:Q2694490 .
  # family name Thomas
  # ?person wdt:P734 wd:Q1413324 .
  # family name Wells
  # ?person wdt:P734 wd:Q13583397 .
  # family name MacDougall
  # ?person wdt:P734 wd:Q3841920 .
  # family name McDougal
  # ?person wdt:P734 wd:Q37041812 .
  # family name McDougall
  # ?person wdt:P734 wd:Q47763071 .
  # family name McDouall
  # ?person wdt:P734 wd:Q77025162 .
  # family name Kelly
  # ?person wdt:P734 wd:Q928249 .
  # family name Alms
  # ?person wdt:P734 wd:Q37069035 .
  # family name Peyton
  # ?person wdt:P734 wd:Q37492774 .
  # family name Bowater
  # ?person wdt:P734 wd:Q25114229 .
  # family name Brunton
  # ?person wdt:P734 wd:Q21507016 .
  # family name Manley
  # ?person wdt:P734 wd:Q21488998 .
  # family name Sutton
  # ?person wdt:P734 wd:Q16884069 .
  # family name Murray
  # ?person wdt:P734 wd:Q1308329 .
  # family name Palmer
  # ?person wdt:P734 wd:Q568872 .
  # family name Osborn
  # ?person wdt:P734 wd:Q16880804 .
  # family name Faulknor
  # ?person wdt:P734 wd:Q37035675 .
  # family name Nicholls
  # ?person wdt:P734 wd:Q11790730 .
  # family name Graves
  # ?person wdt:P734 wd:Q13553605 .
  # family name Pender
  # ?person wdt:P734 wd:Q21502151 .
  # family name Lumsdaine
  ?person wdt:P734 wd:Q56539303 .
          
  # given name Thomas
  # ?person wdt:P735 wd:Q16428906 .
  # given name Robert
  # ?person wdt:P735 wd:Q4927937 .
  # given name Jahleel
  # ?person wdt:P735 wd:Q21079782 .
  # given name George
  # ?person wdt:P735 wd:Q15921732 .
  # given name John
  # ?person wdt:P735 wd:Q4925477 .
  # given name James
  # ?person wdt:P735 wd:Q677191 .
  # given name Henry
  # ?person wdt:P735 wd:Q1158477 .
  # given name Sampson
  # ?person wdt:P735 wd:Q18324386 .
  # given name William
  # ?person wdt:P735 wd:Q12344159 .
  # given name Edward
  # ?person wdt:P735 wd:Q278835 .
  # given name Nathan
  # ?person wdt:P735 wd:Q11167678 .
  # given name Samuel
  # ?person wdt:P735 wd:Q629347 .
  # given name Jonathan
  # ?person wdt:P735 wd:Q1158394 .
  # given name David
  # ?person wdt:P735 wd:Q18057751 .
  # given name Francis
  ?person wdt:P735 wd:Q1441346 .
  
  OPTIONAL {
    # birth date
    ?person wdt:P569 ?dateBirth .
  }
  
  OPTIONAL {
    # death date
    ?person wdt:P570 ?dateDeath .
  }

  OPTIONAL {
    # occupation
    ?person wdt:P106 ?occupation .
  }
  
  OPTIONAL {
    # military rank
    ?person wdt:P410 ?rank .
  }
  
  # person in Royal Navy
  # ?person wdt:P241 wd:Q172771 .
  
  OPTIONAL {
    ?person wdt:P7389 ?threeID .
  }
  
  OPTIONAL {
    ?person wdt:P4638 ?peerID .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER  BY ?dateBirth
Try it!

Bogus occupation

# Find a bad occupation
SELECT ?person ?personLabel ?givenLabel ?familyLabel ?timeCaptain ?timeDeath ?threeID WHERE {

  # Human
  ?person wdt:P31 wd:Q5 .

  # branch of service is Royal Navy
  ?person wdt:P241 wd:Q172771 .
  
  # for officers (not sailors) want to see occupation is a naval officer
  # occupation naval officer
  # FILTER not exists { ?person wdt:P106 wd:Q10669499 .}
  
  # occupation Q47064 military personnel is not an occupation
  # ?person wdt:P106 wd:Q47064 .

  # occupation Q189290 military officer is too generic
  # ?person wdt:P106 wd:Q189290 .

  # admiral of the fleet (not RN)
  # ?person wdt:P410 wd:Q842486 .
  # admiral (not RN)
  ?person wdt:P410 wd:Q132851 .
  # vice admiral (not RN)
  # ?person wdt:P410 wd:Q214443 .
  # rear admiral (not RN)
  # ?person wdt:P410 wd:Q156945 .
  # captain (not RN)
  # ?person wdt:P410 wd:Q163500 .

  optional {
    # given name
    ?person wdt:P735 ?given .
  }

  optional {
    # family name
    ?person wdt:P734 ?family .
  }
  
  optional {
    # Three Decks person ID
    ?person wdt:P7389 ?threeID .
  }

  optional {
    ?person p:P410 ?stmtCaptain .
    ?stmtCaptain ps:P410 wd:Q5036514 .
    ?stmtCaptain pq:P580 ?timeCaptain .
  }
  
  optional {
    ?person wdt:P570 ?timeDeath .
  }
  
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY ?timeDeath
Try it!

Three Decks list

# Three Decks list for the Royal Navy
SELECT DISTINCT ?person ?personLabel ?givenLabel ?familyLabel ?threeID
{ 
  # human instead of fictional
  ?person wdt:P31 wd:Q5 .
  
  # person in Royal Navy
  ?person wdt:P241 wd:Q172771 .

  # person has a Three Decks identifier
  ?person wdt:P7389 ?threeID .

  OPTIONAL {
    # given name
    ?person wdt:P735 ?given .
  }
  
  OPTIONAL {
    # family name
    ?person wdt:P734 ?family .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .} .
  
} ORDER BY ?threeID
Try it!

List of Admirals

en:List of Royal Navy admirals (1707–current) (which would not include vice admirals such as Nelson).

# Admiral list for the Royal Navy
SELECT DISTINCT ?timeAdmiral ?person ?personLabel ?timeBirth ?timeDeath ?fleet ?threeID
{ 
  # allow the report to work for different years
  BIND ("1707-01-01"^^xsd:dateTime AS ?timeReport) .
  
  # person in Royal Navy
  ?person wdt:P241 wd:Q172771 .
  
  # human instead of fictional
  ?person wdt:P31 wd:Q5 .
  
  # ?person wdt:P410 ?rank .
  # ?rank wdt:P279 wd:Q977459 .
  # admiral of the fleet (of the Royal Navy) subclass of admiral of the fleet Q842486
  # ?person wdt:P410 wd:Q2501631 .
  # use P279 to pick up the subclass
  
  # military rank -- should have a start time
  # admiral of the fleet wd:Q842486 .
  # admiral of the fleet (Royal Navy) wd:Q2501631
  # admiral wd:Q132851
  # admiral (Royal Navy) wd:Q2916006
  
  # get statements about the person's rank
  optional {
      ?person p:P410 ?stmtFleet .
      ?stmtFleet ps:P410 wd:Q2501631 .
      BIND(1 AS ?fleet) .
    }
  
  ?person p:P410 ?stmtAdmiral .
  ?stmtAdmiral ps:P410 wd:Q2916006 .
  optional {
    ?stmtAdmiral pq:P580 ?timeAdmiral .
  }
  
  optional {
    ?person wdt:P7389 ?threeID .
    } .
  
  # get time  of death (some have multiple death dates)
  ?person wdt:P570 ?timeDeath .
  ?person wdt:P569 ?timeBirth .

  filter ( ?timeReport < ?timeDeath) .
  
  filter ( ?timeBirth < "1800-01-01"^^xsd:dateTime ).

  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .} .
  
} ORDER BY ?timeAdmiral ?timeDeath
Try it!

List of vice admirals

9 July 1739

Edward Vernon Edward Vernon (Q713145) is a difficult case.

Promoted from captain to vice admiral in 1739?

Also checkered admiral: King dismissed him from the service on 11 April 1746.

1769 List

Reference above has 1 admiral of the fleet (Edward Hawke, Edward Hawke, 1st Baron Hawke (Q333560)), 7 admirals, 10 vice admirals, 11 rear admirals, and 22 superannuated. Query gets 1 admiral of the fleet, 8 admirals, 8 vice admirals, and 9 rear admirals.

Do not have the source document. Try reconstructing from the Wikipedia admirals list.

Admirals... There's one who resigned!

  1. Vere Beauclerk, 1st Baron Vere (Q135111) Vere Beauclerk (predates Hawke)
  2. Henry Osborn (Q3132983) Henry Osborn (predates Hawke!)
  3. Thomas Griffin (Q7790205) Thomas Griffin (predates Hawke!)
  4. Sir Charles Knowles, 1st Baronet (Q1065198) Charles Knowles
  5. John Forbes (Q3181515) John Forbes
  6. George Townshend (Q5545292) George Townshend
  7. George Pocock (Q472599) George Pocock (resigned!)
  8. Francis Holburne (Q3081493) Francis Holburne

Vice Admirals...

  1. Sir Thomas Frankland, 5th Baronet (Q7529123) Thomas Frankland
  2. Harry Powlett, 6th Duke of Bolton (Q7585528) Powlett
  3. Thomas Brodrick (Q7787922) Thomas Broderick/Brodrick?
  4. Charles Hardy (Q2959316) Charles Hardy
  5. George Carnegie, 6th Earl of Northesk (Q3760458) George Carnegie
  6. Charles Saunders (Q534372) Charles Saunders
  7. Thomas Pye (Q7793322) Thomas Pye (promotion delayed)
  8. Sir Samuel Cornish, 1st Baronet (Q7528936) Samuel Cornish
  9. Sir Francis Geary, 1st Baronet (Q7526707) Francis Geary
  10. George Brydges Rodney, 1st Baron Rodney (Q332426) George Brydges Rodney

Rear Admirals... (source is inconsistent: says 11 but also 4 Red, 4 White, and 5 Blue = 13)

  1. Sir William Burnaby, 1st Baronet (Q11802830) William Burnaby
  2. James Young (Q15982585) James Young
  3. Peircy Brett (Q7160953) Peircy Brett
  4. Sir John Moore, 1st Baronet (Q3182111) John Moore
  5. Alexander Colville, 7th Lord Colville of Culross (Q2833095) Alexander, Lord Colville?
    No evidence of being a vice admiral despite en.Wiki
    promotion to vice admiral would be on 18 Oct 1770 but died 21 May 1770
  6. Sir James Douglas, 1st Baronet (Q7527404) James Douglas (check order!)
  7. John Bentley (Q18530112) John Bentley
  8. George Edgcumbe, 1st Earl of Mount Edgcumbe (Q3101548) Edgcumbe
  9. Samuel Graves (Q320800) Samuel Graves (RA 21 Oct 1762, VA 24 Oct 1770)
  10. William Parry (Q21209228) William Parry
  11. Augustus Keppel, 1st Viscount Keppel (Q332972) Augustus Keppel
  12. John Amherst (Q6218898) John Amherst (RA 23 May 1765, VA 24 Oct 1770, A 29 Jan 1778)
  13. rear admiral who died before becoming an admiral
    or Prince Henry, Duke of Cumberland and Strathearn (Q699738) Prince Henry (RA 20 March 1769 - but we lost vice admiral Brodrick)

Superannuated

  1. Robert Long
  2. Charles Drummond

Rear Admirals after 1770 found from a Three Decks search

January 1784 List

  Done List is 55. Query gets 55 (but adds Pocock and does not have Parker). Need to add 4.

Forbes is Admiral of the Fleet.
Pocock should not be on the list.
Douglas and Young are reversed
Montagu and Buckle are reversed
Hyde Parker should not be on the list

January 1790 List

Nelson was 169th on the Captains List.

  Done List has 49 Admirals. Query gets 51 (Pocock!). Ah, the book miscounts by calling # 26 just # 25; there are 50 Admirals.

John Laforey (Q6243805) Laforey got special dispensation to be # 40. How should that be handled? Captain's date sorts. Promoted out of the yellow?

January 1791 List

  Done List has 56 entries. Query gets 57 (Pocock!).

From 1790 list, need to add

January 1792 List

Nelson was 140th on the Captains List.

  Done There are 54 entries on 1792 list. Query gets 55 (Pocock!).

August 1795 List

Nelson is 7th on the captains' list.

  Done Query produces 106 entries. List has 106 entries.

January 1798 List

Nelson is RA of the Blue at 101.

  Done Flag list has 104 entries. Query now gives 104.

Gidoin and Gayton are not on the 1798 list. Need to find two more:

Superannuated (discovered)

January 1799 list

Nelson is RA of the Blue at 96.

  Done Flag list has 99 entries. Query has 98 entries.

Make the query use 1 November 1798 and it works.

So missing one entry? Checking whole list...

January 1802 List

The vice admirals end at 83 (last is Nelson). The rear admirals end at 138 (last is Sir James Saumarez 1 January 1801).

List is 138. Query gives 138.

January 1802 List
Number Name Admiral Vice Admiral Rear Admiral Captain
85 Sir Charles Cotton, 5th Baronet (Q2958797)
86* John Thomas (Q125917039) John Thomas
https://morethannelson.com/officer/john-thomas/
87* James Brine (Q125909865) James Brine
https://morethannelson.com/officer/james-brine/
son en:Augustus Brine
88 John Pakenham (Q21182813)
93 Thomas Pakenham (Q7792981)
94* Robert Deans (Q125880042) Robert Deans
95 Cuthbert Collingwood, 1st Baron Collingwood (Q335267) Cuthbert Collingwood
96 James Hawkins-Whitshed (Q15375977) James Hawkins Whitshed
97* Arthur Kempe (Q125910292) Arthur Kempe
98 Smith Child (Q7545091)
99 Charles FitzGerald, 1st Baron Lecale (Q5077685)
100* Thomas Taylor (Q125917300) Thomas Taylor
https://morethannelson.com/officer/thomas-taylor/
estimated date of death
father Thomas Taylor Three Decks 1256
101 Sir John Duckworth, 1st Baronet (Q706762)
105 George Cranfield Berkeley (Q4084923) George Berkeley
106* Thomas West (Q125917448) Thomas West
estimated date of death
107* James Douglas (Q125931239) James Douglas
108 Peter Aplin (Q7172547)
109* Henry Savage (Q125879429) Henry Savage
110 Bartholomew Rowley (Q4865275)
111 Sir Richard Bickerton, 2nd Baronet (Q15994303)
112* George Bowen (Q125864591) George Bowen
113 Robert Montagu (Q76328954)
114* John Fergusson (Q125930967) John Fergusson (s or ss)
https://morethannelson.com/officer/john-ferguson/
115 Edward Edwards (Q966744) Edward Edwards
116 Sir John Borlase Warren, 1st Baronet (Q1750346)
117* Edward Tyrrell Smith (Q109942224) Edward Tyrrel Smith
https://morethannelson.com/officer/edward-tyrrell-smith/
118 Thomas Graves (Q286462)
122 Sir Henry Edwyn Stanhope, 1st Baronet (Q18716109) Henry Edwin Stanhope
123* Robert McDouall (Q125930540) Robert McDouall (spelling? McDougall)
124 Billy Douglas (Q107095174) Billy Douglas
125* John Wickey (Q125864767) John Wickey
https://en.m.wikisource.org/wiki/Page:Royal_Naval_Biography_Marshall_v1p1.djvu/184
126 John Inglis (Q56726520) John Inglis
127* John Fish (Q26211708) John Fish
https://en.wikisource.org/wiki/Royal_Naval_Biography/Fish,_John
128* Jahleel Brenton (Q108293459) Jahleel Brenton
son: Sir Jahleel Brenton, 1st Baronet (Q7527359)
129 John Knight (Q6243316) John Knight
130 Edward Thornbrough (Q5345613)
131* James Kempthorne (Q125864881) James Kempthorne
132* Sampson Edwards (Q107618705) Sampson Edwards
https://morethannelson.com/officer/sampson-edwards/
133 George Campbell (Q5537640) George Campbell
134* Henry Cromwell (Q125879778) Henry Cromwell
AKA Henry Frankland (see 1812 list)
135 Arthur Phillip (Q311548) Arthur Phillip
136 William George Fairfax (Q8009784)
137 Thomas Totty (Q7794515) Thomas Totty
138 James Saumarez, 1st Baron de Saumarez (Q335837)

July 1803 List

List has 126 (last is mislabled 125 due to an early miscount)

  • 50 50. John Henry
  • 51 51. Richard Rodney Bligh
  • 52 52. Alexander Graeme
  • 53 53. George Keppel
  • 54 54. Robert Biggs
  • 55 55. Francis Parry
  • 56 55! Isaac Prescott (SHOULD BE 56)
  • 126 125! James Saumarez

Query gets 126.

  Done except some same dates of rank are out order....

Last is James Saumarez, so there were no new additions but (138-126)=12 died.

July 1804 List

Nelson is VAW at 70.

Flag list is 150 long.

Query is now 148.

  • We lost 2 previous admirals. These two are not on the list because they died in 1804.
    Joseph Peyton Joseph Peyton (Q27894126) d. 1804; added more accurate value of 27 Sep 1804.
    George Keppel George Keppel (Q106828217) d. 1804
  • (another previous admiral died between May and July, but he is not on the flag list)
  • 121 James Saumarez (so 5 previous admirals in the flag list died).

Query was 104 long but includes new admirals #125 and #139. Therefore Saumarez would be 102 on my list, so I'm missing 19 earlier admirals.

With new additions it would be 104+37 = 141. That is only missing 9 earlier admirals. So of the missing 18 1802 additions, only 9 are left?

Need to add (39-2):

January 1807 List

List has 159.

Query now gets 158.

Thomas Louis was 150 but now 139 (so 11 died). Twenty were added.

We have another special case Charles Stirling: "Ranks according to Seniority as Captain by His Majesty's Order in Council"

Multivalue tests for colored squadrons

# 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
Try it!

January 1809 List

List has 176.

Query is 161.

With all additions, I will only get 169: that is 7 short. 3 died from Nov 1808 to 1 Jan 1808. 4 died from Jan 1808 to Jan 1809.

D'Auvergne is 147. So 29 added.

Have an extra John Trigge John Trigge (Q96085424)! Superannuated!

January 1812 List

Has list of 31 superannuated admirals.

List has 187. Thomas Bertie is 146.

Query 147

Here's a tough one: Robert Barlow (Q7341872). Superannuated in 1823. Promoted to admiral of the white in 1840.

Superannuated

  1. Sir Digby Dent Digby Dent (Q76184588)
  2. Samuel Thompson
  3. Thomas Shirley Thomas Shirley (Q75408260)
  4. Evelyn Sutton
  5. Alexander Scott
  6. William Duddington William Duddingston (Q97959458)?
  7. John Kendall
  8. Alexander Edgar
  9. David Graves
  10. Sir Chichester Fortescue Chichester Fortescue (Q5095997)?
  11. Alexander Christie
  12. Richard Graves Rear-Adm. Richard Graves (Q96083771)
  13. Charles Sandys
  14. John F. Fortescue
  15. William Chambers
  16. John Graves John Graves (Q75985506) should not be on list: died 6 May 1811.
  17. Isaac Smith Isaac Smith (Q6077130)
  18. David Stow
  19. Thomas Goldesbrough
  20. Joseph Peyton Joseph Peyton (Q76251599)
  21. William Heath William Heath (Q101209728)
  22. David Laird
  23. Abraham Guyot
  24. John Trigge John Trigge (Q96085424)
  25. James Kinneer
  26. James Dundas (Three Decks 5251)
  27. Lauchlan Hunter
  28. Nicholas Ingram
  29. Richard Willis
  30. Jeremiah Beale
  31. Henry Warre

1 January 1819

https://babel.hathitrust.org/cgi/pt?id=nyp.33433008432761&seq=13

List has 182.

93 Thomas Bertie (RA 28 Apr 1808) (last vice admiral of the white)
...
126 Thomas Wolley (last of 1812 flag list)
...
182 Edward Fellows. RA 4 Jun 1814.

There are 27 Superannuated Rear Admirals

16 Henry Warre
...
27 Richard Dacres (Q16230303). Richard Dacres. Later a vice admiral!

29 Superannuated or Retired Captains

more years

Find more years: https://catalog.hathitrust.org/Record/012313436

January 1831 List

https://babel.hathitrust.org/cgi/pt?id=mdp.39015073474838&view=1up&seq=9

More Stuff

There is the Blue-White-Red mess:

For example, see Charles Richardson (Q108087874).

SELECT ?person ?personLabel ?rank ?rankLabel WHERE {
  BIND(wd:Q24038804 AS ?rank) .
  ?person wdt:P31 wd:Q5 .

  ?person wdt:P410 ?rank .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
Try it!

Also the honorary mess Rear-Admiral of the United Kingdom (Q2995864), Vice Admiral of the United Kingdom (Q3556878), Lord High Admiral (Q16153574)

Also next lower rank (P3729) next higher rank (P3730)

There are problems with the underlying data.

# improper occupations
SELECT ?p ?pLabel ?w ?wLabel WHERE {
   wd:Q30 p:P6/ps:P6 ?p .
   ?p wdt:P26 ?w .
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
   }
 }
Try it!
SELECT ?person ?personLabel ?rankLabel WHERE
{
  # BIND (wd:Q214443 AS ?rank) .

  # real human
  ?person wdt:P31 wd:Q5 .

  # has an occupation
  ?person wdt:P106 ?rank .
  
  # occupation is a naval officer rank
  ?rank wdt:P31/wdt:P279* wd:Q4226220 .
  # occupation is a military rank
  # ?rank wdt:P31/wdt:P279* wd:Q56019 .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
Try it!
# Looking at ranks
SELECT ?rank ?rankLabel
{
  # this returns just 2: Chief of Joint Operations and rear admiral
  #?rank wdt:P31/wdt:P279* wd:Q977459 .
  #?rank wdt:P279* wd:Q977459 .
  
  # instance of military rank
  ?rank wdt:P31/wdt:P279* wd:Q56019 .
  # this part of the Royal Navy
  ?rank wdt:P361 wd:Q172771 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?rankLabel
Try it!

Flag list query

Should fix the post captain issue (a subclass of captain).

# Working on a flag list for the Royal Navy
SELECT DISTINCT ?person ?personLabel ?fleet ?timeAdmiral ?timeVice ?timeRear ?timeCaptain ?threeID
{ 
  # allow the report to work for different years
  BIND ("1769-01-01"^^xsd:dateTime AS ?timeReport) .
  
  # person in Royal Navy
  ?person wdt:P241 wd:Q172771 .
  
  # human instead of fictional
  ?person wdt:P31 wd:Q5 .
  
  # ?person wdt:P410 ?rank .
  # ?rank wdt:P279 wd:Q977459 .
  # admiral of the fleet (of the Royal Navy) subclass of admiral of the fleet Q842486
  # ?person wdt:P410 wd:Q2501631 .
  # use P279 to pick up the subclass
  
  # military rank -- should have a start time
  # admiral of the fleet wd:Q842486 .
  # admiral of the fleet (Royal Navy) wd:Q2501631
  # admiral
  # admiral (Royal Navy) wd:Q2916006
  # vice admiral wd:Q214443 .
  # vice admiral (Royal Navy) wd:Q4902790
  # rear admiral wd:Q156945
  # rear admiral (Royal Navy) wd:Q15615347
  # captain
  # captain (Royal Navy) wd:Q5036514
  # flag officer (watch out: rear admiral is an instance of military rank) wd:Q977459 .
  
  # get statements about the person's rank
  optional {
    ?person p:P410 ?stmtFleet .
    ?stmtFleet ps:P410 wd:Q2501631 .
    BIND(1 AS ?fleet) .
  }
  
  optional {
    ?person p:P410 ?stmtAdmiral .
    ?stmtAdmiral ps:P410 wd:Q2916006 .
    ?stmtAdmiral pq:P580 ?timeAdmiral .
  }
  
  optional {
    ?person p:P410 ?stmtVice .
    ?stmtVice ps:P410 wd:Q4902790 .
    ?stmtVice pq:P580 ?timeVice .
  }
  
  optional {
    # ?person p:P410 ?stmtRear .
    # ?stmtRear ps:P410 wd:Q15615347 .
    # ?stmtRear pq:P580 ?timeRear .
    #
    # use a SELECT to find the earliest date as a rear admiral
    SELECT ?person (MIN(?dRear) AS ?timeRear) WHERE {
      # there is a statement about the rank
      ?person p:P410 ?stmtRear .
      # that rank is a subclass of rear admiral
      ?stmtRear ps:P410/wdt:P279* wd:Q15615347 .
      # the rank has a date qualifier
      ?stmtRear pq:P580 ?dRear .
      # filter out superannuated rear admirals...
      filter not exists {?stmtRear ps:P410 wd:Q125940783 . }.
    } GROUP BY ?person
  }
  
  optional {
    # person has a rank
    ?person p:P410 ?stmtCaptain .
    # the rank is captain or a subclass of captain (i.e., captain or post-captain)
    ?stmtCaptain ps:P410/wdt:P279* wd:Q5036514 .
    # the statement has a start time
    ?stmtCaptain pq:P580 ?timeCaptain .
    # the statement is not deprecrated
    ?stmtCaptain wikibase:rank ?rank . FILTER(?rank != wikibase:DeprecatedRank) .
  }
  
  # Three Decks ID
  optional {
    ?person wdt:P7389 ?threeID .
  }
  
  # get time  of death (some have multiple death dates)
  ?person wdt:P570 ?timeDeath .
  filter ( ?timeReport <= ?timeDeath)  .
  
  filter ( ?timeReport >= ?timeRear) .
  
  # occupation naval officer
  # ?person wdt:P106 wd:Q10669499
  # occupation military officer
  # ?person wdt:P106 wd:Q189290 .
  
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?timeRear ?timeCaptain
Try it!

Captains list query

Comparing with 1 January 1784 list of captains

Should fix the post captain issue (a subclass of captain).

# Captains list for the Royal Navy
SELECT DISTINCT ?person ?personLabel ?timeCaptain ?threeID
{ 
  # allow the report to work for different years
  BIND ("1741-03-01"^^xsd:dateTime AS ?timeMin) .
  BIND ("1784-01-01"^^xsd:dateTime AS ?timeReport) .
  
  # person in Royal Navy
  ?person wdt:P241 wd:Q172771 .
  
  # human instead of fictional
  ?person wdt:P31 wd:Q5 .
  

  # military rank -- should have a start time
  # captain (Royal Navy) wd:Q5036514
   
  ?person p:P410 ?stmtCaptain .
  ?stmtCaptain ps:P410 wd:Q5036514 .
  ?stmtCaptain pq:P580 ?timeCaptain .
  
  # Three Decks ID
  optional {
      ?person wdt:P7389 ?threeID .
  }
  
  # get time  of death (some have multiple death dates)
  ?person wdt:P570 ?timeDeath .
  filter ( ?timeReport <= ?timeDeath)  .
  
  filter ( ?timeMin <= ?timeCaptain) .
  filter ( ?timeReport >= ?timeCaptain) .
  
  # occupation naval officer
  # ?person wdt:P106 wd:Q10669499
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?timeCaptain
Try it!

Participants in a battle

Consider a battle such as Battle of Cape St. Vincent (Q373401). Which ships participated?

en:Battle_of_Cape_St._Vincent_(1797) provides a list of 15 + 7 ships on the British side. Spanish fleet is broken down by squadrons.

Consider HMS Victory (Q213958)

  • conflict (P607) → First Battle of Ushant, Battle of Ushant, Battle of Cape Spartel, Battle of Cape St. Vincent, Battle of Trafalgar
    conflict is used for battles...
  • participant in (P1344) → Battle of Trafalgar, Battle of Cape St. Vincent

The query now gets 19 results (short of 22). Three ships are unrated.

SELECT ?ship ?shipLabel WHERE {

  # ship of the line Q207452
  ?ship wdt:P31/wdt:P279 wd:Q207452 .

  # conflict
  ?ship wdt:P607 wd:Q373401 .
  
  # particpant
  # ?ship wdt:P1344 wd:Q373401 .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
Try it!

Ships of the Line

SELECT ?ship ?shipLabel
{
  # instance of ship of the line Q207452
  ?ship wdt:P31/wdt:P279* wd:Q207452 .
  
  # operator GB
  ?ship wdt:P137 wd:Q172771 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?shipLabel
Try it!

A confused hierarchy: the Ajax class is a subclass of ship of the line rather than being a subclass of n-rate.

If {A instance of B, A instance of C, B subclass C} → remove {A instance of C}.

If {A instance of C, B subclass C} → possibly {A instance of B}.

SELECT ?shipclass ?shipclassLabel
{
  # first-rate Q892367 subclass of ship of the line Q207452
  # second-rate Q892368
  # third-rate Q892492
  # fourth-rate Q892562
  # fifth-rate Q892554 is subclass of frigate Q12012855
  # sixth-rate Q892278 is subclass of frigate

  # subclass of ship of the line Q207452
  ?shipclass wdt:P279 wd:Q207452 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?shipclassLabel
Try it!

Languages

SELECT ?lang ?langLabel ?l1 ?l2 ?l3 ?l4
{
  # instance of a language
  ?lang wdt:P31/wdt:P279* wd:Q34770 .

  # ISO 639-1 code
  optional {
    ?lang wdt:P218 ?l1 .
  }
  
  # ISO 639-2 code
  optional {
    ?lang wdt:P219 ?l2 .
  }

  # ISO 639-3 code
  optional {
    ?lang wdt:P220 ?l3 .
  }
  
  # IETF language tag
  optional {
    ?lang wdt:P305 ?l4 .
  }
 
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?langLabel
Try it!

Submarines

Submarines do not have patrol plots, attacks, sinkings.

Conlicts: WW II is a war, Pacific War is a theatue.

US submarines in WW II

SELECT ?sub ?subLabel
{
  # instance of submarine
  ?sub wdt:P31/wdt:P279* wd:Q2811 .
  
  # conflict is Pacific War
  #?sub wdt:P607 wd:Q184425 .

  # conflict is WW II
  ?sub wdt:P607 wd:Q362 .
  
  # operator is US Navy
  ?sub wdt:P137 wd:Q11220 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?subLabel
Try it!

German submarines in WW II

Battle of the Atlantic statistics in war reports and post war surveys. Stats such as number of patrols, merchants sunk, and submarines sunk.

Group by month. Count

SELECT ?sub ?subLabel ?timeSink ?timeScuttle
{
  # instance of submarine
  ?sub wdt:P31/wdt:P279* wd:Q2811 .
  
  # ?sub wdt:P607 wd:Q184425 .

  # conflict is WW II
  ?sub wdt:P607 wd:Q362 .
  
  # operator is Kriegsmarine
  ?sub wdt:P137 wd:Q151701 .

  optional {
    # significant event is sinking
    # ?sub wdt:P793 wd:Q30880545 .
    ?sub p:P793 ?stmtSignificant .
    ?stmtSignificant ps:P793  wd:Q30880545 .
    ?stmtSignificant pq:P585 ?timeSink .
  }

  optional {
    # significant event is scuttling
    # ?sub wdt:P793 wd:Q1786766 .
    ?sub p:P793 ?stmtSignificant .
    ?stmtSignificant ps:P793  wd:Q1786766 .
    ?stmtSignificant pq:P585 ?timeScuttle .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?timeSink
Try it!

Second Happy Time

See en:https://en.wikipedia.org/wiki/Second_Happy_Time. It has a list of ships lost and submarines lost.

See also https://www.youtube.com/watch?v=gp5diNUq-rU&t=1m37s at 1:37

Japanese warships

Goal: a query that lists all IJN vessels torpedoed by a submarine during WW II.

No mention of sinking by USS Cavalla (Q1398898)

en:List of sunken aircraft carriers

World War I fighter pilots

The query has several holes. The military branch may not be specified or it may be too generic. Or it may be wrong. follows (P155), followed by (P156), replaces (P1365), replaced by (P1366)

Same with

Pilots

SELECT ?pilot ?pilotLabel ?branch ?branchLabel ?awardLabel
{
  # instance of human
  ?pilot wdt:P31 wd:Q5 .

  # occupation is fighter pilot
  ?pilot wdt:P106 wd:Q618694 .
  
  OPTIONAL {
    # military branch
    ?pilot wdt:P241 ?branch .
  }
  
  # conflict is WW I
  ?pilot wdt:P607 wd:Q361 .
  
  OPTIONAL {
    # award
    ?pilot wdt:P166 ?award .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?pilotLabel
Try it!

Aircraft families

# aircraft families
SELECT ?aircraft ?aircraftLabel ?manufacturerLabel
{
  # Lockheed
  BIND (wd:Q7233 AS ?manufacturer) .

  # instance of aircraft family
  ?aircraft wdt:P31 wd:Q15056993 .

  # manufacturer
  ?aircraft wdt:P176 ?manufacturer .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?aircraftLabel
Try it!

Cast member in two films

Find the common cast members in two films.

# Find a person
SELECT ?person ?personLabel ?film1Label ?film2Label WHERE {
  # Auntie Mame
  BIND(wd:Q1219582 AS ?film1) .
  # The Big Sleep
  BIND(wd:Q221462 AS ?film2) .
  
  # cast member
  ?film1 wdt:P161 ?person .
  ?film2 wdt:P161 ?person .
  
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
Try it!

Golf tournament winners

Even better: duplicated table at en:List of men's major championships winning golfers.

SELECT  ?person ?personLabel (COUNT(?tournament) AS ?count) WHERE {
  # tournament is a men's major
  # e.g., 2019 Masters Tournament Q55316366 is P31 of Masters Tournament Q280275
  #    P279 of golf tournament Q15061650 (argh! inappropriate subclass)
  #    P279 of men's major golf championships Q268554
  #      P279 of golf tournament Q15061650
  ?tournament wdt:P31/wdt:P279* wd:Q268554 .
  
  # just a golf tournament
  # ?tournament wdt:P31/wdt:P279* wd:Q15061650 .
  
  # the winner of the tournament
  ?tournament wdt:P1346 ?person .

  # person is human
  # ?person wdt:P31 wd:Q5 .

  # occupation is a golfer (not required for an Open winner)
  # ?person wdt:P106 wd:Q11303721 .
  
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
GROUP BY ?person ?personLabel
ORDER BY DESC(?count)
Try it!

Subclass issue

The U.S. Open is an open golf tournament which is a subclass of golf tournament. It makes sense to be both a major and an open golf tournament: major does not → open golf tournament. It does not make sense for a major and a golf tournament: major → golf tournament.

SELECT  ?tournament ?tournamentLabel WHERE {
  # tournament is a men's major
  # e.g., 2019 Masters Tournament Q55316366 is P31 of Masters Tournament Q280275
  #    P279 of golf tournament Q15061650 (argh! inappropriate subclass)
  #    P279 of men's major golf championships Q268554
  #      P279 of golf tournament Q15061650
  
  ?tournament wdt:P279 wd:Q268554 .
  
  # just a golf tournament
  ?tournament wdt:P279+ wd:Q15061650 .
  
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?tournamentLabel
Try it!

Refrigerants

See List of refrigerants and https://www.ashrae.org/technical-resources/standards-and-guidelines/ashrae-refrigerant-designations

SELECT ?ref ?refLabel ?form ?smiles ?melt ?boil ?ashrae ?cas WHERE {
  ?ref wdt:P31 wd:Q266790 .
  
  optional {
    ?ref wdt:P274 ?form .
  }
  
  optional {
    ?ref wdt:P233 ?smiles .
  }
  
  optional {
    ?ref wdt:P2101 ?melt .
  }
  
  optional {
    ?ref wdt:P2102 ?boil .
  }
  
  optional {
    ?ref wdt:P4842 ?ashrae .
   }
  
  optional {
    ?ref wdt:P231 ?cas .
   }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?refLabel
Try it!

City by population in a state

SELECT ?city ?cityLabel ?countyLabel ?pop WHERE {
  # a city in the US
  ?city wdt:P31/wdt:P279 wd:Q1093829 .
  
  # expect next administrative territory is a county
  ?city wdt:P131 ?county .
  
  # in a particular state
  ?county wdt:P131 wd:Q1384 .
  
  # get the population
  ?city wdt:P1082 ?pop .
 
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY DESC(?pop) LIMIT 1000
Try it!

Stars

Too many stars in the sky.... Create navigational star (Q108171565) so the relevant subset can be selected quickly. The 1981 Nautical Almanac states:

Typically, only 57 stars are used for navigational purposes in both Northern and Southern Hemispheres. Here you’ll also find Polaris and Scheat. In the Northern Hemisphere Polaris is often used for determination of latitude.

SELECT ?star ?starLabel ?epochLabel ?ra ?decl WHERE {
  ?star wdt:P31 wd:Q108171565 .
  
  ?star wdt:P6259 ?epoch .
  ?star wdt:P6257 ?ra .
  ?star wdt:P6258 ?decl .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} LIMIT 100
Try it!

Epoch

See

Some of these are inappropriate.

SELECT ?epoch ?epochLabel WHERE {
  ?epoch wdt:P31 wd:Q2703 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?epochLabel
Try it!

Constellations

Can find the constellations without hitting a time limit.

https://www.iau.org/public/themes/constellations/

Boundaries of the constellations (B1875): http://pbarbier.com/constellations/boundaries.html#:~:text=Original%20boundary%20data%20The%20original%20constellation%20boundary%20data,a%20sequence%20of%20vertices%2C%20one%20vertex%20per%20line

SELECT ?constellation ?constellationLabel WHERE {
  # there are 88 constellations
  # this returns 462 results
  # there are Chinese constellations
  # Pisces instance of constellation and zodiacal constellation
  # ?constellation wdt:P31/wdt:P279* wd:Q8928 .
  
  # try simpler
  # this has 89 results
  #   there are two Musca constellations: wd:Q10435 wd:Q6940204
  # soms has part...
  #   for Orion, a part is the asterism Orion's belt, which has parts
  ?constellation wdt:P31 wd:Q8928 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?constellationLabel
Try it!

Museum paintings

SELECT ?painting ?paintingLabel ?creatorLabel ?locationLabel WHERE {
  # BIND(wd:Q762 AS ?creator).
  #Louvre
  #BIND(wd:Q19675 AS ?location).
  #Musee d'Orsay
  BIND(wd:Q23402 AS ?location).
  
  # a painting
  ?painting wdt:P31/wdt:P279* wd:Q3305213 .
  
  # painted by ...
  ?painting wdt:P170 ?creator .
  
  # located in the Louvre
  ?painting wdt:P276 ?location .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?creatorLabel # LIMIT 2000
Try it!

GIS

Look at spatial reference system (Q161779); especially has-parts.

https://epsg.io/27700-7710

For example, World Geodetic System 1984 (Q11902211) and EPSG CRS (P1338).

geodetic reference system (Q1502887) is both an instance and a subclass of frame of reference (Q184876). spatial reference system (Q161779) is only an instance of frame of reference (Q184876); it is a subclass of coordinate system (Q11210).

Handling semi-major axis (Q171594) and inverse flattening (Q65952201) as has-parts seems strained, but maybe it is right. If an instance, then it should have the properties. If a subclass, then each instance should have the property, and the property should be restricted to a specific value. A better way would be to point to a specific ellipsoid; something like the class X is based on this item. Ah, the problem is they are not properties but rather items!

SELECT ?CRS ?CRSLabel WHERE {
  # a CRS
  # confusion about
  #   version of Q1502887
  #   instance of spatial reference system Q161779
  #   subclass of Q1502887
  ?CRS wdt:P31/wdt:P279* wd:Q161779 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
}
Try it!
SELECT ?CRS ?CRSLabel ?id WHERE {
  # a CRS that has an EPSG CRS id
  ?CRS wdt:P1338 ?id .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
}
Try it!

There is reference ellipsoid (Q1335878) (and the general Earth ellipsoid (Q1203807)).

Look for reference ellipsoids; no EPSG.

SELECT ?RE ?RELabel WHERE {
  # a Reference Ellipsoid
  ?RE wdt:P31/wdt:P279* wd:Q1335878 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
}
Try it!

France

 

Looking at regimes and Constitutions of France for File:Chronologie constitutions françaises.svg.

I am not getting some regimes

  1. National Constitutent Assembly, National Constituent Assembly (Q876424)
  2. Legislative Assembly, Legislative Assembly (Q780457) (replaced by National Convention!)
    • not a regime
    • no country
    • uses start time and end time
  3. Directory, French Directory (Q219817)
  4. French Third Republic, French Third Republic (Q70802)
    • republic regime in France (Q17152708) is a subclass of regime; has dates; should work
    • country is France; should work
    • has inception P571; should work
    • has abolished P576
    • historical country is preferred over republic regime of France; lower to normal rank and try again. That worked!
  5. Hundred Days, Hundred Days (Q199955) (after First Restoration)
    • instance of regime
    • no country!
    • start and end times instead of inception!
  6. Second Republic, French Second Republic (Q58326) (after July Monarchy)
    • subclass! instead of instance of republic regime in France. Fixed.
    • has country
    • has inception and abolished
  7. Government of National Defense, Government of National Defense (Q2358315) (after Second Empire)
    • instance of Government rather than regime. Added republic regime in France.
    • has country
    • has start and end times rather than inception. Add inception. Start time same as Third Republic!
SELECT ?regime ?regimeLabel ?date ?fini ?pred ?predLabel ?succ ?succLabel
{
  # instance of a regime
  # republic regime in France (Q17152708) might be better but few use it
  # some also use provisional government that is a subclass of regime
  ?regime wdt:P31/wdt:P279* wd:Q5589178 .
  
  # country is France
  # country is not quite right. some regimes do not use France
  ?regime wdt:P17 wd:Q142 .
  
  # date of inception
  # some use start date
  ?regime wdt:P571 ?date .
  
  optional {
    # abolished
    # some use end date
    ?regime wdt:P576 ?fini .

    # these are very confused because they address different territories
    # ?regime wdt:P155 ?pred .
    # ?regime wdt:P156 ?succ .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?date
Try it!

Fonts

Where was the original query? There were a lot of issues with semantics.

compare

  • font (Q4868296) font whose description is "particular size, weight and style of a typeface".

see

Font classification

Instances of a typeface

Publishers

Adobe (Q11463) Adobe

Type Foundry type foundry (P4586)

Google Font ID Google Fonts ID (P10687)

SELECT ?font ?fontLabel ?publisher ?publisherLabel
{
  # instance of a type face (aka font family?)
  ?font wdt:P31/wdt:P279* wd:Q17451 .
  
  optional {
    ?font wdt:P123 ?publisher .
  }

  optional {
    ?font wdt:P4586 ?foundry .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?fontLabel
Try it!

Knights Templar

SELECT ?gm ?gmLabel ?dateDeath
{
  # instance of a human
  ?gm wdt:P31 wd:Q5 .

  # gm holds the office of Grandmaster of the Knights Templar
  ?gm wdt:P39 wd:Q22673588 .

  optional {
    ?gm wdt:P570 ?dateDeath .
  }
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
  
} ORDER BY ?dateDeath
Try it!

Optical glass

SELECT ?glass ?glassLabel
{
  # an optical glass
  ?glass wdt:P279 wd:Q13326 .

  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
}
Try it!

Finland

See File:Regions of Finland labelled FI.svg.

Accessing native label (P1705) for fi gets the preferred label.

SELECT ?reg ?regLabel ?cap ?capLabel WHERE {
  # region of Finland
  ?reg wdt:P31 wd:Q193512 .
  
  # find the capital
  ?reg wdt:P36 ?cap .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "fi" .
  }
} ORDER BY ?regLabel
Try it!

Map projections

Wikidata is confused. The Mercator projection (Mercator projection (Q309372)) is a instance of (P31) of:

(On 1 July 2020, the instance of map projection was dropped, so the item is just a subclass of the others.)

A cylindrical projection is both an instance of and a subclass of map projection. (The cylindrical projection was also fixed on 1 July 2020.)

Is that trying to say there is a trivial cylindrical projection, and there are other, more complicated, projections? But then there should be two items: one for the instance and one for the class.

We are back to the typeface problem.

Using subclass of (subclass of (P279)) makes more sense. I have trouble with a system that leads to an instance of an instance. A map might use an instance of a Mercator projection which is itself an instance of a map projection. If I want to make a list of different map projections, then a query that asks for all instances* of a map projection would return the instance that map used. That is not the answer I want. If Mercator projection were a subclass of map projection, then I'd ask for all subclasses* of map projection. I should get the Mercator projection without specific instances of the Mercator projection.

SELECT ?item ?itemLabel
{
  # instance of a map projection
  ?item wdt:P31/wdt:P279* wd:Q186386 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?itemLabel
Try it!
SELECT ?item ?itemLabel
{
  # subclass of a map projection
  ?item wdt:P279+ wd:Q186386 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?itemLabel
Try it!

Instance versus subclass

One could also say that a Lambert conformal conic projection with specific parameters is an instance of the projection.

What about a projection with no parameters. Is that an instance, a subclass, or both? Maybe the simple answer is there could only be one of them (a singleton class), so it is better to call it an instance.

Is there some better way to identify an instance?

Poking around the instance or subclass issue brought up a similar subset or set or superset issue. I do not think that Wikidata distinguishes subset and subclass.

Consider items that are an instance of and a subclass of the same item.

Wikidata apparently does not include EPSG identifiers.

Query to find suspect relations

Queries to find suspect relations.

       If ?x is an instance of ?y and
       ?x is an instance of ?z and
       ?y is a subclass of ?z

Then ?x is an instance of ?z is suspect. Or rather why not find it with ?x P31/P279* ?z

Try again.

       If ?x is an instance of ?y and
       ?x is an instance of ?z and
       ?y is an instance of ?z

Then ?y might be a subclass of ?z.

Also

       if ?x is an instance of ?y and
       ?x is a subclass of ?y

Then the instance of statement is suspect.

Actors and their films

Actors (cast member (P161)) and great movies (film (Q11424), review score (P444)).

SELECT ?actor ?actorLabel ?rankLabel ?film ?filmLabel ?score ?stmtScore
{ 
  # bind the actor
  BIND (wd:Q16390 AS ?actor) .

  # there is a film
  ?film wdt:P31/wdt:P279* wd:Q11424 .

  # film has actor as a cast member
  ?film wdt:P161 ?actor .
  
  # get the film review score statement
  ?film p:P444 ?stmtScore .
  ?stmtScore ps:P444 ?score .
  # by Rotten Tomatoes
  ?stmtScore pq:P447 wd:Q105584 .
  # determination method is tomato meter
  ?stmtScore pq:P459 wd:Q108403393 .
  
  # human instead of fictional
  ?actor wdt:P31 wd:Q5 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?score
Try it!

Directors

SELECT ?director ?directorLabel ?film ?filmLabel ?date
{ 
  # bind the director
  BIND (wd:Q8877 AS ?director) .

  # there is a film
  ?film wdt:P31/wdt:P279* wd:Q11424 .
  
  ?film wdt:P577 ?date .

  # film has a director
  ?film wdt:P57 ?director .
  
  # human instead of fictional
  ?director wdt:P31 wd:Q5 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?date
Try it!

Composers

SELECT ?composer ?composerLabel ?film ?filmLabel ?date
{ 
  # bind the composer
  BIND (wd:Q131285 AS ?composer) .

  # there is a film
  ?film wdt:P31/wdt:P279* wd:Q11424 .
  
  ?film wdt:P577 ?date .

  # film has a composer
  ?film wdt:P86 ?composer .
  
  # human instead of fictional
  ?composer wdt:P31 wd:Q5 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?date
Try it!

TV

Who has the most appearances? television series (Q5398426)

Do a GROUP BY with a COUNT?

Bea Benaderet (Q1285376)

Multiple awards

Looking for EGOT. .

More problems with instance and subclass...

SELECT ?actor ?actorLabel
{ 
  # human instead of fictional
  ?actor wdt:P31 wd:Q5 .
  
  # occupation is an actor
  ?actor wdt:P106/wdt:P279* wd:Q33999 .
  
  # Best Actor Oscar
  #  best actor is an instance of Academy Awards Q19020!
  ?actor wdt:P166 wd:Q103916 .
  
  # Golden Globe
  ?actor wdt:P166/wdt:P279* wd:Q1011547 .
  
  # Tony Award
  #  best actor is an instance of Tony Awards Q191874 rather than a subclass!
  # ?actor wdt:P166/wdt:P279* wd:Q191874 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?actorLabel
Try it!

District Attorneys

district attorney (Q653368) is a subclass of prosecutor (Q600751)

Should there be a California DA class?

The office should have an associated county. See w:List of district attorneys by county.

This query finds DAs in LA and Santa Clara counties.

SELECT ?attorney ?attorneyLabel ?jurisdictionLabel
{
  # find someone who holds a position
  ?attorney wdt:P39 ?position .
  
  # the position is a subclass of district attorney
  ?position wdt:P279* wd:Q653368 .
  
  # the position has a jurisdiction
  ?position wdt:P1001 ?jurisdiction .
            
  # jurisdiction is a county in California
  ?jurisdiction wdt:P31 wd:Q13212489 . 
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }
} ORDER BY ?jurisdictionLabel
Try it!

Fix a bunch of DAs..

Standard Model

 
Standard Model

No clear queries.

SELECT ?particle ?particleLabel
{
  # find a particle
  ?particle wdt:P279+ wd:Q43116 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }

} ORDER BY ?particleLabel
Try it!

Body shape

 
Body shapes
 
Body types

Query uninteresting; returns male and female shapes....

SELECT ?shape ?shapeLabel
{
  # find a particle
  ?shape wdt:P279+ wd:Q1072278 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }

} ORDER BY ?shapeLabel
Try it!

But there is

And

Pirates

SELECT ?pirate ?pirateLabel
{
  # occupation a pirate
  ?pirate wdt:P106 wd:Q10729326 .

  # a human
  ?pirate wdt:P31 wd:Q5 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }

} ORDER BY ?pirateLabel
Try it!

Serial killers

SELECT ?killer ?killerLabel
{
  # occupation a serial killer
  ?killer wdt:P106 wd:Q484188 .

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

  # country of citizenship: US
  ?killer wdt:P27 wd:Q30 .
  
  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }

} ORDER BY ?killerLabel
Try it!

Antibiotics

Query does not have good coverage.... Class versus instance problem.

SELECT ?antibiotic ?antibioticLabel
{
  # occupation a pirate
  ?antibiotic wdt:P31/wdt:P279* wd:Q12187 .

  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }

} ORDER BY ?pirateLabel
Try it!

NFL teams

There are 32 current NFL teams. See w:National_Football_League_team_captains.

Query returns 20 (gets old teams such as Brooklyn Dodgers). Buffalo Bills are missing. It has league or competition (P118) being American Football League (Q464508) for a time and then National Football League (Q1215884) That gives better query result: 54 teams.

Solved by filtering out dissolved teams.

Asking for head coach gets only 13 items with some duplicates. Need to filter for start and end time. See Kansas City Chiefs and Andy Reid.

Why not instance of NFL Americal Football Team?

SELECT ?team ?teamLabel ?coach ?coachLabel
{
  # instance of American football team
  ?team wdt:P31 wd:Q17156793 .
  
  # member of National Football League
  # ?team wdt:P463 wd:Q1215884 .

  # league is NFL
  ?team wdt:P118 wd:Q1215884 .
  
  FILTER NOT EXISTS {
    # no dissolved date
    ?team wdt:P576 ?date .
  }
  
  optional {
    # head coach
    ?team wdt:P286 ?coach .
  }

  SERVICE wikibase:label {
     bd:serviceParam wikibase:language "en" .
  }

} ORDER BY ?teamLabel
Try it!

Animals

These items are a surprise. I expected some properties...

animal with specific gender (Q116742203)

Also groups: herd of cattle, pride of lions

bear, , , cub

cat, , , kitten

cattle, bull, cow, heifer, calf

deer, stag/buck, doe, fawn

dog, , , puppy

duck, drake, , duckling

lion, lion, lioness, cub

seal, , , pup

Musical instruments

Not what I expected.

MIMO's classification of musical instrument (Q26836418)
Guizzi's classification of musical instruments (Q53424891)
Hornbostel–Sachs (Q496327)

Violin: violin (Q8355)

Oboe: oboe (Q8377)