From: <sk...@us...> - 2008-10-27 15:32:12
|
Revision: 1452 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1452&view=rev Author: sknappe Date: 2008-10-27 15:32:05 +0000 (Mon, 27 Oct 2008) Log Message: ----------- changes to use new ontology Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php trunk/src/dbpedia-navigator/ajax_learn_concepts.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-10-27 14:53:57 UTC (rev 1451) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-10-27 15:32:05 UTC (rev 1452) @@ -76,6 +76,7 @@ $algorithmID=$this->client->setLearningAlgorithm($this->id, "dbpediaNavigationSuggestor"); $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "forceRefinementLengthIncrease", true); $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "useHasValueConstructor", true); + $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "useCardinalityRestrictions", false); $this->client->applyConfigEntryInt($this->id, $algorithmID, "valueFrequencyThreshold", 2); $this->client->applyConfigEntryInt($this->id, $algorithmID, "guaranteeXgoodDescriptions", 3); $this->client->applyConfigEntryInt($this->id, $algorithmID, "maxExecutionTimeInSeconds", 3); Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-10-27 14:53:57 UTC (rev 1451) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-10-27 15:32:05 UTC (rev 1452) @@ -32,12 +32,14 @@ $databaseConnection->connect($settings->database_server,$settings->database_user,$settings->database_pass); $databaseConnection->select_database($settings->database_name); - $test=preg_match("/^([\(]*\"http:\/\/dbpedia\.org\/class\/yago\/[^\040]+\"[\)]*(\040(AND|OR)\040)?)+$/",$kb); + if ($settings->classSystem=="YAGO") $test=preg_match("/^([\(]*\"http:\/\/dbpedia\.org\/class\/yago\/[^\040]+\"[\)]*(\040(AND|OR)\040)?)+$/",$kb); + else if ($settings->classSystem=="DBpedia") $test=preg_match("/^([\(]*\"http:\/\/dbpedia\.org\/ontology\/[^\040]+\"[\)]*(\040(AND|OR)\040)?)+$/",$kb); $content=""; if ($test){ - preg_match_all("/\"http:\/\/dbpedia\.org\/class\/yago\/[^\040()]+\"/",$kb,$treffer,PREG_OFFSET_CAPTURE); - + if ($settings->classSystem=="YAGO") preg_match_all("/\"http:\/\/dbpedia\.org\/class\/yago\/[^\040()]+\"/",$kb,$treffer,PREG_OFFSET_CAPTURE); + else if ($settings->classSystem=="DBpedia") preg_match_all("/\"http:\/\/dbpedia\.org\/ontology\/[^\040()]+\"/",$kb,$treffer,PREG_OFFSET_CAPTURE); + $final=''; $i=1; $pos=0; Modified: trunk/src/dbpedia-navigator/ajax_learn_concepts.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-10-27 14:53:57 UTC (rev 1451) +++ trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-10-27 15:32:05 UTC (rev 1452) @@ -41,16 +41,18 @@ $classes=array(); $noclass=array(); + if ($settings->classSystem=="YAGO") $rekursion=1; + else if ($settings->classSystem=="DBpedia") $rekursion=0; foreach ($all as $pos){ $newclasses=array(); $query="SELECT category FROM articlecategories WHERE name='$pos'"; $res=$databaseConnection->query($query); if (mysql_num_rows($res)<1) $noclass[]=$pos; while ($result=$databaseConnection->nextEntry($res)){ - $classes[$pos][]=$result['category']; - $newclasses[]=$result['category']; + if ($result['category']!="http://dbpedia.org/ontology/Resource") $classes[$pos][]=$result['category']; + if ($result['category']!="http://dbpedia.org/ontology/Resource") $newclasses[]=$result['category']; } - for ($i=0;$i<1;$i++){ + for ($i=0;$i<$rekursion;$i++){ $tempclasses=array(); foreach ($newclasses as $clas){ $query="SELECT father FROM classhierarchy WHERE child='$clas'"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |