query-05bdfc929c42343530ba75293e648333
How many people are there whose "number of children (P1971)" matches with "child (P40)"? PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. How many people are there whose "number of children (P1971)" matches with "child (P40)"?PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. How many people are there whose "number of children (P1971)" matches with "child (P40)"? PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. How many people are there whose "number of children (P1971)" matches with "child (P40)"?PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. Combien de personnes existe-t-il dont le "nombre d'enfants (P1971)" vaut "enfant (P40)"?PS : y compris le cas limite pour lequel le nombre d'enfants vaut 0. P1971 est principalement utilisé lorsque la liste complète des enfants ne peut pas (ou ne doit pas) être incluse. How many people are there whose "number of children (P1971)" matches with "child (P40)"? PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. Hoeveel mensen hebben een "aantal kinderen (P1971) " die overeenkomt met "kind (P40)"?PS: Inclusief het grensgeval waar het aantal kinderen gelijk is aan 0. P1971 wordt voornamelijk gebruikt wanneer volledige lijsten van kinderen niet kunnen of niet mogen worden opgenomen. How many people are there whose "number of children (P1971)" matches with "child (P40)"? PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. How many people are there whose "number of children (P1971)" matches with "child (P40)"? PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. How many people are there whose "number of children (P1971)" matches with "child (P40)"? PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included. How many people are there whose "number of children (P1971)" matches with "child (P40)"?PS: Including the corner case where the number of children equals 0. P1971 is mainly used when full listings of children can't or shouldn't be included.
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT (COUNT(DISTINCT(?person)) AS ?countPerson)
WHERE {
{ # non-zero number of children matches
?person wdt:P1971 ?numOfChildren .
{SELECT ?person (COUNT(?child) AS ?numOfChildrenComputed)
WHERE {
?person wdt:P40 ?child
}
GROUP BY ?person}
FILTER (?numOfChildren = ?numOfChildrenComputed)
}
UNION
{ # zero number of children matches
?person wdt:P1971 "0"^^xsd:decimal .
FILTER NOT EXISTS { ?person wdt:P40 ?child }
}
}
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