query-db96503d8eee6acbac06c55c4b48646a

rq turtle/ttl

humain né-e ou mort-e dans la Canton de Vaud SELECT ?humain ?humainLabel ?lieuNaissanceLabel ?lieuMortLabel ?occ ?archive_at WITH { SELECT ?humain (group_concat(distinct ?occupLabel;separator=", ") as ?occ) (group_concat(distinct ?archiveLabel;separator=", ") as ?archive_at) WHERE { ?humain wdt:P31 wd:Q5. OPTIONAL {?humain wdt:P106 ?occup. ?occup rdfs:label ?occupLabel. filter(lang(?occupLabel)="fr")} OPTIONAL {?humain wdt:P485 ?archive. ?archive rdfs:label ?archiveLabel. filter(lang(?archiveLabel)="fr")} {?humain wdt:P19 ?lieuNaissance. ?lieuNaissance wdt:P131 wd:Q12771.} UNION {?humain wdt:P20 ?lieuMort. ?lieuMort wdt:P131 wd:Q12771.} } group by ?humain } as %i WHERE {include %i OPTIONAL {?humain wdt:P19 ?lieuNaissance.} OPTIONAL {?humain wdt:P20 ?lieuMort.} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr". } } ORDER BY ?humainLabel

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#>
#humain né-e ou mort-e dans la Canton de Vaud 
SELECT ?humain ?humainLabel ?lieuNaissanceLabel ?lieuMortLabel ?occ ?archive_at
WHERE { { SELECT ?humain (group_concat(distinct ?occupLabel;separator=", ") as ?occ) (group_concat(distinct ?archiveLabel;separator=", ") as ?archive_at) WHERE 
{
  ?humain wdt:P31 wd:Q5.
  OPTIONAL {?humain wdt:P106 ?occup.
            ?occup rdfs:label ?occupLabel. filter(lang(?occupLabel)="fr")}
  OPTIONAL {?humain wdt:P485 ?archive.
             ?archive rdfs:label ?archiveLabel. filter(lang(?archiveLabel)="fr")}
  {?humain wdt:P19 ?lieuNaissance.
  ?lieuNaissance wdt:P131 wd:Q12771.}
  UNION
  {?humain wdt:P20 ?lieuMort.
  ?lieuMort wdt:P131 wd:Q12771.}
  } group by ?humain  }  OPTIONAL {?humain wdt:P19 ?lieuNaissance.}
  OPTIONAL {?humain wdt:P20 ?lieuMort.} 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr". }
} ORDER BY ?humainLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?archive") v2("?archiveLabel") v10("?archive_at"):::projected v4("?humain"):::projected v1("?humainLabel"):::projected v8("?lieuMort") v7("?lieuNaissance") v9("?occ"):::projected v5("?occup") v3("?occupLabel") c9(["wd:Q12771"]):::iri c12(["bd:serviceParam"]):::iri c14(["#91;AUTO_LANGUAGE#93;,fr"]):::literal c3(["wd:Q5"]):::iri v4 --"wdt:P31"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P106".-> v5 v5 --"rdfs:label"--> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P485".-> v6 v6 --"rdfs:label"--> v2 end subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P20"--> v8 v8 --"wdt:P131"--> c9 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P19"--> v7 v7 --"wdt:P131"--> c9 end union0r <== or ==> union0l end bind2[/"?occupLabel"/] v3 --o bind2 bind2 --as--o v9 bind3[/"?archiveLabel"/] v2 --o bind3 bind3 --as--o v10 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P19".-> v7 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P20".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end