query-95f4a2d4412cba9a670aa1b9c96f9bdd
TODO
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 bd: <http://www.bigdata.com/rdf#>
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" .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?person"):::projected
v2("?rank")
a1((" "))
c7(["bd:serviceParam"]):::iri
c5(["wd:Q4226220"]):::iri
c2(["wd:Q5"]):::iri
c9(["en"]):::literal
v1 --"wdt:P31"--> c2
v1 --"wdt:P106"--> v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end