Exemple #1
0
 public function update_display_label($label)
 {
     global $base_path;
     $this->get_data_store();
     // On commence par supprimer le label existant
     $query = "delete {\n\t\t\t\t<" . $this->get_uri() . "> <http://www.w3.org/2004/02/skos/core#prefLabel> ?obj\n\t\t\t\t}";
     $this->data_store->query($query);
     // On insert le nouveau label
     $query = "insert into <pmb> {\n\t\t\t\t<" . $this->get_uri() . "> <http://www.w3.org/2004/02/skos/core#prefLabel> '" . $label . "'\n\t\t\t\t}";
     $this->data_store->query($query);
     // On réindexe
     $onto_store_config = array('db_name' => DATA_BASE, 'db_user' => USER_NAME, 'db_pwd' => USER_PASS, 'db_host' => SQL_SERVER, 'store_name' => 'ontology', 'max_errors' => 100, 'store_strip_mb_comp_str' => 0);
     $data_store_config = array('db_name' => DATA_BASE, 'db_user' => USER_NAME, 'db_pwd' => USER_PASS, 'db_host' => SQL_SERVER, 'store_name' => 'rdfstore', 'max_errors' => 100, 'store_strip_mb_comp_str' => 0);
     $tab_namespaces = array("skos" => "http://www.w3.org/2004/02/skos/core#", "dc" => "http://purl.org/dc/elements/1.1", "dct" => "http://purl.org/dc/terms/", "owl" => "http://www.w3.org/2002/07/owl#", "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdfs" => "http://www.w3.org/2000/01/rdf-schema#", "xsd" => "http://www.w3.org/2001/XMLSchema#", "pmb" => "http://www.pmbservices.fr/ontology#");
     $onto_index = new onto_index();
     $onto_index->load_handler($base_path . "/classes/rdf/skos_pmb.rdf", "arc2", $onto_store_config, "arc2", $data_store_config, $tab_namespaces, 'http://www.w3.org/2004/02/skos/core#prefLabel');
     $onto_index->maj($this->get_id());
 }
 /**
  * Exécute une nouvelle requête SPARQL sur le store de l'ontologie SKOS
  * @param query string  <p>Requête SPARQL a lancer sur le store ARC2</p>
  * @return bool
  * @access public
  */
 public static function query($query)
 {
     self::init();
     return self::$store->query($query);
 }