query-bac75b44b8cde47d547fab10ecfc1cf0
title: female persons with male given name
set ?givenName to the item for the given name
SELECT distinct ?item ?itemQid ?itemLabel WHERE { bind (wd:Q4925932 as ?givenName). # Franz ?item wdt:P735 ?givenName . ?item wdt:P735 ?givenName2 . #?item wdt:P106 wd:Q82955. filter not exists {?item wdt:P742 []} ?item wdt:P21 wd:Q6581072. # female #?givenName wdt:P31 wd:Q12308941. # male given name filter not exists {?givenName2 wdt:P31 wd:Q11879590} # no female given name # get the plain wikidata id in string format bind (replace(xsd:string(?item),"http://www.wikidata.org/entity/","") as ?itemQid)
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" } . } limit 50
Use at
- https://query.wikidata.org/sparql
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 bd: <http://www.bigdata.com/rdf#>
#title: female persons with male given name
#set ?givenName to the item for the given name
SELECT distinct ?item ?itemQid ?itemLabel WHERE {
bind (wd:Q4925932 as ?givenName). # Franz
?item wdt:P735 ?givenName .
?item wdt:P735 ?givenName2 .
#?item wdt:P106 wd:Q82955.
filter not exists {?item wdt:P742 []}
?item wdt:P21 wd:Q6581072. # female
#?givenName wdt:P31 wd:Q12308941. # male given name
filter not exists {?givenName2 wdt:P31 wd:Q11879590} # no female given name
# get the plain wikidata id in string format
bind (replace(xsd:string(?item),"http://www.wikidata.org/entity/","") as ?itemQid)
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" } .
} limit 50
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?givenName")
v1("?givenName2")
v2("?item"):::projected
v4("?itemQid"):::projected
a1((" "))
c8(["bd:serviceParam"]):::iri
c2(["wd:Q11879590"]):::iri
c6(["wd:Q6581072"]):::iri
c10(["de,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0c2
e0v1("?givenName2"):::projected
e0c2(["wd:Q11879590"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"wdt:P31"--> c2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"wdt:P742"--> e1a1
e1v1("?item"):::projected
e1a1((" ")):::projected
end
f1--EXISTS--> f1e1
f1 --> v2
f1 --> c3
f1 --> a1
v2 --"wdt:P742"--> a1
bind2[/"'wd:Q4925932'"/]
bind2 --as--o v3
v2 --"wdt:P735"--> v3
v2 --"wdt:P735"--> v1
v2 --"wdt:P21"--> c6
bind3[/"replace(http://www.w3.org/2001/XMLSchema#string(?item),'http://www.wikidata.org/entity/','')"/]
v2 --o bind3
bind3 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end