From: <jen...@us...> - 2008-01-09 16:32:38
|
Revision: 356 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=356&view=rev Author: jenslehmann Date: 2008-01-09 08:32:14 -0800 (Wed, 09 Jan 2008) Log Message: ----------- - various userinterface improvements - started article display Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/default.css trunk/src/dbpedia-navigator/index.php Added Paths: ----------- trunk/src/dbpedia-navigator/images/green-plus.png trunk/src/dbpedia-navigator/images/red-minus.png trunk/src/dbpedia-navigator/images/remove.png trunk/src/dbpedia-navigator/images/wikipedia_favicon.ico trunk/src/dbpedia-navigator/images/wikipedia_favicon.png Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-01-09 13:42:40 UTC (rev 355) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-01-09 16:32:14 UTC (rev 356) @@ -55,13 +55,40 @@ { $content.=substr($triples,7); } - else if (count($triples)==0) $content.="Article not found."; - else { - $content=""; - $content.="<img src=\"".$triples['http://xmlns.com/foaf/0.1/depiction']."\" alt=\"Picture of ".str_replace("_"," ",urldecode(substr (strrchr ($subject, "/"), 1)))."\" width=\"50\"/ style=\"float:left\">"; - $content.="<div>".urldecode($triples['http://dbpedia.org/property/abstract'])."</div>"; + else if (count($triples)==0) + $content.="Did not find an article with that name."; + else { + + // goal: display the data in a nice (DBpedia specific way), maybe similar to + // dbpedia.org/search + + $content=""; + // replace by label(?) + $subject_nice = str_replace("_"," ",urldecode(substr (strrchr ($subject, "/"), 1))); + + // display a picture if there is one + if(isset($triples['http://xmlns.com/foaf/0.1/depiction'])) + $content.='<img src="'.$triples['http://xmlns.com/foaf/0.1/depiction'].'" alt="Picture of '.$subject_nice.'" style="float:right; max-width:200px;" \>'; + + // add short description in english + $content.="<h3>Short Description</h3><p>".urldecode($triples['http://dbpedia.org/property/abstract'])."</p>"; + + // give the link to the corresponding Wikipedia article + if(isset($triples['http://xmlns.com/foaf/0.1/page'])) + $content .= '<p><img src="images/wikipedia_favicon.png" alt"Wikipedia" /> <a href="'.$triples['http://xmlns.com/foaf/0.1/page'].'">view Wikipedia article</a>, '; + $content .= '<a href="'.$subject.'">view DBpedia resource description</a></p>'; + + // display a list of classes + + // filter out uninteresting properties + // unset + + // display the remaining properties as list which can be used for further navigation + + $content .= '<br/><br/><br/><br/><br/><br/>'.get_triple_table($triples); - $contentbuttons="<input type=\"button\" value=\"Positive\" class=\"button\" onclick=\"xajax_addPositive('".$subject."');return false;\" /> <input type=\"button\" value=\"Negative\" class=\"button\" onclick=\"xajax_addNegative('".$subject."');return false;\" />"; + // $contentbuttons="<input type=\"button\" value=\"Positive\" class=\"button\" onclick=\"xajax_addPositive('".$subject."');return false;\" /> <input type=\"button\" value=\"Negative\" class=\"button\" onclick=\"xajax_addNegative('".$subject."');return false;\" />"; + $contentbuttons='<img src="images/green-plus.png" alt="positive example" onclick="xajax_addPositive(\''.$subject.'\')" /> <img src="images/red-minus.png" alt="negative example" onclick="xajax_addNegative(\''.$subject.'\') />'; } //store article in session, to navigate between last 5 articles quickly @@ -218,5 +245,15 @@ $objResponse->call('xajax_getsubjects',$keyword); return $objResponse; } + +// helper function +function get_triple_table($triples) { + $table = '<table border="1"><tr><td>predicate</td><td>object</td></tr>'; + foreach($triples as $predicate=>$object) { + $table .= '<tr><td>'.$predicate.'</td><td>'.$object.'</td></tr>'; + } + $table .= '</table>'; + return $table; +} ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/default.css =================================================================== --- trunk/src/dbpedia-navigator/default.css 2008-01-09 13:42:40 UTC (rev 355) +++ trunk/src/dbpedia-navigator/default.css 2008-01-09 16:32:14 UTC (rev 356) @@ -356,6 +356,20 @@ border: none; } +#positivesboxtitle { + /*color: black;*/ + background-color: lightgreen; +} + +#negativesboxtitle { + /*color: black;*/ + background-color: #ee6666; +} + +#ArticleTitle { + font-size: 110%; +} + #footer { clear: both; text-align: center; Added: trunk/src/dbpedia-navigator/images/green-plus.png =================================================================== (Binary files differ) Property changes on: trunk/src/dbpedia-navigator/images/green-plus.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/dbpedia-navigator/images/red-minus.png =================================================================== (Binary files differ) Property changes on: trunk/src/dbpedia-navigator/images/red-minus.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/dbpedia-navigator/images/remove.png =================================================================== (Binary files differ) Property changes on: trunk/src/dbpedia-navigator/images/remove.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/dbpedia-navigator/images/wikipedia_favicon.ico =================================================================== (Binary files differ) Property changes on: trunk/src/dbpedia-navigator/images/wikipedia_favicon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/src/dbpedia-navigator/images/wikipedia_favicon.png =================================================================== (Binary files differ) Property changes on: trunk/src/dbpedia-navigator/images/wikipedia_favicon.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-01-09 13:42:40 UTC (rev 355) +++ trunk/src/dbpedia-navigator/index.php 2008-01-09 16:32:14 UTC (rev 356) @@ -63,7 +63,7 @@ </head> <body> -<h1>DBPedia Navigator</h1> +<h1>DBpedia Navigator</h1> <div id="layer" style="display:none"> <div id="layerContent" style="display:none"></div> </div> @@ -74,10 +74,12 @@ <div class="box"> <div class="boxtitle">Search DBpedia</div> <div class="boxcontent" id="search"> - <!-- Search:<br/> --> + <!-- Search:<br/> --> + <form onSubmit="xajax_searchAndShowArticle(document.getElementById('label').value);return false;"> <input type="text" name="label" id="label" /><br/> - <input type="button" value="Search" class="button" onclick="xajax_searchAndShowArticle(document.getElementById('label').value);return false;" /> - <!-- <input type="button" value="Fulltext" class="button" onclick=""/> --> + <input type="button" value="Search" class="button" onclick="xajax_searchAndShowArticle(document.getElementById('label').value);return false;" /> + <!-- <input type="button" value="Fulltext" class="button" onclick=""/> --> + </form> </div> <!-- boxcontent --> </div> <!-- box --> @@ -123,9 +125,14 @@ <div id="content"> <div class="box"> - <div class="boxtitlewithbutton"><table border="0" class="titletable"><tr><td class="left" id="ArticleTitle">Article</td><td class="right"><span id="contentbuttons"></span></td></tr></table></div> + <div class="boxtitlewithbutton"><table border="0" class="titletable"><tr><td class="left" id="ArticleTitle">Welcome</td><td class="right"><span id="contentbuttons"></span></td></tr></table></div> <div class="boxcontent" id="article"> - <div id="articlecontent" style="display:block"></div> + <div id="articlecontent" style="display:block"> + <br /><br /> + Welcome to the DBpedia Navigator interface! DBpedia Navigator allows you to search DBpedia + and uses the background knowledge in DBpedia to suggest possible interesting navigation + links. + </div> <div id="loadingArticle" style="display:none"><img src="ajax-loader.gif" alt="Loading..."/></div> </div> <!-- boxcontent --> </div> <!-- box --> @@ -134,19 +141,19 @@ <div id="rightSidebar"> <div class="box"> - <div class="boxtitlewithbutton"><table border="0" class="titletable"><tr><td class="left">Positives</td><td class="right"><input type="button" value="Clear" class="button" onclick="xajax_clearPositives();return false;" /></td></tr></table></div> + <div class="boxtitlewithbutton" id="positivesboxtitle">search relevant <input type="button" value="Clear" class="button" onclick="xajax_clearPositives();return false;" /></div> <div class="boxcontent" id="Positives"> </div> <!-- boxcontent --> </div> <!-- box --> <div class="box"> - <div class="boxtitlewithbutton"><table border="0" class="titletable"><tr><td class="left">Negatives</td><td class="right"><input type="button" value="Clear" class="button" onclick="xajax_clearNegatives();return false;" /></td></tr></table></div> + <div class="boxtitlewithbutton" id="negativesboxtitle">not relevant <input type="button" value="Clear" class="button" onclick="xajax_clearNegatives();return false;" /></div> <div class="boxcontent" id="Negatives"> </div> <!-- boxcontent --> </div> <!-- box --> <div class="box"> - <div class="boxtitle">Last Articles</div> + <div class="boxtitle">Articles Last Viewed</div> <div class="boxcontent" id="lastarticles"> </div> <!-- boxcontent --> </div> <!-- box --> @@ -169,8 +176,19 @@ echo '><img src="images/valid-css.png" alt="valid CSS" /></a></div>'."\n"; ?> </div> - <p><a href='clearsession.php'>restart session and redownload WSDL file (for debugging)</a></p> -</div> + <p><a href='clearsession.php'>restart session and redownload WSDL file (for debugging)</a></p> + <p> +ToDo: +<ul> + <li>get learning process working (with new SPARQL component)</li> + <li>get local DBpedia SPARQL endpoint working</li> + <li>many queries work correctly on the server, but yield to response in the interface (seems to be rather random)</li> + <li>fix sometimes occurring PHP errors and warnings</li> +</ul> +</p> +</div> + + </body> </html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |