protected function analyse_indexation() { $ontology = $this->handler->get_ontology(); $this->classes = $this->handler->get_classes(); $unions = array(); $this->properties = $ontology->get_properties(); foreach ($this->classes as $class) { $unions[$class->uri] = array(); $query = "select * {\n\t\t\t\t<" . $class->uri . "> <http://www.w3.org/2000/01/rdf-schema#subClassOf> ?subclass .\n\t\t\t\t?subclass rdf:type pmb:indexation .\n\t\t\t\t?subclass owl:onProperty ?property .\n\t\t\t\toptional {\t\t\n\t\t\t\t\t?subclass pmb:use ?use .\n\t\t\t\t}\n\t\t\t\t?subclass pmb:pound ?pound .\n\t\t\t\t?subclass pmb:field ?field .\n\t\t\t\t?subclass pmb:subfield ?subfield .\n\t\t\t\toptional {\n\t\t\t\t\t?subclass owl:unionOf ?union\n\t\t\t\t}\n\t\t\t}"; $this->handler->onto_query($query); if ($this->handler->onto_num_rows()) { $results = $this->handler->onto_result(); foreach ($results as $result) { if ($result->use) { $element = array($result->property => $result->use); } else { $element = $result->property; } $this->infos[$class->uri][$result->pound][] = $element; $this->tab_code_champ[$result->field][$this->classes[$class->uri]->pmb_name . "_" . $this->properties[$result->property]->pmb_name] = array('champ' => $result->field, 'ss_champ' => $result->subfield, 'pond' => $result->pound, 'no_words' => false); } if ($result->union && !in_array($result->union, $unions[$class->uri])) { $unions[$class->uri][] = $result->union; } } } foreach ($unions as $class_uri => $bnodes) { foreach ($bnodes as $bnode) { $this->recurse_analyse_indexation($class_uri, $bnode); } } }
public function get_skos_handler() { global $class_path; $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); $handler = new onto_handler($class_path . "/rdf/skos_pmb.rdf", "arc2", $onto_store_config, "arc2", $data_store_config, $this->get_skos_namespaces(), 'http://www.w3.org/2004/02/skos/core#prefLabel'); $handler->get_ontology(); return $handler; }