query-9f2b1d85db5887867f4e801b2e90551b
People by surname and initial
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel WHERE {
?item wdt:P31 wd:Q5 .
?item wdt:P734 wd:Q16479693 . # Family name Badger
?item wdt:P735 ?name .
?name rdfs:label ?nameLabel .
FILTER (LANG(?nameLabel) = "en")
FILTER (STRSTARTS(?nameLabel, "E")) # First initial
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v3("?name")
v1("?nameLabel")
c10(["bd:serviceParam"]):::iri
c4(["wd:Q5"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q16479693"]):::iri
f0[["starts-with(?nameLabel,'E')"]]
f0 --> v1
f1[["?nameLabel = 'en'"]]
f1 --> v1
v2 --"wdt:P31"--> c4
v2 --"wdt:P734"--> c6
v2 --"wdt:P735"--> v3
v3 --"rdfs:label"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end