query-1f60805531afcc77605897aec5c6a50a
title: female persons with male names SELECT distinct ?item ?itemQid ?itemLabel WHERE { ?givenName wdt:P31 wd:Q12308941. # male given name ?item wdt:P21 wd:Q6581072. # female ?item wdt:P735 ?givenName . ?item wdt:P735 ?givenName2 . #?item wdt:P735 ?givenName3 . #?item wdt:P106 wd:Q82955. filter not exists {?item wdt:P742 []} filter not exists {?givenName2 wdt:P31 wd:Q11879590} # no female given name filter not exists {?givenName2 wdt:P31 wd:Q3409032} # no unisex 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 500
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 names
SELECT distinct ?item ?itemQid ?itemLabel WHERE {
?givenName wdt:P31 wd:Q12308941. # male given name
?item wdt:P21 wd:Q6581072. # female
?item wdt:P735 ?givenName .
?item wdt:P735 ?givenName2 .
#?item wdt:P735 ?givenName3 .
#?item wdt:P106 wd:Q82955.
filter not exists {?item wdt:P742 []}
filter not exists {?givenName2 wdt:P31 wd:Q11879590} # no female given name
filter not exists {?givenName2 wdt:P31 wd:Q3409032} # no unisex 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 500
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((" "))
c5(["wd:Q12308941"]):::iri
c2(["wd:Q3409032"]):::iri
c3(["wd:Q11879590"]):::iri
c7(["wd:Q6581072"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0c2
e0v1("?givenName2"):::projected
e0c2(["wd:Q3409032"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"wdt:P31"--> c2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"wdt:P31"--> e1c2
e1v1("?givenName2"):::projected
e1c2(["wd:Q11879590"]):::iri
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c1
f1 --> c3
v1 --"wdt:P31"--> c3
f2[["not "]]
subgraph f2e2["Exists Clause"]
e2v1 --"wdt:P742"--> e2a1
e2v1("?item"):::projected
e2a1((" ")):::projected
end
f2--EXISTS--> f2e2
f2 --> v2
f2 --> c4
f2 --> a1
v2 --"wdt:P742"--> a1
v3 --"wdt:P31"--> c5
v2 --"wdt:P21"--> c7
v2 --"wdt:P735"--> v3
v2 --"wdt:P735"--> v1
bind3[/"replace(http://www.w3.org/2001/XMLSchema#string(?item),'http://www.wikidata.org/entity/','')"/]
v2 --o bind3
bind3 --as--o v4