query-e21d1048015f560ae7d11386a4a0749f
Query to identify people, bird-, tree-types streets are named afterThis query does not always return all a P21 for humans, even though it is set. Example Q108377852 is not shown as 'female'. What am I doing wrong? Query:
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 ?ist_eineLabel ?objekt ?objektLabel ?cityLabel ?personLabel ?artLabel ?geschlechtLabel ?personDescription ?religionLabel
(group_concat(DISTINCT ?berufL;separator=", ") as ?berufe)
WHERE
{
# ?street wdt:P31 wd:Q79007 .
?objekt wdt:P31 ?ist_eine .
?objekt wdt:P131 wd:Q570057 . #Verwaltungseinheit Karben
?objekt wdt:P131 ?city .
?objekt wdt:P138 ?person .
?person wdt:P31 ?art .
FILTER ( ?art not in ( wd:Q16521, wd:Q55983715, wd:Q754660, wd:Q978 ) ) . #nicht Taxon, Lebewesen Trivaler Name, Falconinae, Mem
optional {
?person wdt:P21 ?geschlecht .
?person wdt:P140 ?religion .
?person wdt:P106 ?beruf .
?beruf rdfs:label ?berufL .
FILTER((LANG(?berufL)) = "de") .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "de" }
}
GROUP BY ?ist_eineLabel ?objekt ?objektLabel ?cityLabel ?personLabel ?artLabel ?geschlechtLabel ?personDescription ?religionLabel
ORDER BY ?city ?objektLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?art")
v10("?beruf")
v4("?berufL"):::projected
v11("?berufe")
v1("?city")
v8("?geschlecht")
v6("?ist_eine")
v5("?objekt"):::projected
v2("?objektLabel"):::projected
v7("?person")
v9("?religion")
c5(["de"]):::literal
c8(["wd:Q570057"]):::iri
c15(["bd:serviceParam"]):::iri
f0[["?art != 'wd:Q16521'?art != 'wd:Q55983715'?art != 'wd:Q754660'?art != 'wd:Q978'"]]
f0 --> v3
v5 --"wdt:P31"--> v6
v5 --"wdt:P131"--> c8
v5 --"wdt:P131"--> v1
v5 --"wdt:P138"--> v7
v7 --"wdt:P31"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v7 -."wdt:P21".-> v8
v7 --"wdt:P140"--> v9
v7 --"wdt:P106"--> v10
v10 --"rdfs:label"--> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c15 --"wikibase:language"--> c5
end
bind2[/"?berufL"/]
v4 --o bind2
bind2 --as--o v11