├── build.xml
├── demo
├── diaspora-france
│ ├── dspl.zip
│ ├── french-abroad-2011-linked.rdf
│ ├── french-abroad-2011.csv
│ └── french-diaspora.PNG
└── ratp
│ ├── ratp-trafic-2011.jpg
│ ├── ratp-trafic-2011.rdf
│ └── ratp_trafic_annuel_2011.csv
├── doc
├── d4-workflow.JPG
├── datacube-ontology.png
├── future-data
│ ├── Ponctualite_TGV_aou12.csv
│ ├── Ponctualite_TGV_avr12.csv
│ ├── Ponctualite_TGV_jul12.csv
│ ├── Ponctualite_TGV_jun12.csv
│ ├── Ponctualite_TGV_mai12.csv
│ ├── Ponctualite_TGV_mar12.csv
│ ├── Ponctualite_TGV_sep12.csv
│ └── liste_gares_ferroviaires_DRR2012_23-11-2011.csv
├── screenshots
│ ├── graph-view-bis.PNG
│ ├── graph-view.PNG
│ ├── metadata-view.PNG
│ ├── statistics-view.PNG
│ └── table-view.PNG
└── slides-d4.pdf
├── live-build.xml
├── readme.md
└── src
├── java
└── org
│ └── datalift
│ └── d4
│ ├── D4Controller.java
│ ├── D4Model.java
│ ├── ModuleController.java
│ ├── ModuleModel.java
│ ├── datacube
│ ├── DataSet.java
│ ├── DataSetORM.java
│ └── Observation.java
│ └── package.html
└── web
├── d4-form.vm
├── public
└── static
│ ├── css
│ ├── DT_bootstrap.css
│ ├── back_disabled.png
│ ├── back_enabled.png
│ ├── back_enabled_hover.png
│ ├── bootstrap-responsive.css
│ ├── bootstrap.css
│ ├── forward_disabled.png
│ ├── forward_enabled.png
│ ├── forward_enabled_hover.png
│ ├── glyphicons-halflings-white.png
│ ├── glyphicons-halflings.png
│ ├── main.css
│ ├── sort_asc.png
│ ├── sort_asc_disabled.png
│ ├── sort_both.png
│ ├── sort_desc.png
│ └── sort_desc_disabled.png
│ └── js
│ ├── charts.js
│ ├── jqgrid.common.js
│ ├── main.coffee
│ ├── main.js
│ ├── plugins.coffee
│ ├── plugins.js
│ ├── stats.coffee
│ ├── stats.js
│ └── vendor
│ ├── DT_bootstrap.js
│ ├── bootstrap.js
│ ├── d3.v2.js
│ ├── jquery-1.8.2.js
│ ├── jquery.dataTables.js
│ ├── underscore.min.js
│ └── underscore.string.min.js
├── resources_en.properties
└── resources_fr.properties
/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
24 |
32 |
33 |
34 |
35 |
36 |
37 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
182 |
183 |
185 |
186 |
187 |
188 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
228 |
229 |
231 |
232 |
237 |
238 |
239 |
240 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
252 |
253 |
254 |
255 |
256 |
257 |
259 |
260 |
261 |
262 |
263 |
264 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
281 |
282 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
298 |
299 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
--------------------------------------------------------------------------------
/demo/diaspora-france/dspl.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/demo/diaspora-france/dspl.zip
--------------------------------------------------------------------------------
/demo/diaspora-france/french-abroad-2011.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/demo/diaspora-france/french-abroad-2011.csv
--------------------------------------------------------------------------------
/demo/diaspora-france/french-diaspora.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/demo/diaspora-france/french-diaspora.PNG
--------------------------------------------------------------------------------
/demo/ratp/ratp-trafic-2011.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/demo/ratp/ratp-trafic-2011.jpg
--------------------------------------------------------------------------------
/demo/ratp/ratp_trafic_annuel_2011.csv:
--------------------------------------------------------------------------------
1 | ,Trafic des entrants (*) par station pour l'ensemble de l'année 2011,,,,,,,,,,
2 | ,,,,,,,,,,,
3 | ,Rang,Réseau,Station,Trafic,Ligne de correspondances RATP,,,,,Ville,Arrondissement pour Paris
4 | ,1,Métro,GARE DU NORD,48 146 629,4,5,0,0,0,Paris,10
5 | ,2,Métro,SAINT-LAZARE ,46 790 941,3,9,12,13,14,Paris,08
6 | ,3,Métro,GARE DE LYON ,34 523 049,1,14,A,,,Paris,12
7 | ,4,Métro,MONTPARNASSE-BIENVENUE,31 152 275,4,6,12,13,0,Paris,14
8 | ,5,Métro,GARE DE L'EST,19 671 320,4,5,7,0,0,Paris,10
9 | ,6,Métro,REPUBLIQUE,17 095 806,3,5,8,9,11,Paris,11
10 | ,7,Métro,BIBLIOTHEQUE,15 826 727,14,0,0,0,0,Paris,13
11 | ,8,Métro,CHATELET,14 440 964,1,4,7,11,14,Paris,01
12 | ,9,Métro,LA DEFENSE,13 853 216,1,0,0,0,0,Puteaux,
13 | ,10,Métro,LES HALLES,13 113 834,4,0,0,0,0,Paris,01
14 | ,11,Métro,HOTEL DE VILLE,12 760 823,1,11,0,0,0,Paris,04
15 | ,12,Métro,FRANKLIN D. ROOSEVELT,12 640 577,1,9,0,0,0,Paris,08
16 | ,13,Métro,BASTILLE,12 517 181,1,5,8,0,0,Paris,12
17 | ,14,Métro,OPERA,12 389 715,3,7,8,0,0,Paris,09
18 | ,15,Métro,PLACE D'ITALIE,12 168 442,5,6,7,0,0,Paris,13
19 | ,16,Métro,BELLEVILLE,11 794 952,2,11,0,0,0,Paris,10
20 | ,17,Métro,PORTE D'ORLEANS,9 598 097,4,0,0,0,0,Paris,14
21 | ,18,Métro,PALAIS-ROYAL,9 559 535,1,7,0,0,0,Paris,01
22 | ,19,Métro,NATION,9 481 963,1,2,6,9,0,Paris,12
23 | ,20,Métro,BARBES-ROCHECHOUART,9 323 474,2,4,0,0,0,Paris,18
24 | ,21,Métro,PLACE CLICHY,9 255 747,2,13,0,0,0,Paris,17
25 | ,22,Métro,SAINT-MICHEL,9 159 024,4,0,0,0,0,Paris,05
26 | ,23,Métro,GARE D'AUSTERLITZ,9 063 260,5,10,0,0,0,Paris,13
27 | ,24,Métro,PORTE DE CLIGNANCOURT,9 000 298,4,0,0,0,0,Paris,18
28 | ,25,Métro,CHARLES DE GAULLE-ETOILE,8 980 015,1,2,6,0,0,Paris,08
29 | ,26,Métro,PORTE MAILLOT,8 852 329,1,0,0,0,0,Paris,16
30 | ,27,Métro,ESPLANADE DE LA DEFENSE,8 721 277,1,0,0,0,0,Puteaux,
31 | ,28,Métro,TROCADERO,8 455 619,6,9,0,0,0,Paris,16
32 | ,29,Métro,HAVRE-CAUMARTIN,8 343 415,3,9,0,0,0,Paris,09
33 | ,30,Métro,LA MOTTE-PICQUET-GRENELLE,8 099 346,6,8,10,0,0,Paris,15
34 | ,31,Métro,BIR-HAKEIM,7 825 821,6,0,0,0,0,Paris,15
35 | ,32,Métro,CHAUSSEE D'ANTIN-LA FAYETTE,7 778 782,7,9,0,0,0,Paris,09
36 | ,33,Métro,GAMBETTA,7 576 845,3,3bis,0,0,0,Paris,20
37 | ,34,Métro,MADELEINE,7 412 746,8,12,14,0,0,Paris,08
38 | ,35,Métro,AUBERVILLIERS-PANTIN-QUATRE CHEMINS,7 356 008,7,0,0,0,0,Aubervilliers,
39 | ,36,Métro,STRASBOURG-SAINT-DENIS,7 346 063,4,8,9,0,0,Paris,02
40 | ,37,Métro,OLYMPIADES,7 245 724,14,0,0,0,0,Paris,13
41 | ,38,Métro,CRIMEE,7 183 997,7,0,0,0,0,Paris,19
42 | ,39,Métro,INVALIDES,6 931 062,8,13,0,0,0,Paris,07
43 | ,40,Métro,STALINGRAD,6 906 194,2,5,7,0,0,Paris,19
44 | ,41,Métro,LA CHAPELLE,6 903 632,2,0,0,0,0,Paris,09
45 | ,42,Métro,MAIRIE DE CLICHY,6 892 451,13,0,0,0,0,Clichy,
46 | ,43,Métro,CONCORDE,6 866 631,1,8,12,0,0,Paris,08
47 | ,44,Métro,GRANDS BOULEVARDS,6 826 718,8,9,0,0,0,Paris,09
48 | ,45,Métro,CHATEAU ROUGE,6 798 017,4,0,0,0,0,Paris,18
49 | ,46,Métro,PONT DE NEUILLY,6 794 402,1,0,0,0,0,Neuilly Sur Seine,
50 | ,47,Métro,BOBIGNY-PABLO PICASSO,6 722 182,5,0,0,0,0,Bobigny,
51 | ,48,Métro,ANVERS,6 667 509,2,0,0,0,0,Paris,18
52 | ,49,Métro,CHATILLON-MONTROUGE,6 540 563,13,0,0,0,0,Chatillon,
53 | ,50,Métro,GALLIENI,6 314 009,3,0,0,0,0,Bagnolet,
54 | ,51,Métro,MAIRIE DE MONTREUIL,6 300 355,9,0,0,0,0,Montreuil,
55 | ,52,Métro,PORTE DE VERSAILLES,6 275 922,12,0,0,0,0,Paris,15
56 | ,53,Métro,SAINT-PAUL,6 265 848,1,0,0,0,0,Paris,04
57 | ,54,Métro,ODEON,6 239 672,4,10,0,0,0,Paris,06
58 | ,55,Métro,VILLIERS,6 193 182,2,3,0,0,0,Paris,17
59 | ,56,Métro,GEORGE V,6 192 199,1,0,0,0,0,Paris,08
60 | ,57,Métro,PIGALLE,6 172 069,2,12,0,0,0,Paris,18
61 | ,58,Métro,MARCADET-POISSONNIERS,6 064 992,4,12,0,0,0,Paris,18
62 | ,59,Métro,JAURES,6 046 012,2,5,7bis,0,0,Paris,19
63 | ,60,Métro,SAINT-MANDE-TOURELLE,5 973 612,1,0,0,0,0,Saint Mandé,
64 | ,61,Métro,REAUMUR-SEBASTOPOL,5 860 077,3,4,0,0,0,Paris,03
65 | ,62,Métro,MARCEL SEMBAT,5 816 044,9,0,0,0,0,Boulogne Billancourt,
66 | ,63,Métro,CONVENTION,5 780 845,12,0,0,0,0,Paris,15
67 | ,64,Métro,MIROMESNIL,5 769 023,9,13,0,0,0,Paris,08
68 | ,65,Métro,LA COURNEUVE-8 MAI 1945,5 707 118,7,0,0,0,0,La Courneuve,
69 | ,66,Métro,VILLEJUIF-LOUIS ARAGON,5 650 185,7,0,0,0,0,Villejuif,
70 | ,67,Métro,SEVRES-BABYLONE,5 618 445,10,12,0,0,0,Paris,07
71 | ,68,Métro,BERCY,5 565 249,6,14,0,0,0,Paris,12
72 | ,69,Métro,COUR SAINT-EMILION,5 550 822,14,0,0,0,0,Paris,12
73 | ,70,Métro,REUILLY-DIDEROT,5 451 933,1,8,0,0,0,Paris,12
74 | ,71,Métro,DAUMESNIL,5 435 445,6,8,0,0,0,Paris,12
75 | ,72,Métro,LES SABLONS,5 430 088,1,0,0,0,0,Neuilly Sur Seine,
76 | ,73,Métro,BASILIQUE DE SAINT-DENIS,5 415 515,13,0,0,0,0,Saint Denis,
77 | ,74,Métro,GABRIEL PERI,5 377 830,13,0,0,0,0,Asnières,
78 | ,75,Métro,SAINT-DENIS-UNIVERSITE,5 365 746,13,0,0,0,0,Saint Denis,
79 | ,76,Métro,ALESIA,5 317 934,4,0,0,0,0,Paris,14
80 | ,77,Métro,RICHELIEU-DROUOT,5 297 670,8,9,0,0,0,Paris,09
81 | ,78,Métro,VOLTAIRE,5 273 953,9,0,0,0,0,Paris,11
82 | ,79,Métro,HOCHE,5 217 935,5,0,0,0,0,Pantin,
83 | ,80,Métro,BONNE NOUVELLE,5 196 140,8,9,0,0,0,Paris,10
84 | ,81,Métro,PASTEUR,5 089 504,6,12,0,0,0,Paris,09
85 | ,82,Métro,PONT DE LEVALLOIS-BECON,5 085 695,3,0,0,0,0,Levallois-Perret,
86 | ,83,Métro,PYRAMIDES,5 084 082,7,14,0,0,0,Paris,01
87 | ,84,Métro,CROIX DE CHAVAUX,4 978 787,9,0,0,0,0,Montreuil,
88 | ,85,Métro,PORTE DE SAINT-CLOUD,4 932 701,9,0,0,0,0,Paris,16
89 | ,86,Métro,PERE LACHAISE,4 880 201,2,3,0,0,0,Paris,20
90 | ,87,Métro,CRETEIL-PREFECTURE,4 865 573,8,0,0,0,0,Créteil,
91 | ,88,Métro,CHATEAU DE VINCENNES,4 858 849,1,0,0,0,0,Vincennes,
92 | ,89,Métro,CHATEAU D'EAU,4 842 822,4,0,0,0,0,Paris,10
93 | ,90,Métro,PORTE DE MONTREUIL,4 822 893,9,0,0,0,0,Paris,20
94 | ,91,Métro,PORTE DE BAGNOLET,4 751 655,3,0,0,0,0,Paris,20
95 | ,92,Métro,GLACIERE,4 739 497,6,0,0,0,0,Paris,13
96 | ,93,Métro,PORTE DE VANVES,4 715 395,13,0,0,0,0,Paris,14
97 | ,94,Métro,PEREIRE,4 678 888,3,0,0,0,0,Paris,17
98 | ,95,Métro,PLAISANCE,4 645 997,13,0,0,0,0,Paris,14
99 | ,96,Métro,MAIRIE DES LILAS,4 602 681,11,0,0,0,0,Les Lilas,
100 | ,97,Métro,COLONEL FABIEN,4 554 566,2,0,0,0,0,Paris,10
101 | ,98,Métro,SAINT-GERMAIN DES PRES,4 548 167,4,0,0,0,0,Paris,06
102 | ,99,Métro,GUY MOQUET,4 524 101,13,0,0,0,0,Paris,17
103 | ,100,Métro,LAUMIERE,4 518 075,5,0,0,0,0,Paris,19
104 | ,101,Métro,CHAMPS-ELYSEES-CLEMENCEAU,4 502 691,1,13,0,0,0,Paris,08
105 | ,102,Métro,LE KREMLIN-BICETRE,4 492 364,7,0,0,0,0,Kremlin-Bicêtre,
106 | ,103,Métro,RAMBUTEAU,4 491 306,11,0,0,0,0,Paris,03
107 | ,104,Métro,PORTE DE PANTIN,4 477 959,5,0,0,0,0,Paris,19
108 | ,105,Métro,ECOLE MILITAIRE,4 403 029,8,0,0,0,0,Paris,07
109 | ,106,Métro,JULES JOFFRIN,4 384 318,12,0,0,0,0,Paris,18
110 | ,107,Métro,PORTE DE VINCENNES,4 363 767,1,0,0,0,0,Paris,12
111 | ,108,Métro,PONT DE SEVRES,4 352 829,9,0,0,0,0,Boulogne Billancourt,
112 | ,109,Métro,DENFERT-ROCHEREAU,4 335 086,4,6,0,0,0,Paris,14
113 | ,110,Métro,ROBESPIERRE,4 317 097,9,0,0,0,0,Montreuil,
114 | ,111,Métro,MENILMONTANT,4 294 888,2,0,0,0,0,Paris,11
115 | ,112,Métro,BALARD,4 263 152,8,0,0,0,0,Paris,15
116 | ,113,Métro,BLANCHE,4 252 071,2,0,0,0,0,Paris,09
117 | ,114,Métro,OBERKAMPF,4 198 870,5,9,0,0,0,Paris,11
118 | ,115,Métro,MAIRIE D'ISSY,4 194 027,12,0,0,0,0,Issy Les Moulineaux,
119 | ,116,Métro,PORTE DE CLICHY,4 156 619,13,0,0,0,0,Paris,17
120 | ,117,Métro,LA MUETTE,4 112 862,9,0,0,0,0,Paris,16
121 | ,118,Métro,JUSSIEU,4 080 680,7,10,0,0,0,Paris,05
122 | ,119,Métro,ALMA-MARCEAU,4 080 301,9,0,0,0,0,Paris,08
123 | ,120,Métro,VICTOR HUGO,3 966 843,2,0,0,0,0,Paris,16
124 | ,121,Métro,TERNES,3 930 362,2,0,0,0,0,Paris,17
125 | ,122,Métro,ALEXANDRE DUMAS,3 926 266,2,0,0,0,0,Paris,11
126 | ,123,Métro,CHARONNE,3 924 516,9,0,0,0,0,Paris,12
127 | ,124,Métro,PASSY,3 918 954,6,0,0,0,0,Paris,16
128 | ,125,Métro,MALAKOFF-PLATEAU DE VANVES,3 912 036,13,0,0,0,0,Malakoff,
129 | ,126,Métro,PORTE DES LILAS,3 899 020,3bis,11,0,0,0,Paris,20
130 | ,127,Métro,CHARLES MICHELS,3 892 728,10,0,0,0,0,Paris,15
131 | ,128,Métro,OURCQ,3 887 042,5,0,0,0,0,Paris,19
132 | ,129,Métro,ARTS ET METIERS,3 859 066,3,11,0,0,0,Paris,03
133 | ,130,Métro,DUPLEIX,3 855 503,6,0,0,0,0,Paris,15
134 | ,131,Métro,VAUGIRARD,3 853 128,12,0,0,0,0,Paris,15
135 | ,132,Métro,LES GOBELINS,3 830 231,7,0,0,0,0,Paris,13
136 | ,133,Métro,LEDRU-ROLLIN,3 829 461,8,0,0,0,0,Paris,12
137 | ,134,Métro,PORTE DE SAINT-OUEN,3 814 464,13,0,0,0,0,Paris,17
138 | ,135,Métro,CENSIER-DAUBENTON,3 766 777,7,0,0,0,0,Paris,06
139 | ,136,Métro,BOULOGNE-JEAN JAURES,3 748 047,10,0,0,0,0,Boulogne Billancourt,
140 | ,137,Métro,MAIRIE DE SAINT-OUEN,3 732 408,13,0,0,0,0,Saint Ouen,
141 | ,138,Métro,ANATOLE FRANCE,3 702 732,3,0,0,0,0,Levallois-Perret,
142 | ,139,Métro,CADET,3 650 405,7,0,0,0,0,Paris,09
143 | ,140,Métro,GONCOURT,3 648 533,11,0,0,0,0,Paris,11
144 | ,141,Métro,EGLISE DE PANTIN,3 632 300,5,0,0,0,0,Pantin,
145 | ,142,Métro,TOLBIAC,3 612 890,7,0,0,0,0,Paris,13
146 | ,143,Métro,MARX DORMOY,3 586 107,12,0,0,0,0,Paris,18
147 | ,144,Métro,POISSONNIERE,3 570 062,7,0,0,0,0,Paris,10
148 | ,145,Métro,PORTE DE CHAMPERRET,3 559 682,3,0,0,0,0,Paris,17
149 | ,146,Métro,SAINT-DENIS-PORTE DE PARIS,3 517 853,13,0,0,0,0,Saint Denis,
150 | ,147,Métro,FUNICULAIRE,3 488 052,2,0,0,0,0,Paris,18
151 | ,148,Métro,FORT D'AUBERVILLIERS,3 455 421,7,0,0,0,0,Aubervilliers,
152 | ,149,Métro,PORTE DE LA CHAPELLE,3 431 552,12,0,0,0,0,Paris,18
153 | ,150,Métro,JOURDAIN,3 418 732,11,0,0,0,0,Paris,20
154 | ,151,Métro,SAINT-PLACIDE,3 404 889,4,0,0,0,0,Paris,06
155 | ,152,Métro,BROCHANT,3 401 859,13,0,0,0,0,Paris,17
156 | ,153,Métro,CORENTIN CELTON,3 385 005,12,0,0,0,0,Issy Les Moulineaux,
157 | ,154,Métro,LES COURTILLES,3 377 106,13,0,0,0,0,Asnières sur Seine,
158 | ,155,Métro,ECOLE VETERINAIRE DE MAISONS-ALFORT,3 371 386,8,0,0,0,0,Maisons -Alfort,
159 | ,156,Métro,PARMENTIER,3 357 432,3,0,0,0,0,Paris,11
160 | ,157,Métro,BOURSE,3 350 796,3,0,0,0,0,Paris,02
161 | ,158,Métro,COURONNES,3 324 335,2,0,0,0,0,Paris,11
162 | ,159,Métro,SENTIER,3 318 660,3,0,0,0,0,Paris,03
163 | ,160,Métro,PYRENEES,3 279 317,11,0,0,0,0,Paris,20
164 | ,161,Métro,PERNETY,3 275 971,13,0,0,0,0,Paris,14
165 | ,162,Métro,PLACE DES FETES,3 265 485,7bis,11,0,0,0,Paris,19
166 | ,163,Métro,LOUISE MICHEL,3 240 270,3,0,0,0,0,Levallois-Perret,
167 | ,164,Métro,GAITE,3 223 366,13,0,0,0,0,Paris,14
168 | ,165,Métro,DUROC,3 218 029,10,13,0,0,0,Paris,07
169 | ,166,Métro,PORTE DE LA VILLETTE,3 209 252,7,0,0,0,0,Paris,19
170 | ,167,Métro,CAMBRONNE,3 155 480,6,0,0,0,0,Paris,15
171 | ,168,Métro,PORTE DE CHOISY,3 116 890,7,0,0,0,0,Paris,13
172 | ,169,Métro,CRETEIL-UNIVERSITE,3 116 625,8,0,0,0,0,Créteil,
173 | ,170,Métro,CORENTIN CARIOU,3 090 833,7,0,0,0,0,Paris,19
174 | ,171,Métro,GARIBALDI,3 088 530,13,0,0,0,0,Saint Ouen,
175 | ,172,Métro,QUAI DE LA GARE,3 085 406,6,0,0,0,0,Paris,13
176 | ,173,Métro,RUE DE LA POMPE,3 081 914,9,0,0,0,0,Paris,16
177 | ,174,Métro,LAMARCK-CAULAINCOURT,3 054 528,12,0,0,0,0,Paris,18
178 | ,175,Métro,CHEVALERET,2 999 174,6,0,0,0,0,Paris,13
179 | ,176,Métro,SIMPLON,2 996 051,4,0,0,0,0,Paris,18
180 | ,177,Métro,MARAICHERS,2 986 282,9,0,0,0,0,Paris,20
181 | ,178,Métro,CHARENTON-ECOLES,2 975 899,8,0,0,0,0,Charenton,
182 | ,179,Métro,LA FOURCHE,2 975 434,13,0,0,0,0,Paris,08
183 | ,180,Métro,FAIDHERBE-CHALIGNY,2 974 641,8,0,0,0,0,Paris,12
184 | ,181,Métro,MAIRIE D'IVRY,2 973 671,7,0,0,0,0,Ivry,
185 | ,182,Métro,PLACE MONGE,2 927 184,7,0,0,0,0,Paris,06
186 | ,183,Métro,SAINT-AUGUSTIN,2 923 768,9,0,0,0,0,Paris,08
187 | ,184,Métro,BOULOGNE-PONT DE SAINT-CLOUD,2 900 015,10,0,0,0,0,Boulogne Billancourt,
188 | ,185,Métro,NOTRE-DAME-DE-LORETTE,2 849 349,12,0,0,0,0,Paris,09
189 | ,186,Métro,SAINT-MAUR,2 846 171,3,0,0,0,0,Paris,11
190 | ,187,Métro,PORTE DAUPHINE,2 840 152,2,0,0,0,0,Paris,16
191 | ,188,Métro,BOUCICAUT,2 826 775,8,0,0,0,0,Paris,15
192 | ,189,Métro,ARGENTINE,2 820 883,1,0,0,0,0,Paris,17
193 | ,190,Métro,SAINT-PHILIPPE-DU-ROULE,2 813 350,9,0,0,0,0,Paris,08
194 | ,191,Métro,SAINT-AMBROISE,2 758 716,9,0,0,0,0,Paris,11
195 | ,192,Métro,CARREFOUR PLEYEL,2 754 091,13,0,0,0,0,Saint Denis,
196 | ,193,Métro,ROME,2 747 395,2,0,0,0,0,Paris,17
197 | ,194,Métro,CLUNY LA SORBONNE,2 744 528,10,0,0,0,0,0,
198 | ,195,Métro,COMMERCE,2 700 300,8,0,0,0,0,Paris,15
199 | ,196,Métro,DUGOMMIER,2 694 014,6,0,0,0,0,Paris,12
200 | ,197,Métro,COURCELLES,2 685 096,2,0,0,0,0,Paris,17
201 | ,198,Métro,PORTE DOREE,2 675 992,8,0,0,0,0,Paris,12
202 | ,199,Métro,RUE DES BOULETS,2 669 336,9,0,0,0,0,Paris,11
203 | ,200,Métro,ETIENNE MARCEL,2 661 074,4,0,0,0,0,Paris,01
204 | ,201,Métro,BILLANCOURT,2 643 194,9,0,0,0,0,Boulogne Billancourt,
205 | ,202,Métro,NATIONALE,2 626 967,6,0,0,0,0,Paris,13
206 | ,203,Métro,JACQUES BONSERGENT,2 622 801,5,0,0,0,0,Paris,10
207 | ,204,Métro,LIBERTE,2 607 263,8,0,0,0,0,Charenton,
208 | ,205,Métro,CORVISART,2 604 292,6,0,0,0,0,Paris,13
209 | ,206,Métro,LOUVRE,2 582 023,1,0,0,0,0,Paris,01
210 | ,207,Métro,WAGRAM,2 575 735,3,0,0,0,0,Paris,17
211 | ,208,Métro,RUE DU BAC,2 563 169,12,0,0,0,0,Paris,07
212 | ,209,Métro,PORTE D'ITALIE,2 562 120,7,0,0,0,0,Paris,13
213 | ,210,Métro,MAUBERT-MUTUALITE,2 549 853,10,0,0,0,0,Paris,05
214 | ,211,Métro,VOLONTAIRES,2 547 550,12,0,0,0,0,Paris,15
215 | ,212,Métro,MALESHERBES,2 546 859,3,0,0,0,0,Paris,17
216 | ,213,Métro,ABBESSES,2 545 127,12,0,0,0,0,Paris,18
217 | ,214,Métro,BERAULT,2 531 531,1,0,0,0,0,Vincennes,
218 | ,215,Métro,LOUIS BLANC,2 523 039,7,7bis,0,0,0,Paris,10
219 | ,216,Métro,RIQUET,2 519 241,7,0,0,0,0,Paris,19
220 | ,217,Métro,TUILERIES,2 473 945,1,0,0,0,0,Paris,01
221 | ,218,Métro,JAVEL-ANDRE CITROEN,2 473 278,10,0,0,0,0,Paris,15
222 | ,219,Métro,SOLFERINO,2 449 915,12,0,0,0,0,Paris,07
223 | ,220,Métro,BREGUET-SABIN,2 448 167,5,0,0,0,0,Paris,11
224 | ,221,Métro,LOURMEL,2 441 226,8,0,0,0,0,Paris,15
225 | ,222,Métro,SAINT-SULPICE,2 432 022,4,0,0,0,0,Paris,06
226 | ,223,Métro,SEVRES-LECOURBE,2 416 242,6,0,0,0,0,Paris,15
227 | ,224,Métro,VILLEJUIF-LEO LAGRANGE,2 392 154,7,0,0,0,0,Villejuif,
228 | ,225,Métro,BEL AIR,2 369 793,6,0,0,0,0,Paris,12
229 | ,226,Métro,LES AGNETTES,2 367 677,13,0,0,0,0,Asnières sur Seine,
230 | ,227,Métro,CITE,2 364 993,4,0,0,0,0,Paris,04
231 | ,228,Métro,RANELAGH,2 315 446,9,0,0,0,0,Paris,16
232 | ,229,Métro,BOBIGNY-PANTIN-RAYMOND QUENEAU,2 251 347,5,0,0,0,0,Pantin,
233 | ,230,Métro,VAVIN,2 242 491,4,0,0,0,0,Paris,14
234 | ,231,Métro,LE PELETIER,2 235 088,7,0,0,0,0,Paris,09
235 | ,232,Métro,EDGAR QUINET,2 224 650,6,0,0,0,0,Paris,14
236 | ,233,Métro,MICHEL-ANGE-AUTEUIL,2 206 285,9,10,0,0,0,Paris,16
237 | ,234,Métro,TRINITE-D'ESTIENNE D'ORVES,2 192 391,12,0,0,0,0,Paris,09
238 | ,235,Métro,TELEGRAPHE,2 160 412,11,0,0,0,0,Paris,20
239 | ,236,Métro,MAISON BLANCHE,2 155 971,7,0,0,0,0,Paris,13
240 | ,237,Métro,BOISSIERE,2 145 714,6,0,0,0,0,Paris,16
241 | ,238,Métro,VILLEJUIF-PAUL VAILLANT-COUTURIER,2 118 126,7,0,0,0,0,Villejuif,
242 | ,239,Métro,IENA,2 115 003,9,0,0,0,0,Paris,16
243 | ,240,Métro,MICHEL BIZOT,2 111 494,8,0,0,0,0,Paris,12
244 | ,241,Métro,CRETEIL-L'ECHAT,2 109 885,8,0,0,0,0,Créteil,
245 | ,242,Métro,JASMIN,2 065 058,9,0,0,0,0,Paris,16
246 | ,243,Métro,LA TOUR-MAUBOURG,2 055 583,8,0,0,0,0,Paris,07
247 | ,244,Métro,NOTRE-DAME-DES-CHAMPS,2 030 493,12,0,0,0,0,Paris,06
248 | ,245,Métro,SAINT-MARCEL,2 023 002,5,0,0,0,0,Paris,13
249 | ,246,Métro,EXELMANS,1 985 640,9,0,0,0,0,Paris,16
250 | ,247,Métro,MAISONS-ALFORT-LES JUILLIOTTES,1 976 516,8,0,0,0,0,Maisons -Alfort,
251 | ,248,Métro,MICHEL-ANGE-MOLITOR,1 939 507,9,10,0,0,0,Paris,16
252 | ,249,Métro,SAINT-JACQUES,1 937 457,6,0,0,0,0,Paris,13
253 | ,250,Métro,FELIX FAURE,1 932 459,8,0,0,0,0,Paris,15
254 | ,251,Métro,AVRON,1 922 250,2,0,0,0,0,Paris,11
255 | ,252,Métro,MABILLON,1 915 829,10,0,0,0,0,Paris,06
256 | ,253,Métro,PORTE D'IVRY,1 903 789,7,0,0,0,0,Paris,13
257 | ,254,Métro,BUZENVAL,1 853 733,9,0,0,0,0,Paris,20
258 | ,255,Métro,SAINT-FRANCOIS-XAVIER,1 850 407,13,0,0,0,0,Paris,07
259 | ,256,Métro,MALAKOFF-RUE ETIENNE DOLET,1 846 661,13,0,0,0,0,Malakoff,
260 | ,257,Métro,PHILIPPE AUGUSTE,1 813 811,2,0,0,0,0,Paris,11
261 | ,258,Métro,MONTGALLET,1 793 225,8,0,0,0,0,Paris,12
262 | ,259,Métro,RASPAIL,1 785 546,4,6,0,0,0,Paris,14
263 | ,260,Métro,QUATRE-SEPTEMBRE,1 751 431,3,0,0,0,0,Paris,02
264 | ,261,Métro,LIEGE,1 731 063,13,0,0,0,0,Paris,08
265 | ,262,Métro,MOUTON-DUVERNET,1 690 457,4,0,0,0,0,Paris,14
266 | ,263,Métro,SAINT-SEBASTIEN-FROISSART,1 680 231,8,0,0,0,0,Paris,03
267 | ,264,Métro,FILLES DU CALVAIRE,1 663 111,8,0,0,0,0,Paris,03
268 | ,265,Métro,CARDINAL LEMOINE,1 661 863,10,0,0,0,0,Paris,05
269 | ,266,Métro,RICHARD LENOIR,1 640 016,5,0,0,0,0,Paris,11
270 | ,267,Métro,SEGUR,1 627 318,10,0,0,0,0,Paris,15
271 | ,268,Métro,PONT NEUF,1 612 517,7,0,0,0,0,Paris,04
272 | ,269,Métro,SULLY-MORLAND,1 606 960,7,0,0,0,0,Paris,04
273 | ,270,Métro,MONCEAU,1 605 664,2,0,0,0,0,Paris,17
274 | ,271,Métro,CHATEAU-LANDON,1 600 022,7,0,0,0,0,Paris,10
275 | ,272,Métro,PONT MARIE,1 595 098,7,0,0,0,0,Paris,04
276 | ,273,Métro,EUROPE,1 536 565,3,0,0,0,0,Paris,08
277 | ,274,Métro,MAISONS-ALFORT-STADE,1 523 038,8,0,0,0,0,Maisons -Alfort,
278 | ,275,Métro,VARENNE,1 517 830,13,0,0,0,0,Paris,07
279 | ,276,Métro,PICPUS,1 496 432,6,0,0,0,0,Paris,12
280 | ,277,Métro,AVENUE EMILE ZOLA,1 479 756,10,0,0,0,0,Paris,15
281 | ,278,Métro,CHEMIN VERT,1 448 436,8,0,0,0,0,Paris,11
282 | ,279,Métro,PIERRE CURIE,1 416 989,7,0,0,0,0,Ivry,
283 | ,280,Métro,MIRABEAU,1 387 272,10,0,0,0,0,Paris,16
284 | ,281,Métro,RENNES,1 307 167,12,0,0,0,0,Paris,06
285 | ,282,Métro,TEMPLE,1 268 036,3,0,0,0,0,Paris,02
286 | ,283,Métro,SAINT-GEORGES,1 254 251,12,0,0,0,0,Paris,09
287 | ,284,Métro,CAMPO-FORMIO,1 234 237,5,0,0,0,0,Paris,13
288 | ,285,Métro,QUAI DE LA RAPEE,1 201 924,5,0,0,0,0,Paris,12
289 | ,286,Métro,KLEBER,1 150 016,6,0,0,0,0,Paris,16
290 | ,287,Métro,BOTZARIS,1 096 111,7bis,0,0,0,0,Paris,19
291 | ,288,Métro,ASSEMBLEE NATIONALE,1 085 710,12,0,0,0,0,Paris,07
292 | ,289,Métro,SAINT-FARGEAU,979 912,3bis,0,0,0,0,Paris,08
293 | ,290,Métro,PORTE DE CHARENTON,957 771,8,0,0,0,0,Paris,12
294 | ,291,Métro,VANEAU,928 476,10,0,0,0,0,Paris,07
295 | ,292,Métro,FALGUIERE,926 922,12,0,0,0,0,Paris,15
296 | ,293,Métro,PORTE D'AUTEUIL,721 009,10,0,0,0,0,Paris,16
297 | ,294,Métro,DANUBE,679 746,7bis,0,0,0,0,Paris,19
298 | ,295,Métro,CHARDON-LAGACHE,636 141,10,0,0,0,0,Paris,16
299 | ,296,Métro,BOLIVAR,582 328,7bis,0,0,0,0,Paris,19
300 | ,297,Métro,BUTTES-CHAUMONT,575 182,7bis,0,0,0,0,Paris,19
301 | ,298,Métro,PRE-SAINT-GERVAIS,451 729,7bis,0,0,0,0,Paris,19
302 | ,299,Métro,CRETEIL-POINTE DU LAC,389 235,8,0,0,0,0,,
303 | ,300,Métro,PELLEPORT,364 642,3bis,0,0,0,0,Paris,20
304 | ,301,Métro,EGLISE D'AUTEUIL,178 152,10,0,0,0,0,Paris,16
305 | ,1,RER,GARE DU NORD-RER,44 596 876,B,0,0,0,0,Paris,10
306 | ,2,RER,GARE DE LYON-RER,31 495 687,A,0,0,0,0,Paris,12
307 | ,3,RER,LA DEFENSE-RER,29 783 058,A,0,0,0,0,Puteaux ,
308 | ,4,RER,NANTERRE-PREFECTURE,23 052 703,A,0,0,0,0,Nanterre ,
309 | ,5,RER,CHATELET-LES HALLES-RER,12 986 517,A,B,0,0,0,Paris,01
310 | ,6,RER,VAL DE FONTENAY,11 369 665,A,0,0,0,0,Fontenay-sous-Bois,
311 | ,7,RER,CHARLES DE GAULLE-ETOILE-RER,9 974 724,A,0,0,0,0,Paris,17
312 | ,8,RER,MASSY-PALAISEAU,8 479 103,B,0,0,0,0,Massy,
313 | ,9,RER,SAINT-MICHEL-NOTRE-DAME,8 410 856,B,0,0,0,0,Paris,00
314 | ,10,RER,NOISY-LE-GRAND-MONT D'EST,6 866 727,A,0,0,0,0,Noisy-le-Grand,
315 | ,11,RER,RUEIL-MALMAISON,6 615 943,A,0,0,0,0,Rueil-Malmaison ,
316 | ,12,RER,ANTONY,6 372 562,B,0,0,0,0,Antony,
317 | ,13,RER,CITE UNIVERSITAIRE,6 359 072,B,0,0,0,0,Paris,14
318 | ,14,RER,VINCENNES,5 874 104,A,0,0,0,0,Vincennes,
319 | ,15,RER,LUXEMBOURG,5 838 336,B,0,0,0,0,Paris,05
320 | ,16,RER,AUBER,5 667 365,A,0,0,0,0,Paris,09
321 | ,17,RER,NANTERRE-UNIVERSITE,5 214 188,A,0,0,0,0,Nanterre ,
322 | ,18,RER,NOISY-CHAMPS,4 669 805,A,0,0,0,0,Champs-sur-Marne,
323 | ,19,RER,NEUILLY-PLAISANCE,4 647 935,A,0,0,0,0,Neuilly-sur-Seine,
324 | ,20,RER,MARNE-LA-VALLEE-CHESSY,4 578 909,A,0,0,0,0,Montévrain,
325 | ,21,RER,SAINT-GERMAIN-EN-LAYE,4 383 920,A,0,0,0,0,Saint-Germain-en-Laye,
326 | ,22,RER,BOURG-LA-REINE,4 309 137,B,0,0,0,0,Bourg la Reine,
327 | ,23,RER,DENFERT-ROCHEREAU-RER,4 262 370,B,0,0,0,0,Paris,14
328 | ,24,RER,NATION-RER,4 195 903,A,0,0,0,0,Paris,12
329 | ,25,RER,TORCY,3 712 967,A,0,0,0,0,Torcy ,
330 | ,26,RER,SAINT-MAUR-CRETEIL,3 626 427,A,0,0,0,0,Saint-Maur des Fossés ,
331 | ,27,RER,JOINVILLE-LE-PONT,3 535 908,A,0,0,0,0,Joinville-le-Pont,
332 | ,28,RER,NANTERRE-VILLE,3 408 388,A,0,0,0,0,Nanterre ,
333 | ,29,RER,CHAMPIGNY,3 279 877,A,0,0,0,0,Saint-Maur des Fossés,
334 | ,30,RER,PORT ROYAL,3 242 096,B,0,0,0,0,Paris,05
335 | ,31,RER,VAL D'EUROPE,3 161 331,A,0,0,0,0,Serris ,
336 | ,32,RER,LAPLACE,3 145 389,B,0,0,0,0,Arcueil,
337 | ,33,RER,ARCUEIL-CACHAN,3 101 352,B,0,0,0,0,Arcueil,
338 | ,34,RER,LA CROIX DE BERNY,2 832 453,B,0,0,0,0,Antony,
339 | ,35,RER,NOGENT-SUR-MARNE,2 792 732,A,0,0,0,0,Nogent-sur-Marne,
340 | ,36,RER,BUSSY-SAINT-GEORGES,2 766 096,A,0,0,0,0,Bussy-Saint-Georges ,
341 | ,37,RER,NOISIEL,2 564 613,A,0,0,0,0,Noisiel,
342 | ,38,RER,FONTENAY-SOUS-BOIS,2 410 731,A,0,0,0,0,Fontenay-sous-Bois,
343 | ,39,RER,ORSAY-VILLE,2 290 579,B,0,0,0,0,Orsay,
344 | ,40,RER,ROBINSON,2 262 137,B,0,0,0,0,Sceaux,
345 | ,41,RER,BOISSY-SAINT-LEGER,2 235 716,A,0,0,0,0,Boissy-Saint-Léger,
346 | ,42,RER,GENTILLY,2 092 205,B,0,0,0,0,Gentilly,
347 | ,43,RER,LE VESINET-LE PECQ,2 078 606,A,0,0,0,0,Le Vésinet ,
348 | ,44,RER,CHATOU-CROISSY,2 057 141,A,0,0,0,0,Chatou ,
349 | ,45,RER,LE PARC DE SAINT-MAUR,2 048 678,A,0,0,0,0,Saint-Maur des Fossés,
350 | ,46,RER,BAGNEUX,1 985 787,B,0,0,0,0,Cachan,
351 | ,47,RER,SUCY-BONNEUIL,1 895 918,A,0,0,0,0,Sucy-en-Brie ,
352 | ,48,RER,BRY-SUR-MARNE,1 874 920,A,0,0,0,0,Bry-sur-Marne ,
353 | ,49,RER,LA VARENNE-CHENNEVIERES,1 830 795,A,0,0,0,0,saint-Maur des Fossés ,
354 | ,50,RER,LES BACONNETS,1 592 744,B,0,0,0,0,Antony,
355 | ,51,RER,LOGNES,1 571 347,A,0,0,0,0,Lognes ,
356 | ,52,RER,LE VESINET-CENTRE,1 218 399,A,0,0,0,0,Le Vésinet ,
357 | ,53,RER,FONTENAY-AUX-ROSES,1 028 095,B,0,0,0,0,Fontenay aux roses,
358 | ,54,RER,PALAISEAU,964 017,B,0,0,0,0,Palaiseau,
359 | ,55,RER,SAINT-REMY-LES-CHEVREUSE,911 726,B,0,0,0,0,St-Rémy-Lès-Chevreuse,
360 | ,56,RER,LE GUICHET,865 385,B,0,0,0,0,Orsay,
361 | ,57,RER,PALAISEAU-VILLEBON,865 323,B,0,0,0,0,Palaiseau,
362 | ,58,RER,LOZERE,765 952,B,0,0,0,0,Palaiseau,
363 | ,59,RER,GIF-SUR-YVETTE,717 784,B,0,0,0,0,Gif sur Yvette,
364 | ,60,RER,SCEAUX,713 823,B,0,0,0,0,sceaux,
365 | ,61,RER,BURES-SUR-YVETTE,670 230,B,0,0,0,0,Bures sur Yvette,
366 | ,62,RER,FONTAINE-MICHALON,575 331,B,0,0,0,0,Antony,
367 | ,63,RER,MASSY-VERRIERES,572 805,B,0,0,0,0,Massy,
368 | ,64,RER,COURCELLE-SUR-YVETTE,571 411,B,0,0,0,0,Gif sur Yvette,
369 | ,65,RER,PARC DE SCEAUX,523 365,B,0,0,0,0,Antony,
370 | ,66,RER,LA HACQUINIERE,425 311,B,0,0,0,0,Bures sur Yvette,
371 | ,,,,,,,,,,,
372 | ," (*) il s'agit des entrants par station qui proviennent de l'exterieur du réseau RATP (issus de la voie publique, du reseau SNCF...)",,,,,,,,,,
373 | ,"Pour certaines gares et stations, une part de ces données releve d'estimation statistiques",,,,,,,,,,
374 |
--------------------------------------------------------------------------------
/doc/d4-workflow.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/d4-workflow.JPG
--------------------------------------------------------------------------------
/doc/datacube-ontology.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/datacube-ontology.png
--------------------------------------------------------------------------------
/doc/future-data/Ponctualite_TGV_aou12.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/Ponctualite_TGV_aou12.csv
--------------------------------------------------------------------------------
/doc/future-data/Ponctualite_TGV_avr12.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/Ponctualite_TGV_avr12.csv
--------------------------------------------------------------------------------
/doc/future-data/Ponctualite_TGV_jul12.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/Ponctualite_TGV_jul12.csv
--------------------------------------------------------------------------------
/doc/future-data/Ponctualite_TGV_jun12.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/Ponctualite_TGV_jun12.csv
--------------------------------------------------------------------------------
/doc/future-data/Ponctualite_TGV_mai12.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/Ponctualite_TGV_mai12.csv
--------------------------------------------------------------------------------
/doc/future-data/Ponctualite_TGV_mar12.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/Ponctualite_TGV_mar12.csv
--------------------------------------------------------------------------------
/doc/future-data/Ponctualite_TGV_sep12.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/Ponctualite_TGV_sep12.csv
--------------------------------------------------------------------------------
/doc/future-data/liste_gares_ferroviaires_DRR2012_23-11-2011.csv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/future-data/liste_gares_ferroviaires_DRR2012_23-11-2011.csv
--------------------------------------------------------------------------------
/doc/screenshots/graph-view-bis.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/screenshots/graph-view-bis.PNG
--------------------------------------------------------------------------------
/doc/screenshots/graph-view.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/screenshots/graph-view.PNG
--------------------------------------------------------------------------------
/doc/screenshots/metadata-view.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/screenshots/metadata-view.PNG
--------------------------------------------------------------------------------
/doc/screenshots/statistics-view.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/screenshots/statistics-view.PNG
--------------------------------------------------------------------------------
/doc/screenshots/table-view.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/screenshots/table-view.PNG
--------------------------------------------------------------------------------
/doc/slides-d4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thibaudcolas/d4/992726e87a6449cc0be91c78325c79994bdc1407/doc/slides-d4.pdf
--------------------------------------------------------------------------------
/live-build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
39 |
40 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # D4
2 |
3 | > DataLift, DataCube, D3
4 |
5 | ## tl;dr
6 |
7 | > D4 is a DataLift module to visualize RDF DataCube data.
8 | >
9 | > D4 is made with Twitter Bootstrap, D3.js, Underscore and CoffeeScript.
10 |
11 | ## Functionalities
12 |
13 | ### Metadata visualization
14 |
15 | D4's main interface displays the datasets' metadata : a previsouly defined set of metadata properties are retrieved via SPARQL and displayed according to a predefined scheme. Each property is translated to the user's language if available and so does the interface.
16 |
17 | 
18 |
19 | We believe metadata availability is especially important in the case of statistical datasets to identify the data's origin and data retrieval methodology.
20 |
21 | D4 uses the Underscore.js library to format its String and number values according to the user's language.
22 |
23 | ### Data Table view
24 |
25 | A classic table displays all of the observations in a spreadsheet-like style. Rows can be ordered according to their cells' values, the user can search for values in the data, thus being able to see each data item individually if necessary.
26 |
27 | 
28 |
29 | This view is necessary to be able to look for the greatest / lowest values and to be able to visualize every piece of data in a format that every user will know how to use.
30 |
31 | D4 uses the DataTables jQuery plugin to manage its table.
32 |
33 | ### Graph view
34 |
35 | Here, (at the moment) we display a pie chart ("camembert") which the summarizes all of the dataset's view. This rather simple graph has one main advantage : first, it is easily comprehensible by anyone looking at it, because you can understand the data distribution (size, patterns, outliers) really quickly. It is however also limited in a number of ways and has to be taken much more as a proof of concept rather than a polished result.
36 |
37 | 
38 |
39 | 
40 |
41 | This really is one of the most important part of data visualisation : the ability to overview big data in small representations, to understand how the data is distributed without having to look at all the data items.
42 |
43 | D4 uses the D3.js library which creates graphs via SVG to display its pie chart.
44 |
45 | ### Statistic measures
46 |
47 | Here are displayed the most used statistic dispersion and position measures : the mean, the mode, the median, the variance, the standard deviation, the range, minimum and maximum values. Those measures aren't always available for all of the datasets, nor useful for some of them, but can be easily understood by beginner statisticians.
48 |
49 | 
50 |
51 | Being able to create knowledge by processing data is amazing, and the modern deluge of information makes this automatic processing a necessity. Our module doesn't go as far as could be but this view is a statement that this kind of processing is needed for a good visualisation / data analysis tool.
52 |
53 | D4's statistical values are calculated using custom functions written in CoffeeScript, of course with well known formulas.
54 |
55 | ## Example datasets
56 |
57 | ### RATP 2011 trafic
58 |
59 | This dataset is from the new (as of november 2012) http://data.ratp.fr/ data portal. It contains the number of travelers entering each of RATP's 367 RER and metro stations during 2011.
60 |
61 | It is available on the RATP data portal as a CSV with metadata in an joint PDF file. It has been converted to DataCube RDF using Google Refine and DataLift.
62 |
63 | ### French diaspora
64 |
65 | This dataset is from the French Open Data portal (http://data.gouv.fr/). It counts the number of french people living in each of the world's countries.
66 |
67 | It is available as a CSV file and has been converted to DataCube RDF with Google Refine, Datalift, and then interlinked to DBpedia's countries using StringToURI.
68 |
69 | Before being used here, this dataset has been converted to Google's DSPL in order to try out this format's capabilities and Google's Public Data Explorer (https://www.google.com/publicdata/directory).
70 | The data has been put on a map where the number of french people in each country is displayed as a blue circle, the bigger the circle the more french people.
71 |
72 | ## Module architecture
73 |
74 | ### General workflow
75 |
76 | 
77 |
78 | ### Back-end
79 |
80 | D4 is backed by DataLift, thus made with JEE, Jersey, Empire and a Sesame triple store. D4 retrieves the datasets' data via SPARQL , uses a little ORM-like translation and sends DataCube DataSets to its views which use Velocity.
81 |
82 | ### Front-end
83 |
84 | Data is included with Velocity and rendered on an HTML template written with Twitter Bootstrap. Graphs are made of SVG generated by D3.js, and the whole JavaScript code actually is compiled CoffeeScript.
85 |
86 | ## Installation
87 |
88 | You'll need DataLift's source code.
89 |
90 | - Put the d4 module directory inside of datalift's module source directory.
91 | - Add d4 to the list of modules in the main build.xml file.
92 | - ant dist
93 | - Put the resulting modules into DataLift's module directory.
94 |
95 | ## Development
96 |
97 | An alternative live-build.xml file is provided to fasten the development process. It is also worth pointing out that it is better to modify the .coffee files and recompile them with coffee -c rather than modify the JavaScript.
98 |
99 | ### Further improvements
100 |
101 | + Handle much more dataset types
102 | ++ There is a good example of interesting data to handle in the doc/ folder.
103 | + Correct the variance's formula
104 | + Add new charts / graphs.
105 | + Better process for alternative metadata properties
106 |
107 | ## External resources
108 |
109 | * https://github.com/thibaudcolas/d4
110 | * http://datalift.org
111 | * http://d3js.org/
112 | * http://datatables.net/
113 | * http://coffeescript.org/
114 | * http://twitter.github.com/bootstrap/
115 | * http://underscorejs.org/
116 | * https://www.google.com/publicdata/directory
117 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/D4Controller.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright / LIRMM 2012
3 | * Contributor(s) : T. Colas, F. Scharffe
4 | *
5 | * Contact: thibaud.colas@etud.univ-montp2.fr
6 | *
7 | * This software is governed by the CeCILL license under French law and
8 | * abiding by the rules of distribution of free software. You can use,
9 | * modify and/or redistribute the software under the terms of the CeCILL
10 | * license as circulated by CEA, CNRS and INRIA at the following URL
11 | * "http://www.cecill.info".
12 | *
13 | * As a counterpart to the access to the source code and rights to copy,
14 | * modify and redistribute granted by the license, users are provided only
15 | * with a limited warranty and the software's author, the holder of the
16 | * economic rights, and the successive licensors have only limited
17 | * liability.
18 | *
19 | * In this respect, the user's attention is drawn to the risks associated
20 | * with loading, using, modifying and/or developing or reproducing the
21 | * software by the user in light of its specific status of free software,
22 | * that may mean that it is complicated to manipulate, and that also
23 | * therefore means that it is reserved for developers and experienced
24 | * professionals having in-depth computer knowledge. Users are therefore
25 | * encouraged to load and test the software's suitability as regards their
26 | * requirements in conditions enabling the security of their systems and/or
27 | * data to be ensured and, more generally, to use and operate it in the
28 | * same conditions as regards security.
29 | *
30 | * The fact that you are presently reading this means that you have had
31 | * knowledge of the CeCILL license and that you accept its terms.
32 | */
33 |
34 | package org.datalift.d4;
35 |
36 | import java.io.ObjectStreamException;
37 | import java.net.URI;
38 | import java.net.URISyntaxException;
39 | import java.util.HashMap;
40 | import java.util.LinkedList;
41 |
42 | import javax.ws.rs.GET;
43 | import javax.ws.rs.Path;
44 | import javax.ws.rs.Produces;
45 | import javax.ws.rs.QueryParam;
46 | import javax.ws.rs.core.MediaType;
47 | import javax.ws.rs.core.Response;
48 |
49 | import org.datalift.d4.datacube.DataSet;
50 | import org.datalift.fwk.project.Project;
51 |
52 | /**
53 | * D4 main controller class, making its model and view cooperate.
54 | * Exposes /d4 as D4's main URL.
55 | *
56 | * @author tcolas
57 | * @version 071112
58 | */
59 | @Path(D4Controller.MODULE_NAME)
60 | public class D4Controller extends ModuleController {
61 | //-------------------------------------------------------------------------
62 | // Constants
63 | //-------------------------------------------------------------------------
64 |
65 | /** The module's name. */
66 | public static final String MODULE_NAME = "d4";
67 |
68 | //-------------------------------------------------------------------------
69 | // Instance members
70 | //-------------------------------------------------------------------------
71 |
72 | /** The module's back-end logic handler. */
73 | protected final D4Model model;
74 |
75 | //-------------------------------------------------------------------------
76 | // Constructors
77 | //-------------------------------------------------------------------------
78 |
79 | /**
80 | * Creates a new InterconnectionController instance.
81 | */
82 | public D4Controller() {
83 | //TODO Switch to the right position.
84 | super(MODULE_NAME, 13371337);
85 |
86 | label = getTranslatedResource(MODULE_NAME + ".button");
87 | model = new D4Model(MODULE_NAME);
88 | }
89 |
90 | //-------------------------------------------------------------------------
91 | // Project management
92 | //-------------------------------------------------------------------------
93 |
94 | /**
95 | * Tells the project manager to add a new button to projects with at least
96 | * two sources.
97 | * @param p Our current project.
98 | * @return The URI to our project's main page.
99 | */
100 | public final UriDesc canHandle(Project p) {
101 | UriDesc uridesc = null;
102 |
103 | try {
104 | // The project can be handled if it has at least one RDF source.
105 | if (model.hasMultipleRDFSources(p, 1)) {
106 | // link URL, link label
107 | uridesc = new UriDesc(this.getName() + "?project=" + p.getUri(), this.label);
108 |
109 | if (this.position > 0) {
110 | uridesc.setPosition(this.position);
111 | }
112 | LOG.debug("Project {} can use D4", p.getTitle());
113 | }
114 | else {
115 | LOG.debug("Project {} can not use D4", p.getTitle());
116 | }
117 | }
118 | catch (URISyntaxException e) {
119 | LOG.fatal("Uh!", e);
120 | throw new RuntimeException(e);
121 | }
122 | return uridesc;
123 | }
124 |
125 | //-------------------------------------------------------------------------
126 | // Web services
127 | //-------------------------------------------------------------------------
128 |
129 | /**
130 | * Index page handler of the D4 module.
131 | * @param projectId the project using D4
132 | * @return Our module's interface.
133 | * @throws ObjectStreamException
134 | */
135 | @GET
136 | @Produces(MediaType.TEXT_HTML)
137 | public Response getIndexPage(@QueryParam("project") URI projectId) throws ObjectStreamException {
138 | // Retrieve the current project and its sources.
139 | Project proj = this.getProject(projectId);
140 | LinkedList datasets = model.getProjectDataSets(proj);
141 |
142 | HashMap args = new HashMap();
143 | args.put("it", proj);
144 |
145 | args.put("datasets", datasets);
146 |
147 | return Response.ok(this.newViewable("/d4-form.vm", args)).build();
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/D4Model.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright / LIRMM 2012
3 | * Contributor(s) : T. Colas, F. Scharffe
4 | *
5 | * Contact: thibaud.colas@etud.univ-montp2.fr
6 | *
7 | * This software is governed by the CeCILL license under French law and
8 | * abiding by the rules of distribution of free software. You can use,
9 | * modify and/or redistribute the software under the terms of the CeCILL
10 | * license as circulated by CEA, CNRS and INRIA at the following URL
11 | * "http://www.cecill.info".
12 | *
13 | * As a counterpart to the access to the source code and rights to copy,
14 | * modify and redistribute granted by the license, users are provided only
15 | * with a limited warranty and the software's author, the holder of the
16 | * economic rights, and the successive licensors have only limited
17 | * liability.
18 | *
19 | * In this respect, the user's attention is drawn to the risks associated
20 | * with loading, using, modifying and/or developing or reproducing the
21 | * software by the user in light of its specific status of free software,
22 | * that may mean that it is complicated to manipulate, and that also
23 | * therefore means that it is reserved for developers and experienced
24 | * professionals having in-depth computer knowledge. Users are therefore
25 | * encouraged to load and test the software's suitability as regards their
26 | * requirements in conditions enabling the security of their systems and/or
27 | * data to be ensured and, more generally, to use and operate it in the
28 | * same conditions as regards security.
29 | *
30 | * The fact that you are presently reading this means that you have had
31 | * knowledge of the CeCILL license and that you accept its terms.
32 | */
33 |
34 | package org.datalift.d4;
35 |
36 | import java.util.LinkedList;
37 |
38 | import org.datalift.d4.datacube.DataSet;
39 | import org.datalift.d4.datacube.DataSetORM;
40 | import org.datalift.fwk.project.Project;
41 | import org.datalift.fwk.project.Source;
42 | import org.datalift.fwk.project.Source.SourceType;
43 | import org.datalift.fwk.project.TransformedRdfSource;
44 |
45 | /**
46 | * D4's backend main class.
47 | * Handles DataSets' retrieval and project compatibility check.
48 | *
49 | * @author tcolas
50 | * @version 071112
51 | */
52 | public class D4Model extends ModuleModel {
53 | //-------------------------------------------------------------------------
54 | // Constructors
55 | //-------------------------------------------------------------------------
56 |
57 | /**
58 | * Creates a new D4Model instance.
59 | * @param name Name of the module.
60 | */
61 | public D4Model(String name) {
62 | super(name);
63 | }
64 |
65 | //-------------------------------------------------------------------------
66 | // Sources management.
67 | //-------------------------------------------------------------------------
68 |
69 | /**
70 | * Checks if a given {@link Source} contains valid RDF-structured data
71 | * AND DataCube data.
72 | * @param src The source to check.
73 | * @return True if src is {@link TransformedRdfSource} and contains QB.
74 | */
75 | protected boolean isValidSource(Source src) {
76 | return src.getType() == SourceType.TransformedRdfSource
77 | && containsDataCube(src);
78 | }
79 |
80 | /**
81 | * Checks if a given {@link Source} contains DataCube data.
82 | * @param src The source to check.
83 | * @return True if src contains at least one qb:Dataset.
84 | */
85 | protected boolean containsDataCube(Source src) {
86 | String query = writeQuery(src.getUri(), "{?d a }", "d");
87 | LinkedList ret = selectQuery(query, "d");
88 |
89 | return !ret.isEmpty();
90 | }
91 |
92 | /**
93 | * Retrieves all of the DataCube DataSets from a given project's sources.
94 | */
95 | public LinkedList getProjectDataSets(Project proj) {
96 | LinkedList ret = new LinkedList();
97 | DataSetORM datasetMapper;
98 | for (Source src : proj.getSources()) {
99 | if (isValidSource(src)) {
100 | datasetMapper = new DataSetORM(src.getUri(), getTranslatedResource("page.lang"));
101 | ret.add(datasetMapper.getDataSet());
102 | }
103 | }
104 |
105 | return ret;
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/ModuleController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright / LIRMM 2011-2012
3 | * Contributor(s) : T. Colas, F. Scharffe
4 | *
5 | * Contact: thibaud.colas@etud.univ-montp2.fr
6 | */
7 |
8 | package org.datalift.d4;
9 |
10 | import static javax.ws.rs.core.HttpHeaders.ACCEPT;
11 |
12 | import java.io.ObjectStreamException;
13 | import java.net.URI;
14 |
15 | import javax.ws.rs.GET;
16 | import javax.ws.rs.HeaderParam;
17 | import javax.ws.rs.Path;
18 | import javax.ws.rs.PathParam;
19 | import javax.ws.rs.QueryParam;
20 | import javax.ws.rs.core.Context;
21 | import javax.ws.rs.core.Request;
22 | import javax.ws.rs.core.Response;
23 | import javax.ws.rs.core.UriInfo;
24 |
25 | import org.datalift.fwk.BaseModule;
26 | import org.datalift.fwk.Configuration;
27 | import org.datalift.fwk.ResourceResolver;
28 | import org.datalift.fwk.i18n.PreferredLocales;
29 | import org.datalift.fwk.log.Logger;
30 | import org.datalift.fwk.project.Project;
31 | import org.datalift.fwk.project.ProjectManager;
32 | import org.datalift.fwk.project.ProjectModule;
33 | import org.datalift.fwk.view.TemplateModel;
34 | import org.datalift.fwk.view.ViewFactory;
35 |
36 | /**
37 | * An abstract class for all of the interlinking modules, combining default
38 | * operations and values.
39 | *
40 | * @author tcolas
41 | * @version 071112
42 | */
43 | public abstract class ModuleController extends BaseModule implements ProjectModule {
44 |
45 | //-------------------------------------------------------------------------
46 | // Constants
47 | //-------------------------------------------------------------------------
48 |
49 | /** Base name of the resource bundle for converter GUI. */
50 | protected static final String GUI_RESOURCES_BUNDLE = "resources";
51 |
52 | //-------------------------------------------------------------------------
53 | // Class members
54 | //-------------------------------------------------------------------------
55 |
56 | /** Datalift's logger. */
57 | protected static final Logger LOG = Logger.getLogger();
58 |
59 | //-------------------------------------------------------------------------
60 | // Instance members
61 | //-------------------------------------------------------------------------
62 |
63 | /** The requested module position in menu. */
64 | protected int position;
65 | /** The requested module label in menu. */
66 | protected String label;
67 |
68 | //-------------------------------------------------------------------------
69 | // Constructors
70 | //-------------------------------------------------------------------------
71 |
72 | /**
73 | * InterlinkingController with default behavior.
74 | * @param name Name of the module.
75 | * @param pos Position of the module's button.
76 | */
77 | public ModuleController(String name, int pos) {
78 | super(name);
79 |
80 | position = pos;
81 | }
82 |
83 | //-------------------------------------------------------------------------
84 | // Project management
85 | //-------------------------------------------------------------------------
86 |
87 | /**
88 | * Resource getter.
89 | * @param key The key to retrieve.
90 | * @return The value of key.
91 | */
92 | protected String getTranslatedResource(String key) {
93 | return PreferredLocales.get().getBundle(GUI_RESOURCES_BUNDLE, ModuleController.class).getString(key);
94 | }
95 |
96 | /**
97 | * Retrieves a {@link Project} using its URI.
98 | * @param projuri the project URI.
99 | *
100 | * @return the project.
101 | * @throws ObjectStreamException if the project does not exist.
102 | */
103 | protected final Project getProject(URI projuri) throws ObjectStreamException {
104 | ProjectManager pm = Configuration.getDefault().getBean(ProjectManager.class);
105 | Project p = pm.findProject(projuri);
106 |
107 | return p;
108 | }
109 |
110 | /**
111 | * Handles our Velocity templates.
112 | * @param templateName Name of the template to parse.
113 | * @param it Parameters for the template.
114 | * @return A new viewable in Velocity Template Language
115 | */
116 | protected final TemplateModel newViewable(String templateName, Object it) {
117 | return ViewFactory.newView("/" + this.getName() + templateName, it);
118 | }
119 |
120 | /**
121 | * Tells the project manager to add a new button to projects with at least
122 | * two sources.
123 | * @param p Our current project.
124 | * @return The URI to our project's main page.
125 | */
126 | public abstract UriDesc canHandle(Project p);
127 |
128 | //-------------------------------------------------------------------------
129 | // Web services
130 | //-------------------------------------------------------------------------
131 |
132 | /**
133 | * Index page handler for interlinking modules.
134 | * @param projectId the project using our module.
135 | * @return Our module's interface.
136 | * @throws ObjectStreamException A Obscene Reject Mixt Opt.
137 | */
138 | public abstract Response getIndexPage(@QueryParam("project") URI projectId) throws ObjectStreamException;
139 |
140 | /**
141 | * Traps accesses to module static resources and redirect them
142 | * toward the default {@link ResourceResolver} for resolution.
143 | * @param path the relative path of the module static
144 | * resource being accessed.
145 | * @param uriInfo the request URI data (injected).
146 | * @param request the JAX-RS request object (injected).
147 | * @param acceptHdr the HTTP "Accept" header value.
148 | *
149 | * @return a {@link Response JAX-RS response} to download the
150 | * content of the specified public resource.
151 | */
152 | @GET
153 | @Path("static/{path: .*$}")
154 | public Object getStaticResource(@PathParam("path") String path,
155 | @Context UriInfo uriInfo,
156 | @Context Request request,
157 | @HeaderParam(ACCEPT) String acceptHdr) {
158 | return Configuration.getDefault()
159 | .getBean(ResourceResolver.class)
160 | .resolveModuleResource(this.getName(),
161 | uriInfo, request, acceptHdr);
162 | }
163 | }
164 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/ModuleModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright / LIRMM 2011-2012
3 | * Contributor(s) : T. Colas, F. Scharffe
4 | *
5 | * Contact: thibaud.colas@etud.univ-montp2.fr
6 | */
7 |
8 | package org.datalift.d4;
9 |
10 | import java.util.Iterator;
11 | import java.util.LinkedList;
12 |
13 | import org.datalift.fwk.Configuration;
14 | import org.datalift.fwk.i18n.PreferredLocales;
15 | import org.datalift.fwk.log.Logger;
16 | import org.datalift.fwk.project.Project;
17 | import org.datalift.fwk.project.Source;
18 | import org.datalift.fwk.project.SparqlSource;
19 | import org.datalift.fwk.project.TransformedRdfSource;
20 | import org.datalift.fwk.rdf.Repository;
21 | import org.openrdf.query.MalformedQueryException;
22 | import org.openrdf.query.QueryEvaluationException;
23 | import org.openrdf.query.QueryLanguage;
24 | import org.openrdf.query.TupleQuery;
25 | import org.openrdf.query.TupleQueryResult;
26 | import org.openrdf.repository.RepositoryConnection;
27 | import org.openrdf.repository.RepositoryException;
28 |
29 | /**
30 | * An abstract class for some modules, combining default
31 | * operations and values.
32 | *
33 | * @author tcolas
34 | * @version 071112
35 | */
36 | public abstract class ModuleModel {
37 |
38 | //-------------------------------------------------------------------------
39 | // Constants
40 | //-------------------------------------------------------------------------
41 |
42 | /** Base name of the resource bundle for converter GUI. */
43 | protected static String GUI_RESOURCES_BUNDLE = ModuleController.GUI_RESOURCES_BUNDLE;
44 |
45 | //-------------------------------------------------------------------------
46 | // Class members
47 | //-------------------------------------------------------------------------
48 |
49 | /** Datalift's internal Sesame {@link Repository repository}. **/
50 | protected static final Repository INTERNAL_REPO = Configuration.getDefault().getInternalRepository();
51 | /** Datalift's internal Sesame {@link Repository repository} URL. */
52 | protected static final String INTERNAL_URL = INTERNAL_REPO.getEndpointUrl();
53 | /** Datalift's logging system. */
54 | protected static final Logger LOG = Logger.getLogger();
55 |
56 | //-------------------------------------------------------------------------
57 | // Instance members
58 | //-------------------------------------------------------------------------
59 |
60 | /** The module name. */
61 | protected final String moduleName;
62 |
63 | //-------------------------------------------------------------------------
64 | // Constructors
65 | //-------------------------------------------------------------------------
66 |
67 | /**
68 | * Creates a new InterconnectionModel instance.
69 | * @param module Name of the module.
70 | */
71 | public ModuleModel(String module) {
72 | this.moduleName = module;
73 | }
74 |
75 | /**
76 | * Resource getter.
77 | * @param key The key to retrieve.
78 | * @return The value of key.
79 | */
80 | protected String getTranslatedResource(String key) {
81 | return PreferredLocales.get().getBundle(GUI_RESOURCES_BUNDLE, ModuleModel.class).getString(key);
82 | }
83 |
84 | //-------------------------------------------------------------------------
85 | // Sources management.
86 | //-------------------------------------------------------------------------
87 |
88 | /**
89 | * Checks if a given {@link Source} is valid for our uses.
90 | * @param src The source to check.
91 | * @return True if src is {@link TransformedRdfSource} or {@link SparqlSource}.
92 | */
93 | protected abstract boolean isValidSource(Source src);
94 |
95 | /**
96 | * Checks if a {@link Project proj} contains valid RDF sources.
97 | * @param proj The project to check.
98 | * @param minvalid The number of RDF sources we want to have.
99 | * @return True if there are more than number valid sources.
100 | */
101 | protected final boolean hasMultipleRDFSources(Project proj, int minvalid) {
102 | int cpt = 0;
103 | Iterator sources = proj.getSources().iterator();
104 |
105 | while (sources.hasNext() && cpt < minvalid) {
106 | if (isValidSource(sources.next())) {
107 | cpt++;
108 | }
109 | }
110 | return cpt >= minvalid;
111 | }
112 |
113 | /**
114 | * Returns all of the URIs (as strings) from the {@link Project project}.
115 | * @param proj The project to use.
116 | * @return A LinkedList containing source file's URIs as strings.
117 | */
118 | protected final LinkedList getSourcesURIs(Project proj) {
119 | LinkedList ret = new LinkedList();
120 |
121 | for (Source src : proj.getSources()) {
122 | if (isValidSource(src)) {
123 | ret.add(src.getUri());
124 | }
125 | }
126 | return ret;
127 | }
128 |
129 | //-------------------------------------------------------------------------
130 | // Queries management.
131 | //-------------------------------------------------------------------------
132 |
133 | /**
134 | * Tels if the bindings of the results are well-formed.
135 | * @param tqr The result of a SPARQL query.
136 | * @param bind The result one and only binding.
137 | * @return True if the results contains only bind.
138 | * @throws QueryEvaluationException Error while closing the result.
139 | */
140 | protected boolean hasCorrectBindingNames(TupleQueryResult tqr, String bind) throws QueryEvaluationException {
141 | return tqr.getBindingNames().size() == 1 && tqr.getBindingNames().contains(bind);
142 | }
143 |
144 | /**
145 | * Sends and evaluates a SPARQL select query on the data set, then returns
146 | * the results (which must be one-column only) as a list of Strings.
147 | * @param query The SPARQL query without its prefixes.
148 | * @param bind The result one and only binding.
149 | * @return The query's result as a list of Strings.
150 | */
151 | protected LinkedList selectQuery(String query, String bind) {
152 | TupleQuery tq;
153 | TupleQueryResult tqr;
154 | LinkedList ret = new LinkedList();
155 |
156 | LOG.debug("Processing query: \"{}\"", query);
157 | RepositoryConnection cnx = INTERNAL_REPO.newConnection();
158 | try {
159 | tq = cnx.prepareTupleQuery(QueryLanguage.SPARQL, query);
160 | tqr = tq.evaluate();
161 |
162 | if (!hasCorrectBindingNames(tqr, bind)) {
163 | throw new MalformedQueryException("Wrong query result bindings - " + query);
164 | }
165 |
166 | while (tqr.hasNext()) {
167 | ret.add(tqr.next().getValue(bind).stringValue());
168 | }
169 | }
170 | catch (MalformedQueryException e) {
171 | LOG.fatal("Failed to process query \"{}\":", e, query);
172 | } catch (QueryEvaluationException e) {
173 | LOG.fatal("Failed to process query \"{}\":", e, query);
174 | } catch (RepositoryException e) {
175 | LOG.fatal("Failed to process query \"{}\":", e, query);
176 | }
177 | finally {
178 | try { cnx.close(); } catch (Exception e) { /* Ignore... */ }
179 | }
180 | return ret;
181 | }
182 |
183 | /**
184 | * Writes a query given a bind to retrieve, a context and a WHERE clause.
185 | * @param context Context on which the query will be executed.
186 | * @param where Constraints given by the query.
187 | * @param bind Binding to use to retrieve data.
188 | * @return A full query.
189 | */
190 | protected String writeQuery(String context, String where, String bind) {
191 | String ret = "SELECT DISTINCT ?" + bind
192 | + (context.isEmpty() ? "" : " FROM <" + context + ">")
193 | + " WHERE " + where;
194 | return ret;
195 | }
196 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/datacube/DataSet.java:
--------------------------------------------------------------------------------
1 | package org.datalift.d4.datacube;
2 |
3 | import java.util.LinkedList;
4 |
5 | import org.datalift.fwk.log.Logger;
6 |
7 | /**
8 | * Objects of this class represent a DataCube DataSet with its metadata and observations.
9 | */
10 | public class DataSet {
11 |
12 | private String graph;
13 | private String uri;
14 | private String title;
15 |
16 | private String nbTriples;
17 |
18 | private String description;
19 | private String comment;
20 | private String publisherName;
21 | private String publisherURL;
22 | private String depictionURL;
23 | private String coverageName;
24 | private String coverageURL;
25 | private String licenseName;
26 | private String licenseURL;
27 | private String formatName;
28 | private String formatURL;
29 | private String sourceName;
30 | private String sourceURL;
31 | private String modificationDate;
32 | private String releaseDate;
33 | private String periodicity;
34 | private String unitMeasureName;
35 | private String unitMeasure;
36 |
37 | private String dimensionName;
38 | private String dimensionURI;
39 | private String measureName;
40 | private String measureURI;
41 |
42 | private String extractDim;
43 | private String extractMeas;
44 | private String extractDimBis;
45 | private String extractMeasBis;
46 |
47 | private String structureName;
48 |
49 | public LinkedList observations;
50 |
51 | /** Datalift's logging system. */
52 | protected static final Logger LOG = Logger.getLogger();
53 |
54 | public DataSet() {
55 | observations = new LinkedList();
56 | }
57 |
58 | public String getGraph() {
59 | return graph;
60 | }
61 |
62 | public void setGraph(String graph) {
63 | this.graph = (graph == null || graph.equals("") ? "N/A" : graph);
64 | }
65 |
66 | public String getUri() {
67 | return uri;
68 | }
69 |
70 | public void setUri(String uri) {
71 | this.uri = (uri == null || uri.equals("") ? "N/A" : uri);
72 | }
73 |
74 | public String getTitle() {
75 | return title;
76 | }
77 |
78 | public void setTitle(String title) {
79 | this.title = (title == null || title.equals("") ? "N/A" : title);
80 | }
81 |
82 | public String getNbTriples() {
83 | return nbTriples;
84 | }
85 |
86 | public String getDescription() {
87 | return description;
88 | }
89 |
90 | public void setDescription(String description) {
91 | this.description = (description == null || description.equals("") ? "N/A" : description);
92 | }
93 |
94 | public String getComment() {
95 | return comment;
96 | }
97 |
98 | public void setComment(String comment) {
99 | this.comment = (comment == null || comment.equals("") ? "" : comment);
100 | }
101 |
102 | public String getPublisherName() {
103 | return publisherName;
104 | }
105 |
106 | public void setPublisherName(String publisherName) {
107 | this.publisherName = (publisherName == null || publisherName.equals("") ? "N/A" : publisherName);
108 | }
109 |
110 | public String getPublisherURL() {
111 | return publisherURL;
112 | }
113 |
114 | public void setPublisherURL(String publisherURL) {
115 | this.publisherURL = (publisherURL == null || publisherURL.equals("") ? "N/A" : publisherURL);
116 | }
117 |
118 | public String getDepictionURL() {
119 | return depictionURL;
120 | }
121 |
122 | public void setDepictionURL(String depictionURL) {
123 | this.depictionURL = (depictionURL == null || depictionURL.equals("") ? "http://placekitten.com/g/300/200" : depictionURL);
124 | }
125 |
126 | public String getCoverageName() {
127 | return coverageName;
128 | }
129 |
130 | public void setCoverageName(String coverageName) {
131 | this.coverageName = (coverageName == null || coverageName.equals("") ? "N/A" : coverageName);
132 | }
133 |
134 | public String getCoverageURL() {
135 | return coverageURL;
136 | }
137 |
138 | public void setCoverageURL(String coverageURL) {
139 | this.coverageURL = (coverageURL == null || coverageURL.equals("") ? "N/A" : coverageURL);
140 | }
141 |
142 | public String getLicenseName() {
143 | return licenseName;
144 | }
145 |
146 | public void setLicenseName(String licenseName) {
147 | this.licenseName = (licenseName == null || licenseName.equals("") ? "N/A" : licenseName);
148 | }
149 |
150 | public String getLicenseURL() {
151 | return licenseURL;
152 | }
153 |
154 | public void setLicenseURL(String licenseURL) {
155 | this.licenseURL = (licenseURL == null || licenseURL.equals("") ? "N/A" : licenseURL);
156 | }
157 |
158 | public String getFormatName() {
159 | return formatName;
160 | }
161 |
162 | public void setFormatName(String formatName) {
163 | this.formatName = (formatName == null || formatName.equals("") ? "N/A" : formatName);
164 | }
165 |
166 | public String getFormatURL() {
167 | return formatURL;
168 | }
169 |
170 | public void setFormatURL(String formatURL) {
171 | this.formatURL = (formatURL == null || formatURL.equals("") ? "N/A" : formatURL);
172 | }
173 |
174 | public String getSourceName() {
175 | return sourceName;
176 | }
177 |
178 | public void setSourceName(String sourceName) {
179 | this.sourceName = (sourceName == null || sourceName.equals("") ? "N/A" : sourceName);
180 | }
181 |
182 | public String getSourceURL() {
183 | return sourceURL;
184 | }
185 |
186 | public void setSourceURL(String sourceURL) {
187 | this.sourceURL = (sourceURL == null || sourceURL.equals("") ? "N/A" : sourceURL);
188 | }
189 |
190 | public String getModificationDate() {
191 | return modificationDate;
192 | }
193 |
194 | public void setModificationDate(String modificationDate) {
195 | this.modificationDate = (modificationDate == null || modificationDate.equals("") ? "N/A" : modificationDate);
196 | }
197 |
198 | public String getReleaseDate() {
199 | return releaseDate;
200 | }
201 |
202 | public void setReleaseDate(String releaseDate) {
203 | this.releaseDate = (releaseDate == null || releaseDate.equals("") ? "N/A" : releaseDate);
204 | }
205 |
206 | public String getPeriodicity() {
207 | return periodicity;
208 | }
209 |
210 | public void setPeriodicity(String periodicity) {
211 | this.periodicity = (periodicity == null || periodicity.equals("") ? "N/A" : periodicity);
212 | }
213 |
214 | public String getUnitMeasureName() {
215 | return unitMeasureName;
216 | }
217 |
218 | public void setUnitMeasureName(String unitMeasureName) {
219 | this.unitMeasureName = (unitMeasureName == null || unitMeasureName.equals("") ? "N/A" : unitMeasureName);
220 | }
221 |
222 | public String getUnitMeasure() {
223 | return unitMeasure;
224 | }
225 |
226 | public void setUnitMeasure(String unitMeasure) {
227 | this.unitMeasure = (unitMeasure == null || unitMeasure.equals("") ? "N/A" : unitMeasure);
228 | }
229 |
230 | public String getDimensionName() {
231 | return dimensionName;
232 | }
233 |
234 | public void setDimensionName(String dimensionName) {
235 | this.dimensionName = (dimensionName == null || dimensionName.equals("") ? "N/A" : dimensionName);
236 | }
237 |
238 | public String getDimensionURI() {
239 | return dimensionURI;
240 | }
241 |
242 | public void setDimensionURI(String dimensionURI) {
243 | this.dimensionURI = (dimensionURI == null || dimensionURI.equals("") ? "N/A" : dimensionURI);
244 | }
245 |
246 | public String getMeasureName() {
247 | return measureName;
248 | }
249 |
250 | public void setMeasureName(String measureName) {
251 | this.measureName = (measureName == null || measureName.equals("") ? "N/A" : measureName);
252 | }
253 |
254 | public String getMeasureURI() {
255 | return measureURI;
256 | }
257 |
258 | public void setMeasureURI(String measureURI) {
259 | this.measureURI = (measureURI == null || measureURI.equals("") ? "N/A" : measureURI);
260 | }
261 |
262 | public String getStructureName() {
263 | return structureName;
264 | }
265 |
266 | public void setStructureName(String structureName) {
267 | this.structureName = (structureName == null || structureName.equals("") ? "N/A" : structureName);
268 | }
269 |
270 | public LinkedList getObservations() {
271 | return observations;
272 | }
273 |
274 | public void setObservations(LinkedList observations) {
275 | this.observations = observations;
276 | LOG.info(observations);
277 | extractDim = observations.getFirst().getDimension();
278 | extractDimBis = observations.getLast().getDimension();
279 | extractMeas = observations.getFirst().getMeasure();
280 | extractMeasBis = observations.getLast().getMeasure();
281 | nbTriples = String.valueOf(observations.size());
282 | }
283 |
284 | public String getExtractDim() {
285 | return extractDim;
286 | }
287 |
288 | public String getExtractMeas() {
289 | return extractMeas;
290 | }
291 |
292 | public String getExtractDimBis() {
293 | return extractDimBis;
294 | }
295 |
296 | public String getExtractMeasBis() {
297 | return extractMeasBis;
298 | }
299 | }
300 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/datacube/DataSetORM.java:
--------------------------------------------------------------------------------
1 | package org.datalift.d4.datacube;
2 |
3 | import java.util.LinkedList;
4 |
5 | import org.datalift.fwk.Configuration;
6 | import org.datalift.fwk.log.Logger;
7 | import org.datalift.fwk.rdf.Repository;
8 | import org.openrdf.query.BindingSet;
9 | import org.openrdf.query.MalformedQueryException;
10 | import org.openrdf.query.QueryEvaluationException;
11 | import org.openrdf.query.QueryLanguage;
12 | import org.openrdf.query.TupleQuery;
13 | import org.openrdf.query.TupleQueryResult;
14 | import org.openrdf.repository.RepositoryConnection;
15 | import org.openrdf.repository.RepositoryException;
16 |
17 |
18 | /**
19 | * Used to convert a DataCube DataSet's RDF representation to a Java object.
20 | * @author tcolas
21 | */
22 | public class DataSetORM {
23 |
24 | private final String sourceURI;
25 | private final String lang;
26 |
27 | private DataSet dataset;
28 |
29 | private static final String uri = "uri";
30 | private static final String title = "title";
31 |
32 | private static final String description = "description";
33 | private static final String comment = "comment";
34 | private static final String publisherName = "publisherName";
35 | private static final String publisherURL = "publisherURL";
36 | private static final String depictionURL = "depictionURL";
37 | private static final String coverageName = "coverageName";
38 | private static final String coverageURL = "coverageURL";
39 | private static final String licenseName = "licenseName";
40 | private static final String formatName = "formatName";
41 | private static final String sourceName = "sourceName";
42 | private static final String modificationDate = "modificationDate";
43 | private static final String releaseDate = "releaseDate";
44 | private static final String periodicity = "periodicity";
45 | private static final String unitMeasureName = "unitMeasureName";
46 | private static final String unitMeasure = "unitMeasure";
47 |
48 | private static final String dimensionName = "dimensionName";
49 | private static final String dimensionURI = "dimensionURI";
50 | private static final String measureName = "measureName";
51 | private static final String measureURI = "measureURI";
52 |
53 | private static final String structureName = "structureName";
54 |
55 | /** Datalift's internal Sesame {@link Repository repository}. **/
56 | protected static final Repository INTERNAL_REPO = Configuration.getDefault().getInternalRepository();
57 | /** Datalift's internal Sesame {@link Repository repository} URL. */
58 | protected static final String INTERNAL_URL = INTERNAL_REPO.getEndpointUrl();
59 | /** Datalift's logging system. */
60 | protected static final Logger LOG = Logger.getLogger();
61 |
62 | public DataSetORM(String sourceURI, String lang) {
63 | this.sourceURI = sourceURI;
64 | this.lang = lang;
65 |
66 | dataset = new DataSet();
67 | dataset.setGraph(sourceURI);
68 | }
69 |
70 | // We might want to only retrieve values for a given language.
71 | public String filterLang(String binding) {
72 | return "FILTER ( lang(?" + binding + ") = '" + lang + "' ) ";
73 | }
74 |
75 | public DataSet getDataSet() {
76 | getMetaData();
77 | getObservations();
78 |
79 | return dataset;
80 | }
81 |
82 | /**
83 | * Sends a massive query to retrieve all of the dataset's metadata.
84 | * TODO : This query needs to be written with UNIONs.
85 | */
86 | private void getMetaData() {
87 | TupleQuery tq;
88 | TupleQueryResult tqr;
89 |
90 | String prefix = "PREFIX rdfs: "
91 | + "PREFIX sdmx-measure: "
92 | + "PREFIX foaf: "
93 | + "PREFIX dct: "
94 | + "PREFIX sdmx-attribute: "
95 | + "PREFIX owl: "
96 | + "PREFIX xsd: "
97 | + "PREFIX rdf: "
98 | + "PREFIX qb: "
99 | + "PREFIX sdmx-dimension: ";
100 | String bindings = "?" + uri
101 | + " ?" + title
102 | + " ?" + description
103 | + " ?" + comment
104 | + " ?" + publisherName
105 | + " ?" + publisherURL
106 | + " ?" + depictionURL
107 | + " ?" + coverageName
108 | + " ?" + coverageURL
109 | + " ?" + licenseName
110 | + " ?" + formatName
111 | + " ?" + sourceName
112 | + " ?" + modificationDate
113 | + " ?" + releaseDate
114 | + " ?" + periodicity
115 | + " ?" + unitMeasureName
116 | + " ?" + unitMeasure
117 | + " ?" + dimensionName
118 | + " ?" + dimensionURI
119 | + " ?" + measureName
120 | + " ?" + measureURI
121 | + " ?" + structureName;
122 | String from = "FROM <" + sourceURI + ">";
123 |
124 | String where = "?" + uri + " a qb:DataSet ."
125 | + " ?" + uri + " dct:title ?" + title + " ."
126 | + " ?" + uri + " dct:description ?" + description + " ."
127 | + " ?" + uri + " rdfs:comment ?" + comment + " ."
128 | + " ?" + uri + " dct:publisher ?pubtmp ."
129 | + " ?pubtmp foaf:name ?" + publisherName + " ."
130 | + " ?pubtmp foaf:homepage ?" + publisherURL + " ."
131 | + " ?" + uri + " foaf:depiction ?" + depictionURL + " ."
132 | + " ?" + uri + " dct:coverage ?" + coverageURL + " ."
133 | + " ?" + coverageURL + " rdfs:label ?" + coverageName + " ."
134 | + " ?" + uri + " dct:license ?" + licenseName + " ."
135 | + " ?" + uri + " dct:format ?" + formatName + " ."
136 | + " ?" + uri + " dct:source ?" + sourceName + " ."
137 | + " ?" + uri + " dct:modified ?" + modificationDate + " ."
138 | + " ?" + uri + " dct:issued ?" + releaseDate + " ."
139 | + " ?" + uri + " dct:accrualPeriodicity ?pertmp ."
140 | + " ?pertmp rdfs:label ?" + periodicity + " ."
141 | + " ?" + uri + " sdmx-attribute:unitMeasure ?" + unitMeasure + " ."
142 | + " ?" + unitMeasure + " rdfs:label ?" + unitMeasureName + " ."
143 | + " ?" + uri + " qb:structure ?dsdtmp ."
144 | + " ?dsdtmp rdfs:label ?" + structureName + " ."
145 | + " ?dsdtmp qb:component ?dimtmp ."
146 | + " ?dimtmp qb:dimension ?" + dimensionURI + " ."
147 | + " ?dimtmp rdfs:label ?" + dimensionName + " ."
148 | + " ?dsdtmp qb:component ?msrtmp ."
149 | + " ?msrtmp qb:measure ?" + measureURI + " ."
150 | + " ?msrtmp rdfs:label ?" + measureName + " .";
151 | String filterLang = filterLang(title) + filterLang(description)
152 | + filterLang(comment) + filterLang(periodicity)
153 | + filterLang(structureName) + filterLang(dimensionName)
154 | + filterLang(measureName);
155 | String query = prefix + " SELECT " + bindings + " " + from + " WHERE { " + where + " " + filterLang + " }";
156 |
157 | LOG.debug("Processing query: \"{}\"", query);
158 | RepositoryConnection cnx = INTERNAL_REPO.newConnection();
159 | try {
160 | tq = cnx.prepareTupleQuery(QueryLanguage.SPARQL, query);
161 | tqr = tq.evaluate();
162 |
163 | BindingSet bs = tqr.next();
164 | dataset.setUri(bs.getValue(uri).stringValue());
165 | dataset.setTitle(bs.getValue(title).stringValue());
166 | dataset.setDescription(bs.getValue(description).stringValue());
167 | dataset.setComment(bs.getValue(comment).stringValue());
168 | dataset.setPublisherName(bs.getValue(publisherName).stringValue());
169 | dataset.setPublisherURL(bs.getValue(publisherURL).stringValue());
170 | dataset.setDepictionURL(bs.getValue(depictionURL).stringValue());
171 | dataset.setCoverageName(bs.getValue(coverageName).stringValue());
172 | dataset.setCoverageURL(bs.getValue(coverageURL).stringValue());
173 |
174 | dataset.setLicenseName(bs.getValue(licenseName).stringValue());
175 | dataset.setFormatName(bs.getValue(formatName).stringValue());
176 | dataset.setSourceName(bs.getValue(sourceName).stringValue());
177 |
178 | dataset.setModificationDate(bs.getValue(modificationDate).stringValue());
179 | dataset.setReleaseDate(bs.getValue(releaseDate).stringValue());
180 | dataset.setPeriodicity(bs.getValue(periodicity).stringValue());
181 | dataset.setUnitMeasureName(bs.getValue(unitMeasureName).stringValue());
182 | dataset.setUnitMeasure(bs.getValue(unitMeasure).stringValue());
183 |
184 | dataset.setDimensionName(bs.getValue(dimensionName).stringValue());
185 | dataset.setDimensionURI(bs.getValue(dimensionURI).stringValue());
186 | dataset.setMeasureName(bs.getValue(measureName).stringValue());
187 | dataset.setMeasureURI(bs.getValue(measureURI).stringValue());
188 | dataset.setStructureName(bs.getValue(structureName).stringValue());
189 |
190 | while (tqr.hasNext()) {
191 | bs = tqr.next();
192 | }
193 |
194 | dataset.setLicenseURL(bs.getValue(licenseName).stringValue());
195 | dataset.setFormatURL(bs.getValue(formatName).stringValue());
196 | dataset.setSourceURL(bs.getValue(sourceName).stringValue());
197 |
198 | }
199 | catch (MalformedQueryException e) {
200 | LOG.fatal("Failed to process query \"{}\":", e, query);
201 | } catch (QueryEvaluationException e) {
202 | LOG.fatal("Failed to process query \"{}\":", e, query);
203 | } catch (RepositoryException e) {
204 | LOG.fatal("Failed to process query \"{}\":", e, query);
205 | }
206 | finally {
207 | try { cnx.close(); } catch (Exception e) { /* Ignore... */ }
208 | }
209 | }
210 |
211 | /**
212 | * Sends a SPARQL query to retrieve a dataset's observation.
213 | */
214 | private void getObservations() {
215 | TupleQuery tq;
216 | TupleQueryResult tqr;
217 |
218 | String prefix = "PREFIX sdmx-measure: "
219 | + "PREFIX rdf: "
220 | + "PREFIX rdfs: "
221 | + "PREFIX qb: "
222 | + "PREFIX sdmx-dimension: ";
223 | String where = "?s a qb:Observation . ?s sdmx-dimension:refArea ?dim . ?s sdmx-measure:obsValue ?obs .";
224 | String query = prefix + " SELECT ?dim ?obs FROM <" + sourceURI + "> WHERE { " + where + " }";
225 |
226 | LOG.debug("Processing query: \"{}\"", query);
227 | RepositoryConnection cnx = INTERNAL_REPO.newConnection();
228 | try {
229 | tq = cnx.prepareTupleQuery(QueryLanguage.SPARQL, query);
230 | tqr = tq.evaluate();
231 |
232 | BindingSet bs;
233 | LinkedList tmp = new LinkedList();
234 |
235 | while (tqr.hasNext()) {
236 | bs = tqr.next();
237 | tmp.add(new Observation(bs.getValue("dim").stringValue(), bs.getValue("obs").stringValue()));
238 |
239 | }
240 |
241 | dataset.setObservations(tmp);
242 |
243 | }
244 | catch (MalformedQueryException e) {
245 | LOG.fatal("Failed to process query \"{}\":", e, query);
246 | } catch (QueryEvaluationException e) {
247 | LOG.fatal("Failed to process query \"{}\":", e, query);
248 | } catch (RepositoryException e) {
249 | LOG.fatal("Failed to process query \"{}\":", e, query);
250 | }
251 | finally {
252 | try { cnx.close(); } catch (Exception e) { /* Ignore... */ }
253 | }
254 | }
255 |
256 | }
257 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/datacube/Observation.java:
--------------------------------------------------------------------------------
1 | package org.datalift.d4.datacube;
2 |
3 | /**
4 | * Represents a statistical observation as a key / value pair.
5 | * There are other much more complex dataset structures out there but this one is the simplest.
6 | * @author tcolas
7 | *
8 | */
9 | public class Observation {
10 |
11 | /** Dimension of an observation, i.e what's being observed. **/
12 | private String dimension;
13 | /** Measure of an observation, i.e the observed value for the given dimension. **/
14 | private String measure;
15 |
16 | public Observation(String dimension, String measure) {
17 | this.dimension = dimension;
18 | this.measure = measure;
19 | }
20 |
21 | public String getDimension() {
22 | return dimension;
23 | }
24 |
25 | public String getMeasure() {
26 | return measure;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/java/org/datalift/d4/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | D4 module
4 |
5 |
6 |
7 | D4 : DataLift, DataCube, D3.
8 |
9 | D4 is a data visualisation tool for DataCube datasets built on top of DataLift widh D3 and Twitter Bootstrap.
10 |