params->base_resource."?ontology_id=".$this->params->ontology_id.($with_params? "&" : ""); } protected function proceed_save($list=true){ global $class_path; $this->item->get_values_from_form(); $result = $this->handler->save($this->item); if($result !== true){ $ui_class_name=self::resolve_ui_class_name($this->params->sub,$this->handler->get_onto_name()); $ui_class_name::display_errors($this,$result); }else{ //on a besoin pour notre ontologie de revoir certaine property... $query = "select * where{ <".$this->item->get_uri()."> rdf:type ?type . <".$this->item->get_uri()."> rdfs:label ?label . optional { <".$this->item->get_uri()."> pmb_onto:indexWith ?indexWith . } . optional { <".$this->item->get_uri()."> pmb_onto:restrictWith ?restrictWith . } }"; $useInConcept = false; $this->handler->data_query($query); if($this->handler->data_num_rows()){ $results = $this->handler->data_result(); $query = " insert into {"; switch($results[0]->type){ case "http://www.w3.org/2002/07/owl#Class" : //nothing to do for now! break; case "http://www.w3.org/2002/07/owl#ObjectProperty" : $query.= " <".$this->item->get_uri()."> rdf:type ."; break; } $labels = $inverseOf = $indexWith = $restrictWith = array(); foreach($results as $result){ $labels[] = "\"".$result->label."\"".(isset($result->label_lang) ? "@".$result->label_lang : ""); if(!empty($result->indexWith)){ $indexWith[] = "<".$result->indexWith.">"; } if(!empty($result->restrictWith)){ $restrictWith[] = "<".$result->restrictWith.">"; } } $labels = array_unique($labels); $indexWith = array_unique($indexWith); $restrictWith = array_unique($restrictWith); foreach($indexWith as $elem){ $query.= " <".$this->item->get_uri()."> rdfs:subClassOf ".$elem." ."; } foreach($restrictWith as $elem){ $query.= " <".$this->item->get_uri()."> rdfs:subClassOf ".$elem." ."; } $query.= " }"; $this->handler->data_query($query); } } if($list){ $this->proceed_list(); } } }