query-1583d95547cc2a4657752e64d91d0244

rq turtle/ttl

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

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#>
# Find a person
SELECT ?person ?personLabel ?timeCaptain ?timeDeath ?threeID WHERE {
  BIND("1800-12-01"^^xsd:date 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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?dateDeath") v3("?person"):::projected v5("?stmtCaptain") v4("?threeID"):::projected v6("?timeCaptain"):::projected v1("?timeDeath"):::projected c10(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c12(["en"]):::literal c7(["wd:Q5036514"]):::iri bind0[/"'1800-12-01^^xsd:date'"/] bind0 --as--o v2 v3 --"p:direct/P31"--> c2 v3 --"p:direct/P7389"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P570".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P410".-> v5 v5 --"p:statement/P410"--> c7 v5 --"p:qualifier/P580"--> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end