query-f1e5d29ee533ed804631632fe50ff409
Mujeres mexicanas SELECT ?item ?name ?image ?gender ?year_of_birth ?country_of_birth (GROUP_CONCAT(DISTINCT ?state_or_province_of_birth; separator=", ") AS ?states_or_provinces_of_birth) ?year_of_death ?country_of_death ?occupations WITH { SELECT ?item ?image ?gender_item ?year_of_birth ?country_of_birth_item ?year_of_death ?country_of_death_item (GROUP_CONCAT(?occupation; SEPARATOR=", ") AS ?occupations) WHERE { ?item wdt:P21 wd:Q6581072 . ?item wdt:P27 wd:Q96 . OPTIONAL { ?item wdt:P18 ?image. } OPTIONAL { ?item wdt:P21 ?gender_item. } ?item wdt:P569 ?date_of_birth. BIND (YEAR(?date_of_birth) AS ?year_of_birth) FILTER (?year_of_birth >= 1675 && ?year_of_birth < 1995) OPTIONAL { ?item wdt:P19/wdt:P17 ?country_of_birth_item. } OPTIONAL { ?item wdt:P570 ?date_of_death. BIND (YEAR(?date_of_death) AS ?year_of_death) } OPTIONAL { ?item wdt:P20/wdt:P17 ?country_of_death_item. } OPTIONAL { ?item wdt:P106 ?occupation_item. } SERVICE wikibase:label { bd:serviceParam wikibase:language "es,en". ?occupation_item rdfs:label ?occupation. } } GROUP BY ?item ?image ?gender_item ?year_of_birth ?country_of_birth_item ?year_of_death ?country_of_death_item } AS %query WHERE { INCLUDE %query OPTIONAL { ?state_or_province_of_birth_item wdt:P131 ?country_of_birth_item. ?item wdt:P19/wdt:P131* ?state_or_province_of_birth_item. } SERVICE wikibase:label { bd:serviceParam wikibase:language "es,en". ?item rdfs:label ?name. ?gender_item rdfs:label ?gender. ?country_of_birth_item rdfs:label ?country_of_birth. ?country_of_death_item rdfs:label ?country_of_death. ?state_or_province_of_birth_item rdfs:label ?state_or_province_of_birth. } } GROUP BY ?item ?name ?image ?gender ?year_of_birth ?country_of_birth ?year_of_death ?country_of_death ?occupations
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#>
#Mujeres mexicanas
SELECT ?item ?name ?image ?gender ?year_of_birth ?country_of_birth
(GROUP_CONCAT(DISTINCT ?state_or_province_of_birth; separator=", ") AS ?states_or_provinces_of_birth)
?year_of_death ?country_of_death ?occupations
WHERE
{
{
SELECT ?item ?image ?gender_item ?year_of_birth ?country_of_birth_item
?year_of_death ?country_of_death_item
(GROUP_CONCAT(?occupation; SEPARATOR=", ") AS ?occupations)
WHERE
{
?item wdt:P21 wd:Q6581072 .
?item wdt:P27 wd:Q96 .
OPTIONAL {
?item wdt:P18 ?image.
}
OPTIONAL {
?item wdt:P21 ?gender_item.
}
?item wdt:P569 ?date_of_birth.
BIND (YEAR(?date_of_birth) AS ?year_of_birth)
FILTER (?year_of_birth >= 1675 && ?year_of_birth < 1995)
OPTIONAL {
?item wdt:P19/wdt:P17 ?country_of_birth_item.
}
OPTIONAL {
?item wdt:P570 ?date_of_death.
BIND (YEAR(?date_of_death) AS ?year_of_death)
}
OPTIONAL {
?item wdt:P20/wdt:P17 ?country_of_death_item.
}
OPTIONAL {
?item wdt:P106 ?occupation_item.
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "es,en".
?occupation_item rdfs:label ?occupation.
}
}
GROUP BY ?item ?image ?gender_item ?year_of_birth ?country_of_birth_item ?year_of_death ?country_of_death_item
} OPTIONAL {
?state_or_province_of_birth_item wdt:P131 ?country_of_birth_item.
?item wdt:P19/wdt:P131* ?state_or_province_of_birth_item.
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "es,en".
?item rdfs:label ?name.
?gender_item rdfs:label ?gender.
?country_of_birth_item rdfs:label ?country_of_birth.
?country_of_death_item rdfs:label ?country_of_death.
?state_or_province_of_birth_item rdfs:label ?state_or_province_of_birth.
}
}
GROUP BY ?item ?name ?image ?gender ?year_of_birth ?country_of_birth ?year_of_death ?country_of_death ?occupations
Query found at
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2020/04
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2020/11