Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 232 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 232 Rev 233
1
<?php
1
<?php
2
/**
2
/**
3
 * Exemple de lancement du script : /opt/lampp/bin/php cli.php ontologie -a analyser
3
 * Exemple de lancement du script : /opt/lampp/bin/php cli.php ontologie -a analyser
4
 *
4
 *
5
 */
5
 */
-
 
6
require_once dirname(__FILE__).DS.'Traduction.php';
-
 
7
 
6
class Prometheus extends EfloreScript {
8
class Prometheus extends EfloreScript {
-
 
9
 
7
 
10
	private $projetDossier = '';
8
	private $lecteur = null;
11
	private $lecteur = null;
9
	private $fichier = '';
12
	private $fichier = '';
10
	private $lotsTermes = array();
13
	private $lotsTermes = array();
11
	private $lotsRelations = array();
14
	private $lotsRelations = array();
12
	private $lotsImages = array();
15
	private $lotsImages = array();
13
	private $lotsPublications = array();
16
	private $lotsPublications = array();
14
	private $lotsAuteurs = array();
17
	private $lotsAuteurs = array();
15
	private $lotsHierarchie = array();
18
	private $lotsHierarchie = array();
16
	private $baseIdGroupe = 10000;
19
	private $baseIdGroupe = 10000;
17
	private $baseIdSousGroupe = 20000;
20
	private $baseIdSousGroupe = 20000;
18
	private $types = array(
21
	private $types = array(
19
		'FREQUENCY_MODIFIERS' => 2,
22
		'FREQUENCY_MODIFIERS' => 2,
20
		'QUALIFIERS' => 3,
23
		'QUALIFIERS' => 3,
21
		'RELATIVE_MODIFIERS' => 4,
24
		'RELATIVE_MODIFIERS' => 4,
22
		'RELATIVE_VALUES' => 5,
25
		'RELATIVE_VALUES' => 5,
23
		'SPATIAL_MODIFIERS' => 6,
26
		'SPATIAL_MODIFIERS' => 6,
24
		'LOCATER_REGIONS' => 7,
27
		'LOCATER_REGIONS' => 7,
25
		'TEMPORAL_MODIFIERS' => 8,
28
		'TEMPORAL_MODIFIERS' => 8,
26
		'UNIT_TERMS' => 9,
29
		'UNIT_TERMS' => 9,
27
		'QUANTITATIVE_PROPERTIES' => 10,
30
		'QUANTITATIVE_PROPERTIES' => 10,
28
		'NEW_QUALITATIVE_PROPERTIES' => 11,
31
		'NEW_QUALITATIVE_PROPERTIES' => 11,
29
		'DISALLOWED_TERMS' => 20,
32
		'DISALLOWED_TERMS' => 20,
30
		'QUALITATIVE_STATES' => 13,
33
		'QUALITATIVE_STATES' => 13,
31
		'TYPE_OF_STRUCTURE_TERMS' => 14,
34
		'TYPE_OF_STRUCTURE_TERMS' => 14,
32
		'STRUCTURE_TERMS' => 15,
35
		'STRUCTURE_TERMS' => 15,
33
		'REGION_TERMS' => 16,
36
		'REGION_TERMS' => 16,
34
		'GENERIC_STRUCTURES' => 17);
37
		'GENERIC_STRUCTURES' => 17);
35
 
38
 
36
	public function executer() {
39
	public function executer() {
37
		try {
40
		try {
38
			$this->initialiserProjet('prometheus');
41
			$this->initialiserProjet('prometheus');
-
 
42
			$this->projetDossier = Config::get('dossierTsv');
39
 
43
 
40
			$this->fichier = realpath(dirname(__FILE__)).'/../../../donnees/prometheus/v1.00_2003-02-18/Ontology.xml';
44
			$this->fichier = $this->projetDossier.'Ontology.xml';
41
			// Lancement de l'action demandée
45
			// Lancement de l'action demandée
42
			$cmd = $this->getParametre('a');
46
			$cmd = $this->getParametre('a');
43
		    switch ($cmd) {
47
		    switch ($cmd) {
44
		    	case 'chargerTous' :
48
		    	case 'chargerTous' :
45
		    		$this->chargerStructureSql();
49
		    		$this->chargerStructureSql();
46
		    		$this->lireFichierXml();
50
		    		$this->lireFichierXml();
47
		    		break;
51
		    		break;
48
		    	case 'chargerStructureSql' :
52
		    	case 'chargerStructureSql' :
49
		    		$this->chargerStructureSql();
53
		    		$this->chargerStructureSql();
50
		    		break;
54
		    		break;
51
		    	case 'analyser' :
55
		    	case 'analyser' :
52
					$this->vider();
56
					$this->vider();
53
		    		$this->lireFichierXml();
57
		    		$this->lireFichierXml();
54
					break;
58
					break;
-
 
59
				case 'chargerTraductions' :
-
 
60
					$this->viderTraductions();
-
 
61
					$this->chargerTraductions();
-
 
62
					break;
55
		    	case 'vider' :
63
		    	case 'vider' :
56
		    		$this->vider();
64
		    		$this->vider();
-
 
65
		    	case 'viderTraductions' :
-
 
66
		    		$this->viderTraductions();
-
 
67
		    		break;
57
		    	case 'supprimerTous' :
68
		    	case 'supprimerTous' :
58
		    		$this->supprimerTous();
69
		    		$this->supprimerTous();
59
		    		break;
70
		    		break;
60
				default :
71
				default :
61
					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
72
					throw new Exception("Erreur : la commande '$cmd' n'existe pas!");
62
			}
73
			}
63
		} catch (Exception $e) {
74
		} catch (Exception $e) {
64
			$this->traiterErreur($e->getMessage());
75
			$this->traiterErreur($e->getMessage());
65
		}
76
		}
66
    }
77
    }
67
 
78
 
68
 
79
 
69
    /**
80
    /**
70
	 * Lit le fichier OSM et lance l'analyse des noeuds xml en fonction de leur type.
81
	 * Lit le fichier OSM et lance l'analyse des noeuds xml en fonction de leur type.
71
	 */
82
	 */
72
	private function lireFichierXml() {
83
	private function lireFichierXml() {
73
		$termes = array_keys($this->types);
84
		$termes = array_keys($this->types);
74
		$this->lecteur = new XMLReader();
85
		$this->lecteur = new XMLReader();
75
		if ($this->ouvrirFichierXml()) {
86
		if ($this->ouvrirFichierXml()) {
76
			while ($this->lecteur->read()) {
87
			while ($this->lecteur->read()) {
77
				if ($this->lecteur->nodeType == XMLREADER::ELEMENT) {
88
				if ($this->lecteur->nodeType == XMLREADER::ELEMENT) {
78
					if (in_array($this->lecteur->localName, $termes)) {
89
					if (in_array($this->lecteur->localName, $termes)) {
79
						$noeud = $this->obtenirNoeudSimpleXml();
90
						$noeud = $this->obtenirNoeudSimpleXml();
80
						$type = $this->lecteur->localName;
91
						$type = $this->lecteur->localName;
81
						$this->traiterTermes($this->types[$type], $noeud->children());
92
						$this->traiterTermes($this->types[$type], $noeud->children());
82
					} else if ($this->lecteur->localName == 'STATE_GROUPS') {
93
					} else if ($this->lecteur->localName == 'STATE_GROUPS') {
83
						$noeud = $this->obtenirNoeudSimpleXml();
94
						$noeud = $this->obtenirNoeudSimpleXml();
84
						$this->traiterGroupes($noeud->children());
95
						$this->traiterGroupes($noeud->children());
85
					} else if ($this->lecteur->localName == 'NewQualitativeProperties') {
96
					} else if ($this->lecteur->localName == 'NewQualitativeProperties') {
86
						$noeud = $this->obtenirNoeudSimpleXml();
97
						$noeud = $this->obtenirNoeudSimpleXml();
87
						$this->traiterNouvellesQualites($noeud->children());
98
						$this->traiterNouvellesQualites($noeud->children());
88
					} else if ($this->lecteur->localName == 'RELATIONSHIPS') {
99
					} else if ($this->lecteur->localName == 'RELATIONSHIPS') {
89
						$noeud = $this->obtenirNoeudSimpleXml();
100
						$noeud = $this->obtenirNoeudSimpleXml();
90
						$this->traiterRelations($noeud->children());
101
						$this->traiterRelations($noeud->children());
91
					} else if ($this->lecteur->localName == 'PICTURES') {
102
					} else if ($this->lecteur->localName == 'PICTURES') {
92
						$noeud = $this->obtenirNoeudSimpleXml();
103
						$noeud = $this->obtenirNoeudSimpleXml();
93
						$this->traiterImages($noeud->children());
104
						$this->traiterImages($noeud->children());
94
					} else if ($this->lecteur->localName == 'CITATIONS') {
105
					} else if ($this->lecteur->localName == 'CITATIONS') {
95
						$noeud = $this->obtenirNoeudSimpleXml();
106
						$noeud = $this->obtenirNoeudSimpleXml();
96
						$this->traiterCitations($noeud->children());
107
						$this->traiterCitations($noeud->children());
97
					} else if ($this->lecteur->localName == 'AUTHORS') {
108
					} else if ($this->lecteur->localName == 'AUTHORS') {
98
						$noeud = $this->obtenirNoeudSimpleXml();
109
						$noeud = $this->obtenirNoeudSimpleXml();
99
						$this->traiterAuteurs($noeud->children());
110
						$this->traiterAuteurs($noeud->children());
100
					} else if ($this->lecteur->localName == 'TreeNode') {
111
					} else if ($this->lecteur->localName == 'TreeNode') {
101
						$noeud = $this->obtenirNoeudSimpleXml();
112
						$noeud = $this->obtenirNoeudSimpleXml();
102
						$this->traiterHierarchie($noeud);
113
						$this->traiterHierarchie($noeud);
103
					}
114
					}
104
				}
115
				}
105
			}
116
			}
106
			if (count($this->lotsTermes) > 0) {
117
			if (count($this->lotsTermes) > 0) {
107
				$this->insererLotDeTermes();
118
				$this->insererLotDeTermes();
108
			}
119
			}
109
			if (count($this->lotsRelations) > 0) {
120
			if (count($this->lotsRelations) > 0) {
110
				$this->insererLotDeRelations();
121
				$this->insererLotDeRelations();
111
			}
122
			}
112
			if (count($this->lotsImages) > 0) {
123
			if (count($this->lotsImages) > 0) {
113
				$this->insererLotImages();
124
				$this->insererLotImages();
114
			}
125
			}
115
			if (count($this->lotsPublications) > 0) {
126
			if (count($this->lotsPublications) > 0) {
116
				$this->insererLotDePublications();
127
				$this->insererLotDePublications();
117
			}
128
			}
118
			if (count($this->lotsAuteurs) > 0) {
129
			if (count($this->lotsAuteurs) > 0) {
119
				$this->insererLotAuteurs();
130
				$this->insererLotAuteurs();
120
			}
131
			}
121
			if (count($this->lotsHierarchie) > 0) {
132
			if (count($this->lotsHierarchie) > 0) {
122
				$this->insererLotHierarchie();
133
				$this->insererLotHierarchie();
123
			}
134
			}
124
		}
135
		}
125
	}
136
	}
126
 
137
 
127
	private function ouvrirFichierXml() {
138
	private function ouvrirFichierXml() {
128
		if ($this->lecteur->open($this->fichier) === false) {
139
		if ($this->lecteur->open($this->fichier) === false) {
129
			throw new Exception("Impossible d'ouvrir le fichier XML : $this->fichier");
140
			throw new Exception("Impossible d'ouvrir le fichier XML : $this->fichier");
130
		}
141
		}
131
		return true;
142
		return true;
132
	}
143
	}
133
 
144
 
134
	private function obtenirNoeudSimpleXml() {
145
	private function obtenirNoeudSimpleXml() {
135
		$doc = new DOMDocument;
146
		$doc = new DOMDocument;
136
		$element = $this->lecteur->expand();
147
		$element = $this->lecteur->expand();
137
		$noeud = simplexml_import_dom($doc->importNode($element, true));
148
		$noeud = simplexml_import_dom($doc->importNode($element, true));
138
		return $noeud;
149
		return $noeud;
139
	}
150
	}
140
 
151
 
141
	private function traiterTermes($type, $termes) {
152
	private function traiterTermes($type, $termes) {
142
		foreach ($termes as $terme) {
153
		foreach ($termes as $terme) {
143
			$id = (int) $terme->attributes()->GLOBALID;
154
			$id = (int) $terme->attributes()->GLOBALID;
144
			if (isset($this->lotsTermes[$id]) === false) {
155
			if (isset($this->lotsTermes[$id]) === false) {
145
				$valeur = array();
156
				$valeur = array();
146
				$valeur[] = (int) $id;
157
				$valeur[] = (int) $id;
147
				$valeur[] = (int) $type;
158
				$valeur[] = (int) $type;
148
				$valeur[] = (string) $terme->attributes()->term;
159
				$valeur[] = (string) $terme->attributes()->term;
149
				$valeur[] = (string) $this->obtenirDefinition($terme);
160
				$valeur[] = (string) $this->obtenirDefinition($terme);
150
				$valeur[] = (int) $this->obtenirPreference($terme);
161
				$valeur[] = (int) $this->obtenirPreference($terme);
151
				$valeur[] = (int) $this->obtenirAuteur($terme);
162
				$valeur[] = (int) $this->obtenirAuteur($terme);
152
				$valeur[] = (int) $this->obtenirCitation($terme);
163
				$valeur[] = (int) $this->obtenirCitation($terme);
153
				$valeur[] = (int) $this->obtenirImage($terme);
164
				$valeur[] = (int) $this->obtenirImage($terme);
154
				$this->lotsTermes[$id] = $valeur;
165
				$this->lotsTermes[$id] = $valeur;
155
			}
166
			}
156
			if (isset($terme->attributes()->parentID)) {
167
			if (isset($terme->attributes()->parentID)) {
157
				$relation = array();
168
				$relation = array();
158
				$relation[] = (int) $terme->attributes()->GLOBALID;
169
				$relation[] = (int) $terme->attributes()->GLOBALID;
159
				$relation[] = (int) $terme->attributes()->parentID;
170
				$relation[] = (int) $terme->attributes()->parentID;
160
				$relation[] = 'A POUR PARENT';
171
				$relation[] = 'A POUR PARENT';
161
				$this->ajouterRelation($relation);
172
				$this->ajouterRelation($relation);
162
			}
173
			}
163
			if (isset($terme->attributes()->PARENT_STRUCTURE_ID)) {
174
			if (isset($terme->attributes()->PARENT_STRUCTURE_ID)) {
164
				$relation = array();
175
				$relation = array();
165
				$relation[] = (int) $terme->attributes()->GLOBALID;
176
				$relation[] = (int) $terme->attributes()->GLOBALID;
166
				$relation[] = (int) $terme->attributes()->PARENT_STRUCTURE_ID;
177
				$relation[] = (int) $terme->attributes()->PARENT_STRUCTURE_ID;
167
				$relation[] = 'A POUR STRUCTURE PARENTE';
178
				$relation[] = 'A POUR STRUCTURE PARENTE';
168
				$this->ajouterRelation($relation);
179
				$this->ajouterRelation($relation);
169
			}
180
			}
170
			if (isset($terme->attributes()->stateOfNEWPROPERTYID)) {
181
			if (isset($terme->attributes()->stateOfNEWPROPERTYID)) {
171
				$relation = array();
182
				$relation = array();
172
				$relation[] = (int) $terme->attributes()->GLOBALID;
183
				$relation[] = (int) $terme->attributes()->GLOBALID;
173
				$relation[] = (int) $terme->attributes()->stateOfNEWPROPERTYID;
184
				$relation[] = (int) $terme->attributes()->stateOfNEWPROPERTYID;
174
				$relation[] = 'A POUR NOUVELLE QUALITE';
185
				$relation[] = 'A POUR NOUVELLE QUALITE';
175
				$this->ajouterRelation($relation);
186
				$this->ajouterRelation($relation);
176
			}
187
			}
177
		}
188
		}
178
	}
189
	}
179
 
190
 
180
	private function obtenirDefinition($terme) {
191
	private function obtenirDefinition($terme) {
181
		$definition = null;
192
		$definition = null;
182
		if (isset($terme->DEFINITION)) {
193
		if (isset($terme->DEFINITION)) {
183
			$definition = $terme->DEFINITION;
194
			$definition = $terme->DEFINITION;
184
		}
195
		}
185
		return $definition;
196
		return $definition;
186
	}
197
	}
187
 
198
 
188
	private function obtenirPreference($terme) {
199
	private function obtenirPreference($terme) {
189
		$preference = '1';
200
		$preference = '1';
190
		if (isset($terme->attributes()->PREFERRED_TERM)) {
201
		if (isset($terme->attributes()->PREFERRED_TERM)) {
191
			$valeur = (string) $terme->attributes()->PREFERRED_TERM;
202
			$valeur = (string) $terme->attributes()->PREFERRED_TERM;
192
			$preference = (trim($valeur) == 'Disallowed Term') ? '0' : '1';
203
			$preference = (trim($valeur) == 'Disallowed Term') ? '0' : '1';
193
		}
204
		}
194
		return $preference;
205
		return $preference;
195
	}
206
	}
196
 
207
 
197
	private function obtenirAuteur($terme) {
208
	private function obtenirAuteur($terme) {
198
		$auteur = 0;
209
		$auteur = 0;
199
		if (isset($terme->attributes()->authorID)) {
210
		if (isset($terme->attributes()->authorID)) {
200
			$auteur = $terme->attributes()->authorID;
211
			$auteur = $terme->attributes()->authorID;
201
		} elseif (isset($terme->attributes()->authorREF)) {
212
		} elseif (isset($terme->attributes()->authorREF)) {
202
			$auteur = $terme->attributes()->authorREF;
213
			$auteur = $terme->attributes()->authorREF;
203
		}
214
		}
204
		return $auteur;
215
		return $auteur;
205
	}
216
	}
206
 
217
 
207
	private function obtenirCitation($terme) {
218
	private function obtenirCitation($terme) {
208
		$citation = 0;
219
		$citation = 0;
209
		if (isset($terme->attributes()->citationID)) {
220
		if (isset($terme->attributes()->citationID)) {
210
			$citation = $terme->attributes()->citationID;
221
			$citation = $terme->attributes()->citationID;
211
		} elseif (isset($terme->attributes()->citationREF)) {
222
		} elseif (isset($terme->attributes()->citationREF)) {
212
			$citation = $terme->attributes()->citationREF;
223
			$citation = $terme->attributes()->citationREF;
213
		}
224
		}
214
		return $citation;
225
		return $citation;
215
	}
226
	}
216
 
227
 
217
	private function obtenirImage($terme) {
228
	private function obtenirImage($terme) {
218
		$image = 0;
229
		$image = 0;
219
		if (isset($terme->attributes()->pictureREF)) {
230
		if (isset($terme->attributes()->pictureREF)) {
220
			$image = $terme->attributes()->pictureREF;
231
			$image = $terme->attributes()->pictureREF;
221
		}
232
		}
222
		return $image;
233
		return $image;
223
	}
234
	}
224
 
235
 
225
	private function traiterGroupes($groupes) {
236
	private function traiterGroupes($groupes) {
226
		foreach ($groupes as $groupe) {
237
		foreach ($groupes as $groupe) {
227
			$id = $this->baseIdGroupe + (int) $groupe->attributes()->GROUP_ID;
238
			$id = $this->baseIdGroupe + (int) $groupe->attributes()->GROUP_ID;
228
			if (isset($this->lotsTermes[$id]) === false) {
239
			if (isset($this->lotsTermes[$id]) === false) {
229
				$valeur = array();
240
				$valeur = array();
230
				$valeur[] = (int) $id;
241
				$valeur[] = (int) $id;
231
				$valeur[] = 18;
242
				$valeur[] = 18;
232
				$valeur[] = (string) $groupe->attributes()->groupName;
243
				$valeur[] = (string) $groupe->attributes()->groupName;
233
				$valeur[] = '';
244
				$valeur[] = '';
234
				$valeur[] = 1;
245
				$valeur[] = 1;
235
				$valeur[] = 0;
246
				$valeur[] = 0;
236
				$valeur[] = 0;
247
				$valeur[] = 0;
237
				$valeur[] = 0;
248
				$valeur[] = 0;
238
				$this->lotsTermes[$id] = $valeur;
249
				$this->lotsTermes[$id] = $valeur;
239
			}
250
			}
240
			if (isset($groupe->STRUCTURES_LINKED_TO_GROUP)) {
251
			if (isset($groupe->STRUCTURES_LINKED_TO_GROUP)) {
241
				foreach ($groupe->STRUCTURES_LINKED_TO_GROUP->children() as $structure) {
252
				foreach ($groupe->STRUCTURES_LINKED_TO_GROUP->children() as $structure) {
242
					$relation = array();
253
					$relation = array();
243
					$relation[] = (int) $structure->attributes()->GLOBALID;
254
					$relation[] = (int) $structure->attributes()->GLOBALID;
244
					$relation[] = (int) $id;
255
					$relation[] = (int) $id;
245
					$relation[] = 'A POUR GROUPE';
256
					$relation[] = 'A POUR GROUPE';
246
					$this->ajouterRelation($relation);
257
					$this->ajouterRelation($relation);
247
				}
258
				}
248
			}
259
			}
249
			if (isset($groupe->STATES_IN_GROUP)) {
260
			if (isset($groupe->STATES_IN_GROUP)) {
250
				foreach ($groupe->STATES_IN_GROUP->children() as $etat) {
261
				foreach ($groupe->STATES_IN_GROUP->children() as $etat) {
251
					$relation = array();
262
					$relation = array();
252
					$relation[] = (int) $id;
263
					$relation[] = (int) $id;
253
					$relation[] = (int) $etat->attributes()->GLOBALID;
264
					$relation[] = (int) $etat->attributes()->GLOBALID;
254
					$relation[] = 'A POUR ETAT';
265
					$relation[] = 'A POUR ETAT';
255
					$this->ajouterRelation($relation);
266
					$this->ajouterRelation($relation);
256
				}
267
				}
257
			}
268
			}
258
			if (isset($groupe->STATESUBGROUPS)) {
269
			if (isset($groupe->STATESUBGROUPS)) {
259
				$this->traiterSousGroupes($id, $groupe->STATESUBGROUPS->children());
270
				$this->traiterSousGroupes($id, $groupe->STATESUBGROUPS->children());
260
			}
271
			}
261
		}
272
		}
262
	}
273
	}
263
 
274
 
264
	private function traiterSousGroupes($idGroupe, $sousGroupes) {
275
	private function traiterSousGroupes($idGroupe, $sousGroupes) {
265
		foreach ($sousGroupes as $sg) {
276
		foreach ($sousGroupes as $sg) {
266
			$id = $this->baseIdSousGroupe + (int) $sg->attributes()->STATESUBGROUP_GLOBALID;
277
			$id = $this->baseIdSousGroupe + (int) $sg->attributes()->STATESUBGROUP_GLOBALID;
267
			if (isset($this->lotsTermes[$id]) === false) {
278
			if (isset($this->lotsTermes[$id]) === false) {
268
				$valeur = array();
279
				$valeur = array();
269
				$valeur[] = (int) $id;
280
				$valeur[] = (int) $id;
270
				$valeur[] = 19;
281
				$valeur[] = 19;
271
				$valeur[] = (string) $sg->attributes()->subgGroupName;
282
				$valeur[] = (string) $sg->attributes()->subgGroupName;
272
				$valeur[] = '';
283
				$valeur[] = '';
273
				$valeur[] = 1;
284
				$valeur[] = 1;
274
				$valeur[] = 0;
285
				$valeur[] = 0;
275
				$valeur[] = 0;
286
				$valeur[] = 0;
276
				$valeur[] = 0;
287
				$valeur[] = 0;
277
				$this->lotsTermes[$id] = $valeur;
288
				$this->lotsTermes[$id] = $valeur;
278
 
289
 
279
				$relation = array();
290
				$relation = array();
280
				$relation[] = (int) $idGroupe;
291
				$relation[] = (int) $idGroupe;
281
				$relation[] = (int) $id;
292
				$relation[] = (int) $id;
282
				$relation[] = 'A POUR SOUS-GROUPE';
293
				$relation[] = 'A POUR SOUS-GROUPE';
283
				$this->ajouterRelation($relation);
294
				$this->ajouterRelation($relation);
284
			}
295
			}
285
			if (isset($sg->STATES_IN_SUBGROUP)) {
296
			if (isset($sg->STATES_IN_SUBGROUP)) {
286
				foreach ($sg->STATES_IN_SUBGROUP->children() as $etat) {
297
				foreach ($sg->STATES_IN_SUBGROUP->children() as $etat) {
287
					$relation = array();
298
					$relation = array();
288
					$relation[] = (int) $id;
299
					$relation[] = (int) $id;
289
					$relation[] = (int) $etat->attributes()->GLOBALID;
300
					$relation[] = (int) $etat->attributes()->GLOBALID;
290
					$relation[] = 'A POUR ETAT';
301
					$relation[] = 'A POUR ETAT';
291
					$this->ajouterRelation($relation);
302
					$this->ajouterRelation($relation);
292
				}
303
				}
293
			}
304
			}
294
		}
305
		}
295
	}
306
	}
296
 
307
 
297
	private function traiterNouvellesQualites($qualites) {
308
	private function traiterNouvellesQualites($qualites) {
298
		foreach ($qualites as $qualite) {
309
		foreach ($qualites as $qualite) {
299
			$id = (int) $qualite->attributes()->IDSEQ;
310
			$id = (int) $qualite->attributes()->IDSEQ;
300
			if (isset($this->lotsTermes[$id]) === false) {
311
			if (isset($this->lotsTermes[$id]) === false) {
301
				$valeur = array();
312
				$valeur = array();
302
				$valeur[] = (int) $id;
313
				$valeur[] = (int) $id;
303
				$valeur[] = 11;
314
				$valeur[] = 11;
304
				$valeur[] = (string) $qualite->attributes()->term;
315
				$valeur[] = (string) $qualite->attributes()->term;
305
				$valeur[] = (string) $this->obtenirDefinition($terme);
316
				$valeur[] = (string) $this->obtenirDefinition($terme);
306
				$valeur[] = (int) $this->obtenirPreference($terme);
317
				$valeur[] = (int) $this->obtenirPreference($terme);
307
				$valeur[] = (int) $this->obtenirAuteur($terme);
318
				$valeur[] = (int) $this->obtenirAuteur($terme);
308
				$valeur[] = (int) $this->obtenirCitation($terme);
319
				$valeur[] = (int) $this->obtenirCitation($terme);
309
				$valeur[] = (int) $this->obtenirImage($terme);
320
				$valeur[] = (int) $this->obtenirImage($terme);
310
				$this->lotsTermes[$id] = $valeur;
321
				$this->lotsTermes[$id] = $valeur;
311
			}
322
			}
312
			if (isset($qualite->attributes()->ParentPropertyID)) {
323
			if (isset($qualite->attributes()->ParentPropertyID)) {
313
				$relation = array();
324
				$relation = array();
314
				$relation[] = (int) $qualite->attributes()->IDSEQ;
325
				$relation[] = (int) $qualite->attributes()->IDSEQ;
315
				$relation[] = (int) $qualite->attributes()->ParentPropertyID;
326
				$relation[] = (int) $qualite->attributes()->ParentPropertyID;
316
				$relation[] = 'A POUR PARENT';
327
				$relation[] = 'A POUR PARENT';
317
				$this->ajouterRelation($relation);
328
				$this->ajouterRelation($relation);
318
			}
329
			}
319
			if (isset($qualite->MemberStates)) {
330
			if (isset($qualite->MemberStates)) {
320
				$etats = $qualite->MemberStates->children();
331
				$etats = $qualite->MemberStates->children();
321
				$idParent = $qualite->attributes()->IDSEQ;
332
				$idParent = $qualite->attributes()->IDSEQ;
322
				$this->traiterEtatsMembre($etats, $idParent);
333
				$this->traiterEtatsMembre($etats, $idParent);
323
			}
334
			}
324
			if (isset($qualite->Structures_linked_to_Property)) {
335
			if (isset($qualite->Structures_linked_to_Property)) {
325
				$structures = $qualite->Structures_linked_to_Property->children();
336
				$structures = $qualite->Structures_linked_to_Property->children();
326
				$idParent = $qualite->attributes()->IDSEQ;
337
				$idParent = $qualite->attributes()->IDSEQ;
327
				$this->traiterStructuresLiees($structures, $idParent);
338
				$this->traiterStructuresLiees($structures, $idParent);
328
			}
339
			}
329
			if (isset($qualite->ContextGroups)) {
340
			if (isset($qualite->ContextGroups)) {
330
				$contextes = $qualite->ContextGroups->children();
341
				$contextes = $qualite->ContextGroups->children();
331
				if (count($contextes) > 0) {
342
				if (count($contextes) > 0) {
332
					foreach ($contextes as $contexte) {
343
					foreach ($contextes as $contexte) {
333
						$idParent = $contexte->attributes()->ID;
344
						$idParent = $contexte->attributes()->ID;
334
						$structures = $contexte->Structures_linked_to_Context->children();
345
						$structures = $contexte->Structures_linked_to_Context->children();
335
						$this->traiterStructuresLiees($structures, $idParent);
346
						$this->traiterStructuresLiees($structures, $idParent);
336
						$etats = $contexte->MemberStates->children();
347
						$etats = $contexte->MemberStates->children();
337
						$this->traiterEtatsMembre($etats, $idParent);
348
						$this->traiterEtatsMembre($etats, $idParent);
338
					}
349
					}
339
				}
350
				}
340
			}
351
			}
341
		}
352
		}
342
	}
353
	}
343
 
354
 
344
	private function ajouterRelation($relation) {
355
	private function ajouterRelation($relation) {
345
		$id = implode('-', $relation);
356
		$id = implode('-', $relation);
346
		if (isset($this->lotsRelations[$id]) === false) {
357
		if (isset($this->lotsRelations[$id]) === false) {
347
			$this->lotsRelations[$id] = $relation;
358
			$this->lotsRelations[$id] = $relation;
348
		}
359
		}
349
	}
360
	}
350
 
361
 
351
	private function traiterEtatsMembre($etats, $idParent) {
362
	private function traiterEtatsMembre($etats, $idParent) {
352
		if (count($etats) > 0) {
363
		if (count($etats) > 0) {
353
			foreach ($etats as $etat) {
364
			foreach ($etats as $etat) {
354
				$relation = array();
365
				$relation = array();
355
				$relation[] = (int) $idParent;
366
				$relation[] = (int) $idParent;
356
				$relation[] = (int) $etat->attributes()->RefID;
367
				$relation[] = (int) $etat->attributes()->RefID;
357
				$relation[] = 'A POUR ETAT';
368
				$relation[] = 'A POUR ETAT';
358
				$this->ajouterRelation($relation);
369
				$this->ajouterRelation($relation);
359
			}
370
			}
360
		}
371
		}
361
	}
372
	}
362
 
373
 
363
	private function traiterStructuresLiees($structures, $idParent) {
374
	private function traiterStructuresLiees($structures, $idParent) {
364
		if (count($structures) > 0) {
375
		if (count($structures) > 0) {
365
			foreach ($structures as $structure) {
376
			foreach ($structures as $structure) {
366
				$relation = array();
377
				$relation = array();
367
				$relation[] = (int) $structure->attributes()->RefID;
378
				$relation[] = (int) $structure->attributes()->RefID;
368
				$relation[] = (int) $idParent;
379
				$relation[] = (int) $idParent;
369
				$relation[] = 'A POUR PROPRIETE';
380
				$relation[] = 'A POUR PROPRIETE';
370
				$this->ajouterRelation($relation);
381
				$this->ajouterRelation($relation);
371
			}
382
			}
372
		}
383
		}
373
	}
384
	}
374
 
385
 
375
	private function traiterRelations($relations) {
386
	private function traiterRelations($relations) {
376
		foreach ($relations as $rel) {
387
		foreach ($relations as $rel) {
377
			$relation = array();
388
			$relation = array();
378
			$relation[] = (int) $rel->attributes()->term1REF;
389
			$relation[] = (int) $rel->attributes()->term1REF;
379
			$relation[] = (int) $rel->attributes()->term2REF;
390
			$relation[] = (int) $rel->attributes()->term2REF;
380
			$relation[] = (string) $this->obtenirTypeRelation($rel->attributes()->relationship);
391
			$relation[] = (string) $this->obtenirTypeRelation($rel->attributes()->relationship);
381
			$this->ajouterRelation($relation);
392
			$this->ajouterRelation($relation);
382
		}
393
		}
383
	}
394
	}
384
 
395
 
385
	private function obtenirTypeRelation($type) {
396
	private function obtenirTypeRelation($type) {
386
		switch ($type) {
397
		switch ($type) {
387
			case 'ASSOCIATED WITH' :
398
			case 'ASSOCIATED WITH' :
388
				$relation = 'ASSOCIE AVEC';
399
				$relation = 'ASSOCIE AVEC';
389
				break;
400
				break;
390
			case 'IS A PART OF' :
401
			case 'IS A PART OF' :
391
				$relation = 'EST UNE PARTIE DE';
402
				$relation = 'EST UNE PARTIE DE';
392
				break;
403
				break;
393
			case 'IS A TYPE OF' :
404
			case 'IS A TYPE OF' :
394
				$relation = 'EST UN TYPE DE';
405
				$relation = 'EST UN TYPE DE';
395
				break;
406
				break;
396
			default :
407
			default :
397
				$relation = '';
408
				$relation = '';
398
		}
409
		}
399
		return $relation;
410
		return $relation;
400
	}
411
	}
401
 
412
 
402
	private function traiterImages($images) {
413
	private function traiterImages($images) {
403
		foreach ($images as $img) {
414
		foreach ($images as $img) {
404
			$valeur = array();
415
			$valeur = array();
405
			$valeur[] = (int) $img->attributes()->ID;
416
			$valeur[] = (int) $img->attributes()->ID;
406
			$valeur[] = (string) $img->attributes()->NAME;
417
			$valeur[] = (string) $img->attributes()->NAME;
407
			$valeur[] = (int) $img->attributes()->CITATION_REFID;
418
			$valeur[] = (int) $img->attributes()->CITATION_REFID;
408
			$this->lotsImages[] = $valeur;
419
			$this->lotsImages[] = $valeur;
409
		}
420
		}
410
	}
421
	}
411
 
422
 
412
	private function traiterCitations($citations) {
423
	private function traiterCitations($citations) {
413
		foreach ($citations as $publi) {
424
		foreach ($citations as $publi) {
414
			$valeur = array();
425
			$valeur = array();
415
			$valeur[] = (int) $publi->attributes()->ID;
426
			$valeur[] = (int) $publi->attributes()->ID;
416
			$valeur[] = (int) $publi->attributes()->primaryAuthorREF;
427
			$valeur[] = (int) $publi->attributes()->primaryAuthorREF;
417
			$valeur[] = (string) $publi->PUBLICATION;
428
			$valeur[] = (string) $publi->PUBLICATION;
418
			$valeur[] = (string) $publi->DATE;
429
			$valeur[] = (string) $publi->DATE;
419
			$valeur[] = (string) $publi->PAGE;
430
			$valeur[] = (string) $publi->PAGE;
420
			$this->lotsPublications[] = $valeur;
431
			$this->lotsPublications[] = $valeur;
421
		}
432
		}
422
	}
433
	}
423
 
434
 
424
	private function traiterAuteurs($auteurs) {
435
	private function traiterAuteurs($auteurs) {
425
		foreach ($auteurs as $auteur) {
436
		foreach ($auteurs as $auteur) {
426
			$valeur = array();
437
			$valeur = array();
427
			$valeur[] = (int) $auteur->attributes()->ID;
438
			$valeur[] = (int) $auteur->attributes()->ID;
428
			$valeur[] = (string) $auteur->attributes()->givenNames;
439
			$valeur[] = (string) $auteur->attributes()->givenNames;
429
			$valeur[] = (string) $auteur->attributes()->surname;
440
			$valeur[] = (string) $auteur->attributes()->surname;
430
			$valeur[] = $this->obtenirDateNaissance((string) $auteur->attributes()->born);
441
			$valeur[] = $this->obtenirDateNaissance((string) $auteur->attributes()->born);
431
			$valeur[] = (string) $auteur->attributes()->died;
442
			$valeur[] = (string) $auteur->attributes()->died;
432
			$this->lotsAuteurs[] = $valeur;
443
			$this->lotsAuteurs[] = $valeur;
433
		}
444
		}
434
	}
445
	}
435
 
446
 
436
	private function obtenirDateNaissance($annee) {
447
	private function obtenirDateNaissance($annee) {
437
		$date = $annee.'-00-00';
448
		$date = $annee.'-00-00';
438
		return $date;
449
		return $date;
439
	}
450
	}
440
 
451
 
441
	private function traiterHierarchie($noeud) {
452
	private function traiterHierarchie($noeud) {
442
		$valeur = array();
453
		$valeur = array();
443
		$valeur[] = (int) $noeud->attributes()->ID;
454
		$valeur[] = (int) $noeud->attributes()->ID;
444
		$valeur[] = (int) $noeud->attributes()->ParentNodeID;
455
		$valeur[] = (int) $noeud->attributes()->ParentNodeID;
445
		$valeur[] = (string) $noeud->attributes()->pathAsNames;
456
		$valeur[] = (string) $noeud->attributes()->pathAsNames;
446
		$valeur[] = (string) $noeud->attributes()->pathAsID;
457
		$valeur[] = (string) $noeud->attributes()->pathAsID;
447
		$valeur[] = (int) $noeud->attributes()->TermID;
458
		$valeur[] = (int) $noeud->attributes()->TermID;
448
		$this->lotsHierarchie[] = $valeur;
459
		$this->lotsHierarchie[] = $valeur;
449
	}
460
	}
450
 
461
 
451
	private function insererLotDeTermes() {
462
	private function insererLotDeTermes() {
452
		$champs = implode(',', array('id_terme', 'ce_type', 'nom_en', 'description_en', 'preference', 'ce_auteur', 'ce_publication', 'ce_image'));
463
		$champs = implode(',', array('id_terme', 'ce_type', 'nom_en', 'description_en', 'preference', 'ce_auteur', 'ce_publication', 'ce_image'));
453
		$values = $this->creerValues($this->lotsTermes);
464
		$values = $this->creerValues($this->lotsTermes);
454
		$requete = "INSERT INTO prometheus_ontologies_terme_v1_00 ($champs) VALUES $values";
465
		$requete = "INSERT INTO prometheus_ontologies_terme_v1_00 ($champs) VALUES $values";
455
		$this->executerSql($requete);
466
		$this->executerSql($requete);
456
	}
467
	}
457
 
468
 
458
	private function insererLotDeRelations() {
469
	private function insererLotDeRelations() {
459
		$champs = implode(',', array('id_terme_01', 'id_terme_02', 'relation'));
470
		$champs = implode(',', array('id_terme_01', 'id_terme_02', 'relation'));
460
		$values = $this->creerValues($this->lotsRelations);
471
		$values = $this->creerValues($this->lotsRelations);
461
		$requete = "INSERT INTO prometheus_ontologies_relation_v1_00 ($champs) VALUES $values";
472
		$requete = "INSERT INTO prometheus_ontologies_relation_v1_00 ($champs) VALUES $values";
462
		$this->executerSql($requete);
473
		$this->executerSql($requete);
463
	}
474
	}
464
 
475
 
465
	private function insererLotImages() {
476
	private function insererLotImages() {
466
		$champs = implode(',', array('id_image', 'uri', 'ce_publication'));
477
		$champs = implode(',', array('id_image', 'uri', 'ce_publication'));
467
		$values = $this->creerValues($this->lotsImages);
478
		$values = $this->creerValues($this->lotsImages);
468
		$requete = "INSERT INTO prometheus_ontologies_image_v1_00 ($champs) VALUES $values";
479
		$requete = "INSERT INTO prometheus_ontologies_image_v1_00 ($champs) VALUES $values";
469
		$this->executerSql($requete);
480
		$this->executerSql($requete);
470
	}
481
	}
471
 
482
 
472
	private function insererLotDePublications() {
483
	private function insererLotDePublications() {
473
		$champs = implode(',', array('id_publication', 'ce_auteur_principal', 'titre', 'date', 'uri'));
484
		$champs = implode(',', array('id_publication', 'ce_auteur_principal', 'titre', 'date', 'uri'));
474
		$values = $this->creerValues($this->lotsPublications);
485
		$values = $this->creerValues($this->lotsPublications);
475
		$requete = "INSERT INTO prometheus_ontologies_publication_v1_00 ($champs) VALUES $values";
486
		$requete = "INSERT INTO prometheus_ontologies_publication_v1_00 ($champs) VALUES $values";
476
		$this->executerSql($requete);
487
		$this->executerSql($requete);
477
	}
488
	}
478
 
489
 
479
	private function insererLotAuteurs() {
490
	private function insererLotAuteurs() {
480
		$champs = implode(',', array('id_auteur', 'prenom', 'nom', 'naissance_date', 'deces_date'));
491
		$champs = implode(',', array('id_auteur', 'prenom', 'nom', 'naissance_date', 'deces_date'));
481
		$values = $this->creerValues($this->lotsAuteurs);
492
		$values = $this->creerValues($this->lotsAuteurs);
482
		$requete = "INSERT INTO prometheus_ontologies_auteur_v1_00 ($champs) VALUES $values";
493
		$requete = "INSERT INTO prometheus_ontologies_auteur_v1_00 ($champs) VALUES $values";
483
		$this->executerSql($requete);
494
		$this->executerSql($requete);
484
	}
495
	}
485
 
496
 
486
	private function insererLotHierarchie() {
497
	private function insererLotHierarchie() {
487
		$champs = implode(',', array('id_noeud', 'id_noeud_parent', 'chemin_noms', 'chemin_ids', 'ce_terme'));
498
		$champs = implode(',', array('id_noeud', 'id_noeud_parent', 'chemin_noms', 'chemin_ids', 'ce_terme'));
488
		$values = $this->creerValues($this->lotsHierarchie);
499
		$values = $this->creerValues($this->lotsHierarchie);
489
		$requete = "INSERT INTO prometheus_ontologies_hierarchie_v1_00 ($champs) VALUES $values";
500
		$requete = "INSERT INTO prometheus_ontologies_hierarchie_v1_00 ($champs) VALUES $values";
490
		$this->executerSql($requete);
501
		$this->executerSql($requete);
491
	}
502
	}
492
 
503
 
493
	private function creerValues($valeurs) {
504
	private function creerValues($valeurs) {
494
		$values = array();
505
		$values = array();
495
		foreach ($valeurs as $valeur) {
506
		foreach ($valeurs as $valeur) {
496
			foreach ($valeur as $id => $val) {
507
			foreach ($valeur as $id => $val) {
497
				$valeur[$id] = $this->etreVide($val) ? 'NULL' : $this->proteger(trim($val));
508
				$valeur[$id] = $this->etreVide($val) ? 'NULL' : $this->proteger(trim($val));
498
			}
509
			}
499
			$values[]  = '('.implode(',', $valeur).')';
510
			$values[]  = '('.implode(',', $valeur).')';
500
		}
511
		}
501
		$values = implode(',', $values);
512
		$values = implode(',', $values);
502
		return $values;
513
		return $values;
503
	}
514
	}
504
 
515
 
505
	private function etreVide($val) {
516
	private function etreVide($val) {
506
		$vide = ($val === null || trim($val) === '') ? true : false;
517
		$vide = ($val === null || trim($val) === '') ? true : false;
507
		return $vide;
518
		return $vide;
508
	}
519
	}
509
 
520
 
510
	private function executerSql($requete) {
521
	private function executerSql($requete) {
511
		$this->getBdd()->requeter($requete);
522
		$this->getBdd()->requeter($requete);
512
	}
523
	}
513
 
524
 
514
	private function proteger($chaine) {
525
	private function proteger($chaine) {
515
		return $this->getBdd()->proteger($chaine);
526
		return $this->getBdd()->proteger($chaine);
516
	}
527
	}
-
 
528
 
-
 
529
	private function viderTraductions() {
-
 
530
		$requete = 'UPDATE prometheus_ontologies_terme_v1_00 '.
-
 
531
			'SET nom = NULL, description = NULL, notes = NULL';
-
 
532
		$this->executerSql($requete);
-
 
533
	}
-
 
534
 
-
 
535
	private function chargerTraductions() {
-
 
536
		$dossier = $this->projetDossier.'traductions'.DS;
-
 
537
		$pointeur = opendir($dossier);
-
 
538
		while ($fichierNom = readdir($pointeur)) {
-
 
539
			if (preg_match('/^[.]{1,2}/', $fichierNom) == false) {
-
 
540
				$fichierChemin = $dossier.$fichierNom;
-
 
541
				$lecteur = new LecteurExcel($fichierChemin);
-
 
542
				//$this->verifierStructureFichierExcel($lecteur);
-
 
543
				for ($ligne = 2; $ligne < $lecteur->getNbreLignes(); $ligne++) {
-
 
544
					$traduction = new Traduction();
-
 
545
					$traduction->type = $lecteur->getValeur($ligne, 1);
-
 
546
					$traduction->en = $lecteur->getValeur($ligne, 2);
-
 
547
					$traduction->fr = $lecteur->getValeur($ligne, 3);
-
 
548
					$traduction->sourcesTraduction = $lecteur->getValeur($ligne, 4);
-
 
549
					$traduction->remarques = $lecteur->getValeur($ligne, 5);
-
 
550
					$traduction->sources = $lecteur->getValeur($ligne, 6);
-
 
551
					$traduction->relectureRemarques = $lecteur->getValeur($ligne, 7);
-
 
552
					$this->genererNotes($traduction);
-
 
553
 
-
 
554
					$this->insererTraduction($traduction);
-
 
555
				}
-
 
556
			}
-
 
557
		}
-
 
558
		closedir($pointeur);
-
 
559
	}
-
 
560
 
-
 
561
	private function verifierStructureFichierExcel($lecteur) {
-
 
562
		$messages = array();
-
 
563
		$colonnes = array("Type d'élément", "Élément en anglais", "Traduction en français", "Sources de la traduction", "Remarques", "Sources", "Relecture/ Remarques");
-
 
564
		foreach ($colonnes as $numero => $intitule) {
-
 
565
			$valeurBrute = $lecteur->getValeur(1, ($numero + 1));
-
 
566
			if ($valeurBrute != $intitule) {
-
 
567
				$messages[] = "Le fichier {$lecteur->getFichier()} ne contient pas la bonne colonne #$numero : $intitule != $valeurBrute";
-
 
568
			}
-
 
569
		}
-
 
570
		if (count($messages) > 0) {
-
 
571
			throw new Exception(implode("\n", $messages));
-
 
572
		}
-
 
573
	}
-
 
574
 
-
 
575
	private function genererNotes(Traduction $traduction) {
-
 
576
		$notes = array();
-
 
577
		if ($this->etreVide($traduction->sourcesTraduction) === false) {
-
 
578
			$notes[] = "Sources de la traduction : ".$traduction->sourcesTraduction;
-
 
579
		}
-
 
580
		if ($this->etreVide($traduction->remarques) === false) {
-
 
581
			$notes[] = "Remarques : ".$traduction->remarques;
-
 
582
		}
-
 
583
		if ($this->etreVide($traduction->sources) === false) {
-
 
584
			$notes[] = "Sources : ".$traduction->sources;
-
 
585
		}
-
 
586
		if ($this->etreVide($traduction->relectureRemarques) === false) {
-
 
587
			$notes[] = "Remarques sur la relecture : ".$traduction->relectureRemarques;
-
 
588
		}
-
 
589
		if (count($notes) > 0) {
-
 
590
			$traduction->notes = implode("\n", $notes);
-
 
591
		}
-
 
592
	}
-
 
593
 
-
 
594
	private function insererTraduction($traduction) {
-
 
595
		$requete = null;
-
 
596
		$notes = $traduction->notes;
-
 
597
		if ($traduction->type == 'term') {
-
 
598
			$notes = $this->proteger("Nom :\n".$notes);
-
 
599
			$nom = $this->proteger($traduction->fr);
-
 
600
			$nomEn = $this->proteger($traduction->en);
-
 
601
			$requete = "UPDATE prometheus_ontologies_terme_v1_00 ".
-
 
602
				"SET nom = $nom, notes = $notes ".
-
 
603
				"WHERE nom_en = $nomEn ";
-
 
604
		} else if ($traduction->type == 'DEFINITION') {
-
 
605
			$notes = $this->proteger("Description :\n".$notes);
-
 
606
			$description = $this->proteger($traduction->fr);
-
 
607
			$descriptionEn = $this->proteger($traduction->en);
-
 
608
			$requete = "UPDATE prometheus_ontologies_terme_v1_00 ".
-
 
609
				"SET description = $description, notes = CONCAT(notes, '\n', $notes) ".
-
 
610
				"WHERE description_en = $descriptionEn ";
-
 
611
		}
-
 
612
		if ($requete != null) {
-
 
613
			$this->executerSql($requete);
-
 
614
		}
-
 
615
	}
517
 
616
 
518
	private function vider() {
617
	private function vider() {
519
		$requete = 'TRUNCATE TABLE prometheus_ontologies_auteur_v1_00';
618
		$requete = 'TRUNCATE TABLE prometheus_ontologies_auteur_v1_00';
520
		$this->executerSql($requete);
619
		$this->executerSql($requete);
521
		$requete = 'TRUNCATE TABLE prometheus_ontologies_hierarchie_v1_00';
620
		$requete = 'TRUNCATE TABLE prometheus_ontologies_hierarchie_v1_00';
522
		$this->executerSql($requete);
621
		$this->executerSql($requete);
523
		$requete = 'TRUNCATE TABLE prometheus_ontologies_image_v1_00';
622
		$requete = 'TRUNCATE TABLE prometheus_ontologies_image_v1_00';
524
		$this->executerSql($requete);
623
		$this->executerSql($requete);
525
		$requete = 'TRUNCATE TABLE prometheus_ontologies_publication_v1_00';
624
		$requete = 'TRUNCATE TABLE prometheus_ontologies_publication_v1_00';
526
		$this->executerSql($requete);
625
		$this->executerSql($requete);
527
		$requete = 'TRUNCATE TABLE prometheus_ontologies_relation_v1_00';
626
		$requete = 'TRUNCATE TABLE prometheus_ontologies_relation_v1_00';
528
		$this->executerSql($requete);
627
		$this->executerSql($requete);
529
		$requete = 'TRUNCATE TABLE prometheus_ontologies_terme_v1_00';
628
		$requete = 'TRUNCATE TABLE prometheus_ontologies_terme_v1_00';
530
		$this->executerSql($requete);
629
		$this->executerSql($requete);
531
	}
630
	}
532
 
631
 
533
	private function supprimerTous() {
632
	private function supprimerTous() {
534
		$requete = "DROP TABLE prometheus_meta, prometheus_ontologies_auteur_v1_00, prometheus_ontologies_hierarchie_v1_00,
633
		$requete = "DROP TABLE prometheus_meta, prometheus_ontologies_auteur_v1_00, prometheus_ontologies_hierarchie_v1_00,
535
			prometheus_ontologies_image_v1_00, prometheus_ontologies_publication_v1_00, prometheus_ontologies_relation_v1_00,
634
			prometheus_ontologies_image_v1_00, prometheus_ontologies_publication_v1_00, prometheus_ontologies_relation_v1_00,
536
			prometheus_ontologies_terme_v1_00, prometheus_ontologies_type_v1_00";
635
			prometheus_ontologies_terme_v1_00, prometheus_ontologies_type_v1_00";
537
		$this->getBdd()->requeter($requete);
636
		$this->getBdd()->requeter($requete);
538
	}
637
	}
539
}
638
}
540
?>
639
?>