-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Services territoires descendants
Pays
Les descendants des pays sont des « territoires ». Comme pour les pays, ils n’ont pas de nom sans article et ils ont un nom en forme longue. Par contres les codes de la norme ISO 3166 ne sont pas fournis.
Requête
| Méthode | Requête | Description |
|---|---|---|
| GET | /pays/{code}/descendants | Récupérer les informations concernant les territoires inclus dans le pays {code} |
Paramètres
| Paramètres | Description | Type |
|---|---|---|
| date | Filtre pour utiliser le pays actif à la date donnée. Par défaut, c’est la date courante. | Date |
| type | Filtre sur le type du ou des territoires renvoyés (par compatibilité) - territoire |
String |
Exemples de requête
/geo/pays/99132/descendants
/geo/pays/99132/descendants?date=1950-01-01
/geo/pays/99132/descendants?type=departement
/geo/pays/99132/descendants?date=1950-01-01&type=departement
Champs de la réponse
| Champ | Description |
|---|---|
| URI | URI du pays |
| Type | « Territoire » |
| Code | Code Insee du territoire |
| Intitule | Nom du territoire |
| IntituleEntier | Nom du territoire en forme longue (composition du territoire) |
| DateCreation | Date de création du territoire |
| DateSuppression | Date de suppression du territoire s’il a été supprimé |
Exemple de réponse en XML
<Territoires>
<Territoire code="99133" uri="http://id.insee.fr/geo/territoire/1af281f6-f58a-4197-a40c-3c1514ebd9c5">
<Intitule>Territoires britanniques en Méditerranée</Intitule>
<IntituleEntier>Gibraltar , Akrotiri , Dhekelia</IntituleEntier>
<DateCreation>1964-09-21</DateCreation>
</Territoire>
<Territoire code="99161" uri="http://id.insee.fr/geo/territoire/f2d890cc-2d4f-4838-b9aa-50b12367d1c8">
<Intitule>Dépendances de la Couronne britannique</Intitule>
<IntituleEntier>Île de Man , Jersey , Guernesey</IntituleEntier>
<DateCreation>1943-01-01</DateCreation>
</Territoire>
...
<Territoire code="99503" uri="http://id.insee.fr/geo/territoire/957a0eb7-3154-4c4c-aab7-761553b76754">
<Intitule>Pitcairn</Intitule>
<IntituleEntier>Pitcairn</IntituleEntier>
<DateCreation>1980-07-30</DateCreation>
</Territoire>
</Territoires>Exemple de réponse en JSON
[
{
"type": "Territoire",
"code": "99133",
"uri": "http://id.insee.fr/geo/territoire/1af281f6-f58a-4197-a40c-3c1514ebd9c5",
"intitule": "Territoires britanniques en Méditerranée",
"IntituleEntier": "Gibraltar , Akrotiri , Dhekelia",
"dateCreation": "1943-01-01"
},
{
"type": "Territoire",
"code": "99161",
"uri": "http://id.insee.fr/geo/territoire/f2d890cc-2d4f-4838-b9aa-50b12367d1c8",
"intitule": "Dépendances de la Couronne britannique",
"IntituleEntier": "Île de Man , Jersey , Guernesey",
"dateCreation": "1943-01-01"
},
...
{
"type": "Territoire",
"code": "99503",
"uri": "http://id.insee.fr/geo/territoire/957a0eb7-3154-4c4c-aab7-761553b76754",
"intitule": "Pitcairn",
"IntituleEntier": "Pitcairn",
"dateCreation": "1980-07-30"
}
]Exemple de requête SPARQL
PREFIX :<http://rdf.insee.fr/def/geo#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?uri ?type ?code ?nom ?nomLong ?dateCreation ?dateSuppression
WHERE {
{
SELECT DISTINCT ?uri ?type ?code ?nom ?nomLong ?dateCreation ?dateSuppression ?dateCreationParent ?dateSuppressionParent
WHERE {
?parent a :Pays ;
:codeINSEE '99132' ;
(^:subdivisionDirecteDe)+ ?ressource .
?ressource a ?typeRDF;
:codeINSEE ?code ;
:nom ?nom .
OPTIONAL {?ressource :nomLong ?nomLong .}
BIND(STR(?typeRDF) AS ?type).
BIND(STR(?ressource) AS ?uri).
OPTIONAL {?parent (^:creation/:date) ?dateCreationParent.}
OPTIONAL {?parent (^:suppression/:date) ?dateSuppressionParent.}
OPTIONAL {?ressource (^:creation/:date) ?dateCreation.}
OPTIONAL {?ressource (^:suppression/:date) ?dateSuppression.}
}
}
FILTER(!BOUND(?dateCreationParent) || xsd:dateTime(?dateCreationParent) <= NOW())
FILTER(!BOUND(?dateSuppressionParent) || xsd:dateTime(?dateSuppressionParent) > NOW())
FILTER(!BOUND(?dateCreation) || xsd:dateTime(?dateCreation) <= NOW())
FILTER(!BOUND(?dateSuppression) || xsd:dateTime(?dateSuppression) > NOW())
}
ORDER BY ?type ?codeAvec 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 ?dateCreation ?dateSuppression
WHERE {
{
SELECT DISTINCT ?uri ?type ?code ?nom ?nomLong ?dateCreation ?dateSuppression ?dateCreationParent ?dateSuppressionParent
WHERE {
?parent a :Pays ;
:codeINSEE '99132' ;
(^:subdivisionDirecteDe)+ ?ressource .
?ressource a ?typeRDF;
:codeINSEE ?code ;
:nom ?nom .
OPTIONAL {?ressource :nomLong ?nomLong .}
BIND(STR(?typeRDF) AS ?type).
BIND(STR(?ressource) AS ?uri).
OPTIONAL {?parent (^:creation/:date) ?dateCreationParent.}
OPTIONAL {?parent (^:suppression/:date) ?dateSuppressionParent.}
OPTIONAL {?ressource (^:creation/:date) ?dateCreation.}
OPTIONAL {?ressource (^:suppression/:date) ?dateSuppression.}
}
}
FILTER(!BOUND(?dateCreationParent) || ?dateCreationParent <= '1950-01-01'^^xsd:date)
FILTER(!BOUND(?dateSuppressionParent) || ?dateSuppressionParent > '1950-01-01'^^xsd:date)
FILTER(!BOUND(?dateCreation) || ?dateCreation <= '1950-01-01'^^xsd:date)
FILTER(!BOUND(?dateSuppression) || ?dateSuppression > '1950-01-01'^^xsd:date)
}
ORDER BY ?type ?codeAvec le paramètre type :
PREFIX :<http://rdf.insee.fr/def/geo#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?uri ?type ?code ?nom ?nomLong ?dateCreation ?dateSuppression
WHERE {
{
SELECT DISTINCT ?uri ?type ?code ?nom ?nomLong ?dateCreation ?dateSuppression ?dateCreationParent ?dateSuppressionParent
WHERE {
?parent a :Pays ;
:codeINSEE '99132' ;
(^:subdivisionDirecteDe)+ ?ressource .
?ressource a ?typeRDF;
a :Territoire ;
:codeINSEE ?code ;
:nom ?nom .
OPTIONAL {?ressource :nomLong ?nomLong .}
BIND(STR(?typeRDF) AS ?type).
BIND(STR(?ressource) AS ?uri).
OPTIONAL {?parent (^:creation/:date) ?dateCreationParent.}
OPTIONAL {?parent (^:suppression/:date) ?dateSuppressionParent.}
OPTIONAL {?ressource (^:creation/:date) ?dateCreation.}
OPTIONAL {?ressource (^:suppression/:date) ?dateSuppression.}
}
}
FILTER(!BOUND(?dateCreationParent) || xsd:dateTime(?dateCreationParent) <= NOW())
FILTER(!BOUND(?dateSuppressionParent) || xsd:dateTime(?dateSuppressionParent) > NOW())
FILTER(!BOUND(?dateCreation) || xsd:dateTime(?dateCreation) <= NOW())
FILTER(!BOUND(?dateSuppression) || xsd:dateTime(?dateSuppression) > NOW())
}
ORDER BY ?type ?codeAvec le paramètre type et 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 ?dateCreation ?dateSuppression
WHERE {
{
SELECT DISTINCT ?uri ?type ?code ?nom ?nomLong ?dateCreation ?dateSuppression ?dateCreationParent ?dateSuppressionParent
WHERE {
?parent a :Pays ;
:codeINSEE '99132' ;
(^:subdivisionDirecteDe)+ ?ressource .
?ressource a ?typeRDF;
a :Territoire ;
:codeINSEE ?code ;
:nom ?nom .
OPTIONAL {?ressource :nomLong ?nomLong .}
BIND(STR(?typeRDF) AS ?type).
BIND(STR(?ressource) AS ?uri).
OPTIONAL {?parent (^:creation/:date) ?dateCreationParent.}
OPTIONAL {?parent (^:suppression/:date) ?dateSuppressionParent.}
OPTIONAL {?ressource (^:creation/:date) ?dateCreation.}
OPTIONAL {?ressource (^:suppression/:date) ?dateSuppression.}
}
}
FILTER(!BOUND(?dateCreationParent) || ?dateCreationParent <= '1950-01-01'^^xsd:date)
FILTER(!BOUND(?dateSuppressionParent) || ?dateSuppressionParent > '1950-01-01'^^xsd:date)
FILTER(!BOUND(?dateCreation) || ?dateCreation <= '1950-01-01'^^xsd:date)
FILTER(!BOUND(?dateSuppression) || ?dateSuppression > '1950-01-01'^^xsd:date)
}
ORDER BY ?type ?codeMetadata
Metadata
Assignees
Labels
No labels