You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(120) |
Sep
(36) |
Oct
(116) |
Nov
(17) |
Dec
(44) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(143) |
Feb
(192) |
Mar
(74) |
Apr
(84) |
May
(105) |
Jun
(64) |
Jul
(49) |
Aug
(120) |
Sep
(159) |
Oct
(156) |
Nov
(51) |
Dec
(28) |
2009 |
Jan
(17) |
Feb
(55) |
Mar
(33) |
Apr
(57) |
May
(54) |
Jun
(28) |
Jul
(6) |
Aug
(16) |
Sep
(38) |
Oct
(30) |
Nov
(26) |
Dec
(52) |
2010 |
Jan
(7) |
Feb
(91) |
Mar
(65) |
Apr
(2) |
May
(14) |
Jun
(25) |
Jul
(38) |
Aug
(48) |
Sep
(80) |
Oct
(70) |
Nov
(75) |
Dec
(77) |
2011 |
Jan
(68) |
Feb
(53) |
Mar
(51) |
Apr
(35) |
May
(65) |
Jun
(101) |
Jul
(29) |
Aug
(230) |
Sep
(95) |
Oct
(49) |
Nov
(110) |
Dec
(63) |
2012 |
Jan
(41) |
Feb
(42) |
Mar
(25) |
Apr
(46) |
May
(51) |
Jun
(44) |
Jul
(45) |
Aug
(29) |
Sep
(12) |
Oct
(9) |
Nov
(17) |
Dec
(2) |
2013 |
Jan
(12) |
Feb
(14) |
Mar
(7) |
Apr
(16) |
May
(54) |
Jun
(27) |
Jul
(11) |
Aug
(5) |
Sep
(85) |
Oct
(27) |
Nov
(37) |
Dec
(32) |
2014 |
Jan
(8) |
Feb
(29) |
Mar
(5) |
Apr
(3) |
May
(22) |
Jun
(3) |
Jul
(4) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <sk...@us...> - 2008-10-28 07:06:09
|
Revision: 1458 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1458&view=rev Author: sknappe Date: 2008-10-28 07:06:00 +0000 (Tue, 28 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php Modified: trunk/src/dbpedia-navigator/templates/AbstractTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-28 07:01:37 UTC (rev 1457) +++ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-28 07:06:00 UTC (rev 1458) @@ -30,7 +30,7 @@ */ abstract class AbstractTemplate { - abstract function printTemplate($triples); + abstract function printTemplate($triples,$subjecttriples); // function to be called after all "special" actions have been taken; // it displays all remaining triples This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-28 07:01:46
|
Revision: 1457 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1457&view=rev Author: sknappe Date: 2008-10-28 07:01:37 +0000 (Tue, 28 Oct 2008) Log Message: ----------- test Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java 2008-10-27 17:25:18 UTC (rev 1456) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java 2008-10-28 07:01:37 UTC (rev 1457) @@ -189,6 +189,7 @@ } logger.debug("getting negExamples from " + classes.size() + " parallel classes"); for (String oneClass : classes) { + System.out.println(oneClass); logger.debug(oneClass); // rsc = new // JenaResultSetConvenience(queryConcept("\""+oneClass+"\"",limit)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-27 17:25:25
|
Revision: 1456 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1456&view=rev Author: jenslehmann Date: 2008-10-27 17:25:18 +0000 (Mon, 27 Oct 2008) Log Message: ----------- non-working geo inference script Added Paths: ----------- trunk/src/dl-learner/org/dllearner/scripts/GeoInference.java Added: trunk/src/dl-learner/org/dllearner/scripts/GeoInference.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/GeoInference.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/GeoInference.java 2008-10-27 17:25:18 UTC (rev 1456) @@ -0,0 +1,88 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.scripts; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.net.URI; +import java.util.LinkedList; +import java.util.List; +import java.util.SortedSet; + +import org.dllearner.kb.sparql.SPARQLTasks; +import org.dllearner.kb.sparql.SparqlEndpoint; + +/** + * Gets additional geo information from DBpedia-Geonames + * mappings. + * + * @author Jens Lehmann + * + */ +public class GeoInference { + + static String geoMappingFile = "src/dbpedia-navigator/data/links_geonames_en.nt"; + static String outputFile = "src/dbpedia-navigator/data/geo_inference.nt"; + + public static void main(String[] args) throws IOException { + // read in mapping file + BufferedReader in = new BufferedReader(new FileReader(geoMappingFile)); + // output file + BufferedWriter out = new BufferedWriter(new FileWriter(outputFile)); + + // db.aksw.org SPARQL endpoint + SparqlEndpoint endpoint = SparqlEndpoint.getEndpointLOCALGeonames(); + SPARQLTasks st = new SPARQLTasks(endpoint); + + URI test = URI.create("http://sws.geonames.org/2959441/"); + List<URI> parents = new LinkedList<URI>(); + getParents(st, test, parents); + System.out.println(parents); + + +// String line; +// while ((line=in.readLine())!=null) +// { +// st.query(sparqlQueryString) +// out.write(line); +// } + + in.close(); + out.close(); + } + + public static List<URI> getParents(SPARQLTasks st, URI geoURI, List<URI> parents) { + String query = "SELECT ?x WHERE {<"+geoURI+"> <http://www.geonames.org/ontology#parentFeature> ?x}"; + System.out.println(query); + SortedSet<String> res = st.queryAsSet(query, "x"); + if(res.size() == 0) { + return parents; + } else { + URI parent = URI.create(res.first()); + parents.add(parent); + // recurse + return getParents(st, parent, parents); + } + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 16:43:10
|
Revision: 1455 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1455&view=rev Author: sknappe Date: 2008-10-27 16:42:58 +0000 (Mon, 27 Oct 2008) Log Message: ----------- changes to use new ontology Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/templates/AbstractTemplate.php trunk/src/dbpedia-navigator/templates/DefaultTemplate.php Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 16:01:36 UTC (rev 1454) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 16:42:58 UTC (rev 1455) @@ -120,10 +120,6 @@ // detect appropriate template (currently always default) $template = new DefaultTemplate(); - // display template for this instance (currently the template is similar to the remaining - // instance view apart from beautifications) - $content .= $template->printTemplate($triples); - //display owl:sameAs properties if (isset($triples['http://www.w3.org/2002/07/owl#sameAs'])||isset($subjecttriples['http://www.w3.org/2002/07/owl#sameAs'])){ $content.='<br/><hr><h4>Same as</h4><br/>'; @@ -272,13 +268,15 @@ // have already been displayed filterTriples(&$triples, &$subjecttriples); - - if (count($triples)>0||count($subjecttriples)>0){ + // display template for this instance (currently the template is similar to the remaining + // instance view apart from beautifications) + $content .= $template->printTemplate($triples,$subjecttriples); + /*if (count($triples)>0||count($subjecttriples)>0){ $content.='<br/><hr><h4>Remaining Triples</h4><br/>'; // display the remaining properties as list which can be used for further navigation $content .= get_triple_table($triples,$subjecttriples); - } + }*/ //Restart the Session session_start(); Modified: trunk/src/dbpedia-navigator/templates/AbstractTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 16:01:36 UTC (rev 1454) +++ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 16:42:58 UTC (rev 1455) @@ -34,59 +34,91 @@ // function to be called after all "special" actions have been taken; // it displays all remaining triples - function printRemainingTriples($triples) { - $i=1; - if (is_array($triples) && count($triples)>0) { - foreach($triples as $predicate=>$object) { - $number=count($object); - if ($i>0) - $backgroundcolor="eee"; - else - $backgroundcolor="ffffff"; - - $table .= '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">'.nicePredicate($predicate).'</a></td>'; - $table .= '<td>'; - if ($number>1) $table.='<ul>'; - $k=1; - foreach($object as $element) { - if ($k>3) $display=" style=\"display:none\""; - else $display=""; - if ($element['type']=="uri") { - if (strpos($element['value'],"http://dbpedia.org/resource/")===0&&substr_count($element['value'],"/")==4&&strpos($element['value'],"Template:")!=28){ - $label=str_replace('_',' ',substr($element['value'],28)); - if (strlen($label)>60) - $label=substr($label,0,60).'...'; - if ($number>1) - $table.='<li'.$display.'>'; - $table .= '<a href="#" onclick="get_article(\'label='.$element['value'].'&cache=-1\');">'.urldecode($label).'</a>'; - if ($number>1) - $table.='</li>'; - } else { - if ($number>1) - $table.='<li'.$display.'>'; - $label=urldecode($element['value']); - if (strlen($label)>60) - $label=substr($label,0,60).'...'; - $table .= '<a href="'.$element['value'].'" target="_blank">'.$label.'</a>'; - if ($number>1) - $table.='</li>'; - } - } else { - if ($number>1) - $table.='<li'.$display.'>'; - $table .= $element['value']; - if ($number>1) - $table.='</li>'; - } - $k++; - } - if ($number>3) $table.='<a href="javascript:none()" onclick="toggleAttributes(this)"><img src="images/arrow_down.gif"/> show</a>'; - if ($number>1) $table.='</ul>'; - $table .= '</td>'; - $i*=-1; - } - } - $table .= '</table>'; + function printRemainingTriples($triples,$subjecttriples) { + if ((is_array($triples)&&count($triples)>0)||(is_array($subjecttriples)&&count($subjecttriples)>0)){ + $table = '<table border="0" style="width:100%;overflow:hidden"><tr><td><b>Predicate</b></td><td><b>Object/Subject</b></td></tr>'; + $i=1; + if (is_array($triples)&&count($triples)>0) foreach($triples as $predicate=>$object) { + $number=count($object); + if ($i>0) $backgroundcolor="eee"; + else $backgroundcolor="ffffff"; + $table .= '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">'.nicePredicate($predicate).'</a></td>'; + $table .= '<td>'; + if ($number>1) $table.='<ul>'; + $k=1; + foreach($object as $element) { + if ($k>3) $display=" style=\"display:none\""; + else $display=""; + if ($element['type']=="uri"){ + if (strpos($element['value'],"http://dbpedia.org/resource/")===0&&substr_count($element['value'],"/")==4&&strpos($element['value'],"Template:")!=28){ + $label=str_replace('_',' ',substr($element['value'],28)); + if (strlen($label)>60) $label=substr($label,0,60).'...'; + if ($number>1) $table.='<li'.$display.'>'; + $table .= '<a href="#" onclick="get_article(\'label='.$element['value'].'&cache=-1\');">'.urldecode($label).'</a>'; + if ($number>1) $table.='</li>'; + } + else{ + if ($number>1) $table.='<li'.$display.'>'; + $label=urldecode($element['value']); + if (strlen($label)>60) $label=substr($label,0,60).'...'; + $table .= '<a href="'.$element['value'].'" target="_blank">'.$label.'</a>'; + if ($number>1) $table.='</li>'; + } + } + else{ + if ($number>1) $table.='<li'.$display.'>'; + $table .= $element['value']; + if ($number>1) $table.='</li>'; + } + $k++; + } + if ($number>3) $table.='<a href="javascript:none()" onclick="toggleAttributes(this)"><img src="images/arrow_down.gif"/> show</a>'; + if ($number>1) $table.='</ul>'; + $table .= '</td>'; + $i*=-1; + } + if (is_array($subjecttriples)&&count($subjecttriples)>0) foreach($subjecttriples as $predicate=>$object) { + $number=count($object); + if ($i>0) $backgroundcolor="eee"; + else $backgroundcolor="ffffff"; + $table .= '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">is '.nicePredicate($predicate).' of </a></td>'; + $table .= '<td>'; + if ($number>1) $table.='<ul>'; + $k=1; + foreach($object as $element) { + if ($k>3) $display=" style=\"display:none\""; + else $display=""; + if ($element['type']=="uri"){ + if (strpos($element['value'],"http://dbpedia.org/resource/")===0&&substr_count($element['value'],"/")==4&&strpos($element['value'],"Template:")!=28){ + $label=str_replace('_',' ',substr($element['value'],28)); + if (strlen($label)>60) $label=substr($label,0,60).'...'; + if ($number>1) $table.='<li'.$display.'>'; + $table .= '<a href="#" onclick="get_article(\'label='.$element['value'].'&cache=-1\');">'.urldecode($label).'</a>'; + if ($number>1) $table.='</li>'; + } + else{ + if ($number>1) $table.='<li'.$display.'>'; + $label=urldecode($element['value']); + if (strlen($label)>60) $label=substr($label,0,60).'...'; + $table .= '<a href="'.$element['value'].'" target="_blank">'.$label.'</a>'; + if ($number>1) $table.='</li>'; + } + } + else{ + if ($number>1) $table.='<li'.$display.'>'; + $table .= $element['value']; + if ($number>1) $table.='</li>'; + } + $k++; + } + if ($number>3) $table.='<a href="javascript:none()" onclick="toggleAttributes(this)"><img src="images/arrow_down.gif"/> show</a>'; + if ($number>1) $table.='</ul>'; + $table .= '</td>'; + $i*=-1; + } + $table .= '</table>'; + } + else $table="No Tripel left."; return $table; } Modified: trunk/src/dbpedia-navigator/templates/DefaultTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/DefaultTemplate.php 2008-10-27 16:01:36 UTC (rev 1454) +++ trunk/src/dbpedia-navigator/templates/DefaultTemplate.php 2008-10-27 16:42:58 UTC (rev 1455) @@ -28,9 +28,8 @@ class DefaultTemplate extends AbstractTemplate { // simply prints all triples without doing anything special to group/format them - function printTemplate($triples) { - $content = '<table>'; - $content .= $this->printRemainingTriples($triples); + function printTemplate($triples,$subjecttriples) { + $content = $this->printRemainingTriples($triples,$subjecttriples); return $content; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 16:01:48
|
Revision: 1454 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1454&view=rev Author: sknappe Date: 2008-10-27 16:01:36 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/templates/AbstractTemplate.php Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 15:37:25 UTC (rev 1453) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 16:01:36 UTC (rev 1454) @@ -63,7 +63,9 @@ require_once("DLLearnerConnection.php"); $sc=new DLLearnerConnection($id,$ksID); $alltriples=$sc->getTriples($uri); + // triples where resource is subject $triples=$alltriples[0]; + // triples where resource is object $subjecttriples=$alltriples[1]; //BUILD ARTICLE Modified: trunk/src/dbpedia-navigator/templates/AbstractTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 15:37:25 UTC (rev 1453) +++ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 16:01:36 UTC (rev 1454) @@ -44,7 +44,7 @@ else $backgroundcolor="ffffff"; - $table = '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">'.nicePredicate($predicate).'</a></td>'; + $table .= '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">'.nicePredicate($predicate).'</a></td>'; $table .= '<td>'; if ($number>1) $table.='<ul>'; $k=1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-27 15:37:30
|
Revision: 1453 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1453&view=rev Author: jenslehmann Date: 2008-10-27 15:37:25 +0000 (Mon, 27 Oct 2008) Log Message: ----------- included default template Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/templates/AbstractTemplate.php trunk/src/dbpedia-navigator/templates/CityTemplate.php trunk/src/dbpedia-navigator/templates/DefaultTemplate.php trunk/src/dbpedia-navigator/templates/PersonTemplate.php trunk/src/dbpedia-navigator/templates/PlaceTemplate.php trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php Property Changed: ---------------- trunk/src/dbpedia-navigator/ Property changes on: trunk/src/dbpedia-navigator ___________________________________________________________________ Modified: svn:ignore - temp .htaccess main.wsdl def0.xsd def1.xsd test.html test.php settings.ini + temp .htaccess main.wsdl def0.xsd def1.xsd test.html test.php settings.ini Settings.php Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 15:32:05 UTC (rev 1452) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 15:37:25 UTC (rev 1453) @@ -1,6 +1,13 @@ <?php - include('helper_functions.php'); - include_once('Settings.php'); + include_once('helper_functions.php'); + include_once('Settings.php'); + // include all templates + include_once('templates/AbstractTemplate.php'); + include_once('templates/CityTemplate.php'); + include_once('templates/DefaultTemplate.php'); + include_once('templates/PersonTemplate.php'); + include_once('templates/PlaceTemplate.php'); + include_once('templates/PopulatedPlaceTemplate.php'); session_start(); @@ -106,6 +113,14 @@ if (isset($triples['http://dbpedia.org/property/hasPhotoCollection'])){ $content.=', <img src="images/flickr.png" alt="Flickr" style="max-width:20px;" /> <a href="'.$triples['http://dbpedia.org/property/hasPhotoCollection'][0]['value'].'" onclick="window.open(\''.$triples['http://dbpedia.org/property/hasPhotoCollection'][0]['value'].'\',\'Wikiwindow\',\'width=800,height=500,top=50,left=50,scrollbars=yes\');return false;">view photo collection</a></p>'; } + + $content .= '<br/><hr><h4>Further Information</h4><br/>'; + // detect appropriate template (currently always default) + $template = new DefaultTemplate(); + + // display template for this instance (currently the template is similar to the remaining + // instance view apart from beautifications) + $content .= $template->printTemplate($triples); //display owl:sameAs properties if (isset($triples['http://www.w3.org/2002/07/owl#sameAs'])||isset($subjecttriples['http://www.w3.org/2002/07/owl#sameAs'])){ Modified: trunk/src/dbpedia-navigator/templates/AbstractTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 15:32:05 UTC (rev 1452) +++ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 15:37:25 UTC (rev 1453) @@ -28,7 +28,7 @@ * * @author Jens Lehmann */ -class AbstractTemplate { +abstract class AbstractTemplate { abstract function printTemplate($triples); @@ -44,7 +44,7 @@ else $backgroundcolor="ffffff"; - $table .= '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">'.nicePredicate($predicate).'</a></td>'; + $table = '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">'.nicePredicate($predicate).'</a></td>'; $table .= '<td>'; if ($number>1) $table.='<ul>'; $k=1; Modified: trunk/src/dbpedia-navigator/templates/CityTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/CityTemplate.php 2008-10-27 15:32:05 UTC (rev 1452) +++ trunk/src/dbpedia-navigator/templates/CityTemplate.php 2008-10-27 15:37:25 UTC (rev 1453) @@ -19,6 +19,8 @@ * */ +include_once('PopulatedPlaceTemplate.php'); + /** * Template for cities. * @@ -26,17 +28,17 @@ */ class CityTemplate extends PopulatedPlaceTemplate { - function getTemplate($triples) { + function printTemplate($triples) { $content = ""; $content .= '<table>'; $content .= '<tr><td colspan="2">City Information</td></tr>'; // population - $content .= '<tr><td>total population</td><td>' + getPopulationString($triples) + '</td></tr>'; + $content .= '<tr><td>total population</td><td>' + $this->getPopulationString($triples) + '</td></tr>'; // location - $content .= '<tr><td>latitude</td><td>' + getLatitudeString($triples) + '</td></tr>'; - $content .= '<tr><td>longitude</td><td>' + getLongitudeString($triples) + '</td></tr>'; + $content .= '<tr><td>latitude</td><td>' + $this->getLatitudeString($triples) + '</td></tr>'; + $content .= '<tr><td>longitude</td><td>' + $this->getLongitudeString($triples) + '</td></tr>'; // resources related to city - $content .= displayMultipleValues('city'); + // $content .= displayMultipleValues('city'); $content .= '</table>'; // .. continue ... Modified: trunk/src/dbpedia-navigator/templates/DefaultTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/DefaultTemplate.php 2008-10-27 15:32:05 UTC (rev 1452) +++ trunk/src/dbpedia-navigator/templates/DefaultTemplate.php 2008-10-27 15:37:25 UTC (rev 1453) @@ -27,9 +27,11 @@ */ class DefaultTemplate extends AbstractTemplate { - // simply prints all triples without doing anything special + // simply prints all triples without doing anything special to group/format them function printTemplate($triples) { - return printRemainingTriples($triples); + $content = '<table>'; + $content .= $this->printRemainingTriples($triples); + return $content; } } Modified: trunk/src/dbpedia-navigator/templates/PersonTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/PersonTemplate.php 2008-10-27 15:32:05 UTC (rev 1452) +++ trunk/src/dbpedia-navigator/templates/PersonTemplate.php 2008-10-27 15:37:25 UTC (rev 1453) @@ -27,7 +27,7 @@ function printTemplate($triples) { $content = ""; - $content .= printRemainingTriples($triples); + $content .= $this->printRemainingTriples($triples); return $content; } Modified: trunk/src/dbpedia-navigator/templates/PlaceTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/PlaceTemplate.php 2008-10-27 15:32:05 UTC (rev 1452) +++ trunk/src/dbpedia-navigator/templates/PlaceTemplate.php 2008-10-27 15:37:25 UTC (rev 1453) @@ -31,7 +31,7 @@ abstract class PlaceTemplate extends AbstractTemplate { // returns a latitude string of the form 49°1′0″N or "unknown" - public getLatitudeString($triples) { + public function getLatitudeString($triples) { if(!areDBpediaPropertiesSet(array('latitudedegrees','latitudeminutes','latitudeseconds'))) { return "unknown"; } @@ -43,7 +43,7 @@ } // returns a latitude string of the form 49°1′0″E or "unknown" - public getLongitudeString($triples) { + public function getLongitudeString($triples) { if(!areDBpediaPropertiesSet(array('longitudedegrees','longitudeminutes','longitudeseconds'))) { return "unknown"; } Modified: trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php 2008-10-27 15:32:05 UTC (rev 1452) +++ trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php 2008-10-27 15:37:25 UTC (rev 1453) @@ -19,15 +19,18 @@ * */ +include_once('PlaceTemplate.php'); + /** * Template for all populated places. */ abstract class PopulatedPlaceTemplate extends PlaceTemplate { // return a nicely formatted string for the population of the place - public getPopulationString() { - $number = number_format(extractPropValue('populationTotal')); - $asOf = extractPropValue('populationAsOf'); + function getPopulationString() { + $population = $this->extractPropValue($triples, 'populationTotal'); + $number = number_format($population); + $asOf = $this->extractPropValue('populationAsOf'); return $number + ' (as of ' + $asOf + ')'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 15:32:12
|
Revision: 1452 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1452&view=rev Author: sknappe Date: 2008-10-27 15:32:05 +0000 (Mon, 27 Oct 2008) Log Message: ----------- changes to use new ontology Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php trunk/src/dbpedia-navigator/ajax_learn_concepts.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-10-27 14:53:57 UTC (rev 1451) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-10-27 15:32:05 UTC (rev 1452) @@ -76,6 +76,7 @@ $algorithmID=$this->client->setLearningAlgorithm($this->id, "dbpediaNavigationSuggestor"); $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "forceRefinementLengthIncrease", true); $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "useHasValueConstructor", true); + $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "useCardinalityRestrictions", false); $this->client->applyConfigEntryInt($this->id, $algorithmID, "valueFrequencyThreshold", 2); $this->client->applyConfigEntryInt($this->id, $algorithmID, "guaranteeXgoodDescriptions", 3); $this->client->applyConfigEntryInt($this->id, $algorithmID, "maxExecutionTimeInSeconds", 3); Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-10-27 14:53:57 UTC (rev 1451) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-10-27 15:32:05 UTC (rev 1452) @@ -32,12 +32,14 @@ $databaseConnection->connect($settings->database_server,$settings->database_user,$settings->database_pass); $databaseConnection->select_database($settings->database_name); - $test=preg_match("/^([\(]*\"http:\/\/dbpedia\.org\/class\/yago\/[^\040]+\"[\)]*(\040(AND|OR)\040)?)+$/",$kb); + if ($settings->classSystem=="YAGO") $test=preg_match("/^([\(]*\"http:\/\/dbpedia\.org\/class\/yago\/[^\040]+\"[\)]*(\040(AND|OR)\040)?)+$/",$kb); + else if ($settings->classSystem=="DBpedia") $test=preg_match("/^([\(]*\"http:\/\/dbpedia\.org\/ontology\/[^\040]+\"[\)]*(\040(AND|OR)\040)?)+$/",$kb); $content=""; if ($test){ - preg_match_all("/\"http:\/\/dbpedia\.org\/class\/yago\/[^\040()]+\"/",$kb,$treffer,PREG_OFFSET_CAPTURE); - + if ($settings->classSystem=="YAGO") preg_match_all("/\"http:\/\/dbpedia\.org\/class\/yago\/[^\040()]+\"/",$kb,$treffer,PREG_OFFSET_CAPTURE); + else if ($settings->classSystem=="DBpedia") preg_match_all("/\"http:\/\/dbpedia\.org\/ontology\/[^\040()]+\"/",$kb,$treffer,PREG_OFFSET_CAPTURE); + $final=''; $i=1; $pos=0; Modified: trunk/src/dbpedia-navigator/ajax_learn_concepts.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-10-27 14:53:57 UTC (rev 1451) +++ trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-10-27 15:32:05 UTC (rev 1452) @@ -41,16 +41,18 @@ $classes=array(); $noclass=array(); + if ($settings->classSystem=="YAGO") $rekursion=1; + else if ($settings->classSystem=="DBpedia") $rekursion=0; foreach ($all as $pos){ $newclasses=array(); $query="SELECT category FROM articlecategories WHERE name='$pos'"; $res=$databaseConnection->query($query); if (mysql_num_rows($res)<1) $noclass[]=$pos; while ($result=$databaseConnection->nextEntry($res)){ - $classes[$pos][]=$result['category']; - $newclasses[]=$result['category']; + if ($result['category']!="http://dbpedia.org/ontology/Resource") $classes[$pos][]=$result['category']; + if ($result['category']!="http://dbpedia.org/ontology/Resource") $newclasses[]=$result['category']; } - for ($i=0;$i<1;$i++){ + for ($i=0;$i<$rekursion;$i++){ $tempclasses=array(); foreach ($newclasses as $clas){ $query="SELECT father FROM classhierarchy WHERE child='$clas'"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 14:54:02
|
Revision: 1451 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1451&view=rev Author: sknappe Date: 2008-10-27 14:53:57 +0000 (Mon, 27 Oct 2008) Log Message: ----------- changes to use new ontology Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorFilterRule.java Modified: trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorFilterRule.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorFilterRule.java 2008-10-27 14:47:51 UTC (rev 1450) +++ trunk/src/dl-learner/org/dllearner/kb/manipulator/DBpediaNavigatorFilterRule.java 2008-10-27 14:53:57 UTC (rev 1451) @@ -48,8 +48,11 @@ typeTuple = tuple; } - if (tuple.a.toString().equals("http://www.w3.org/1999/02/22-rdf-syntax-ns#type") && !(tuple.b.toString().startsWith("http://dbpedia.org/class/yago"))){ + /*if (tuple.a.toString().equals("http://www.w3.org/1999/02/22-rdf-syntax-ns#type") && !(tuple.b.toString().startsWith("http://dbpedia.org/class/yago"))){ toRemove.add(typeTuple); + }*/ + if (tuple.a.toString().equals("http://www.w3.org/1999/02/22-rdf-syntax-ns#type") && !(tuple.b.toString().startsWith("http://dbpedia.org/ontology"))){ + toRemove.add(typeTuple); } }//end for for (RDFNodeTuple tuple : toRemove) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 14:47:56
|
Revision: 1450 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1450&view=rev Author: sknappe Date: 2008-10-27 14:47:51 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/helper_functions.php trunk/src/dbpedia-navigator/js/navigator.js Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 14:39:05 UTC (rev 1449) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 14:47:51 UTC (rev 1450) @@ -70,12 +70,12 @@ $lab=getLabel($tag,$label[$tag]); //$tag_with_entities=htmlentities("\"".$tag."\""); - $ret.='<a style="'.$style.'" href="#" onclick="document.getElementById(\'hidden_class\').value=\''.$tag.'\';show_results(\''.$tag.'\',\''.utf8_to_html($lab).'\',document.getElementById(\'hidden_number\').value);">'.utf8_to_html($lab).'</a> '; + $ret.='<a style="'.$style.'" href="#" onclick="document.getElementById(\'hidden_class\').value=\''.$tag.'\';show_results(\''.$tag.'\',document.getElementById(\'hidden_number\').value,\''.utf8_to_html($lab).'\');">'.utf8_to_html($lab).'</a> '; } $ret.="</p><br/>"; $ret.='<span id="FilterTags">You currently don\'t filter your search results.</span>'; - $ret.=' You can <a style="font-size:11px;" href="#" onclick="document.getElementById(\'hidden_class\').value=\'all\';show_results(\'all\',\'all\',document.getElementById(\'hidden_number\').value);">show all results</a> '; - if ($nc) $ret.=' or <a style="font-size:11px;" href="#" onclick="document.getElementById(\'hidden_class\').value=\'NoCategory\';show_results(\'NoCategory\',\'No Category\',document.getElementById(\'hidden_number\').value);">show results with no category</a> '; + $ret.=' You can <a style="font-size:11px;" href="#" onclick="document.getElementById(\'hidden_class\').value=\'all\';show_results(\'all\',document.getElementById(\'hidden_number\').value,\'all\');">show all results</a> '; + if ($nc) $ret.=' or <a style="font-size:11px;" href="#" onclick="document.getElementById(\'hidden_class\').value=\'NoCategory\';show_results(\'NoCategory\',document.getElementById(\'hidden_number\').value,\'No Category\');">show results with no category</a> '; $ret.='<br/><br/>'; return $ret; } Modified: trunk/src/dbpedia-navigator/js/navigator.js =================================================================== --- trunk/src/dbpedia-navigator/js/navigator.js 2008-10-27 14:39:05 UTC (rev 1449) +++ trunk/src/dbpedia-navigator/js/navigator.js 2008-10-27 14:47:51 UTC (rev 1450) @@ -23,7 +23,7 @@ } } -function show_results(class, label, number) +function show_results(class, number, label) { var links=document.getElementById('results').getElementsByTagName('p'); var j=0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 14:39:19
|
Revision: 1449 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1449&view=rev Author: sknappe Date: 2008-10-27 14:39:05 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php trunk/src/dbpedia-navigator/helper_functions.php trunk/src/dbpedia-navigator/js/navigator.js Modified: trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-10-27 14:22:25 UTC (rev 1448) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_category.php 2008-10-27 14:39:05 UTC (rev 1449) @@ -28,7 +28,7 @@ $result=$databaseConnection->nextEntry($res); $label=$result['label']; - $query="SELECT name FROM articlecategories WHERE category='$category' ORDER BY number DESC LIMIT ".$number; + $query="SELECT DISTINCT name FROM articlecategories WHERE category='$category' ORDER BY number DESC LIMIT ".$number; $res=$databaseConnection->query($query); $bestsearches=""; if ($databaseConnection->numberOfEntries($res)>0){ Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 14:22:25 UTC (rev 1448) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 14:39:05 UTC (rev 1449) @@ -399,7 +399,7 @@ for($i=0; $i<count($ar); $i++) { if ($classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; else if ($classSystem=="DBpedia") $prefix='http://dbpedia.org/ontology/'; - if (substr($ar[$i]['value'],0,strlen($prefix))!=$prefix) continue; + if (substr($ar[$i]['value'],0,strlen($prefix))!=$prefix||$ar[$i]['value']=='http://dbpedia.org/ontology/Resource') continue; $query="SELECT label FROM categories WHERE category='".$ar[$i]['value']."' LIMIT 1"; $res=$databaseConnection->query($query); $result=$databaseConnection->nextEntry($res); Modified: trunk/src/dbpedia-navigator/js/navigator.js =================================================================== --- trunk/src/dbpedia-navigator/js/navigator.js 2008-10-27 14:22:25 UTC (rev 1448) +++ trunk/src/dbpedia-navigator/js/navigator.js 2008-10-27 14:39:05 UTC (rev 1449) @@ -30,8 +30,8 @@ var names; var hasClass; - if (class=='all') document.getElementById('FilterTags').innerHTML='You currently don\'t filter your search results.'; - else document.getElementById('FilterTags').innerHTML='Filtered by class: '+label+'.'; + if (class=='all'&&document.getElementById('FilterTags')) document.getElementById('FilterTags').innerHTML='You currently don\'t filter your search results.'; + else if (document.getElementById('FilterTags')) document.getElementById('FilterTags').innerHTML='Filtered by class: '+label+'.'; for (var i=0;i<links.length;i++){ if (class=='all'){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 14:22:31
|
Revision: 1448 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1448&view=rev Author: sknappe Date: 2008-10-27 14:22:25 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/helper_functions.php Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 14:06:04 UTC (rev 1447) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 14:22:25 UTC (rev 1448) @@ -128,7 +128,7 @@ // display a list of classes if ($settings->classSystem=="YAGO") $content.='<br/><hr><h4>YAGO Classes</h4><br/>'; else if ($settings->classSystem=="DBpedia") $content.='<br/><hr><h4>DBpedia Classes</h4><br/>'; - $content .= '<p>'.formatClassArray($triples['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'],$classSystem).'</p>'; + $content .= '<p>'.formatClassArray($triples['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'],$settings->classSystem).'</p>'; } //skos-subjects Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 14:06:04 UTC (rev 1447) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 14:22:25 UTC (rev 1448) @@ -399,7 +399,7 @@ for($i=0; $i<count($ar); $i++) { if ($classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; else if ($classSystem=="DBpedia") $prefix='http://dbpedia.org/ontology/'; - if(strpos($ar[$i]['value'],$prefix)!==0) continue; + if (substr($ar[$i]['value'],0,strlen($prefix))!=$prefix) continue; $query="SELECT label FROM categories WHERE category='".$ar[$i]['value']."' LIMIT 1"; $res=$databaseConnection->query($query); $result=$databaseConnection->nextEntry($res); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 14:06:10
|
Revision: 1447 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1447&view=rev Author: sknappe Date: 2008-10-27 14:06:04 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/helper_functions.php Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 13:56:41 UTC (rev 1446) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 14:06:04 UTC (rev 1447) @@ -399,7 +399,7 @@ for($i=0; $i<count($ar); $i++) { if ($classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; else if ($classSystem=="DBpedia") $prefix='http://dbpedia.org/ontology/'; - if(substr($ar[$i]['value'],0,30)!=$prefix) continue; + if(strpos($ar[$i]['value'],$prefix)!==0) continue; $query="SELECT label FROM categories WHERE category='".$ar[$i]['value']."' LIMIT 1"; $res=$databaseConnection->query($query); $result=$databaseConnection->nextEntry($res); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 13:56:53
|
Revision: 1446 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1446&view=rev Author: sknappe Date: 2008-10-27 13:56:41 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/helper_functions.php Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 13:51:53 UTC (rev 1445) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 13:56:41 UTC (rev 1446) @@ -398,7 +398,7 @@ $string="<ul>"; for($i=0; $i<count($ar); $i++) { if ($classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; - else if ($classSystem=="DBpedia") $prefix='http://dbpedia.org/ontology/' + else if ($classSystem=="DBpedia") $prefix='http://dbpedia.org/ontology/'; if(substr($ar[$i]['value'],0,30)!=$prefix) continue; $query="SELECT label FROM categories WHERE category='".$ar[$i]['value']."' LIMIT 1"; $res=$databaseConnection->query($query); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 13:52:11
|
Revision: 1445 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1445&view=rev Author: sknappe Date: 2008-10-27 13:51:53 +0000 (Mon, 27 Oct 2008) Log Message: ----------- changes to use new ontology Modified Paths: -------------- trunk/src/dbpedia-navigator/Settings.php.dist trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/helper_functions.php Modified: trunk/src/dbpedia-navigator/Settings.php.dist =================================================================== --- trunk/src/dbpedia-navigator/Settings.php.dist 2008-10-27 12:36:06 UTC (rev 1444) +++ trunk/src/dbpedia-navigator/Settings.php.dist 2008-10-27 13:51:53 UTC (rev 1445) @@ -60,6 +60,10 @@ public $ignoredRoles=array(); public $classSystem="YAGO"; + //public $classSystem="DBpedia"; + //the name of the used database + public $database_name='navigator_db'; + //public $database_name='navigator_db_new'; //the type of database server public $database_type='mysql'; @@ -70,9 +74,6 @@ //the password of that user public $database_pass='dbpedia'; - //the name of the used database - if ($classSystem=="YAGO") - public $database_name='navigator_db'; } ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 12:36:06 UTC (rev 1444) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 13:51:53 UTC (rev 1445) @@ -127,6 +127,7 @@ if(isset($triples['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'])){ // display a list of classes if ($settings->classSystem=="YAGO") $content.='<br/><hr><h4>YAGO Classes</h4><br/>'; + else if ($settings->classSystem=="DBpedia") $content.='<br/><hr><h4>DBpedia Classes</h4><br/>'; $content .= '<p>'.formatClassArray($triples['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'],$classSystem).'</p>'; } Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 12:36:06 UTC (rev 1444) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 13:51:53 UTC (rev 1445) @@ -397,7 +397,8 @@ $string="<ul>"; for($i=0; $i<count($ar); $i++) { - if ($settings->classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; + if ($classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; + else if ($classSystem=="DBpedia") $prefix='http://dbpedia.org/ontology/' if(substr($ar[$i]['value'],0,30)!=$prefix) continue; $query="SELECT label FROM categories WHERE category='".$ar[$i]['value']."' LIMIT 1"; $res=$databaseConnection->query($query); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-27 12:36:09
|
Revision: 1444 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1444&view=rev Author: jenslehmann Date: 2008-10-27 12:36:06 +0000 (Mon, 27 Oct 2008) Log Message: ----------- templates ctd. Modified Paths: -------------- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php trunk/src/dbpedia-navigator/templates/CityTemplate.php Added Paths: ----------- trunk/src/dbpedia-navigator/templates/DefaultTemplate.php trunk/src/dbpedia-navigator/templates/PersonTemplate.php Modified: trunk/src/dbpedia-navigator/templates/AbstractTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 10:12:36 UTC (rev 1443) +++ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 12:36:06 UTC (rev 1444) @@ -32,6 +32,64 @@ abstract function printTemplate($triples); + // function to be called after all "special" actions have been taken; + // it displays all remaining triples + function printRemainingTriples($triples) { + $i=1; + if (is_array($triples) && count($triples)>0) { + foreach($triples as $predicate=>$object) { + $number=count($object); + if ($i>0) + $backgroundcolor="eee"; + else + $backgroundcolor="ffffff"; + + $table .= '<tr style="background-color:#'.$backgroundcolor.';"><td><a href="'.$predicate.'" target="_blank">'.nicePredicate($predicate).'</a></td>'; + $table .= '<td>'; + if ($number>1) $table.='<ul>'; + $k=1; + foreach($object as $element) { + if ($k>3) $display=" style=\"display:none\""; + else $display=""; + if ($element['type']=="uri") { + if (strpos($element['value'],"http://dbpedia.org/resource/")===0&&substr_count($element['value'],"/")==4&&strpos($element['value'],"Template:")!=28){ + $label=str_replace('_',' ',substr($element['value'],28)); + if (strlen($label)>60) + $label=substr($label,0,60).'...'; + if ($number>1) + $table.='<li'.$display.'>'; + $table .= '<a href="#" onclick="get_article(\'label='.$element['value'].'&cache=-1\');">'.urldecode($label).'</a>'; + if ($number>1) + $table.='</li>'; + } else { + if ($number>1) + $table.='<li'.$display.'>'; + $label=urldecode($element['value']); + if (strlen($label)>60) + $label=substr($label,0,60).'...'; + $table .= '<a href="'.$element['value'].'" target="_blank">'.$label.'</a>'; + if ($number>1) + $table.='</li>'; + } + } else { + if ($number>1) + $table.='<li'.$display.'>'; + $table .= $element['value']; + if ($number>1) + $table.='</li>'; + } + $k++; + } + if ($number>3) $table.='<a href="javascript:none()" onclick="toggleAttributes(this)"><img src="images/arrow_down.gif"/> show</a>'; + if ($number>1) $table.='</ul>'; + $table .= '</td>'; + $i*=-1; + } + } + $table .= '</table>'; + return $table; + } + // utility method, which checks whether the given DBpedia ontology properties exists in the triples // is they exist, the method returns true and false otherwise; // TODO: use $dbpediaOntologyPrefix in $settings (how do we access those settings in all scripts?) @@ -57,6 +115,15 @@ return $value; } + // displays as list of values for this property; + // TODO: add toggle button here (as in remaining triples) + function displayMultipleValues($triples, $property) { + $objects = $triples[$property]; + foreach($objects as $object) { + // ... + } + } + } ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/templates/CityTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/CityTemplate.php 2008-10-27 10:12:36 UTC (rev 1443) +++ trunk/src/dbpedia-navigator/templates/CityTemplate.php 2008-10-27 12:36:06 UTC (rev 1444) @@ -30,7 +30,13 @@ $content = ""; $content .= '<table>'; $content .= '<tr><td colspan="2">City Information</td></tr>'; + // population $content .= '<tr><td>total population</td><td>' + getPopulationString($triples) + '</td></tr>'; + // location + $content .= '<tr><td>latitude</td><td>' + getLatitudeString($triples) + '</td></tr>'; + $content .= '<tr><td>longitude</td><td>' + getLongitudeString($triples) + '</td></tr>'; + // resources related to city + $content .= displayMultipleValues('city'); $content .= '</table>'; // .. continue ... Added: trunk/src/dbpedia-navigator/templates/DefaultTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/DefaultTemplate.php (rev 0) +++ trunk/src/dbpedia-navigator/templates/DefaultTemplate.php 2008-10-27 12:36:06 UTC (rev 1444) @@ -0,0 +1,37 @@ +<?php +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * The default template. It should correspond to the "remaining triples" + * view. + * + * @author Jens Lehmann + */ +class DefaultTemplate extends AbstractTemplate { + + // simply prints all triples without doing anything special + function printTemplate($triples) { + return printRemainingTriples($triples); + } + +} + +?> \ No newline at end of file Added: trunk/src/dbpedia-navigator/templates/PersonTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/PersonTemplate.php (rev 0) +++ trunk/src/dbpedia-navigator/templates/PersonTemplate.php 2008-10-27 12:36:06 UTC (rev 1444) @@ -0,0 +1,36 @@ +<?php +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * Template for persons. + */ +class PersonTemplate extends AbstractTemplate { + + function printTemplate($triples) { + $content = ""; + + $content .= printRemainingTriples($triples); + return $content; + } + +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 10:15:22
|
Revision: 1443 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1443&view=rev Author: sknappe Date: 2008-10-27 10:12:36 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java Modified: trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 09:32:46 UTC (rev 1442) +++ trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 10:12:36 UTC (rev 1443) @@ -254,7 +254,6 @@ if (split.length<3) continue; name=split[0].substring(1); pred=split[1].substring(2); - if (i>100) break; if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); if (name.length()>name.lastIndexOf("/")+1) className=name.substring(name.lastIndexOf("/")+1,name.lastIndexOf("/")+2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-27 09:36:28
|
Revision: 1441 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1441&view=rev Author: jenslehmann Date: 2008-10-27 09:32:07 +0000 (Mon, 27 Oct 2008) Log Message: ----------- continued city template Modified Paths: -------------- trunk/src/dbpedia-navigator/Settings.php.dist trunk/src/dbpedia-navigator/templates/AbstractTemplate.php trunk/src/dbpedia-navigator/templates/CityTemplate.php Added Paths: ----------- trunk/src/dbpedia-navigator/templates/PlaceTemplate.php trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php Modified: trunk/src/dbpedia-navigator/Settings.php.dist =================================================================== --- trunk/src/dbpedia-navigator/Settings.php.dist 2008-10-27 09:28:53 UTC (rev 1440) +++ trunk/src/dbpedia-navigator/Settings.php.dist 2008-10-27 09:32:07 UTC (rev 1441) @@ -40,6 +40,8 @@ public $endpoint="DBPEDIA"; //public $endpoint="LOCALDBPEDIA"; + public $dbpediaPropertyPrefix = 'http://dbpedia.org/ontology/'; + public $dbpediaClassPrefix = 'http://dbpedia.org/ontology/'; // in mikrosekunden public $sparqlttl=60000000; Modified: trunk/src/dbpedia-navigator/templates/AbstractTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 09:28:53 UTC (rev 1440) +++ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 09:32:07 UTC (rev 1441) @@ -32,6 +32,31 @@ abstract function printTemplate($triples); + // utility method, which checks whether the given DBpedia ontology properties exists in the triples + // is they exist, the method returns true and false otherwise; + // TODO: use $dbpediaOntologyPrefix in $settings (how do we access those settings in all scripts?) + function areDBpediaPropertiesSet($triples, $properties) { + foreach($properties as $property) { + if(!isset($triples['http://dbpedia.org/ontology/'.$property])) { + return false; + } + } + return true; + } + + // gets the value of the property + function getPropValue($triples, $property) { + return $triples['http://dbpedia.org/ontology/'.$property]; + } + + // gets the value of the property and removes it from the triple array + // (this means you cannot access this information anymore afterwards) + function extractPropValue($triples, $property) { + $value = $triples['http://dbpedia.org/ontology/'.$property]; + unset($triples['http://dbpedia.org/ontology/'.$property]); + return $value; + } + } ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/templates/CityTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/CityTemplate.php 2008-10-27 09:28:53 UTC (rev 1440) +++ trunk/src/dbpedia-navigator/templates/CityTemplate.php 2008-10-27 09:32:07 UTC (rev 1441) @@ -24,15 +24,15 @@ * * @author Jens Lehmann */ -class CityTemplate { +class CityTemplate extends PopulatedPlaceTemplate { function getTemplate($triples) { $content = ""; + $content .= '<table>'; + $content .= '<tr><td colspan="2">City Information</td></tr>'; + $content .= '<tr><td>total population</td><td>' + getPopulationString($triples) + '</td></tr>'; + $content .= '</table>'; - $latitude = $triples['http://dbpedia.org/ontology/latitutedegrees'] + "° " - + $triples['http://dbpedia.org/ontology/latitudeminutes'] + "′" - + $triples['http://dbpedia.org/ontology/latitudeseconds'] + "″N"; - // .. continue ... return $content; Added: trunk/src/dbpedia-navigator/templates/PlaceTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/PlaceTemplate.php (rev 0) +++ trunk/src/dbpedia-navigator/templates/PlaceTemplate.php 2008-10-27 09:32:07 UTC (rev 1441) @@ -0,0 +1,59 @@ +<?php +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * Abstract template class. Templates are used for displaying information + * about a particular entity in a user friendly way. + * + * You can also use this class for convenience functions accessible by + * all concrete templates. + * + * @author Jens Lehmann + */ +abstract class PlaceTemplate extends AbstractTemplate { + + // returns a latitude string of the form 49°1′0″N or "unknown" + public getLatitudeString($triples) { + if(!areDBpediaPropertiesSet(array('latitudedegrees','latitudeminutes','latitudeseconds'))) { + return "unknown"; + } + + $latitude = $triples['http://dbpedia.org/ontology/latitutedegrees'] + "° " + + $triples['http://dbpedia.org/ontology/latitudeminutes'] + "′" + + $triples['http://dbpedia.org/ontology/latitudeseconds'] + "″N"; + return $latitude; + } + + // returns a latitude string of the form 49°1′0″E or "unknown" + public getLongitudeString($triples) { + if(!areDBpediaPropertiesSet(array('longitudedegrees','longitudeminutes','longitudeseconds'))) { + return "unknown"; + } + + $longitude = $triples['http://dbpedia.org/ontology/longitutedegrees'] + "° " + + $triples['http://dbpedia.org/ontology/longitudeminutes'] + "′" + + $triples['http://dbpedia.org/ontology/longitudeseconds'] + "″N"; + return $longitude; + } + +} + +?> \ No newline at end of file Added: trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php (rev 0) +++ trunk/src/dbpedia-navigator/templates/PopulatedPlaceTemplate.php 2008-10-27 09:32:07 UTC (rev 1441) @@ -0,0 +1,36 @@ +<?php +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * Template for all populated places. + */ +abstract class PopulatedPlaceTemplate extends PlaceTemplate { + + // return a nicely formatted string for the population of the place + public getPopulationString() { + $number = number_format(extractPropValue('populationTotal')); + $asOf = extractPropValue('populationAsOf'); + + return $number + ' (as of ' + $asOf + ')'; + } + +} +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 09:35:27
|
Revision: 1442 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1442&view=rev Author: sknappe Date: 2008-10-27 09:32:46 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java Modified: trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 09:32:07 UTC (rev 1441) +++ trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 09:32:46 UTC (rev 1442) @@ -334,18 +334,18 @@ public static void main(String[] args) throws ClassNotFoundException,SQLException,BackingStoreException{ CalculatePageRank cal=new CalculatePageRank(); - //Class.forName("com.mysql.jdbc.Driver"); - //String url = - // "jdbc:mysql://"+dbServer+":3306/"+dbName; + Class.forName("com.mysql.jdbc.Driver"); + String url = + "jdbc:mysql://"+dbServer+":3306/"+dbName; - //con = DriverManager.getConnection( - // url, dbUser, dbPass); + con = DriverManager.getConnection( + url, dbUser, dbPass); //cal.calculateLinks(); //cal.addLabels(); //cal.calculateCategories(); cal.calculateCategoriesNewOntology(); //cal.copyNumbers(); - //con.close(); + con.close(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 09:33:13
|
Revision: 1440 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1440&view=rev Author: sknappe Date: 2008-10-27 09:28:53 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java Modified: trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 08:42:11 UTC (rev 1439) +++ trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 09:28:53 UTC (rev 1440) @@ -253,17 +253,21 @@ split=line.split(">"); if (split.length<3) continue; name=split[0].substring(1); - if (name.length()>name.lastIndexOf("/")+1) className=name.substring(name.lastIndexOf("/")+1,name.lastIndexOf("/")+1); - else className="t"; - if (className.toLowerCase().equals(className)) - isClassLabel=false; - else - isClassLabel=true; pred=split[1].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")) + if (i>100) break; + if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - else + if (name.length()>name.lastIndexOf("/")+1) className=name.substring(name.lastIndexOf("/")+1,name.lastIndexOf("/")+2); + else className="t"; + if (className.toLowerCase().equals(className)) + isClassLabel=false; + else + isClassLabel=true; + } + else{ label=split[2].substring(2); + isClassLabel=false; + } if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")&&isClassLabel){ try{ stmt.executeUpdate("INSERT INTO categories (category,label) VALUES (\""+name+"\",\""+label+"\")"); @@ -284,7 +288,7 @@ in.close(); - in = new BufferedReader(new FileReader(categoriesNewOntology2)); + /*in = new BufferedReader(new FileReader(categoriesNewOntology2)); i=0; while ((line=in.readLine())!=null) @@ -300,7 +304,7 @@ i++; } - in.close(); + in.close();*/ } catch (FileNotFoundException e) { System.out.println("File not found"); @@ -330,18 +334,18 @@ public static void main(String[] args) throws ClassNotFoundException,SQLException,BackingStoreException{ CalculatePageRank cal=new CalculatePageRank(); - Class.forName("com.mysql.jdbc.Driver"); - String url = - "jdbc:mysql://"+dbServer+":3306/"+dbName; + //Class.forName("com.mysql.jdbc.Driver"); + //String url = + // "jdbc:mysql://"+dbServer+":3306/"+dbName; - con = DriverManager.getConnection( - url, dbUser, dbPass); + //con = DriverManager.getConnection( + // url, dbUser, dbPass); //cal.calculateLinks(); //cal.addLabels(); //cal.calculateCategories(); cal.calculateCategoriesNewOntology(); - cal.copyNumbers(); + //cal.copyNumbers(); - con.close(); + //con.close(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 08:46:35
|
Revision: 1439 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1439&view=rev Author: sknappe Date: 2008-10-27 08:42:11 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java Modified: trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 08:33:26 UTC (rev 1438) +++ trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 08:42:11 UTC (rev 1439) @@ -251,6 +251,7 @@ while ((line=in.readLine())!=null) { split=line.split(">"); + if (split.length<3) continue; name=split[0].substring(1); if (name.length()>name.lastIndexOf("/")+1) className=name.substring(name.lastIndexOf("/")+1,name.lastIndexOf("/")+1); else className="t"; @@ -336,7 +337,7 @@ con = DriverManager.getConnection( url, dbUser, dbPass); //cal.calculateLinks(); - cal.addLabels(); + //cal.addLabels(); //cal.calculateCategories(); cal.calculateCategoriesNewOntology(); cal.copyNumbers(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 08:34:27
|
Revision: 1438 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1438&view=rev Author: sknappe Date: 2008-10-27 08:33:26 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/helper_functions.php Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 08:31:27 UTC (rev 1437) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-27 08:33:26 UTC (rev 1438) @@ -397,7 +397,7 @@ $string="<ul>"; for($i=0; $i<count($ar); $i++) { - if ($classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; + if ($settings->classSystem=="YAGO") $prefix = 'http://dbpedia.org/class/yago/'; if(substr($ar[$i]['value'],0,30)!=$prefix) continue; $query="SELECT label FROM categories WHERE category='".$ar[$i]['value']."' LIMIT 1"; $res=$databaseConnection->query($query); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 08:34:08
|
Revision: 1437 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1437&view=rev Author: sknappe Date: 2008-10-27 08:31:27 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix 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-27 08:29:37 UTC (rev 1436) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 08:31:27 UTC (rev 1437) @@ -17,6 +17,8 @@ die(); } + $settings=new Settings(); + //write last action into session if (strpos($subject,"http://dbpedia.org/resource/")===0) $actionuri=substr (strrchr ($subject, "/"), 1); else $actionuri=urlencode($subject); @@ -124,7 +126,7 @@ if(isset($triples['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'])){ // display a list of classes - if ($classSystem=="YAGO") $content.='<br/><hr><h4>YAGO Classes</h4><br/>'; + if ($settings->classSystem=="YAGO") $content.='<br/><hr><h4>YAGO Classes</h4><br/>'; $content .= '<p>'.formatClassArray($triples['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'],$classSystem).'</p>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-27 08:33:59
|
Revision: 1436 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1436&view=rev Author: jenslehmann Date: 2008-10-27 08:29:37 +0000 (Mon, 27 Oct 2008) Log Message: ----------- started DBpedia Navigator templates Added Paths: ----------- trunk/src/dbpedia-navigator/templates/ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php trunk/src/dbpedia-navigator/templates/CityTemplate.php Added: trunk/src/dbpedia-navigator/templates/AbstractTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/AbstractTemplate.php (rev 0) +++ trunk/src/dbpedia-navigator/templates/AbstractTemplate.php 2008-10-27 08:29:37 UTC (rev 1436) @@ -0,0 +1,37 @@ +<?php +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * Abstract template class. Templates are used for displaying information + * about a particular entity in a user friendly way. + * + * You can also use this class for convenience functions accessible by + * all concrete templates. + * + * @author Jens Lehmann + */ +class AbstractTemplate { + + abstract function printTemplate($triples); + +} + +?> \ No newline at end of file Added: trunk/src/dbpedia-navigator/templates/CityTemplate.php =================================================================== --- trunk/src/dbpedia-navigator/templates/CityTemplate.php (rev 0) +++ trunk/src/dbpedia-navigator/templates/CityTemplate.php 2008-10-27 08:29:37 UTC (rev 1436) @@ -0,0 +1,42 @@ +<?php +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +/** + * Template for cities. + * + * @author Jens Lehmann + */ +class CityTemplate { + + function getTemplate($triples) { + $content = ""; + + $latitude = $triples['http://dbpedia.org/ontology/latitutedegrees'] + "° " + + $triples['http://dbpedia.org/ontology/latitudeminutes'] + "′" + + $triples['http://dbpedia.org/ontology/latitudeseconds'] + "″N"; + + // .. continue ... + + return $content; + } + +} +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 08:32:30
|
Revision: 1435 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1435&view=rev Author: sknappe Date: 2008-10-27 08:28:08 +0000 (Mon, 27 Oct 2008) Log Message: ----------- bugfix 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-27 08:05:19 UTC (rev 1434) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-27 08:28:08 UTC (rev 1435) @@ -250,7 +250,7 @@ // filter out uninteresting properties and properties which // have already been displayed - filterTriples($triples, $subjecttriples); + filterTriples(&$triples, &$subjecttriples); if (count($triples)>0||count($subjecttriples)>0){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-27 08:05:22
|
Revision: 1434 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1434&view=rev Author: sknappe Date: 2008-10-27 08:05:19 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java Modified: trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 06:25:07 UTC (rev 1433) +++ trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-27 08:05:19 UTC (rev 1434) @@ -252,7 +252,8 @@ { split=line.split(">"); name=split[0].substring(1); - className=name.substring(name.lastIndexOf("/")+1,name.lastIndexOf("/")+2); + if (name.length()>name.lastIndexOf("/")+1) className=name.substring(name.lastIndexOf("/")+1,name.lastIndexOf("/")+1); + else className="t"; if (className.toLowerCase().equals(className)) isClassLabel=false; else @@ -334,7 +335,7 @@ con = DriverManager.getConnection( url, dbUser, dbPass); - cal.calculateLinks(); + //cal.calculateLinks(); cal.addLabels(); //cal.calculateCategories(); cal.calculateCategoriesNewOntology(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |