/** * Loads an ontology from configuration files using the DBpedia mapping language. * * @param $pages Array of PageNode instances containing the configuration files * @return Ontology The ontology */ public function read(array $pages) { $ontology = new Ontology(); $ontology->addClass(new OntologyClass("owl:Thing")); OntologyDataTypes::addDataTypes($ontology); // TODO: range should be rdfs:Class $ontology->addProperty(new OntologyProperty("rdf:type", $ontology->getClass("owl:Thing"))); foreach ($pages as $pageNode) { OntologyReader::createClasses($ontology, $pageNode); } foreach ($pages as $pageNode) { OntologyReader::linkClasses($ontology, $pageNode); } return $ontology; }