query-f1e5d29ee533ed804631632fe50ff409

rq turtle/ttl

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

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

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v16("?country_of_birth"):::projected v6("?country_of_birth_item") v17("?country_of_death"):::projected v9("?country_of_death_item") v5("?date_of_birth") v7("?date_of_death") v15("?gender"):::projected v4("?gender_item") v3("?image"):::projected v2("?item"):::projected v14("?name"):::projected v11("?occupation") v10("?occupation_item") v12("?occupations"):::projected v18("?state_or_province_of_birth"):::projected v13("?state_or_province_of_birth_item") v19("?states_or_provinces_of_birth") v6("?year_of_birth"):::projected v8("?year_of_death"):::projected a1((" ")) a2((" ")) a3((" ")) c17(["es,en"]):::literal c6(["wd:Q96"]):::iri c4(["wd:Q6581072"]):::iri c15(["bd:serviceParam"]):::iri f0[["?year_of_birth >= '1675^^xsd:integer'?year_of_birth < '1995^^xsd:integer'"]] f0 --> v6 v2 --"wdt:P21"--> c4 v2 --"wdt:P27"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P18".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P21".-> v4 end v2 --"wdt:P569"--> v5 bind1[/"year-from-dateTime(?date_of_birth)"/] v5 --o bind1 bind1 --as--o v6 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P19".-> a1 a1 --"wdt:P17"--> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P570".-> v7 bind2[/"year-from-dateTime(?date_of_death)"/] v7 --o bind2 bind2 --as--o v8 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P20".-> a2 a2 --"wdt:P17"--> v9 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P106".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 v10 --"rdfs:label"--> v11 end bind4[/"?occupation"/] v11 --o bind4 bind4 --as--o v12 subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v13 -."wdt:P131".-> v6 v2 --"wdt:P19"--> a3 a3 --"wdt:P131"--> v13 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 v2 --"rdfs:label"--> v14 v4 --"rdfs:label"--> v15 v6 --"rdfs:label"--> v16 v9 --"rdfs:label"--> v17 v13 --"rdfs:label"--> v18 end bind6[/"?state_or_province_of_birth"/] v18 --o bind6 bind6 --as--o v19