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-23 07:11:07
|
Revision: 1408 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1408&view=rev Author: sknappe Date: 2008-10-23 07:11:01 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-23 07:02:51 UTC (rev 1407) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-23 07:11:01 UTC (rev 1408) @@ -272,7 +272,7 @@ l=l.replaceAll("cities", "City"); l=l.replaceAll("Cities", "City"); - l=l.replaceAll("([^-0\040A-Z])([A-Z])", "$1 $2"); + l=l.replaceAll("([^-0\040])([A-Z])([^A-Z])", "$1 $2$3"); if (l.toLowerCase().startsWith("a")||l.toLowerCase().startsWith("e")||l.toLowerCase().startsWith("i")||l.toLowerCase().startsWith("o")||l.toLowerCase().startsWith("u")) query+="an "+l; else query+="a "+l; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-23 07:02:55
|
Revision: 1407 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1407&view=rev Author: sknappe Date: 2008-10-23 07:02:51 +0000 (Thu, 23 Oct 2008) Log Message: ----------- added support for some more descriptions Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-23 07:01:53 UTC (rev 1406) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-23 07:02:51 UTC (rev 1407) @@ -109,7 +109,8 @@ System.out.println("************************"); } System.out.println("Finished");*/ - String conj="\"http://dbpedia.org/class/yago/PlannedCities\""; + //String conj="EXISTS \"http://xmlns.com/foaf/0.1/page\".<= 0 \"http://www.w3.org/2004/02/skos/core#subject\".TOP"; + String conj="(\"Male\" AND (\"hasDog\" = 18))"; System.out.println(NaturalLanguageDescriptionConvertVisitor.getNaturalLanguageDescription(conj, "DBPEDIA")); } catch (ParseException e) { // TODO Auto-generated catch block @@ -203,6 +204,9 @@ */ public void visit(ObjectMinCardinalityRestriction description) { logger.trace("ObjectMinCardinalityRestriction"); + if (query.endsWith("which is ")) query=query.substring(0, query.length()-3)+"has "; + query+="at least "+description.getCardinality()+" "+description.getRole().toString()+" which is "; + description.getChild(0).accept(this); } /* (non-Javadoc) @@ -210,6 +214,9 @@ */ public void visit(ObjectExactCardinalityRestriction description) { logger.trace("ObjectExactCardinalityRestriction"); + if (query.endsWith("which is ")) query=query.substring(0, query.length()-3)+"has "; + query+="exactly "+description.getCardinality()+" "+description.getRole().toString()+" which is "; + description.getChild(0).accept(this); } /* (non-Javadoc) @@ -217,6 +224,9 @@ */ public void visit(ObjectMaxCardinalityRestriction description) { logger.trace("ObjectMaxCardinalityRestriction"); + if (query.endsWith("which is ")) query=query.substring(0, query.length()-3)+"has "; + query+="at most "+description.getCardinality()+" "+description.getRole().toString()+" which is "; + description.getChild(0).accept(this); } /* (non-Javadoc) @@ -237,6 +247,8 @@ */ public void visit(DatatypeValueRestriction description) { logger.trace("DatatypeValueRestriction"); + //if (query.endsWith("which is ")) query=query.substring(0, query.length()-3)+"has "; + query+=description.getRestrictedPropertyExpression().toString()+" has the value "+description.getValue(); } /* (non-Javadoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-23 07:02:03
|
Revision: 1406 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1406&view=rev Author: sknappe Date: 2008-10-23 07:01:53 +0000 (Thu, 23 Oct 2008) Log Message: ----------- manchesterSyntax as tooltip Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_learn_concepts.php Modified: trunk/src/dbpedia-navigator/ajax_learn_concepts.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-10-22 16:32:27 UTC (rev 1405) +++ trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-10-23 07:01:53 UTC (rev 1406) @@ -113,7 +113,8 @@ foreach ($concepts as $conc){ foreach ($conc as $con){ $label=$sc->getNaturalDescription($con['descriptionKBSyntax']); - $concept.="<tr><td><a href=\"\" onclick=\"getSubjectsFromConcept('kb=".htmlentities($con['descriptionKBSyntax'])."&number=10');return false;\" />".$label."</a></td></tr>"; + if (strlen($label)<=0) $label=$con['descriptionManchesterSyntax']; + $concept.="<tr><td><a href=\"\" onclick=\"getSubjectsFromConcept('kb=".htmlentities($con['descriptionKBSyntax'])."&number=10');return false;\" title=\"".$con['descriptionManchesterSyntax']."\"/>".$label."</a></td></tr>"; } } $concept.="</table>"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-22 16:32:32
|
Revision: 1405 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1405&view=rev Author: jenslehmann Date: 2008-10-22 16:32:27 +0000 (Wed, 22 Oct 2008) Log Message: ----------- continued EL refinement operator Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-10-22 12:35:04 UTC (rev 1404) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-10-22 16:32:27 UTC (rev 1405) @@ -115,7 +115,34 @@ // we need to update the set of nodes on a particular level tree.addNodeToLevel(this, level); - // TODO simulation update + // simulation update + // the nodes, which need to be updated + Set<ELDescriptionNode> update = new TreeSet<ELDescriptionNode>(); + + // loop over all nodes on the same level, which are not in the in set + Set<ELDescriptionNode> nodes = tree.getNodesOnLevel(level); + for(ELDescriptionNode w : nodes) { + if(w.label.size() == 0) { + + } + + if(inSC1.contains(w) && checkSC2(this, w)) { + extendSimulation(this, w); + update.add(w.parent); + } + } + + // loop over all nodes in out set + for(ELDescriptionNode w : out) { + if(!checkSC1(this, w)) { + shrinkSimulation(this, w); + update.add(w.parent); + } + } + + // apply updates recursively top-down + tree.updateSimulation(update); + } /** @@ -249,18 +276,45 @@ public void replaceInLabel(NamedClass oldClass, NamedClass newClass) { label.remove(oldClass); label.add(newClass); + labelSimulationUpdate(); + } + + /** + * Adds an entry to the node label. + * @param newClass Class to add to label. + */ + public void extendLabel(NamedClass newClass) { + label.add(newClass); + labelSimulationUpdate(); + } + + // simulation update when extending or refining label + // (same in both cases) + private void labelSimulationUpdate() { + // compute the nodes, which need to be updated + Set<ELDescriptionNode> update = new TreeSet<ELDescriptionNode>(); - // simulation update - - + // loop over all nodes on the same level, which are not in the in set Set<ELDescriptionNode> nodes = tree.getNodesOnLevel(level); Set<ELDescriptionNode> tmp = Helper.difference(nodes, in); - for(ELDescriptionNode node : tmp) { - if(isSublabel(label, node.label)) { - // TODO continue later + for(ELDescriptionNode w : tmp) { + // we only need to recompute SC2 + if(inSC1.contains(w) && checkSC2(this, w)) { + extendSimulation(this, w); + update.add(w.parent); } } + // loop over all nodes in out set + for(ELDescriptionNode w : out) { + if(!checkSC1(this, w)) { + shrinkSimulation(this, w); + update.add(w.parent); + } + } + + // apply updates recursively top-down + tree.updateSimulation(update); } // SC satisfied if both SC1 and SC2 satisfied @@ -335,16 +389,14 @@ private void extendSimulation(ELDescriptionNode node1, ELDescriptionNode node2) { node1.out.add(node2); node2.in.add(node1); + // TODO: SC1, SC2 sets ? } - /** - * Adds an entry to the node label. - * @param newClass Class to add to label. - */ - public void extendLabel(NamedClass newClass) { - label.add(newClass); - - // TODO simulation update + // removes (node1,node2) from simulation, takes care of all helper sets + private void shrinkSimulation(ELDescriptionNode node1, ELDescriptionNode node2) { + node1.out.remove(node2); + node2.in.remove(node1); + // TODO: SC1, SC2 sets ? } /** Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-10-22 12:35:04 UTC (rev 1404) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-10-22 16:32:27 UTC (rev 1405) @@ -221,6 +221,17 @@ return currentNode; } + protected void updateSimulation(Set<ELDescriptionNode> nUpdate) { +// for(ELDescriptionNode node : nodes) { +// +// } + Set<ELDescriptionNode> update; + while(nUpdate.size() != 0) { + update = nUpdate; // TODO: clone + + } + } + @Override public ELDescriptionTree clone() { // create a new reference tree This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-22 12:35:13
|
Revision: 1404 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1404&view=rev Author: jenslehmann Date: 2008-10-22 12:35:04 +0000 (Wed, 22 Oct 2008) Log Message: ----------- started DBpedia Navigator hasValue support Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertVisitor.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 11:43:59 UTC (rev 1403) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 12:35:04 UTC (rev 1404) @@ -13,6 +13,7 @@ import org.dllearner.core.owl.DatatypeValueRestriction; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.DescriptionVisitor; +import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; @@ -21,6 +22,7 @@ import org.dllearner.core.owl.ObjectExactCardinalityRestriction; import org.dllearner.core.owl.ObjectMaxCardinalityRestriction; import org.dllearner.core.owl.ObjectMinCardinalityRestriction; +import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.ObjectValueRestriction; import org.dllearner.core.owl.Thing; @@ -221,7 +223,13 @@ * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectValueRestriction) */ public void visit(ObjectValueRestriction description) { - logger.trace("ObjectValueRestriction"); + ObjectProperty op = (ObjectProperty) description.getRestrictedPropertyExpression(); + Individual ind = description.getIndividual(); + SortedSet<String> label = tasks.queryAsSet("SELECT ?label WHERE {<"+ind.getName()+"> <http://www.w3.org/2000/01/rdf-schema#label> ?label}", "label"); + String indLabel =label.first(); + label = tasks.queryAsSet("SELECT ?label WHERE {<"+op.getName()+"> <http://www.w3.org/2000/01/rdf-schema#label> ?label}", "label"); + String propLabel =label.first(); + query += propLabel + " is " + indLabel; } /* (non-Javadoc) Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertVisitor.java 2008-10-22 11:43:59 UTC (rev 1403) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryDescriptionConvertVisitor.java 2008-10-22 12:35:04 UTC (rev 1404) @@ -34,6 +34,7 @@ import org.dllearner.core.owl.DatatypeValueRestriction; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.DescriptionVisitor; +import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; @@ -42,6 +43,7 @@ import org.dllearner.core.owl.ObjectExactCardinalityRestriction; import org.dllearner.core.owl.ObjectMaxCardinalityRestriction; import org.dllearner.core.owl.ObjectMinCardinalityRestriction; +import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.ObjectValueRestriction; import org.dllearner.core.owl.Thing; @@ -301,7 +303,9 @@ * @see org.dllearner.core.owl.DescriptionVisitor#visit(org.dllearner.core.owl.ObjectValueRestriction) */ public void visit(ObjectValueRestriction description) { - logger.trace("ObjectValueRestriction"); + ObjectProperty op = (ObjectProperty) description.getRestrictedPropertyExpression(); + Individual ind = description.getIndividual(); + query+="?"+stack.peek()+" <"+op.getName()+"> <"+ind.getName()+">"; } /* (non-Javadoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 11:44:09
|
Revision: 1403 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1403&view=rev Author: sknappe Date: 2008-10-22 11:43:59 +0000 (Wed, 22 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-22 11:41:09 UTC (rev 1402) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 11:43:59 UTC (rev 1403) @@ -9,7 +9,7 @@ $final=''; $offset=0; - preg_match_all("/[^A-Z]([A-Z])/",$res,$treffer,PREG_OFFSET_CAPTURE); + preg_match_all("/[^-0\040A-Z]([A-Z])/",$res,$treffer,PREG_OFFSET_CAPTURE); foreach ($treffer[1] as $treff){ if ($res[$treff[1]-1]!=' '&&$res[$treff[1]-1]!='-'&&$treff[1]!=0){ $final.=substr($res,$offset,$treff[1]-$offset).' '; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 11:41:11
|
Revision: 1402 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1402&view=rev Author: sknappe Date: 2008-10-22 11:41:09 +0000 (Wed, 22 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 11:40:41 UTC (rev 1401) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 11:41:09 UTC (rev 1402) @@ -252,7 +252,7 @@ l=l.replaceAll("cities", "City"); l=l.replaceAll("Cities", "City"); - l=l.replaceAll("([^-0\040])([A-Z])", "$1 $2"); + l=l.replaceAll("([^-0\040A-Z])([A-Z])", "$1 $2"); if (l.toLowerCase().startsWith("a")||l.toLowerCase().startsWith("e")||l.toLowerCase().startsWith("i")||l.toLowerCase().startsWith("o")||l.toLowerCase().startsWith("u")) query+="an "+l; else query+="a "+l; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 11:40:54
|
Revision: 1401 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1401&view=rev Author: sknappe Date: 2008-10-22 11:40:41 +0000 (Wed, 22 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-22 11:39:17 UTC (rev 1400) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 11:40:41 UTC (rev 1401) @@ -7,11 +7,19 @@ } $res=utf8_to_html($res); - preg_match_all("/([A-Z])/",$res,$treffer,PREG_OFFSET_CAPTURE); - foreach ($treffer[0] as $treff){ - if ($res[$treff[1]-1]!=' '&&$res[$treff[1]-1]!='-'&&$treff[1]!=0) $res=substr($res,0,$treff[1]).' '.substr($res,$treff[1]); + $final=''; + $offset=0; + preg_match_all("/[^A-Z]([A-Z])/",$res,$treffer,PREG_OFFSET_CAPTURE); + foreach ($treffer[1] as $treff){ + if ($res[$treff[1]-1]!=' '&&$res[$treff[1]-1]!='-'&&$treff[1]!=0){ + $final.=substr($res,$offset,$treff[1]-$offset).' '; + $offset=$treff[1]; + } } + $final.=substr($res,$offset); + $res=$final; + //replacements $res=str_replace('cities','City',$res); $res=str_replace('Cities','City',$res); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-10-22 11:39:25
|
Revision: 1400 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1400&view=rev Author: jenslehmann Date: 2008-10-22 11:39:17 +0000 (Wed, 22 Oct 2008) Log Message: ----------- - moved DBpedia Navigator page rank calculator to scripts - integrated a simple ini reader to read DB configuration values Added Paths: ----------- trunk/lib/ini4j-0.3.2.jar trunk/resources/logos/DL-Learner2.svg trunk/src/dbpedia-navigator/settings.ini.dist trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java Removed Paths: ------------- trunk/src/dbpedia-navigator/CalculatePageRank.java trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java Property Changed: ---------------- trunk/src/dbpedia-navigator/ Added: trunk/lib/ini4j-0.3.2.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/ini4j-0.3.2.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/resources/logos/DL-Learner2.svg =================================================================== --- trunk/resources/logos/DL-Learner2.svg (rev 0) +++ trunk/resources/logos/DL-Learner2.svg 2008-10-22 11:39:17 UTC (rev 1400) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="210mm" height="297mm" id="svg2" sodipodi:version="0.32" inkscape:version="0.45.1" sodipodi:docbase="c:\Data\work\DL-Lerner" sodipodi:docname="DL-Learner.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.4329667" inkscape:cx="430.84137" inkscape:cy="985.67425" inkscape:document-units="px" inkscape:current-layer="layer1" inkscape:window-width="1400" inkscape:window-height="964" inkscape:window-x="-4" inkscape:window-y="-4" showguides="true" inkscape:guide-bbox="true"/> + <defs id="defs4"/> + <metadata id="metadata7"> + <rdf:RDF> + <cc:Work rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Ebene 1" id="layer1" inkscape:groupmode="layer"> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 172.79279,291.17739 C 155.51538,279.07582 149.17819,259.06513 147.67832,211.87443 C 146.91282,187.78924 150.80965,163.19822 143.23382,167.38534 C 136.23639,171.25277 75.153792,185.39046 70.978132,188.85594 C 61.136292,197.02394 44.781322,197.64857 28.594962,190.47464 C 16.313771,185.0315 11.922172,180.63825 8.0887989,169.96072 C 1.6224726,151.94936 8.2476549,130.08692 22.654819,121.89431 C 31.304862,116.97548 32.585932,114.07442 32.605632,99.360184 C 32.625492,84.520004 31.429722,81.851934 22.746321,77.361574 C 16.854053,74.314564 10.915664,66.862284 8.0375759,58.903064 C -1.8946914,31.435874 17.655616,3.669334 46.927412,3.669334 C 61.644322,3.669334 81.102252,14.503334 84.261252,24.456484 C 85.873312,29.535624 91.068792,32.151784 103.13775,33.961634 C 127.78529,37.657754 160.02473,46.894428 180.87021,62.946968 C 210.73114,85.942048 215.11542,135.19295 168.79316,160.30854 L 171.27428,140.18654 L 172.57326,203.1074 C 173.6854,248.10594 174.92379,257.4653 181.18305,268.17745 C 190.43421,284.00997 202.14008,286.27349 210.33237,273.77046 C 213.67216,268.6733 211.36,258.64117 214.90341,262.01102 C 218.68734,265.60961 207.5248,260.05346 200.64295,256.93706 C 174.89973,245.2794 173.72628,204.27373 198.70006,189.04425 C 220.65915,175.65318 254.6993,182.85534 260.20405,205.97932 C 265.03562,226.27545 275.96104,222.99092 275.96104,213.14683 C 275.96104,210.33806 278.2422,205.38873 281.33184,202.29908 C 286.25311,197.37783 304.83109,196.68155 431.2179,196.68155 C 557.60472,196.68155 576.18272,197.37783 581.10396,202.29908 C 584.19363,205.38873 586.35142,210.33806 586.35142,213.14683 C 586.35142,223.09383 597.51529,218.69176 603.00277,205.704 C 616.13114,174.63178 665.28303,174.92125 678.36309,206.22628 C 688.16844,229.69377 673.46416,258.51422 649.38044,263.03235 C 631.7908,266.33219 605.49899,256.46477 602.85337,240.92346 C 600.68994,228.21468 586.72151,224.15111 586.72151,233.96156 C 586.72151,236.77033 584.19363,241.5963 581.10396,244.68594 C 576.18272,249.60719 557.60472,250.30348 431.2179,250.30348 C 304.83109,250.30348 286.25311,249.60719 281.33184,244.68594 C 278.2422,241.5963 275.71431,236.77033 275.71431,233.96156 C 275.71431,231.15279 272.49699,228.8547 268.56472,228.8547 C 264.04427,228.8547 263.26559,231.2379 261.41513,235.33548 C 258.25561,242.33179 240.18123,252.51704 233.39986,261.97969 C 231.05045,265.25804 231.12476,267.09427 229.79305,270.79119 C 221.024,295.13464 201.17737,296.77581 190.44036,296.77581 C 185.13027,296.77581 177.18887,294.25652 172.79279,291.17739 z M 256.30608,216.43503 C 252.48547,196.06945 229.95289,182.73968 212.26169,190.37936 L 202.431,194.6246 L 215.6144,195.85562 C 225.99298,196.82475 229.03518,198.7548 229.91358,204.92739 C 230.62027,209.89336 233.97624,213.18667 239.06676,213.90968 C 248.0913,215.19144 252.63388,227.10648 249.09552,240.21478 C 247.26677,246.98967 247.92415,246.63514 252.67059,238.28672 C 256.49546,231.55925 257.74002,224.07862 256.30608,216.43503 z M 674.55712,216.43503 C 670.73652,196.06945 648.20395,182.73968 630.51274,190.37936 L 620.68206,194.6246 L 633.86543,195.85562 C 644.24404,196.82475 647.28622,198.7548 648.16462,204.92739 C 648.87132,209.89336 652.2273,213.18667 657.31781,213.90968 C 666.34235,215.19144 670.88491,227.10648 667.34657,240.21478 C 665.51782,246.98967 666.17519,246.63514 670.92166,238.28672 C 674.74651,231.55925 675.99108,224.07862 674.55712,216.43503 z M 81.141102,148.51392 C 77.320502,128.14835 54.787912,114.81857 37.096722,122.45825 L 27.266042,126.70349 L 40.449432,127.93452 C 50.828012,128.90364 53.870212,130.83369 54.748612,137.00629 C 55.455302,141.97225 58.811272,145.26556 63.901792,145.98858 C 72.926322,147.27034 77.468912,159.18537 73.930562,172.29368 C 72.101802,179.06856 72.759182,178.71403 77.505622,170.36562 C 81.330492,163.63814 82.575052,156.15752 81.141102,148.51392 z M 116.17614,160.7986 C 141.97051,151.14769 147.39833,144.70674 134.63678,138.89219 C 125.66504,134.80439 116.50452,117.88804 116.50452,106.57102 C 116.50452,103.76695 117.92812,93.442684 121.69207,85.652204 C 129.46763,69.558634 128.64401,68.476964 103.33419,61.542574 C 90.594212,58.052054 89.424242,58.506384 75.629532,72.301094 C 63.357522,84.573094 61.226592,88.936934 61.226592,101.79623 C 61.226592,114.50748 62.665802,117.54418 70.349332,121.04504 C 80.164802,125.51726 89.824952,144.35897 89.824952,159.03138 C 89.824952,169.96433 91.396792,170.06975 116.17614,160.7986 z M 191.95975,98.466804 C 188.13915,78.101214 156.53447,63.375738 138.84329,71.015418 C 127.06112,91.441957 120.37412,135.20415 152.64798,135.50575 C 158.06219,139.97 184.27568,137.04112 189.02213,128.69271 C 192.84699,121.96524 193.3937,106.11038 191.95975,98.466804 z M 81.141102,37.695274 C 77.320502,17.329704 54.787912,3.999934 37.096722,11.639604 L 27.266042,15.884844 L 40.449432,17.115874 C 50.828012,18.084994 53.870212,20.015054 54.748612,26.187634 C 55.455302,31.153604 58.811272,34.446914 63.901792,35.169934 C 72.926322,36.451694 77.468912,48.366724 73.930562,61.475034 C 72.101802,68.249904 72.759182,67.895384 77.505622,59.546974 C 81.330492,52.819494 82.575052,45.338874 81.141102,37.695274 z " id="path3320" sodipodi:nodetypes="cssssssssssssscccssssssssssssssssssssssssscccccsssscccccsssscccccssssccssssssssccccscccccssssc"/> + <text xml:space="preserve" style="font-size: 55.2859px; font-style: normal; font-weight: bold; fill: rgb(0, 0, 0); fill-opacity: 1; stroke: none; stroke-width: 1px; stroke-linecap: butt; stroke-linejoin: miter; stroke-opacity: 1; font-family: Arial;" x="200.904" y="335.529" id="text3326" transform="scale(1.42565, 0.701436)"><tspan sodipodi:role="line" id="tspan3328" x="200.904" y="335.529" style="fill: rgb(255, 255, 255); font-family: Arial;">Learner</tspan></text> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 618.73497,260.66384 C 587.45211,246.07999 588.77609,202.80526 618.8551,185.53936 C 628.83409,179.81123 645.538,176.88635 661.93157,186.1828 C 687.86039,200.88648 690.98611,234.12649 670.09714,254.1394 C 656.31104,267.34731 638.04764,269.66728 618.73497,260.66384 z M 675.78808,216.71692 C 671.75368,195.21171 647.96021,181.13602 629.27904,189.20321 L 618.89825,193.686 L 632.81937,194.98592 C 643.77872,196.00927 646.99116,198.04732 647.91871,204.56532 C 648.66495,209.80918 652.2087,213.28678 657.58408,214.05025 C 667.11362,215.40374 671.91039,227.98552 668.17404,241.82735 C 666.24296,248.98133 666.93712,248.60697 671.94916,239.79139 C 675.98807,232.68746 677.30227,224.78823 675.78808,216.71692 z " id="path3531" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 199.99989,259.9044 C 168.71703,245.32055 170.04101,202.04582 200.12002,184.77992 C 210.09901,179.05179 226.80292,176.12691 243.19649,185.42336 C 269.12531,200.12704 272.25103,233.36705 251.36206,253.37996 C 237.57596,266.58787 219.31256,268.90784 199.99989,259.9044 z M 257.053,215.95748 C 253.0186,194.45227 229.22513,180.37658 210.54396,188.44377 L 200.16317,192.92656 L 214.08429,194.22648 C 225.04364,195.24983 228.25608,197.28788 229.18363,203.80588 C 229.92987,209.04974 233.47362,212.52734 238.849,213.29081 C 248.37854,214.6443 253.17531,227.22608 249.43896,241.06791 C 247.50788,248.22189 248.20204,247.84753 253.21408,239.03195 C 257.25299,231.92802 258.56719,224.02879 257.053,215.95748 z " id="path3570" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 25.809737,196.24851 C -5.4731222,181.66466 -5.6295116,135.92265 26.423324,119.64366 C 36.682208,114.43338 53.106224,110.99065 69.499794,120.2871 C 95.428614,134.99078 98.554334,168.23079 77.665364,188.2437 C 63.879264,201.45161 45.122407,205.25195 25.809737,196.24851 z M 83.356304,150.82122 C 79.321904,129.31601 55.528434,115.24032 36.847264,123.30751 L 26.466474,127.7903 L 40.387594,129.09022 C 51.346944,130.11357 54.559384,132.15162 55.486934,138.66962 C 56.233174,143.91348 59.776924,147.39108 65.152304,148.15455 C 74.681844,149.50804 79.478614,162.08982 75.742264,175.93165 C 73.811184,183.08563 74.505344,182.71127 79.517384,173.89569 C 83.556294,166.79176 84.870494,158.89253 83.356304,150.82122 z " id="path3572" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 26.303191,83.246967 C -4.9796692,68.663117 -3.6556892,25.388387 26.423321,8.1224867 C 36.402311,2.3943567 53.106221,-0.53052327 69.499791,8.7659267 C 95.428611,23.469607 98.554331,56.709617 77.665361,76.722527 C 63.879261,89.930437 45.615861,92.250407 26.303191,83.246967 z M 83.356301,39.300047 C 79.321901,17.794837 55.528431,3.7191467 36.847261,11.786337 L 26.466471,16.269127 L 40.387591,17.569047 C 51.346941,18.592397 54.559381,20.630447 55.486931,27.148447 C 56.233171,32.392307 59.776921,35.869907 65.152301,36.633377 C 74.681841,37.986867 79.478611,50.568647 75.742261,64.410477 C 73.811181,71.564457 74.505341,71.190097 79.517381,62.374517 C 83.556291,55.270587 84.870491,47.371357 83.356301,39.300047 z " id="path3574" sodipodi:nodetypes="cssscccccssssc"/> + <path style="fill: rgb(11, 71, 157); fill-opacity: 1;" d="M 134.7439,150.90934 C 103.46104,135.36982 104.78502,89.259302 134.86403,70.861971 C 144.84302,64.758478 163.4906,62.697761 178.92741,71.547575 C 204.36449,86.130474 208.74046,123.50995 187.09298,143.95736 C 173.30688,156.9792 154.05657,160.50278 134.7439,150.90934 z M 191.79701,104.08259 C 187.76261,81.168148 163.96914,66.170081 145.28797,74.765912 L 134.90718,79.542459 L 148.8283,80.927562 C 159.78765,82.017972 163.00009,84.189575 163.92764,91.134698 C 164.67388,96.722187 168.21763,100.42767 173.59301,101.24117 C 183.12255,102.68336 187.91932,116.08962 184.18297,130.8385 C 182.25189,138.46128 182.94605,138.06239 187.95809,128.66913 C 191.997,121.09968 193.3112,112.68281 191.79701,104.08259 z " id="path3576" sodipodi:nodetypes="cssscccccssssc"/> + </g> +</svg> \ No newline at end of file Property changes on: trunk/src/dbpedia-navigator ___________________________________________________________________ Modified: svn:ignore - temp .htaccess main.wsdl def0.xsd def1.xsd test.html test.php + temp .htaccess main.wsdl def0.xsd def1.xsd test.html test.php settings.ini Deleted: trunk/src/dbpedia-navigator/CalculatePageRank.java =================================================================== --- trunk/src/dbpedia-navigator/CalculatePageRank.java 2008-10-22 11:20:08 UTC (rev 1399) +++ trunk/src/dbpedia-navigator/CalculatePageRank.java 2008-10-22 11:39:17 UTC (rev 1400) @@ -1,231 +0,0 @@ -package org.dllearner.test; - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.Statement; - -public class CalculatePageRank { - - private final String wikilinks="../pagelinks_en.nt"; - private final String labels="../articles_label_en.nt"; - private final String categories="../yago_en.nt"; - - private void calculateLinks() - { - try{ - Statement stmt; - ResultSet rs; - int number; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(wikilinks)); - - String line; - String[] split; - String name; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(" "); - name=split[2].substring(1, split[2].length()-1); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - number=rs.getInt(1); - number++; - stmt.executeUpdate("UPDATE rank SET number="+number+" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,number) VALUES ('"+name+"',1)"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void addLabels() - { - try{ - Statement stmt; - ResultSet rs; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(labels)); - - String line; - String[] split; - String name; - String label; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - stmt.executeUpdate("UPDATE rank SET label=\""+label+"\" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,label) VALUES ('"+name+"',\""+label+"\")"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void calculateCategories() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("ALTER TABLE rank DROP COLUMN category"); - - BufferedReader in = new BufferedReader(new FileReader(categories)); - - String line; - String[] split; - String name; - String label; - String pred; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - pred=split[1].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")) - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - else - label=split[2].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ - try{ - stmt.executeUpdate("INSERT INTO categories (category,label) VALUES (\""+name+"\",\""+label+"\")"); - }catch(Exception e) - {} - } - else{ - if (name.startsWith("http://dbpedia.org/resource")){ - try{ - stmt.executeUpdate("INSERT INTO articlecategories (name,category) VALUES ('"+name+"','"+label+"')"); - }catch(Exception e) - {} - }else{ - try{ - stmt.executeUpdate("INSERT INTO classhierarchy (father,child) VALUES ('"+label+"','"+name+"')"); - }catch(Exception e) - {} - } - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void copyNumbers() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("UPDATE articlecategories SET number=(SELECT number FROM rank WHERE articlecategories.name=rank.name)"); - - con.close(); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - public static void main(String[] args){ - CalculatePageRank cal=new CalculatePageRank(); - cal.calculateLinks(); - cal.addLabels(); - cal.calculateCategories(); - cal.copyNumbers(); - } -} \ No newline at end of file Added: trunk/src/dbpedia-navigator/settings.ini.dist =================================================================== --- trunk/src/dbpedia-navigator/settings.ini.dist (rev 0) +++ trunk/src/dbpedia-navigator/settings.ini.dist 2008-10-22 11:39:17 UTC (rev 1400) @@ -0,0 +1,20 @@ +[general] +wsdluri = http://localhost:8181/services?wsdl + +; URI pointing to DBpedia SPARQL endpoint +dbpediauri = http://dbpedia.openlinksw.com:8890/sparql + +; which predefined endpoint settings to use in DL-Learner +endpoint = DBPEDIA + +[database] +; the type of database server +type = mysql +; the server, where the mysql database is located +server = localhost +; the user, that has rights to access the navigator database +user = navigator +; the password of that user +pass = dbpedia +; the name of the used database +name = navigator_db Copied: trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java (from rev 1396, trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/CalculatePageRank.java 2008-10-22 11:39:17 UTC (rev 1400) @@ -0,0 +1,280 @@ +/** + * 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.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.prefs.BackingStoreException; +import java.util.prefs.Preferences; + +import org.ini4j.IniFile; + +/** + * Fills that database needed for running DBpedia Navigator. + * First move the mentioned DBpedia files to the specified + * directory, then execute this script. Database settings are + * taken from the settings.ini file of DBpedia Navigator. + * + * @author Sebastian Knappe + * @author Jens Lehmann + * + */ +public class CalculatePageRank { + + private final String datasetDir = "src/dbpedia-navigator/data/"; + private final String wikilinks = datasetDir + "pagelinks_en.nt"; + private final String labels = datasetDir + "articles_label_en.nt"; + private final String categories = datasetDir + "yago_en.nt"; + + private static String dbServer; + private static String dbName; + private static String dbUser; + private static String dbPass; + + private void calculateLinks() + { + try{ + Statement stmt; + ResultSet rs; + int number; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://"+dbServer+":3306/"+dbName; + + Connection con = DriverManager.getConnection( + url, dbUser, dbPass); + + stmt = con.createStatement(); + BufferedReader in = new BufferedReader(new FileReader(wikilinks)); + + String line; + String[] split; + String name; + int i=0; + while ((line=in.readLine())!=null) + { + split=line.split(" "); + name=split[2].substring(1, split[2].length()-1); + rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); + if (rs.next()){ + number=rs.getInt(1); + number++; + stmt.executeUpdate("UPDATE rank SET number="+number+" WHERE name='"+name+"'"); + } + else{ + try{ + stmt.executeUpdate("INSERT INTO rank (name,number) VALUES ('"+name+"',1)"); + }catch(Exception e) + {} + } + if (i%100000==0) System.out.println(i); + i++; + } + + in.close(); + con.close(); + } catch (FileNotFoundException e) + { + System.out.println("File not found"); + } catch (IOException e) + { + System.out.println("IOException"); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + private void addLabels() + { + try{ + Statement stmt; + ResultSet rs; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://localhost:3306/navigator_db"; + + Connection con = DriverManager.getConnection( + url,"navigator", "dbpedia"); + + stmt = con.createStatement(); + BufferedReader in = new BufferedReader(new FileReader(labels)); + + String line; + String[] split; + String name; + String label; + int i=0; + while ((line=in.readLine())!=null) + { + split=line.split(">"); + name=split[0].substring(1); + label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); + rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); + if (rs.next()){ + stmt.executeUpdate("UPDATE rank SET label=\""+label+"\" WHERE name='"+name+"'"); + } + else{ + try{ + stmt.executeUpdate("INSERT INTO rank (name,label) VALUES ('"+name+"',\""+label+"\")"); + }catch(Exception e) + {} + } + if (i%100000==0) System.out.println(i); + i++; + } + + in.close(); + con.close(); + } catch (FileNotFoundException e) + { + System.out.println("File not found"); + } catch (IOException e) + { + System.out.println("IOException"); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + private void calculateCategories() + { + try{ + Statement stmt; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://localhost:3306/navigator_db"; + + Connection con = DriverManager.getConnection( + url,"navigator", "dbpedia"); + + stmt = con.createStatement(); + + stmt.executeUpdate("ALTER TABLE rank DROP COLUMN category"); + + BufferedReader in = new BufferedReader(new FileReader(categories)); + + String line; + String[] split; + String name; + String label; + String pred; + int i=0; + while ((line=in.readLine())!=null) + { + split=line.split(">"); + name=split[0].substring(1); + pred=split[1].substring(2); + if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")) + label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); + else + label=split[2].substring(2); + if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ + try{ + stmt.executeUpdate("INSERT INTO categories (category,label) VALUES (\""+name+"\",\""+label+"\")"); + }catch(Exception e) + {} + } + else{ + if (name.startsWith("http://dbpedia.org/resource")){ + try{ + stmt.executeUpdate("INSERT INTO articlecategories (name,category) VALUES ('"+name+"','"+label+"')"); + }catch(Exception e) + {} + }else{ + try{ + stmt.executeUpdate("INSERT INTO classhierarchy (father,child) VALUES ('"+label+"','"+name+"')"); + }catch(Exception e) + {} + } + } + if (i%100000==0) System.out.println(i); + i++; + } + + in.close(); + con.close(); + } catch (FileNotFoundException e) + { + System.out.println("File not found"); + } catch (IOException e) + { + System.out.println("IOException"); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + private void copyNumbers() + { + try{ + Statement stmt; + + Class.forName("com.mysql.jdbc.Driver"); + + String url = + "jdbc:mysql://localhost:3306/navigator_db"; + + Connection con = DriverManager.getConnection( + url,"navigator", "dbpedia"); + + stmt = con.createStatement(); + + stmt.executeUpdate("UPDATE articlecategories SET number=(SELECT number FROM rank WHERE articlecategories.name=rank.name)"); + + con.close(); + } catch (Exception e) + { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws BackingStoreException{ + + // reading values from ini file + String iniFile = "src/dbpedia-navigator/settings.ini"; + Preferences prefs = new IniFile(new File(iniFile)); + dbServer = prefs.node("database").get("name", null); + dbName = prefs.node("database").get("name", null); + dbUser = prefs.node("database").get("user", null); + dbPass = prefs.node("database").get("pass", null); + + CalculatePageRank cal=new CalculatePageRank(); + cal.calculateLinks(); + cal.addLabels(); + cal.calculateCategories(); + cal.copyNumbers(); + } +} \ No newline at end of file Deleted: trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java 2008-10-22 11:20:08 UTC (rev 1399) +++ trunk/src/dl-learner/org/dllearner/test/CalculatePageRank.java 2008-10-22 11:39:17 UTC (rev 1400) @@ -1,231 +0,0 @@ -package org.dllearner.test; - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.Statement; - -public class CalculatePageRank { - - private final String wikilinks="../pagelinks_en.nt"; - private final String labels="../articles_label_en.nt"; - private final String categories="../yago_en.nt"; - - private void calculateLinks() - { - try{ - Statement stmt; - ResultSet rs; - int number; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(wikilinks)); - - String line; - String[] split; - String name; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(" "); - name=split[2].substring(1, split[2].length()-1); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - number=rs.getInt(1); - number++; - stmt.executeUpdate("UPDATE rank SET number="+number+" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,number) VALUES ('"+name+"',1)"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void addLabels() - { - try{ - Statement stmt; - ResultSet rs; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - BufferedReader in = new BufferedReader(new FileReader(labels)); - - String line; - String[] split; - String name; - String label; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - rs=stmt.executeQuery("SELECT number FROM rank WHERE name='"+name+"'"); - if (rs.next()){ - stmt.executeUpdate("UPDATE rank SET label=\""+label+"\" WHERE name='"+name+"'"); - } - else{ - try{ - stmt.executeUpdate("INSERT INTO rank (name,label) VALUES ('"+name+"',\""+label+"\")"); - }catch(Exception e) - {} - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void calculateCategories() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("ALTER TABLE rank DROP COLUMN category"); - - BufferedReader in = new BufferedReader(new FileReader(categories)); - - String line; - String[] split; - String name; - String label; - String pred; - int i=0; - while ((line=in.readLine())!=null) - { - split=line.split(">"); - name=split[0].substring(1); - pred=split[1].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")) - label=split[2].substring(split[2].indexOf("\"")+1, split[2].lastIndexOf("\"")); - else - label=split[2].substring(2); - if (pred.equals("http://www.w3.org/2000/01/rdf-schema#label")){ - try{ - stmt.executeUpdate("INSERT INTO categories (category,label) VALUES (\""+name+"\",\""+label+"\")"); - }catch(Exception e) - {} - } - else{ - if (name.startsWith("http://dbpedia.org/resource")){ - try{ - stmt.executeUpdate("INSERT INTO articlecategories (name,category) VALUES ('"+name+"','"+label+"')"); - }catch(Exception e) - {} - }else{ - try{ - stmt.executeUpdate("INSERT INTO classhierarchy (father,child) VALUES ('"+label+"','"+name+"')"); - }catch(Exception e) - {} - } - } - if (i%100000==0) System.out.println(i); - i++; - } - - in.close(); - con.close(); - } catch (FileNotFoundException e) - { - System.out.println("File not found"); - } catch (IOException e) - { - System.out.println("IOException"); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - private void copyNumbers() - { - try{ - Statement stmt; - - Class.forName("com.mysql.jdbc.Driver"); - - String url = - "jdbc:mysql://localhost:3306/navigator_db"; - - Connection con = DriverManager.getConnection( - url,"navigator", "dbpedia"); - - stmt = con.createStatement(); - - stmt.executeUpdate("UPDATE articlecategories SET number=(SELECT number FROM rank WHERE articlecategories.name=rank.name)"); - - con.close(); - } catch (Exception e) - { - e.printStackTrace(); - } - } - - public static void main(String[] args){ - CalculatePageRank cal=new CalculatePageRank(); - cal.calculateLinks(); - cal.addLabels(); - cal.calculateCategories(); - cal.copyNumbers(); - } -} \ 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-22 11:20:21
|
Revision: 1399 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1399&view=rev Author: sknappe Date: 2008-10-22 11:20:08 +0000 (Wed, 22 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-22 11:00:47 UTC (rev 1398) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 11:20:08 UTC (rev 1399) @@ -66,6 +66,7 @@ $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.='<br/><br/>'; return $ret; } Modified: trunk/src/dbpedia-navigator/js/navigator.js =================================================================== --- trunk/src/dbpedia-navigator/js/navigator.js 2008-10-22 11:00:47 UTC (rev 1398) +++ trunk/src/dbpedia-navigator/js/navigator.js 2008-10-22 11:20:08 UTC (rev 1399) @@ -30,9 +30,9 @@ var names; var hasClass; - if (class='all') document.getElementById('FilterTags').innerHTML='You currently don\'t filter your search results.'; - else document.getElementById('FilterTags').innerHTML='You filter your search results by class '+label+'.'; - + if (class=='all') document.getElementById('FilterTags').innerHTML='You currently don\'t filter your search results.'; + else document.getElementById('FilterTags').innerHTML='Filtered by class: '+label+'.'; + for (var i=0;i<links.length;i++){ if (class=='all'){ if ((j+1)>number&&j<(number+25)) links[i].style.display='block'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 11:01:01
|
Revision: 1398 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1398&view=rev Author: sknappe Date: 2008-10-22 11:00:47 +0000 (Wed, 22 Oct 2008) Log Message: ----------- changed labels Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 11:00:26 UTC (rev 1397) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 11:00:47 UTC (rev 1398) @@ -84,7 +84,7 @@ */ public static void main(String[] args) { try { - SortedSet<String> s = new TreeSet<String>(); + /*SortedSet<String> s = new TreeSet<String>(); HashMap<String,String> result = new HashMap<String,String>(); String conj="(\"http://dbpedia.org/class/yago/Person100007846\" AND \"http://dbpedia.org/class/yago/Head110162991\")"; s.add("EXISTS \"http://dbpedia.org/property/disambiguates\".TOP"); @@ -106,7 +106,9 @@ System.out.println("Query:\n"+result.get(string)); System.out.println("************************"); } - System.out.println("Finished"); + System.out.println("Finished");*/ + String conj="\"http://dbpedia.org/class/yago/PlannedCities\""; + System.out.println(NaturalLanguageDescriptionConvertVisitor.getNaturalLanguageDescription(conj, "DBPEDIA")); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -245,6 +247,13 @@ String l=label.first(); String l2=description.getName().substring(description.getName().lastIndexOf("/")+1, description.getName().length()).replace('_', ' '); if (l.length()+5<l2.length()&&!l2.matches(".*[0-9]")) l=l2; + + //replacements + l=l.replaceAll("cities", "City"); + l=l.replaceAll("Cities", "City"); + + l=l.replaceAll("([^-0\040])([A-Z])", "$1 $2"); + if (l.toLowerCase().startsWith("a")||l.toLowerCase().startsWith("e")||l.toLowerCase().startsWith("i")||l.toLowerCase().startsWith("o")||l.toLowerCase().startsWith("u")) query+="an "+l; else query+="a "+l; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 11:00:31
|
Revision: 1397 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1397&view=rev Author: sknappe Date: 2008-10-22 11:00:26 +0000 (Wed, 22 Oct 2008) Log Message: ----------- changed tag-cloud and labels Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_class.php trunk/src/dbpedia-navigator/helper_functions.php trunk/src/dbpedia-navigator/js/navigator.js Modified: trunk/src/dbpedia-navigator/ajax_get_class.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 07:40:12 UTC (rev 1396) +++ trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 11:00:26 UTC (rev 1397) @@ -50,10 +50,7 @@ $query="SELECT label FROM categories WHERE category='".$result['child']."' LIMIT 1"; $res2=$databaseConnection->query($query); $result2=$databaseConnection->nextEntry($res2); - $identify=urldecode(str_replace("_"," ",substr (strrchr ($result['child'], "/"), 1))); - if (strlen($result2['label'])>strlen($identify)-3||preg_match('/[0-9]$/',$identify)===1){ - $identify=$result2['label']; - } + $identify=getLabel($result['child'],$result2['label']); if (strlen($identify)>100) $identify=substr($identify,0,100); $childClasses.='<option value="'.$result['child'].'">'.utf8_to_html($identify).'</option>'; } @@ -69,10 +66,7 @@ $query="SELECT label FROM categories WHERE category='".$result['father']."' LIMIT 1"; $res2=$databaseConnection->query($query); $result2=$databaseConnection->nextEntry($res2); - $identify=urldecode(str_replace("_"," ",substr (strrchr ($result['father'], "/"), 1))); - if (strlen($result2['label'])>strlen($identify)-3||preg_match('/[0-9]$/',$identify)===1){ - $identify=$result2['label']; - } + $identify=getLabel($result['father'],$result2['label']); if (strlen($identify)>100) $identify=substr($identify,0,100); $fatherClasses.='<option value="'.$result['father'].'">'.utf8_to_html($identify).'</option>'; } @@ -83,10 +77,7 @@ $query="SELECT label FROM categories WHERE category='$class' LIMIT 1"; $res=$databaseConnection->query($query); $result=$databaseConnection->nextEntry($res); - $title=urldecode(str_replace("_"," ",substr (strrchr ($class, "/"), 1))); - if (strlen($result['label'])>strlen($title)-3||preg_match('/[0-9]$/',$title)===1){ - $title=$result['label']; - } + $title=getLabel($class,$result['label']); $content.=getClassView($fatherClasses,$childClasses,$title,$class); Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 07:40:12 UTC (rev 1396) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 11:00:26 UTC (rev 1397) @@ -1,4 +1,24 @@ <?php +function getLabel($uri,$label) +{ + $res=urldecode(str_replace("_"," ",substr (strrchr ($uri, "/"), 1))); + if (strlen($label)>strlen($res)-5||preg_match('/[0-9]$/',$res)===1){ + $res=$label; + } + $res=utf8_to_html($res); + + preg_match_all("/([A-Z])/",$res,$treffer,PREG_OFFSET_CAPTURE); + foreach ($treffer[0] as $treff){ + if ($res[$treff[1]-1]!=' '&&$res[$treff[1]-1]!='-'&&$treff[1]!=0) $res=substr($res,0,$treff[1]).' '.substr($res,$treff[1]); + } + + //replacements + $res=str_replace('cities','City',$res); + $res=str_replace('Cities','City',$res); + + return $res; +} + function subjectToURI($subject) { //if the subject is already a URI return it @@ -31,29 +51,27 @@ $distribution=$diff/3; $ret="<p>"; - $ret.='<a style="font-size:xx-large;" href="#" onclick="document.getElementById(\'hidden_class\').value=\'all\';show_results(\'all\',document.getElementById(\'hidden_number\').value);">All</a> '; - if ($nc) $ret.='<a style="font-size:xx-small;" href="#" onclick="document.getElementById(\'hidden_class\').value=\'NoCategory\';show_results(\'NoCategory\',document.getElementById(\'hidden_number\').value);">No Category</a> '; foreach ($tags as $tag=>$count){ - if ($count==$min) $style="font-size:xx-small;"; - else if ($count==$max) $style="font-size:xx-large;"; - else if ($count>($min+2*$distribution)) $style="font-size:large;"; - else if ($count>($min+$distribution)) $style="font-size:medium;"; - else $style="font-size:small;"; + if ($count==$min) $style="font-size:9px;"; + else if ($count==$max) $style="font-size:17px;"; + else if ($count>($min+2*$distribution)) $style="font-size:15px;"; + else if ($count>($min+$distribution)) $style="font-size:13px;"; + else $style="font-size:11px;"; - $lab=urldecode(str_replace("_"," ",substr (strrchr ($tag, "/"), 1))); - if (strlen($label[$tag])>strlen($lab)-3||preg_match('/[0-9]/',$lab)===1){ - $lab=$label[$tag]; - } + $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.'\',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.'\',\''.utf8_to_html($lab).'\',document.getElementById(\'hidden_number\').value);">'.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> '; return $ret; } function getResultsTable($names,$labels,$classes,$number) { - $ret="<p>These are the results of your search. Show best "; + $ret="<p>You got ".count($names)." results. Show best "; for ($k=10;$k<125;){ $ret.="<a href=\"#\" onclick=\"search_it('label='+document.getElementById('label').value+'&number=".$k."');return false;\""; if ($k==$number) $ret.=" style=\"text-decoration:none;\""; @@ -119,7 +137,7 @@ function getCategoryResultsTable($names,$labels,$category,$number) { - $ret="<p>These are your the results of your search. Show best "; + $ret="<p>You got ".count($names)." results. Show best "; for ($k=10;$k<125;){ $ret.="<a href=\"#\" onclick=\"getSubjectsFromCategory('category=".$category."&number=".$k."');return false;\""; if ($k==$number) $ret.=" style=\"text-decoration:none;\""; @@ -162,7 +180,7 @@ function getConceptResultsTable($names,$labels,$kb,$number) { - $ret="<p>These are your results. Show best "; + $ret="<p>You got ".count($names)." results. Show best "; for ($k=10;$k<125;){ $ret.="<a href=\"#\" onclick=\"getSubjectsFromConcept('kb=".$kb."&number=".$k."');return false;\""; if ($k==$number) $ret.=" style=\"text-decoration:none;\""; @@ -370,10 +388,7 @@ $query="SELECT label FROM categories WHERE category='".$ar[$i]['value']."' LIMIT 1"; $res=$databaseConnection->query($query); $result=$databaseConnection->nextEntry($res); - $label=urldecode(str_replace("_"," ",substr (strrchr ($ar[$i]['value'], "/"), 1))); - if (strlen($result['label'])>strlen($label)-3||preg_match('/[0-9]$/',$label)===1){ - $label=$result['label']; - } + $label=getLabel($ar[$i]['value'],$result['label']); $label=utf8_to_html($label); $string .= '<li>' . formatClass($ar[$i]['value'],$label).'</li>'; } Modified: trunk/src/dbpedia-navigator/js/navigator.js =================================================================== --- trunk/src/dbpedia-navigator/js/navigator.js 2008-10-22 07:40:12 UTC (rev 1396) +++ trunk/src/dbpedia-navigator/js/navigator.js 2008-10-22 11:00:26 UTC (rev 1397) @@ -23,12 +23,16 @@ } } -function show_results(class, number) +function show_results(class, label, number) { var links=document.getElementById('results').getElementsByTagName('p'); var j=0; var names; var hasClass; + + if (class='all') document.getElementById('FilterTags').innerHTML='You currently don\'t filter your search results.'; + else document.getElementById('FilterTags').innerHTML='You filter your search results by class '+label+'.'; + for (var i=0;i<links.length;i++){ if (class=='all'){ if ((j+1)>number&&j<(number+25)) links[i].style.display='block'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 07:40:18
|
Revision: 1396 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1396&view=rev Author: sknappe Date: 2008-10-22 07:40:12 +0000 (Wed, 22 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_class.php Modified: trunk/src/dbpedia-navigator/ajax_get_class.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 07:37:17 UTC (rev 1395) +++ trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 07:40:12 UTC (rev 1396) @@ -86,7 +86,7 @@ $title=urldecode(str_replace("_"," ",substr (strrchr ($class, "/"), 1))); if (strlen($result['label'])>strlen($title)-3||preg_match('/[0-9]$/',$title)===1){ $title=$result['label']; - }\xB4 + } $content.=getClassView($fatherClasses,$childClasses,$title,$class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 07:37:21
|
Revision: 1395 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1395&view=rev Author: sknappe Date: 2008-10-22 07:37:17 +0000 (Wed, 22 Oct 2008) Log Message: ----------- better titles for classview Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_class.php trunk/src/dbpedia-navigator/helper_functions.php Modified: trunk/src/dbpedia-navigator/ajax_get_class.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 07:26:37 UTC (rev 1394) +++ trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 07:37:17 UTC (rev 1395) @@ -51,8 +51,11 @@ $res2=$databaseConnection->query($query); $result2=$databaseConnection->nextEntry($res2); $identify=urldecode(str_replace("_"," ",substr (strrchr ($result['child'], "/"), 1))); - if ((strlen($identify)+strlen($result2['label']))>100) $identify=substr($identify,0,100-strlen($result2['label'])); - $childClasses.='<option value="'.$result['child'].'">'.utf8_to_html($result2['label']).' ('.$identify.')</option>'; + if (strlen($result2['label'])>strlen($identify)-3||preg_match('/[0-9]$/',$identify)===1){ + $identify=$result2['label']; + } + if (strlen($identify)>100) $identify=substr($identify,0,100); + $childClasses.='<option value="'.$result['child'].'">'.utf8_to_html($identify).'</option>'; } if (strlen($childClasses)>0) $childClasses='<select size="1" style="width:500px" id="childSelect">'.$childClasses.'</select>'; @@ -67,8 +70,11 @@ $res2=$databaseConnection->query($query); $result2=$databaseConnection->nextEntry($res2); $identify=urldecode(str_replace("_"," ",substr (strrchr ($result['father'], "/"), 1))); - if ((strlen($identify)+strlen($result2['label']))>100) $identify=substr($identify,0,100-strlen($result2['label'])); - $fatherClasses.='<option value="'.$result['father'].'">'.utf8_to_html($result2['label']).' ('.$identify.')</option>'; + if (strlen($result2['label'])>strlen($identify)-3||preg_match('/[0-9]$/',$identify)===1){ + $identify=$result2['label']; + } + if (strlen($identify)>100) $identify=substr($identify,0,100); + $fatherClasses.='<option value="'.$result['father'].'">'.utf8_to_html($identify).'</option>'; } if (strlen($fatherClasses)>0) $fatherClasses='<select size="1" style="width:500px" id="fatherSelect">'.$fatherClasses.'</select>'; @@ -77,8 +83,11 @@ $query="SELECT label FROM categories WHERE category='$class' LIMIT 1"; $res=$databaseConnection->query($query); $result=$databaseConnection->nextEntry($res); - $title=$result['label']; - + $title=urldecode(str_replace("_"," ",substr (strrchr ($class, "/"), 1))); + if (strlen($result['label'])>strlen($title)-3||preg_match('/[0-9]$/',$title)===1){ + $title=$result['label']; + }\xB4 + $content.=getClassView($fatherClasses,$childClasses,$title,$class); //Restart the Session @@ -111,7 +120,7 @@ if (isset($_SESSION['classes'])){ foreach ($_SESSION['classes'] as $key => $value) { - $lastClasses.="<a href=\"\" onclick=\"get_class('class=&cache=".$key."');return false;\">".$value['title']." (".urldecode(str_replace("_"," ",substr (strrchr ($value['uri'], "/"), 1))).")</a><br/>"; + $lastClasses.="<a href=\"\" onclick=\"get_class('class=".$value['uri']."&cache=".$key."');return false;\">".$value['title']."</a><br/>"; } } Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 07:26:37 UTC (rev 1394) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 07:37:17 UTC (rev 1395) @@ -434,7 +434,7 @@ $ret.='<tr style="height:20px"><td><hr/></td></tr>'; $ret.='<tr><td style="font-size:14px;"><b>Current class</b></td></tr>'; $ret.='<tr style="height:10px"><td></td></tr>'; - $ret.='<tr><td><b>'.$title.'</b> ('.urldecode(str_replace("_"," ",substr (strrchr ($class, "/"), 1))).')</td></tr>'; + $ret.='<tr><td><b>'.$title.'</b></td></tr>'; $ret.='<tr style="height:10px"><td></td></tr>'; $ret.='<tr><td>'; $ret.='<input style="width:70px" type="button" value="Instances" class="button" onclick="getSubjectsFromCategory(\'category='.$class.'&number=10\');" title="Search Instances of Shown class."/>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 07:26:50
|
Revision: 1394 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1394&view=rev Author: sknappe Date: 2008-10-22 07:26:37 +0000 (Wed, 22 Oct 2008) Log Message: ----------- added fatherclass to last classes Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_class.php Modified: trunk/src/dbpedia-navigator/ajax_get_class.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 07:23:14 UTC (rev 1393) +++ trunk/src/dbpedia-navigator/ajax_get_class.php 2008-10-22 07:26:37 UTC (rev 1394) @@ -111,7 +111,7 @@ if (isset($_SESSION['classes'])){ foreach ($_SESSION['classes'] as $key => $value) { - $lastClasses.="<a href=\"\" onclick=\"get_class('class=&cache=".$key."');return false;\">".$value['title']."</a><br/>"; + $lastClasses.="<a href=\"\" onclick=\"get_class('class=&cache=".$key."');return false;\">".$value['title']." (".urldecode(str_replace("_"," ",substr (strrchr ($value['uri'], "/"), 1))).")</a><br/>"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 07:23:23
|
Revision: 1393 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1393&view=rev Author: sknappe Date: 2008-10-22 07:23:14 +0000 (Wed, 22 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-22 07:20:20 UTC (rev 1392) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-22 07:23:14 UTC (rev 1393) @@ -414,7 +414,7 @@ if (isset($_SESSION['articles'])){ foreach ($_SESSION['articles'] as $key => $value) { - $lastArticles.="<a href=\"\" onclick=\"get_article('label=\'".$value['subject']."\'&cache=".$key."');return false;\">".$value['subject']."</a><br/>"; + $lastArticles.="<a href=\"\" onclick=\"get_article('label=".$value['subject']."&cache=".$key."');return false;\">".$value['subject']."</a><br/>"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 07:20:31
|
Revision: 1392 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1392&view=rev Author: sknappe Date: 2008-10-22 07:20:20 +0000 (Wed, 22 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-22 06:51:21 UTC (rev 1391) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-22 07:20:20 UTC (rev 1392) @@ -324,6 +324,20 @@ if (isset($triples['http://dbpedia.org/property/footballPlayerStatistics3Property'])) unset($triples['http://dbpedia.org/property/footballPlayerStatistics3Property']); if (isset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before'])) unset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before']); if (isset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title'])) unset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title']); + if (isset($triples['http://dbpedia.org/property/accessdate'])) unset($triples['http://dbpedia.org/property/accessdate']); + if (isset($triples['http://dbpedia.org/property/state'])) unset($triples['http://dbpedia.org/property/state']); + if (isset($triples['http://dbpedia.org/property/coordinates'])) unset($triples['http://dbpedia.org/property/coordinates']); + if (isset($triples['http://dbpedia.org/property/lga'])) unset($triples['http://dbpedia.org/property/lga']); + if (isset($triples['http://dbpedia.org/property/fedgov'])) unset($triples['http://dbpedia.org/property/fedgov']); + if (isset($triples['http://dbpedia.org/property/dist'])) unset($triples['http://dbpedia.org/property/dist']); + if (isset($triples['http://dbpedia.org/property/dir'])) unset($triples['http://dbpedia.org/property/dir']); + if (isset($triples['http://dbpedia.org/property/float'])) unset($triples['http://dbpedia.org/property/float']); + if (isset($triples['http://dbpedia.org/property/left'])) unset($triples['http://dbpedia.org/property/left']); + if (isset($triples['http://dbpedia.org/property/quick'])) unset($triples['http://dbpedia.org/property/quick']); + if (isset($triples['http://dbpedia.org/property/clear'])) unset($triples['http://dbpedia.org/property/clear']); + if (isset($triples['http://dbpedia.org/property/utc'])) unset($triples['http://dbpedia.org/property/utc']); + if (isset($triples['http://dbpedia.org/property/utcDst'])) unset($triples['http://dbpedia.org/property/utcDst']); + if (isset($triples['http://dbpedia.org/property/spokenWikipedia2Property'])) unset($triples['http://dbpedia.org/property/spokenWikipedia2Property']); if (count($triples)>0){ @@ -400,7 +414,7 @@ if (isset($_SESSION['articles'])){ foreach ($_SESSION['articles'] as $key => $value) { - $lastArticles.="<a href=\"\" onclick=\"get_article('label=&cache=".$key."');return false;\">".$value['subject']."</a><br/>"; + $lastArticles.="<a href=\"\" onclick=\"get_article('label=\'".$value['subject']."\'&cache=".$key."');return false;\">".$value['subject']."</a><br/>"; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 06:51:27
|
Revision: 1391 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1391&view=rev Author: sknappe Date: 2008-10-22 06:51:21 +0000 (Wed, 22 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-22 06:47:41 UTC (rev 1390) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-22 06:51:21 UTC (rev 1391) @@ -322,8 +322,8 @@ if (isset($triples['http://dbpedia.org/property/ntupdate'])) unset($triples['http://dbpedia.org/property/ntupdate']); if (isset($triples['http://dbpedia.org/property/footballPlayerStatistics2Property'])) unset($triples['http://dbpedia.org/property/footballPlayerStatistics2Property']); if (isset($triples['http://dbpedia.org/property/footballPlayerStatistics3Property'])) unset($triples['http://dbpedia.org/property/footballPlayerStatistics3Property']); - if (isset($triples['http://dbpedia.org/property/is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before_of'])) unset($triples['is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before_of']); - if (isset($triples['http://dbpedia.org/property/is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title_of'])) unset($triples['is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title_of']); + if (isset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before'])) unset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before']); + if (isset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title'])) unset($triples['http://dbpedia.org/property/_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title']); if (count($triples)>0){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 06:47:49
|
Revision: 1390 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1390&view=rev Author: sknappe Date: 2008-10-22 06:47:41 +0000 (Wed, 22 Oct 2008) Log Message: ----------- bugfix Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 06:43:16 UTC (rev 1389) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 06:47:41 UTC (rev 1390) @@ -244,7 +244,7 @@ SortedSet<String> label=tasks.queryAsSet("SELECT ?label WHERE {<"+description.getName()+"> <http://www.w3.org/2000/01/rdf-schema#label> ?label}", "label"); String l=label.first(); String l2=description.getName().substring(description.getName().lastIndexOf("/")+1, description.getName().length()).replace('_', ' '); - if (l.length()+3<l2.length()&&!l2.matches(".*[0-9]")) l=l2; + if (l.length()+5<l2.length()&&!l2.matches(".*[0-9]")) l=l2; if (l.toLowerCase().startsWith("a")||l.toLowerCase().startsWith("e")||l.toLowerCase().startsWith("i")||l.toLowerCase().startsWith("o")||l.toLowerCase().startsWith("u")) query+="an "+l; else query+="a "+l; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 06:43:23
|
Revision: 1389 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1389&view=rev Author: sknappe Date: 2008-10-22 06:43:16 +0000 (Wed, 22 Oct 2008) Log Message: ----------- little change to labels in yago classes and some more predicate filters Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_get_article.php trunk/src/dbpedia-navigator/helper_functions.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 + temp .htaccess main.wsdl def0.xsd def1.xsd test.html test.php Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-22 06:41:32 UTC (rev 1388) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-22 06:43:16 UTC (rev 1389) @@ -306,7 +306,26 @@ if (isset($triples['http://dbpedia.org/property/refLabelProperty'])) unset($triples['http://dbpedia.org/property/refLabelProperty']); if (isset($triples['http://dbpedia.org/property/noteLabelProperty'])) unset($triples['http://dbpedia.org/property/noteLabelProperty']); if (isset($triples['http://dbpedia.org/property/wikisourcelangProperty'])) unset($triples['http://dbpedia.org/property/wikisourcelangProperty']); + if (isset($triples['http://dbpedia.org/property/lk'])) unset($triples['http://dbpedia.org/property/lk']); + if (isset($triples['http://dbpedia.org/property/abbr'])) unset($triples['http://dbpedia.org/property/abbr']); + if (isset($triples['http://dbpedia.org/property/x'])) unset($triples['http://dbpedia.org/property/x']); + if (isset($triples['http://dbpedia.org/property/y'])) unset($triples['http://dbpedia.org/property/y']); + if (isset($triples['http://dbpedia.org/property/imageFlagSize'])) unset($triples['http://dbpedia.org/property/imageFlagSize']); + if (isset($triples['http://dbpedia.org/property/imageCoatOfArmsSize'])) unset($triples['http://dbpedia.org/property/imageCoatOfArmsSize']); + if (isset($triples['http://dbpedia.org/property/wikiaProperty'])) unset($triples['http://dbpedia.org/property/wikiaProperty']); + if (isset($triples['http://dbpedia.org/property/coorDmProperty'])) unset($triples['http://dbpedia.org/property/coorDmProperty']); + if (isset($triples['http://dbpedia.org/property/nuts'])) unset($triples['http://dbpedia.org/property/nuts']); + if (isset($triples['http://dbpedia.org/property/years'])) unset($triples['http://dbpedia.org/property/years']); + if (isset($triples['http://dbpedia.org/property/dateofbirth'])) unset($triples['http://dbpedia.org/property/dateofbirth']); + if (isset($triples['http://dbpedia.org/property/caps_percent_28goals_percent_29'])) unset($triples['http://dbpedia.org/property/caps_percent_28goals_percent_29']); + if (isset($triples['http://dbpedia.org/property/nationalcaps_percent_28goals_percent_29'])) unset($triples['http://dbpedia.org/property/nationalcaps_percent_28goals_percent_29']); + if (isset($triples['http://dbpedia.org/property/ntupdate'])) unset($triples['http://dbpedia.org/property/ntupdate']); + if (isset($triples['http://dbpedia.org/property/footballPlayerStatistics2Property'])) unset($triples['http://dbpedia.org/property/footballPlayerStatistics2Property']); + if (isset($triples['http://dbpedia.org/property/footballPlayerStatistics3Property'])) unset($triples['http://dbpedia.org/property/footballPlayerStatistics3Property']); + if (isset($triples['http://dbpedia.org/property/is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before_of'])) unset($triples['is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23Before_of']); + if (isset($triples['http://dbpedia.org/property/is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title_of'])) unset($triples['is_percent_7D_percent_7D_percent_7B_percent_7BsuccessionBox_percent_23_percent_23_percent_23_percent_23title_of']); + if (count($triples)>0){ $content.='<br/><hr><h4>Remaining Triples</h4><br/>'; Modified: trunk/src/dbpedia-navigator/helper_functions.php =================================================================== --- trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 06:41:32 UTC (rev 1388) +++ trunk/src/dbpedia-navigator/helper_functions.php 2008-10-22 06:43:16 UTC (rev 1389) @@ -45,7 +45,7 @@ $lab=$label[$tag]; } //$tag_with_entities=htmlentities("\"".$tag."\""); - $ret.='<a style="'.$style.'" href="#" onclick="document.getElementById(\'hidden_class\').value=\''.$tag.'\';show_results(\''.$tag.'\',document.getElementById(\'hidden_number\').value);">'.$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).'</a> '; } $ret.="</p><br/>"; return $ret; @@ -371,7 +371,7 @@ $res=$databaseConnection->query($query); $result=$databaseConnection->nextEntry($res); $label=urldecode(str_replace("_"," ",substr (strrchr ($ar[$i]['value'], "/"), 1))); - if (strlen($result['label'])>strlen($label)-3||preg_match('/[0-9]/',$label)===1){ + if (strlen($result['label'])>strlen($label)-3||preg_match('/[0-9]$/',$label)===1){ $label=$result['label']; } $label=utf8_to_html($label); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-22 06:41:40
|
Revision: 1388 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1388&view=rev Author: sknappe Date: 2008-10-22 06:41:32 +0000 (Wed, 22 Oct 2008) Log Message: ----------- little change to labels in description Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 05:57:53 UTC (rev 1387) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-22 06:41:32 UTC (rev 1388) @@ -244,7 +244,7 @@ SortedSet<String> label=tasks.queryAsSet("SELECT ?label WHERE {<"+description.getName()+"> <http://www.w3.org/2000/01/rdf-schema#label> ?label}", "label"); String l=label.first(); String l2=description.getName().substring(description.getName().lastIndexOf("/")+1, description.getName().length()).replace('_', ' '); - if (l.length()+3<l2.length()&&!l2.matches(".*[0-9].*")) l=l2; + if (l.length()+3<l2.length()&&!l2.matches(".*[0-9]")) l=l2; if (l.toLowerCase().startsWith("a")||l.toLowerCase().startsWith("e")||l.toLowerCase().startsWith("i")||l.toLowerCase().startsWith("o")||l.toLowerCase().startsWith("u")) query+="an "+l; else query+="a "+l; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <sk...@us...> - 2008-10-21 10:44:00
|
Revision: 1386 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1386&view=rev Author: sknappe Date: 2008-10-21 10:43:54 +0000 (Tue, 21 Oct 2008) Log Message: ----------- bugfixes and added ignoredConcepts and -Roles to settings Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php trunk/src/dbpedia-navigator/Settings.php.dist trunk/src/dbpedia-navigator/ajax_get_article.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-10-21 10:25:14 UTC (rev 1385) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-10-21 10:43:54 UTC (rev 1386) @@ -21,7 +21,11 @@ // ID of the DBpedia knowledge source private $ksID; - + + private $ignoredConcepts; + + private $ignoredRoles; + function DLLearnerConnection($id=0,$ksID=0) { ini_set('default_socket_timeout',200); @@ -32,6 +36,8 @@ $this->lang=$settings->language; $this->DBPediaUrl=$settings->dbpediauri; $this->endpoint=$settings->endpoint; + $this->ignoredConcepts=$settings->ignoredConcepts; + $this->ignoredRoles=$settings->ignoredRoles; $this->client=new SoapClient("main.wsdl",array('features' => SOAP_SINGLE_ELEMENT_ARRAYS)); $this->id=$id; $this->ksID=$ksID; @@ -75,6 +81,8 @@ $this->client->applyConfigEntryInt($this->id, $algorithmID, "maxExecutionTimeInSeconds", 3); $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "useNegation", false); $this->client->applyConfigEntryBoolean($this->id, $algorithmID, "useAllConstructor", false); + $this->client->applyConfigEntryStringArray($this->id, $algorithmID, "ignoredConcepts",$this->ignoredConcepts); + $this->client->applyConfigEntryStringArray($this->id, $algorithmID, "ignoredRoles",$this->ignoredRoles); $start = microtime(true); $this->client->initAll($this->id); Modified: trunk/src/dbpedia-navigator/Settings.php.dist =================================================================== --- trunk/src/dbpedia-navigator/Settings.php.dist 2008-10-21 10:25:14 UTC (rev 1385) +++ trunk/src/dbpedia-navigator/Settings.php.dist 2008-10-21 10:43:54 UTC (rev 1386) @@ -54,6 +54,10 @@ public $useCache=true; + public $ignoredConcepts=array(); + public $ignoredRoles=array(); + + //the type of database server public $database_type='mysql'; //the server, where the mysql databank is located Modified: trunk/src/dbpedia-navigator/ajax_get_article.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-21 10:25:14 UTC (rev 1385) +++ trunk/src/dbpedia-navigator/ajax_get_article.php 2008-10-21 10:43:54 UTC (rev 1386) @@ -331,7 +331,7 @@ else{ $array=$_SESSION['positive']; $array[$uri]=$artTitle; - if (count($array)>3){ + if (count($array)>10){ foreach ($array as $key=>$value){ unset($array[$key]); break; @@ -362,7 +362,7 @@ else{ $array=$_SESSION['positive']; $array[$uri]=$artTitle; - if (count($array)>3){ + if (count($array)>10){ foreach ($array as $key=>$value){ unset($array[$key]); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-10-21 10:25:23
|
Revision: 1385 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1385&view=rev Author: sknappe Date: 2008-10-21 10:25:14 +0000 (Tue, 21 Oct 2008) Log Message: ----------- changes to use specific endpoint for natural language conversion Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-18 19:32:50 UTC (rev 1384) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-10-21 10:25:14 UTC (rev 1385) @@ -44,10 +44,10 @@ private SPARQLTasks tasks; - public NaturalLanguageDescriptionConvertVisitor() + public NaturalLanguageDescriptionConvertVisitor(String endpoint) { //stack.push("subject"); - tasks=new SPARQLTasks(new Cache("cache"),SparqlEndpoint.getEndpointDBpedia()); + tasks=new SPARQLTasks(new Cache("cache"),SparqlEndpoint.getEndpointByName(endpoint)); } private String getDescription() @@ -62,16 +62,16 @@ public static String getNaturalLanguageDescription(Description description) { - NaturalLanguageDescriptionConvertVisitor visitor=new NaturalLanguageDescriptionConvertVisitor(); + NaturalLanguageDescriptionConvertVisitor visitor=new NaturalLanguageDescriptionConvertVisitor("DBpedia"); description.accept(visitor); String ret = visitor.getDescription(); return ret; } - public static String getNaturalLanguageDescription(String descriptionKBSyntax) throws ParseException + public static String getNaturalLanguageDescription(String descriptionKBSyntax, String endpoint) throws ParseException { Description d = KBParser.parseConcept(descriptionKBSyntax); - NaturalLanguageDescriptionConvertVisitor visitor=new NaturalLanguageDescriptionConvertVisitor(); + NaturalLanguageDescriptionConvertVisitor visitor=new NaturalLanguageDescriptionConvertVisitor(endpoint); d.accept(visitor); String ret = visitor.getDescription(); return ret; @@ -98,7 +98,7 @@ s.add("NOT \"http://dbpedia.org/class/yago/Person100007846\""); s.add("(\"http://dbpedia.org/class/yago/HeadOfState110164747\" AND (\"http://dbpedia.org/class/yago/Negotiator110351874\" AND \"http://dbpedia.org/class/yago/Representative110522035\"))"); for (String kbsyntax : s) { - result.put(kbsyntax,NaturalLanguageDescriptionConvertVisitor.getNaturalLanguageDescription(kbsyntax)); + result.put(kbsyntax,NaturalLanguageDescriptionConvertVisitor.getNaturalLanguageDescription(kbsyntax,"DBPEDIA")); } System.out.println("************************"); for (String string : result.keySet()) { Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-10-18 19:32:50 UTC (rev 1384) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-10-21 10:25:14 UTC (rev 1385) @@ -720,9 +720,9 @@ } @WebMethod - public String getNaturalDescription(String conceptString) throws ParseException { + public String getNaturalDescription(String conceptString, String endpoint) throws ParseException { // call parser to parse concept - return NaturalLanguageDescriptionConvertVisitor.getNaturalLanguageDescription(conceptString); + return NaturalLanguageDescriptionConvertVisitor.getNaturalLanguageDescription(conceptString, endpoint); } @WebMethod This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-10-18 19:33:00
|
Revision: 1384 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1384&view=rev Author: anitaj Date: 2008-10-18 19:32:50 +0000 (Sat, 18 Oct 2008) Log Message: ----------- Modified Paths: -------------- trunk/src/music-recommender/ajax.php trunk/src/music-recommender/index.php Modified: trunk/src/music-recommender/ajax.php =================================================================== --- trunk/src/music-recommender/ajax.php 2008-10-17 13:38:47 UTC (rev 1383) +++ trunk/src/music-recommender/ajax.php 2008-10-18 19:32:50 UTC (rev 1384) @@ -26,7 +26,7 @@ * @author Anita Janassary */ -require_once '../dbpedia-navigator/xajax/xajax_core/xajax.inc.php'; +require_once '../music-recommender/xajax/xajax_core/xajax.inc.php'; require_once 'DLLearnerConnection.php'; $xajax = new xajax(); Modified: trunk/src/music-recommender/index.php =================================================================== --- trunk/src/music-recommender/index.php 2008-10-17 13:38:47 UTC (rev 1383) +++ trunk/src/music-recommender/index.php 2008-10-18 19:32:50 UTC (rev 1384) @@ -56,7 +56,7 @@ <head> <title>DL-Learner Music Recommender</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> - <?php $xajax->printJavascript('../dbpedia-navigator/xajax/'); ?> + <?php $xajax->printJavascript('../music-recommender/xajax/'); ?> <script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script> </head> <body> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |