query-902e729cc3717b490df3fcf046593886

rq turtle/ttl

Députés français de la XVIe législature

SELECT ?depute ?deputeNom ?circonscriptionNom ?dateDebutMandat ?dateFinMandat ?dateNaissance ?groupeParlementaireNom (SAMPLE(?photo) AS ?photographie) ?article

SELECT ?depute ?deputeNom ?circonscriptionNom ?dateDebutMandat ?dateFinMandat ?dateNaissance ?groupeParlementaireNom WHERE { ?depute wdt:P39 wd:Q3044918 . ?depute p:P39 ?mandat . ?mandat pq:P2937 wd:Q112567597 . ?mandat pq:P580 ?dateDebutMandat . OPTIONAL { ?depute rdfs:label ?deputeNom . FILTER( LANG(?deputeNom) = "fr" ) } . OPTIONAL { ?depute wdt:P734 ?nomFamille . ?nomFamille rdfs:label ?nomFamilleNom . FILTER( LANG(?nomFamilleNom) = "fr" ) } . OPTIONAL { ?mandat pq:P582 ?dateFinMandat } . #FILTER NOT EXISTS { ?mandat pq:P582 ?dateFinMandat } . # Décommenter pour avoir les mandats en cours (c-à-d sans date de fin) #?mandat pq:P582 ?dateFinMandat . # Décommenter pour avoir les mandats terminés (c-à-d avec une date de fin) #FILTER( ?dateDebutMandat != "2017-06-21"^^xsd:dateTime ) . # Décommenter pour avoir les mandats commencés après le 21 juin 2017 OPTIONAL { ?mandat pq:P768 ?circonscription . ?circonscription rdfs:label ?circonscriptionNom . FILTER( LANG(?circonscriptionNom) = "fr" ) } . OPTIONAL { ?depute wdt:P569 ?dateNaissance } . OPTIONAL { ?mandat pq:P1365 ?remplace } . OPTIONAL { ?mandat pq:P1366 ?remplacepar } . OPTIONAL { ?mandat pq:P4100 ?groupeParlementaire . ?groupeParlementaire rdfs:label ?groupeParlementaireNom . FILTER( LANG(?groupeParlementaireNom) = "fr" ) } . #OPTIONAL { ?depute wdt:P18 ?photo } . OPTIONAL { ?article schema:about ?depute; schema:isPartOf https://fr.wikipedia.org/ } . BIND( REPLACE( UCASE( REPLACE( ?nomFamilleNom, "^de ", "" ) ), "É", "E" ) AS ?nom ) . }

GROUP BY ?depute ?deputeNom ?circonscriptionNom ?dateDebutMandat ?dateFinMandat ?dateNaissance ?groupeParlementaireNom ?article

ORDER BY ?dateFinMandat ?dateDebutMandat ?nom

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
# Députés français de la XVIe législature
#SELECT ?depute ?deputeNom ?circonscriptionNom ?dateDebutMandat ?dateFinMandat ?dateNaissance ?groupeParlementaireNom (SAMPLE(?photo) AS ?photographie) ?article
SELECT ?depute ?deputeNom ?circonscriptionNom ?dateDebutMandat ?dateFinMandat ?dateNaissance ?groupeParlementaireNom
WHERE {
  ?depute wdt:P39 wd:Q3044918 .
  ?depute p:P39 ?mandat .
  ?mandat pq:P2937 wd:Q112567597 .
  ?mandat pq:P580 ?dateDebutMandat .
  OPTIONAL { ?depute rdfs:label ?deputeNom . FILTER( LANG(?deputeNom) = "fr" ) } .
  OPTIONAL { ?depute wdt:P734 ?nomFamille . ?nomFamille rdfs:label ?nomFamilleNom . FILTER( LANG(?nomFamilleNom) = "fr" ) } .
  OPTIONAL { ?mandat pq:P582 ?dateFinMandat } .
  #FILTER NOT EXISTS { ?mandat pq:P582 ?dateFinMandat } . # Décommenter pour avoir les mandats en cours (c-à-d sans date de fin)
  #?mandat pq:P582 ?dateFinMandat . # Décommenter pour avoir les mandats terminés (c-à-d avec une date de fin)
  #FILTER( ?dateDebutMandat != "2017-06-21"^^xsd:date ) . # Décommenter pour avoir les mandats commencés après le 21 juin 2017
  OPTIONAL { ?mandat pq:P768 ?circonscription . ?circonscription rdfs:label ?circonscriptionNom . FILTER( LANG(?circonscriptionNom) = "fr" ) } .
  OPTIONAL { ?depute wdt:P569 ?dateNaissance } .
  OPTIONAL { ?mandat pq:P1365 ?remplace } .
  OPTIONAL { ?mandat pq:P1366 ?remplacepar } .
  OPTIONAL { ?mandat pq:P4100 ?groupeParlementaire . ?groupeParlementaire rdfs:label ?groupeParlementaireNom . FILTER( LANG(?groupeParlementaireNom) = "fr" ) } .
  #OPTIONAL { ?depute wdt:P18 ?photo } .
  OPTIONAL { ?article schema:about ?depute; schema:isPartOf <https://fr.wikipedia.org/> } .
  BIND( REPLACE( UCASE( REPLACE( ?nomFamilleNom, "^de ", "" ) ), "É", "E" ) AS ?nom ) .
}
#GROUP BY ?depute ?deputeNom ?circonscriptionNom ?dateDebutMandat ?dateFinMandat ?dateNaissance ?groupeParlementaireNom ?article
ORDER BY ?dateFinMandat ?dateDebutMandat ?nom

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v16("?article") v11("?circonscription") v5("?circonscriptionNom"):::projected v2("?dateDebutMandat"):::projected v1("?dateFinMandat"):::projected v12("?dateNaissance"):::projected v8("?depute"):::projected v7("?deputeNom"):::projected v15("?groupeParlementaire") v4("?groupeParlementaireNom"):::projected v9("?mandat") v17("?nom") v10("?nomFamille") v6("?nomFamilleNom") v13("?remplace") v14("?remplacepar") c3(["wd:Q3044918"]):::iri c18([https://fr.wikipedia.org/]):::iri c6(["wd:Q112567597"]):::iri v8 --"p:direct/P39"--> c3 v8 --"p:P39"--> v9 v9 --"p:qualifier/P2937"--> c6 v9 --"p:qualifier/P580"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v8 -."rdfs:label".-> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P734".-> v10 v10 --"rdfs:label"--> v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:qualifier/P582".-> v1 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:qualifier/P768".-> v11 v11 --"rdfs:label"--> v5 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P569".-> v12 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:qualifier/P1365".-> v13 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:qualifier/P1366".-> v14 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:qualifier/P4100".-> v15 v15 --"rdfs:label"--> v4 end subgraph optional8["(optional)"] style optional8 fill:#bbf,stroke-dasharray: 5 5; v16 -."schema:about".-> v8 v16 --"schema:isPartOf"--> c18 end bind0[/"replace(upper-case(replace(?nomFamilleNom,'^de ','')),'É','E')"/] v6 --o bind0 bind0 --as--o v17