-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Services territoires suivants
Pays
Requête
| Méthode | Requête | Description |
|---|---|---|
| GET | /pays/{code}/suivants | Récupérer les informations concernant les pays qui succèdent au pays {code} |
Paramètres
| Paramètres | Description | Type |
|---|---|---|
| date | Filtre pour préciser le pays {code} de départ. Par défaut, c’est la date courante qui est utilisée. | Date |
Exemples de requête
/geo/pays/99121/suivants?date=1950-01-01
Champs de la réponse
| Champ | Description |
|---|---|
| URI | URI du pays |
| Type | « Pays » |
| Code | Code Insee du pays |
| Intitule | Nom du pays |
| IntituleEntier | Nom du pays en forme longue |
| Iso3166alpha2 | Code ISO 3166-1 alpha-2 du pays |
| Iso3166alpha3 | Code ISO 3166-1 alpha-3 du pays |
| Iso3166num | Code ISO 3166-1 numérique du pays |
| DateCreation | Date de création du pays |
| DateSuppression | Date de suppression du pays s’il a été supprimé |
Exemple de réponse en XML
<Pays>
<Pays code="99119" uri="http://id.insee.fr/geo/pays/0b0d2b49-54a2-4d6c-be48-8900c905eaaa">
<Intitule>Croatie</Intitule>
<IntituleEntier>République de Croatie</IntituleEntier>
<Iso3166alpha2>HR</Iso3166alpha2>
<Iso3166alpha3>HRV</Iso3166alpha3>
<Iso3166num>191</Iso3166num>
<DateCreation>1991-06-25</DateCreation>
</Pays>
<Pays code="99121" uri="http://id.insee.fr/geo/pays/fcc6730a-8cb3-45dd-a476-384b489a50b5">
<Intitule>Yougoslavie</Intitule>
<IntituleEntier>République fédérative socialiste de Yougoslavie</IntituleEntier>
<DateCreation>1991-06-25</DateCreation>
<DateSuppression>1991-09-08</DateSuppression>
</Pays>
<Pays code="99145" uri="http://id.insee.fr/geo/pays/b1a977b0-a56f-47e9-9991-3dfa9e93197e">
<Intitule>Slovénie</Intitule>
<IntituleEntier>République de Slovénie</IntituleEntier>
<Iso3166alpha2>SI</Iso3166alpha2>
<Iso3166alpha3>SVN</Iso3166alpha3>
<Iso3166num>705</Iso3166num>
<DateCreation>1991-06-25</DateCreation>
</Pays>
</Pays>Exemple de réponse en JSON
[
{
"type": "Pays",
"code": "99119",
"uri": "http://id.insee.fr/geo/pays/0b0d2b49-54a2-4d6c-be48-8900c905eaaa",
"intitule": "Croatie",
"IntituleEntier": "République de Croatie",
"Iso3166alpha2": "HR",
"Iso3166alpha": "HRV",
"Iso3166num": "191",
"dateCreation": "1991-06-25"
},
{
"type": "Pays",
"code": "99121",
"uri": "http://id.insee.fr/geo/pays/fcc6730a-8cb3-45dd-a476-384b489a50b5",
"intitule": "Yougoslavie",
"IntituleEntier": "République fédérative socialiste de Yougoslavie",
"dateCreation": "1991-06-25",
"dateSuppression": "1991-09-08"
},
{
"type": "Pays",
"code": "99145",
"uri": "http://id.insee.fr/geo/pays/b1a977b0-a56f-47e9-9991-3dfa9e93197e",
"intitule": "Slovénie",
"IntituleEntier": "République de Slovénie",
"Iso3166alpha2": "SI",
"Iso3166alpha": "SVN",
"Iso3166num": "705",
"dateCreation": "1991-06-25"
}
]Exemple de requête SPARQL
Avec le paramètre date :
PREFIX :<http://rdf.insee.fr/def/geo#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?uri ?type ?code ?nom ?nomLong ?iso3166alpha2 ?iso3166alpha3 ?iso3166num ?dateCreation ?dateSuppression
WHERE {
{
# Sélection de la ressource d'origine (et de son événement destructeur)
SELECT DISTINCT ?origine ?evenement (?dateSuppressionOrigine AS ?dateCreation)
WHERE {
?origine a :Pays ;
:codeINSEE '99121' .
?evenement :suppression ?origine;
:date ?dateSuppressionOrigine.
OPTIONAL {?origine (^:creation/:date) ?dateCreationOrigine.}
FILTER(!BOUND(?dateCreationOrigine) || ?dateCreationOrigine <= '1950-01-01'^^xsd:date)
FILTER(!BOUND(?dateSuppressionOrigine) || ?dateSuppressionOrigine > '1950-01-01'^^xsd:date)
}
}
?evenement :creation ?ressource .
?ressource a ?typeRDF ;
a :Pays ;
:codeINSEE ?code ;
:codeArticle ?typeArticle;
:nom ?nom.
OPTIONAL {?ressource :nomLong ?nomLong .}
OPTIONAL {?ressource :codeIso3166alpha2 ?iso3166alpha2 .}
OPTIONAL {?ressource :codeIso3166alpha3 ?iso3166alpha3 .}
OPTIONAL {?ressource :codeIso3166num ?iso3166num .}
BIND(STR(?typeRDF) AS ?type).
BIND(STR(?ressource) AS ?uri).
OPTIONAL { ?ressource (^:suppression/:date) ?dateSuppression.}
}
ORDER BY ?codeMetadata
Metadata
Assignees
Labels
No labels