From: <sk...@us...> - 2008-01-16 15:42:56
|
Revision: 382 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=382&view=rev Author: sknappe Date: 2008-01-16 07:42:53 -0800 (Wed, 16 Jan 2008) Log Message: ----------- the uris are now identified out of the concept Modified Paths: -------------- trunk/src/dbpedia-navigator/NaturalConcepts.php Modified: trunk/src/dbpedia-navigator/NaturalConcepts.php =================================================================== --- trunk/src/dbpedia-navigator/NaturalConcepts.php 2008-01-16 15:39:43 UTC (rev 381) +++ trunk/src/dbpedia-navigator/NaturalConcepts.php 2008-01-16 15:42:53 UTC (rev 382) @@ -15,17 +15,30 @@ function identifyConcepts() { + $temp=$this->concept; $ret=array(); + $offset=0; while (true){ - $nextpos=strpos("http",$this->concept); - $nextend=strpos() + $nextpos=strpos($temp,"http",$offset); + if (!$nextpos) break; + $nextend=preg_match("/\040|.TOP|.BOTTOM|.EXISTS|.ALL|.\(/",$temp,$treffer,PREG_OFFSET_CAPTURE,$nextpos); + if (!$nextend){ + $uri=substr($temp,$nextpos,strlen($temp)-$nextpos); + $ret[]=$uri; + break; + } + $uri=substr($temp,$nextpos,$treffer[0][1]-$nextpos); + $ret[]=$uri; + $offset=$treffer[0][1]; } + + print_r($ret); return $ret; } } -$conc="EXISTS http://dbpedia.org/property/website AND http://dbpedia.org/resource/Berlin"; +$conc="EXISTS http://dbpedia.org/property/website.TOP AND http://dbpedia.org/resource/Berlin"; $nc=new NaturalConcepts($conc); $ic=$nc->getNaturalConcept(); -print_r($ic); +//print_r($ic); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |