query-a722a68a95b392f806fd7ec3ff2ddcd7
Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender) Fathers with non-existent or unusual gender statements
SELECT (?father as ?father_id) ?father_name ?father_is_a ?father_gender (?child as ?child_id) ?child_name ?child_is_a WHERE { ?child wdt:P22 ?father . ?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 . ?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 . OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because # SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . ?father rdfs:label ?father_name . ?f_is_a rdfs:label ?father_is_a . ?f_gender rdfs:label ?father_gender . ?child rdfs:label ?child_name . ?c_is_a rdfs:label ?child_is_a . }
# Show only results where the father's gender: FILTER( # ...is not set NOT EXISTS { ?father wdt:P21 [] } # ...or is set to something other than "male" or "male organism", or "unknown value" || ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender) ) } ORDER BY DESC(?f_gender)
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#>
# Fathers with non-existent or unusual gender statements
SELECT
(?father as ?father_id) ?father_name ?father_is_a ?father_gender
(?child as ?child_id) ?child_name ?child_is_a
WHERE {
?child wdt:P22 ?father .
?father wdt:P31 ?f_is_a . #?father wdt:P31 wd:Q5 .
?child wdt:P31 ?c_is_a . #?child wdt:P31 wd:Q5 .
OPTIONAL { ?father wdt:P21 ?f_gender . }
# Aliases for the headings in the results table. Must be done this way because
# SELECT (?var as ?varAlias) works, but (?varLabel as ?varLabelAlias) doesn't.
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?father rdfs:label ?father_name .
?f_is_a rdfs:label ?father_is_a .
?f_gender rdfs:label ?father_gender .
?child rdfs:label ?child_name .
?c_is_a rdfs:label ?child_is_a .
}
# Show only results where the father's gender:
FILTER(
# ...is not set
NOT EXISTS { ?father wdt:P21 [] }
# ...or is set to something other than "male" or "male organism", or "unknown value"
|| ?f_gender NOT IN(wd:Q6581097, wd:Q44148) && !wikibase:isSomeValue(?f_gender)
)
}
ORDER BY DESC(?f_gender)
Query found at
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance/en
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance/es
- https://www.wikidata.org/wiki/User:Amitie_10g/Sandbox/Wikidata:SPARQL_query_service/queries/examples/maintenance/zh
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/cs
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/en
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/es
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/fr
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/ja
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/nl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/pl
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/sv
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/maintenance/uk