UNKNOWN
Project description
Summary
-------
Cube for data.gouv.fr accidents (http://www.data.gouv.fr/fr/dataset/base-de-donnees-accidents-corporels-de-la-circulation-sur-6-annees)
Installation
------------
Create an instance:
cubicweb create accidents my_instance_accidents
Create the database:
cubicweb db-create my_instance_accidents
! Do not launch the db-init !
Insert postgis:
psql my_instance_accidents -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
psql my_instance_accidents -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
Finish the db:
cubicweb db-init my_instance_accidents
Push the data:
Get the communes and departements on http://fr.dbpedia.org/sparql
in JSON, using the following request:
prefix db-owl: <http://dbpedia.org/ontology/>
select ?ville ?code ?name ?lat ?long ?dep ?depcode ?depname where {
?ville db-owl:country <http://fr.dbpedia.org/resource/France> .
?ville dbpedia-owl:inseeCode ?code.
?ville foaf:name ?name.
?ville dbpedia-owl:department ?dep.
?dep dbpedia-owl:inseeCode ?depcode.
?dep foaf:name ?depname.
?ville geo:lat ?lat.
?ville geo:long ?long.
}
Push the communes/departements using:
cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_communes.py /path/to/json/files
Download both vehicules and accidents files on data.gouv.fr.
Push the data:
cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_vehicules.py /path/to/vehicules.csv
cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_accidents.py /path/to/accidents.csv
-------
Cube for data.gouv.fr accidents (http://www.data.gouv.fr/fr/dataset/base-de-donnees-accidents-corporels-de-la-circulation-sur-6-annees)
Installation
------------
Create an instance:
cubicweb create accidents my_instance_accidents
Create the database:
cubicweb db-create my_instance_accidents
! Do not launch the db-init !
Insert postgis:
psql my_instance_accidents -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
psql my_instance_accidents -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
Finish the db:
cubicweb db-init my_instance_accidents
Push the data:
Get the communes and departements on http://fr.dbpedia.org/sparql
in JSON, using the following request:
prefix db-owl: <http://dbpedia.org/ontology/>
select ?ville ?code ?name ?lat ?long ?dep ?depcode ?depname where {
?ville db-owl:country <http://fr.dbpedia.org/resource/France> .
?ville dbpedia-owl:inseeCode ?code.
?ville foaf:name ?name.
?ville dbpedia-owl:department ?dep.
?dep dbpedia-owl:inseeCode ?depcode.
?dep foaf:name ?depname.
?ville geo:lat ?lat.
?ville geo:long ?long.
}
Push the communes/departements using:
cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_communes.py /path/to/json/files
Download both vehicules and accidents files on data.gouv.fr.
Push the data:
cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_vehicules.py /path/to/vehicules.csv
cubicweb-ctl shell my_instance_accidents /path/to/cubes/accidents/import_accidents.py /path/to/accidents.csv
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cubicweb-accidents-0.1.0.tar.gz
(14.0 kB
view details)
File details
Details for the file cubicweb-accidents-0.1.0.tar.gz
.
File metadata
- Download URL: cubicweb-accidents-0.1.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa042f1bcce979f711be4ee2c437840f2803277a34a43f3e4b6071717468b85 |
|
MD5 | 9d468765aee803afc2f3acd26b413aa7 |
|
BLAKE2b-256 | 98f1d21f31bc582cf4af0d8f4eeba72e578ebf56f917cae8a51b0739b64dd5af |