From: <sk...@us...> - 2008-06-17 16:33:41
|
Revision: 965 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=965&view=rev Author: sknappe Date: 2008-06-17 09:33:03 -0700 (Tue, 17 Jun 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php trunk/src/dbpedia-navigator/ajaxfunctions.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-06-17 10:56:39 UTC (rev 964) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-06-17 16:33:03 UTC (rev 965) @@ -176,6 +176,7 @@ function getSubjects($label,$checkedInstances) { $offset=1; + $steps=100; $ret=array(); $labels=preg_split("[\040]",$label,-1,PREG_SPLIT_NO_EMPTY); //TODO if instances are checked the offset no longer works @@ -191,7 +192,7 @@ $i=1; } $query.="'@en.?subject a ?cat.?cat <http://www.w3.org/2000/01/rdf-schema#label> ?label}\n". - "LIMIT 100 OFFSET ".$offset."}}"; + "LIMIT ".$steps." OFFSET ".$offset."}}"; }else { $query="SELECT DISTINCT ?subject ?cat ?label\n". "WHERE { ?subject <http://www.w3.org/2000/01/rdf-schema#label> ?object. ?object bif:contains '"; @@ -202,7 +203,7 @@ $i=1; } $query.="'@en.?subject a ?cat.?cat <http://www.w3.org/2000/01/rdf-schema#label> ?label}". - "LIMIT 100 OFFSET ".$offset; + "LIMIT ".$steps." OFFSET ".$offset; } $result=json_decode($this->getSparqlResultThreaded($query),true); $count=count($result['results']['bindings']); @@ -217,8 +218,8 @@ else $tagcloud[$results['cat']['value']]++; } - $offset+=100; - } while($count==100); + $offset+=$steps; + } while($count==$steps); //have to do this, because distinct doesn't work, and i use the key to eliminate doubles unset($tagcloud['http://www.w3.org/2004/02/skos/core#Concept']); foreach ($ret as $r) Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-06-17 10:56:39 UTC (rev 964) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-06-17 16:33:03 UTC (rev 965) @@ -456,6 +456,9 @@ function subjectToURI($subject) { + //if the subject is already a URI return it + if (strpos($subject,"http://dbpedia.org/resource/")===0) + return $subject; //delete whitespaces at beginning and end $subject=trim($subject); //get first letters big @@ -483,7 +486,7 @@ else if ($count>($min+$distribution)) $style="font-size:medium;"; else $style="font-size:small;"; - $ret.="<a style='".$style."' href='".$tag."'>".$label[$tag]."</a> "; + $ret.="<a style='".$style."' href='javascript:xajax_getSubjectsFromConcept('".$tag."');>".$label[$tag]."</a> "; } $ret.="</p>"; return $ret; @@ -500,7 +503,7 @@ for ($j=0;($j<30)&&(($i*30+$j)<count($results));$j++) { $result=$results[$i*30+$j]; - $ret.=" <a href=\"\" onclick=\"xajax_getarticle('".str_replace("_"," ",substr (strrchr ($result, "/"), 1))."',-1);return false;\">".urldecode(str_replace("_"," ",substr (strrchr ($result, "/"), 1)))."</a><br/>"; + $ret.=" <a href=\"\" onclick=\"xajax_getarticle('".$result."',-1);return false;\">".urldecode(str_replace("_"," ",substr (strrchr ($result, "/"), 1)))."</a><br/>"; } $ret.="</div>"; $i++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |