From: <sk...@us...> - 2008-01-15 10:21:40
|
Revision: 372 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=372&view=rev Author: sknappe Date: 2008-01-15 02:21:31 -0800 (Tue, 15 Jan 2008) Log Message: ----------- removed bug with empty result Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-01-15 09:29:18 UTC (rev 371) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-01-15 10:21:31 UTC (rev 372) @@ -113,6 +113,7 @@ if (!$this->client->isThreadRunning($this->id,$this->ksID,"triples")) { $object=$this->client->getFromSparql($this->id,$this->ksID,"triples"); + if (count($object)==0) return array(); $array=$object->item; if (count($array)==1) return $array; $ret=array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-01-29 08:49:30
|
Revision: 449 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=449&view=rev Author: sknappe Date: 2008-01-29 00:49:28 -0800 (Tue, 29 Jan 2008) Log Message: ----------- now works with new SparqlQuery Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-01-29 05:51:30 UTC (rev 448) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-01-29 08:49:28 UTC (rev 449) @@ -42,7 +42,7 @@ function getConceptFromExamples($posExamples,$negExamples) { - $this->client->applyConfigEntryInt($this->id, $this->ksID, "recursionDepth",2); + $this->client->applyConfigEntryInt($this->id, $this->ksID, "recursionDepth",1); $this->client->applyConfigEntryStringArray($this->id, $this->ksID, "instances", array_merge($posExamples,$negExamples)); // $this->client->applyConfigEntryStringArray($this->id, $this->ksID, "predList", array()); // $this->client->applyConfigEntryStringArray($this->id, $this->ksID, "objList", array()); @@ -122,16 +122,16 @@ sleep($sleeptime); - $running=$this->client->isSparqlQueryRunning($this->id,$this->ksID,$queryID); + $running=$this->client->isSparqlQueryRunning($this->id,$queryID); if (!$running){ - $result=$this->client->sparqlQuery($this->id,$this->ksID,$queryID); + $result=$this->client->getAsStringArray($this->id,$queryID); return $result; } $seconds = $i * $sleeptime; $i++; } while($seconds<$this->ttl); - $this->client->stopSparqlQuery($id,$ksID,$queryID); + $this->client->stopSparqlQuery($id,$queryID); } function getSubjects($label) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-06 17:37:51
|
Revision: 506 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=506&view=rev Author: sknappe Date: 2008-02-06 09:37:47 -0800 (Wed, 06 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-06 17:13:22 UTC (rev 505) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-06 17:37:47 UTC (rev 506) @@ -106,7 +106,7 @@ $query="SELECT ?pred ?obj ". "WHERE {<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}"; $result=$this->getSparqlResult($query); - if (!$result->item) throw new Exception("Your query brought no result."); + if (!isset($result->item)) throw new Exception("Your query brought no result."); $ret=array(); foreach ($result->item as $results){ $value=$results->item[1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-07 10:40:29
|
Revision: 510 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=510&view=rev Author: sknappe Date: 2008-02-07 02:40:10 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Redirects are now properly handled Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-07 09:55:12 UTC (rev 509) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-07 10:40:10 UTC (rev 510) @@ -104,7 +104,7 @@ function getTriples($label) { $query="SELECT ?pred ?obj ". - "WHERE {<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}"; + "WHERE {{<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}UNION{<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> <http://dbpedia.org/property/redirect> ?Conc.?Conc ?pred ?obj}}"; $result=$this->getSparqlResult($query); if (!isset($result->item)) throw new Exception("Your query brought no result. The Label-Search is started."); $ret=array(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-18 19:20:37
|
Revision: 607 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=607&view=rev Author: sknappe Date: 2008-02-18 11:20:32 -0800 (Mon, 18 Feb 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-18 18:53:32 UTC (rev 606) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-18 19:20:32 UTC (rev 607) @@ -160,7 +160,7 @@ throw new Exception("Query stopped"); } } while($seconds<$this->ttl); - $this->client->stopSparqlQuery($id,$queryID); + $this->client->stopSparqlThread($id,$queryID); } function getSubjects($label) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-28 14:18:24
|
Revision: 662 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=662&view=rev Author: sknappe Date: 2008-02-28 06:18:15 -0800 (Thu, 28 Feb 2008) Log Message: ----------- search with categories should now work Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-28 13:57:59 UTC (rev 661) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-28 14:18:15 UTC (rev 662) @@ -169,9 +169,10 @@ $ret=array(); do{ if (strlen($checkedInstances[0])>0){ - $query="SELECT ?zw\n". - "WHERE {?zw a <".$checkedInstances[0].">.{SELECT ?subject as ?zw\n". - "WHERE { ?subject <http://www.w3.org/2000/01/rdf-schema#label> ?object. ?object bif:contains '\"".$label."\"'@en}\nLimit 100}}"; + $query="SELECT DISTINCT ?subject\n". + "WHERE {?subject a <".$checkedInstances[0].">.{SELECT ?zw as ?subject\n". + "WHERE { ?zw <http://www.w3.org/2000/01/rdf-schema#label> ?object. ?object bif:contains '\"".$label."\"'@en}\n". + "LIMIT 1000 OFFSET ".$offset."}}"; }else { $query="SELECT DISTINCT ?subject\n". "WHERE { ?subject <http://www.w3.org/2000/01/rdf-schema#label> ?object. ?object bif:contains '\"".$label."\"'@en}". This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-07-06 12:28:56
|
Revision: 999 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=999&view=rev Author: sknappe Date: 2008-07-06 05:28:50 -0700 (Sun, 06 Jul 2008) Log Message: ----------- Changed to work with new Manipulator Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-07-05 14:21:07 UTC (rev 998) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-07-06 12:28:50 UTC (rev 999) @@ -46,19 +46,23 @@ $settings=new Settings(); $this->client->applyConfigEntryInt($this->id, $this->ksID, "recursionDepth",1); - $this->client->applyConfigEntryStringArray($this->id, $this->ksID, "instances", array_merge($posExamples,$negExamples)); - $this->client->applyConfigEntryString($this->id, $this->ksID, "predefinedFilter", "YAGO"); + $this->client->applyConfigEntryString($this->id, $this->ksID, "predefinedFilter", "DBPEDIA-NAVIGATOR"); + //$this->client->applyConfigEntryBoolean($this->id, $this->ksID, "useLits", true); $this->client->applyConfigEntryString($this->id, $this->ksID, "predefinedEndpoint", "DBPEDIA"); + $this->client->applyConfigEntryString($this->id, $this->ksID, "predefinedManipulator", "DBPEDIA-NAVIGATOR"); $this->client->applyConfigEntryBoolean($this->id, $this->ksID, "useCache", $settings->useCache); + if(empty($negExamples)){ + $negExamples=$this->client->getNegativeExamples($this->id,$this->ksID,$posExamples,count($posExamples),"http://dbpedia.org/resource/"); + $negExamples=$negExamples->item; + + var_dump($negExamples); + } + $this->client->applyConfigEntryStringArray($this->id, $this->ksID, "instances", array_merge($posExamples,$negExamples)); $this->client->setReasoner($this->id, "fastInstanceChecker"); - /*if(empty($negExamples)) + if(empty($negExamples)) $this->client->setLearningProblem($this->id, "posOnlyDefinition"); else - $this->client->setLearningProblem($this->id, "posNegDefinition");*/ - $this->client->setLearningProblem($this->id, "posNegDefinition"); - if(empty($negExamples)){ - $negExamples=$this->client->getNegativeExamples($this->id,$this->ksID,$posExamples,count($posExamples),"http://dbpedia.org/resource/"); - } + $this->client->setLearningProblem($this->id, "posNegDefinition"); $this->client->setPositiveExamples($this->id, $posExamples); if(!empty($negExamples)) $this->client->setNegativeExamples($this->id, $negExamples); @@ -334,11 +338,11 @@ } } -/* + ini_set('default_socket_timeout',200); $sc=new DLLearnerConnection(); $ids=$sc->getIDs(); $sc=new DLLearnerConnection($ids[0],$ids[1]); -$triples=$sc->getSubjects("Leipzig"); -var_dump($triples);*/ +$triples=$sc->getConceptFromExamples(array('http://dbpedia.org/resource/Leipzig'),array()); +var_dump($triples); ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |