From: <sk...@us...> - 2008-10-22 05:58:00
|
Revision: 1387 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1387&view=rev Author: sknappe Date: 2008-10-22 05:57:53 +0000 (Wed, 22 Oct 2008) Log Message: ----------- the article is now handling the case with no label and description well Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-21 10:43:54 UTC (rev 1386) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-22 05:57:53 UTC (rev 1387) @@ -61,10 +61,10 @@ // dbpedia.org/search //BUILD ARTICLE TITLE - if (strlen($triples['http://www.w3.org/2000/01/rdf-schema#label'][0]['value'])>0) + if (isset($triples['http://www.w3.org/2000/01/rdf-schema#label'])&&strlen($triples['http://www.w3.org/2000/01/rdf-schema#label'][0]['value'])>0) $artTitle=$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]['value']; else - $artTitle=urldecode(str_replace("_"," ",substr (strrchr ($url, "/"), 1))); + $artTitle=urldecode(str_replace("_"," ",substr (strrchr ($uri, "/"), 1))); // display a picture if there is one if (isset($triples['http://dbpedia.org/property/imageCaption'])&&$triples['http://dbpedia.org/property/imageCaption'][0]['type']!='uri') $alt=$triples['http://dbpedia.org/property/imageCaption'][0]['value']; @@ -87,7 +87,12 @@ } // add short description in english - $content.="<h4>Short Description</h4><p>".urldecode($triples['http://dbpedia.org/property/abstract'][0]['value'])."</p>"; + $content.="<h4>Short Description</h4><p>"; + if (isset($triples['http://dbpedia.org/property/abstract'])) + $content.=urldecode($triples['http://dbpedia.org/property/abstract'][0]['value']); + else + $content.="No Short Description available."; + $content.="</p>"; // give the link to the corresponding Wikipedia article if(isset($triples['http://xmlns.com/foaf/0.1/page'])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |