From: <jen...@us...> - 2008-09-15 17:28:36
|
Revision: 1214 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1214&view=rev Author: jenslehmann Date: 2008-09-15 17:28:02 +0000 (Mon, 15 Sep 2008) Log Message: ----------- - fixed and improved search tree display - fixed some conf files according to unit test Modified Paths: -------------- trunk/examples/arch/arch_owl.conf trunk/examples/conflict/arch_refexamples_owlAPI.conf trunk/examples/conflict/test_ZERO_ONE_refexamples_owlAPI.conf trunk/examples/cross-benchmark/arch/arch_gp.conf trunk/examples/cross-benchmark/arch/arch_hybrid.conf trunk/examples/cross-benchmark/arch/arch_refexamples.conf trunk/examples/cross-benchmark/forte/uncle_gp.conf trunk/examples/cross-benchmark/forte/uncle_hybrid.conf trunk/examples/cross-benchmark/forte/uncle_refexamples.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_gp.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_hybrid.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_refexamples.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_gp.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_hybrid.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_refexamples.conf trunk/examples/cross-benchmark/poker/pair_gp.conf trunk/examples/cross-benchmark/poker/pair_hybrid.conf trunk/examples/cross-benchmark/poker/pair_refexamples.conf trunk/examples/cross-benchmark/poker/straight_gp.conf trunk/examples/cross-benchmark/poker/straight_hybrid.conf trunk/examples/cross-benchmark/poker/straight_refexamples.conf trunk/examples/cross-benchmark/trains/trains_gp.conf trunk/examples/cross-benchmark/trains/trains_hybrid.conf trunk/examples/cross-benchmark/trains/trains_refexamples.conf trunk/examples/family/father_posonly.conf trunk/examples/krk/complete_no_draw.conf trunk/examples/semantic_bible/normal.conf trunk/examples/semantic_bible/normal_retrieval_special.conf trunk/examples/semantic_bible/sparqlbible.conf trunk/examples/semantic_bible/woman.conf trunk/examples/sparql/govtrack.conf trunk/examples/sparql/musicbrainz.conf trunk/examples/sparql/roles_notworking/Roles_fixed_DBPedia_monarch_range_yago.conf trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/gui/EBNodeTreeModel.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/gui/SearchTree.java Modified: trunk/examples/arch/arch_owl.conf =================================================================== --- trunk/examples/arch/arch_owl.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/arch/arch_owl.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -16,8 +16,9 @@ * Copyright (C) 2007, Sebastian Hellmann */ +refexamples.writeSearchTree = true; +refexamples.searchTreeFile = "log/test.txt"; - /** background knowledge **/ import("arch.owl"); Modified: trunk/examples/conflict/arch_refexamples_owlAPI.conf =================================================================== --- trunk/examples/conflict/arch_refexamples_owlAPI.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/conflict/arch_refexamples_owlAPI.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -17,7 +17,7 @@ */ algorithm = refexamples; -reasoner=owlAPI; +reasoner=owlAPIReasoner; Modified: trunk/examples/conflict/test_ZERO_ONE_refexamples_owlAPI.conf =================================================================== --- trunk/examples/conflict/test_ZERO_ONE_refexamples_owlAPI.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/conflict/test_ZERO_ONE_refexamples_owlAPI.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -11,7 +11,7 @@ algorithm = refexamples; -reasoner=owlAPI; +reasoner=owlAPIReasoner; refexamples.useAllConstructor = false; Modified: trunk/examples/cross-benchmark/arch/arch_gp.conf =================================================================== --- trunk/examples/cross-benchmark/arch/arch_gp.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/arch/arch_gp.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -10,7 +10,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("arch.owl"); Modified: trunk/examples/cross-benchmark/arch/arch_hybrid.conf =================================================================== --- trunk/examples/cross-benchmark/arch/arch_hybrid.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/arch/arch_hybrid.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -10,7 +10,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("arch.owl"); Modified: trunk/examples/cross-benchmark/arch/arch_refexamples.conf =================================================================== --- trunk/examples/cross-benchmark/arch/arch_refexamples.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/arch/arch_refexamples.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -1,5 +1,5 @@ algorithm = refexamples; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("arch.owl"); +c1 Modified: trunk/examples/cross-benchmark/forte/uncle_gp.conf =================================================================== --- trunk/examples/cross-benchmark/forte/uncle_gp.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/forte/uncle_gp.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -27,7 +27,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("forte_family.owl"); /** examples **/ Modified: trunk/examples/cross-benchmark/forte/uncle_hybrid.conf =================================================================== --- trunk/examples/cross-benchmark/forte/uncle_hybrid.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/forte/uncle_hybrid.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -28,7 +28,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("forte_family.owl"); /** examples **/ Modified: trunk/examples/cross-benchmark/forte/uncle_refexamples.conf =================================================================== --- trunk/examples/cross-benchmark/forte/uncle_refexamples.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/forte/uncle_refexamples.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -18,7 +18,7 @@ algorithm = refexamples; refexamples.useCardinalityRestrictions = false; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("forte_family.owl"); /** examples **/ Modified: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_gp.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_gp.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_gp.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -20,7 +20,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /** background knowledge **/ import("moral_43instances_complex.owl"); Modified: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_hybrid.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_hybrid.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_hybrid.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -20,7 +20,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /** background knowledge **/ import("moral_43instances_complex.owl"); Modified: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_refexamples.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_refexamples.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_refexamples.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -10,7 +10,7 @@ ***********************/ algorithm = refexamples; refexamples.useCardinalityRestrictions = false; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /** background knowledge **/ import("moral_43instances_complex.owl"); Modified: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_gp.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_gp.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_gp.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -21,7 +21,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /** background knowledge **/ import("moral_43instances.owl"); Modified: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_hybrid.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_hybrid.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_hybrid.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -20,7 +20,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /** background knowledge **/ import("moral_43instances.owl"); Modified: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_refexamples.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_refexamples.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_refexamples.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -10,7 +10,7 @@ ***********************/ algorithm = refexamples; refexamples.useCardinalityRestrictions = false; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /** background knowledge **/ import("moral_43instances.owl"); Modified: trunk/examples/cross-benchmark/poker/pair_gp.conf =================================================================== --- trunk/examples/cross-benchmark/poker/pair_gp.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/poker/pair_gp.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -17,7 +17,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /*Background knowledge*/ import("pair50.owl"); Modified: trunk/examples/cross-benchmark/poker/pair_hybrid.conf =================================================================== --- trunk/examples/cross-benchmark/poker/pair_hybrid.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/poker/pair_hybrid.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -17,7 +17,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /*Background knowledge*/ import("pair50.owl"); Modified: trunk/examples/cross-benchmark/poker/pair_refexamples.conf =================================================================== --- trunk/examples/cross-benchmark/poker/pair_refexamples.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/poker/pair_refexamples.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -6,7 +6,7 @@ */ algorithm = refexamples; refexamples.useCardinalityRestrictions = false; -reasoner = owlAPI; +reasoner = owlAPIReasoner; /*Background knowledge*/ import("pair50.owl"); Modified: trunk/examples/cross-benchmark/poker/straight_gp.conf =================================================================== --- trunk/examples/cross-benchmark/poker/straight_gp.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/poker/straight_gp.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -18,7 +18,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("straight.owl"); /*Examples*/ Modified: trunk/examples/cross-benchmark/poker/straight_hybrid.conf =================================================================== --- trunk/examples/cross-benchmark/poker/straight_hybrid.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/poker/straight_hybrid.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -18,7 +18,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("straight.owl"); /*Examples*/ Modified: trunk/examples/cross-benchmark/poker/straight_refexamples.conf =================================================================== --- trunk/examples/cross-benchmark/poker/straight_refexamples.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/poker/straight_refexamples.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -8,7 +8,7 @@ /*Background knowledge*/ algorithm = refexamples; refexamples.useCardinalityRestrictions = false; -reasoner = owlAPI; +reasoner = owlAPIReasoner; import("straight.owl"); /*Examples*/ Modified: trunk/examples/cross-benchmark/trains/trains_gp.conf =================================================================== --- trunk/examples/cross-benchmark/trains/trains_gp.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/trains/trains_gp.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -17,7 +17,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; hidePrefix = "http://example.com/foo#"; Modified: trunk/examples/cross-benchmark/trains/trains_hybrid.conf =================================================================== --- trunk/examples/cross-benchmark/trains/trains_hybrid.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/trains/trains_hybrid.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -17,7 +17,7 @@ gp.hillClimbingProbability = 0; posNegDefinitionLP.percentPerLenghtUnit = 0.02; gp.maxConceptLength = 30; -reasoner = owlAPI; +reasoner = owlAPIReasoner; hidePrefix = "http://example.com/foo#"; /*Background knowledge*/ Modified: trunk/examples/cross-benchmark/trains/trains_refexamples.conf =================================================================== --- trunk/examples/cross-benchmark/trains/trains_refexamples.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/cross-benchmark/trains/trains_refexamples.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -7,7 +7,7 @@ algorithm = refexamples; refexamples.useCardinalityRestrictions = false; -reasoner = owlAPI; +reasoner = owlAPIReasoner; hidePrefix = "http://example.com/foo#"; /*Background knowledge*/ Modified: trunk/examples/family/father_posonly.conf =================================================================== --- trunk/examples/family/father_posonly.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/family/father_posonly.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -13,7 +13,7 @@ import("father.kb"); problem = posOnlyDefinitionLP; -reasoner = owlAPI; +reasoner = owlAPIReasoner; algorithm = refexamples; refexamples.usePropernessChecks = true; refexamples.maxPosOnlyExpansion = 4; Modified: trunk/examples/krk/complete_no_draw.conf =================================================================== --- trunk/examples/krk/complete_no_draw.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/krk/complete_no_draw.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -23,7 +23,7 @@ algorithm = refexamples; reasoner=fastInstanceChecker; -//reasoner=owlAPI; +//reasoner=owlAPIReasoner; //fastInstanceChecker.reasonerType = fact; refexamples.useAllConstructor = false; Modified: trunk/examples/semantic_bible/normal.conf =================================================================== --- trunk/examples/semantic_bible/normal.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/semantic_bible/normal.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -16,7 +16,7 @@ //refexamples.ignoredConcepts = {"http://semanticbible.org/ns/2006/NTNames#God"}; //reasoner = fastInstanceChecker; -reasoner = owlAPI; +reasoner = owlAPIReasoner; owlAPIReasoner.reasonerType = pellet; /** examples **/ Modified: trunk/examples/semantic_bible/normal_retrieval_special.conf =================================================================== --- trunk/examples/semantic_bible/normal_retrieval_special.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/semantic_bible/normal_retrieval_special.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -16,7 +16,7 @@ //refexamples.ignoredConcepts = {"http://semanticbible.org/ns/2006/NTNames#God"}; //reasoner = fastInstanceChecker; -reasoner = owlAPI; +reasoner = owlAPIReasoner; owlAPIReasoner.reasonerType = pellet; problem = posNegDefinitionLP; Modified: trunk/examples/semantic_bible/sparqlbible.conf =================================================================== --- trunk/examples/semantic_bible/sparqlbible.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/semantic_bible/sparqlbible.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -16,7 +16,7 @@ //refexamples.ignoredConcepts = {"http://semanticbible.org/ns/2006/NTNames#God"}; //reasoner = fastInstanceChecker; -reasoner = owlAPI; +reasoner = owlAPIReasoner; owlAPIReasoner.reasonerType = pellet; /** examples **/ Modified: trunk/examples/semantic_bible/woman.conf =================================================================== --- trunk/examples/semantic_bible/woman.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/semantic_bible/woman.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -14,7 +14,7 @@ //refexamples.ignoredConcepts = {"http://semanticbible.org/ns/2006/NTNames#God"}; reasoner = fastInstanceChecker; -//reasoner = owlAPI; +//reasoner = owlAPIReasoner; //owlAPIReasoner.reasonerType = pellet; /** examples **/ Modified: trunk/examples/sparql/govtrack.conf =================================================================== --- trunk/examples/sparql/govtrack.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/sparql/govtrack.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -4,7 +4,7 @@ sparql.useLits = true; algorithm = refexamples; -reasoner = owlAPI; +reasoner = owlAPIReasoner; // reasoner = fastInstanceChecker; import("http://www.govtrack.us/sparql","SPARQL"); Modified: trunk/examples/sparql/musicbrainz.conf =================================================================== --- trunk/examples/sparql/musicbrainz.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/sparql/musicbrainz.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -13,7 +13,7 @@ sparql.useLits=true; algorithm = refexamples; -//reasoner = owlAPI; +//reasoner = owlAPIReasoner; reasoner = fastInstanceChecker; Modified: trunk/examples/sparql/roles_notworking/Roles_fixed_DBPedia_monarch_range_yago.conf =================================================================== --- trunk/examples/sparql/roles_notworking/Roles_fixed_DBPedia_monarch_range_yago.conf 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/examples/sparql/roles_notworking/Roles_fixed_DBPedia_monarch_range_yago.conf 2008-09-15 17:28:02 UTC (rev 1214) @@ -18,7 +18,7 @@ sparql2.predefinedFilter=1; // use DBpedia endpoint -import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL2"); +import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL"); //***********ROLE SPECIFIC Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-09-15 17:28:02 UTC (rev 1214) @@ -178,6 +178,29 @@ return ret; } + public String getShortDescriptionHTML(int nrOfPositiveExamples, int nrOfNegativeExamples, String baseURI) { + String ret = "<html> " + concept.toString(baseURI,null) + " <i>["; + + if(isTooWeak) + ret += "q:tw"; + else { + double accuracy = 100 * (coveredPositives.size() + nrOfNegativeExamples - coveredNegatives.size())/(double)(nrOfPositiveExamples+nrOfNegativeExamples); + ret += "<b>acc: " + df.format(accuracy) + "% </b>"; + + // comment this out to display the heuristic score with default parameters + double heuristicScore = MultiHeuristic.getNodeScore(this, nrOfPositiveExamples, nrOfNegativeExamples); + ret += "h:" +df.format(heuristicScore) + " "; + + int wrongPositives = nrOfPositiveExamples - coveredPositives.size(); + ret += "q:" + wrongPositives + "p-" + coveredNegatives.size() + "n"; + } + + ret += " ("+qualityEvaluationMethod+"), he:" + horizontalExpansion; + ret += " c:" + children.size() + "]"; + + return ret + "</i></html>"; + } + //TODO integrate this method with the one above public String getStats(int nrOfPositiveExamples, int nrOfNegativeExamples) { String ret = " ["; Modified: trunk/src/dl-learner/org/dllearner/gui/EBNodeTreeModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/EBNodeTreeModel.java 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/src/dl-learner/org/dllearner/gui/EBNodeTreeModel.java 2008-09-15 17:28:02 UTC (rev 1214) @@ -22,6 +22,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.SortedSet; import java.util.TreeMap; import javax.swing.event.TreeModelEvent; @@ -92,6 +93,7 @@ } + @SuppressWarnings("unused") private void fireTreeStructureChanged(ExampleBasedNode node) { TreeModelEvent e = new TreeModelEvent(this, new Object[] {node}); @@ -102,13 +104,25 @@ // convert the set of children to a list and store it in this model private List<ExampleBasedNode> getChildren(ExampleBasedNode node) { +// System.out.println("asking for children of " + node); + List<ExampleBasedNode> children = childrenMap.get(node); // if the children have not been cached or the list is outdated // (node has more children now) we do an update if(children == null || children.size() != node.getChildren().size()) { - children = new LinkedList<ExampleBasedNode>(node.getChildren()); + SortedSet<ExampleBasedNode> childrenSet = node.getChildren(); + children = new LinkedList<ExampleBasedNode>(childrenSet); + + // we need to ensure that the children are sorted correctly +// children = new LinkedList<ExampleBasedNode>(); +// for(ExampleBasedNode child : childrenSet) { +// children.add(child); +// } + childrenMap.put(node, children); - fireTreeStructureChanged(node); + +// fireTreeStructureChanged(node); +// System.out.println("updating children of " + node); } return children; } Modified: trunk/src/dl-learner/org/dllearner/gui/RunPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-09-15 17:28:02 UTC (rev 1214) @@ -31,7 +31,9 @@ import javax.swing.*; +import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.core.EvaluatedDescription; +import org.dllearner.learningproblems.PosNegDefinitionLP; /** * @author Tilo Hielscher @@ -82,8 +84,10 @@ stopButton.setEnabled(false); stopButton.addActionListener(this); showPanel.add(stopButton); + treeButton = new JButton("Tree"); treeButton.addActionListener(this); + treeButton.setEnabled(false); showPanel.add(treeButton); infoPanel.setLayout(gridbag); @@ -182,8 +186,8 @@ } // tree if (e.getSource() == treeButton) { - @SuppressWarnings("unused") TreeWindow a = new TreeWindow(config); + a.setLocationRelativeTo(startGUI); } } @@ -348,7 +352,17 @@ * Method is called when algorithm has terminated successfully. */ public void algorithmTerminated() { + // the methods called are similar to those when the stop button is pressed stopButton.setEnabled(false); runButton.setEnabled(true); + startGUI.enableTabbedPane(); + + System.out.println("TEST"); + + // enable tree button + if((config.getLearningAlgorithm() instanceof ExampleBasedROLComponent) + && (config.getLearningProblem() instanceof PosNegDefinitionLP)) { + treeButton.setEnabled(true); + } } } Added: trunk/src/dl-learner/org/dllearner/gui/SearchTree.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/SearchTree.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/gui/SearchTree.java 2008-09-15 17:28:02 UTC (rev 1214) @@ -0,0 +1,57 @@ +/** + * 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.gui; + +import javax.swing.JTree; + +import org.dllearner.algorithms.refexamples.ExampleBasedNode; + +/** + * Own JTree implemenation with improved formatting. + * + * @author Jens Lehmann + * + */ +public class SearchTree extends JTree { + + private static final long serialVersionUID = 4509903171856747400L; + + private int nrOfNegativeExamples; + private int nrOfPositiveExamples; + private String baseURI; + + public SearchTree(EBNodeTreeModel model, int nrOfPositiveExamples, int nrOfNegativeExamples, String baseURI) { + super(model); + this.nrOfPositiveExamples = nrOfPositiveExamples; + this.nrOfNegativeExamples = nrOfNegativeExamples; + this.baseURI = baseURI; + } + + @Override + public String convertValueToText(Object value, + boolean selected, + boolean expanded, + boolean leaf, + int row, + boolean hasFocus) { + ExampleBasedNode node = (ExampleBasedNode) value; + return node.getShortDescriptionHTML(nrOfPositiveExamples, nrOfNegativeExamples, baseURI); + } +} Modified: trunk/src/dl-learner/org/dllearner/gui/StartGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2008-09-15 17:28:02 UTC (rev 1214) @@ -171,6 +171,11 @@ setVisible(true); updateTabs(); + // load file + if(file != null) { + config.loadFile(file); + } + // Register a change listener tabPane.addChangeListener(new ChangeListener() { // This method is called whenever the selected tab changes Modified: trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java 2008-09-15 17:28:02 UTC (rev 1214) @@ -20,13 +20,18 @@ * */ -import javax.swing.*; +import java.util.Set; +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.JTree; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeWillExpandListener; import javax.swing.tree.ExpandVetoException; -import org.dllearner.algorithms.refexamples.*; +import org.dllearner.algorithms.refexamples.ExampleBasedNode; +import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.learningproblems.PosNegDefinitionLP; /** * TreeWindow @@ -42,13 +47,14 @@ private EBNodeTreeModel ebNodeModel; private ExampleBasedNode rootNode; private JTree tree; - + + @SuppressWarnings("unchecked") public TreeWindow(Config config) { this.config = config; this.setTitle("DL-Learner Tree"); this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); - this.setLocationByPlatform(true); - this.setSize(640, 300); +// this.setLocationByPlatform(true); + this.setSize(800, 600); // set icon if (this.getClass().getResource("icon.gif") != null) @@ -61,7 +67,7 @@ .getLearningAlgorithm(); this.rootNode = ebrol.getStartNode(); - System.out.println("childs1: " + rootNode.getChildren()); +// System.out.println("childs1: " + rootNode.getChildren()); this.ebNodeModel = new EBNodeTreeModel(rootNode); @@ -71,15 +77,23 @@ // System.out.println("childs2: " + // ebNodeModel.getChildren((ExampleBasedNode) first)); - - tree = new JTree(ebNodeModel); - tree.addTreeWillExpandListener(this); + + // collect some helper values for display and accuracy calculations + PosNegDefinitionLP lp = (PosNegDefinitionLP) config.getLearningProblem(); + Set<String> posExamples = lp.getConfigurator().getPositiveExamples(); + Set<String> negExamples = lp.getConfigurator().getNegativeExamples(); + String baseURI = config.getReasoningService().getBaseURI(); + int nrOfPositiveExamples = posExamples.size(); + int nrOfNegativeExamples = negExamples.size(); + + tree = new SearchTree(ebNodeModel, nrOfPositiveExamples, nrOfNegativeExamples, baseURI); +// tree.addTreeWillExpandListener(this); this.add(new JScrollPane(tree)); } // } - this.repaint(); - this.setVisible(true); +// this.repaint(); + setVisible(true); } /* Modified: trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java 2008-09-15 13:30:02 UTC (rev 1213) +++ trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java 2008-09-15 17:28:02 UTC (rev 1214) @@ -83,6 +83,8 @@ ignore.add("./examples/sparql/scrobble.conf"); // HTTP 502 Proxy Error ignore.add("./examples/family-benchmark/Cousin.conf"); // Out of Memory Error ignore.add("./examples/sparql/SilentBobWorking2.conf"); // Out of Memory Error + ignore.add("./examples/family/father_posonly.conf"); // ArrayOutOfBoundsException in Pellet - main problem: pos only not working + ignore.add("./examples/sparql/difference/DBPediaSKOS_kohl_vs_angela.conf"); // Pellet: literal cannot be cast to individual for (String path : confFiles.keySet()) { for (String file : confFiles.get(path)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |