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: <jen...@us...> - 2009-12-19 09:53:06
|
Revision: 1933 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1933&view=rev Author: jenslehmann Date: 2009-12-19 09:52:58 +0000 (Sat, 19 Dec 2009) Log Message: ----------- implemented Jaccard distance metric for accuracy computation Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-12-17 15:18:17 UTC (rev 1932) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-12-19 09:52:58 UTC (rev 1933) @@ -42,6 +42,7 @@ import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.SubClassAxiom; +import org.dllearner.utilities.Helper; /** * The problem of learning the description of an existing class @@ -58,13 +59,14 @@ private NamedClass classToDescribe; private List<Individual> classInstances; + private TreeSet<Individual> classInstancesSet; private boolean equivalence = true; private ClassLearningProblemConfigurator configurator; // approximation of accuracy +- 0.05 % private double approx = 0.05; private boolean useApproximations; - private boolean useFMeasure; +// private boolean useFMeasure; // factor for higher weight on coverage (needed for subclass learning) private double coverageFactor; @@ -72,6 +74,9 @@ // instances of super classes excluding instances of the class itself private List<Individual> superClassInstances; + private enum HeuristicType { PRED_ACC, OWN, JACCARD, FMEASURE, GEN_FMEASURE }; + private HeuristicType heuristic = HeuristicType.OWN; + @Override public ClassLearningProblemConfigurator getConfigurator(){ return configurator; @@ -95,7 +100,7 @@ DoubleConfigOption approxAccuracy = new DoubleConfigOption("approxAccuracy", "accuracy of the approximation (only for expert use)", 0.05); options.add(approxAccuracy); StringConfigOption accMethod = new StringConfigOption("accuracyMethod", "Specifies, which method/function to use for computing accuracy.","standard"); // or domain/range of a property. - accMethod.setAllowedValues(new String[] {"standard", "fmeasure", "predacc"}); + accMethod.setAllowedValues(new String[] {"standard", "fmeasure", "predacc", "generalised_fmeasure", "jaccard"}); options.add(accMethod); return options; } @@ -108,7 +113,25 @@ public void init() throws ComponentInitException { classToDescribe = new NamedClass(configurator.getClassToDescribe().toString()); useApproximations = configurator.getUseApproximations(); - useFMeasure = configurator.getAccuracyMethod().equals("fmeasure"); + + String accM = configurator.getAccuracyMethod(); + if(accM.equals("standard")) { + heuristic = HeuristicType.OWN; + } else if(accM.equals("fmeasure")) { + heuristic = HeuristicType.FMEASURE; + } else if(accM.equals("generalised_fmeasure")) { + heuristic = HeuristicType.GEN_FMEASURE; + } else if(accM.equals("jaccard")) { + heuristic = HeuristicType.JACCARD; + } else if(accM.equals("predacc")) { + heuristic = HeuristicType.PRED_ACC; + } + + if(useApproximations && !(heuristic.equals(HeuristicType.OWN) || heuristic.equals(HeuristicType.FMEASURE))) { + throw new ComponentInitException("Approximations only supported for F-Measure or Standard-Measure. It is unsupported for \"" + accM + ".\""); + } + +// useFMeasure = configurator.getAccuracyMethod().equals("fmeasure"); approx = configurator.getApproxAccuracy(); if(!reasoner.getNamedClasses().contains(classToDescribe)) { @@ -116,6 +139,7 @@ } classInstances = new LinkedList<Individual>(reasoner.getIndividuals(classToDescribe)); + classInstancesSet = new TreeSet<Individual>(classInstances); equivalence = (configurator.getType().equals("equivalence")); if(equivalence) { @@ -188,7 +212,17 @@ // we check whether the axiom already follows from the knowledge base boolean followsFromKB = reasoner.isSuperClassOf(description, classToDescribe); - double acc = useFMeasure ? getFMeasure(coverage, protusion) : getAccuracy(coverage, protusion); + double acc = 0; + if(heuristic.equals(HeuristicType.FMEASURE)) { + acc = getFMeasure(coverage, protusion); + } else if(heuristic.equals(HeuristicType.OWN)) { + acc = getAccuracy(coverage, protusion); + } else { + // TODO: some superfluous instance checks are required to compute accuracy => + // move accuracy computation here if possible + acc = getAccuracyOrTooWeakExact(description, 1); + } +// double acc = useFMeasure ? getFMeasure(coverage, protusion) : getAccuracy(coverage, protusion); return new ClassScore(coveredInstances, coverage, additionalInstances, protusion, acc, isConsistent, followsFromKB); } @@ -339,10 +373,10 @@ double size; if(estimatedA) { // size = 1/(coverageFactor+1) * (coverageFactor * (upperBorderA-lowerBorderA) + Math.sqrt(upperEstimateA/(upperEstimateA+lowerEstimate)) + Math.sqrt(lowerEstimateA/(lowerEstimateA+upperEstimate))); - size = useFMeasure ? getFMeasure(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getFMeasure(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)) : getAccuracy(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getAccuracy(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); + size = heuristic.equals(HeuristicType.FMEASURE) ? getFMeasure(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getFMeasure(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)) : getAccuracy(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getAccuracy(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); } else { // size = 1/(coverageFactor+1) * (coverageFactor * coverage + Math.sqrt(instancesCovered/(instancesCovered+lowerEstimate)) + Math.sqrt(instancesCovered/(instancesCovered+upperEstimate))); - size = useFMeasure ? getFMeasure(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getFMeasure(recall, instancesCovered/(double)(instancesCovered+upperEstimate)) : getAccuracy(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); + size = heuristic.equals(HeuristicType.FMEASURE) ? getFMeasure(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getFMeasure(recall, instancesCovered/(double)(instancesCovered+upperEstimate)) : getAccuracy(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); } if(size < 0.1) { @@ -375,34 +409,64 @@ // System.out.println("standard acc: " + getAccuracy(recall, precision)); // return getAccuracy(recall, precision); - return useFMeasure ? getFMeasure(recall, precision) : getAccuracy(recall, precision); + return heuristic.equals(HeuristicType.FMEASURE) ? getFMeasure(recall, precision) : getAccuracy(recall, precision); } public double getAccuracyOrTooWeakExact(Description description, double noise) { - int additionalInstances = 0; - for(Individual ind : superClassInstances) { - if(reasoner.hasType(description, ind)) { - additionalInstances++; + if(heuristic.equals(HeuristicType.JACCARD)) { + + // computing R(C) restricted to relevant instances + TreeSet<Individual> additionalInstancesSet = new TreeSet<Individual>(); + for(Individual ind : superClassInstances) { + if(reasoner.hasType(description, ind)) { + additionalInstancesSet.add(ind); + } } - } - - int coveredInstances = 0; - for(Individual ind : classInstances) { - if(reasoner.hasType(description, ind)) { - coveredInstances++; + + // computing R(A) + TreeSet<Individual> coveredInstancesSet = new TreeSet<Individual>(); + for(Individual ind : classInstances) { + if(reasoner.hasType(description, ind)) { + coveredInstancesSet.add(ind); + } + } + + // for Jaccard: covered instances is the intersection of the sets + // R(A) and R(C); + Set<Individual> union = Helper.union(classInstancesSet, additionalInstancesSet); + return (1 - (union.size() - coveredInstancesSet.size()) / (double) union.size()); + + } else if (heuristic.equals(HeuristicType.OWN) || heuristic.equals(HeuristicType.FMEASURE)) { + + // computing R(C) restricted to relevant instances + int additionalInstances = 0; + for(Individual ind : superClassInstances) { + if(reasoner.hasType(description, ind)) { + additionalInstances++; + } } + + // computing R(A) + int coveredInstances = 0; + for(Individual ind : classInstances) { + if(reasoner.hasType(description, ind)) { + coveredInstances++; + } + } + + double recall = coveredInstances/(double)classInstances.size(); + + if(recall < 1 - noise) { + return -1; + } + + double precision = (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); + + return heuristic.equals(HeuristicType.FMEASURE) ? getFMeasure(recall, precision) : getAccuracy(recall, precision); } - double recall = coveredInstances/(double)classInstances.size(); - - if(recall < 1 - noise) { - return -1; - } - - double precision = (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); - - return useFMeasure ? getFMeasure(recall, precision) : getAccuracy(recall, precision); + throw new Error("ClassLearningProblem error: not implemented"); } // @Deprecated @@ -478,6 +542,13 @@ return 0; } + @SuppressWarnings("unused") + private double getInverseJaccardDistance(TreeSet<Individual> set1, TreeSet<Individual> set2) { + Set<Individual> intersection = Helper.intersection(set1, set2); + Set<Individual> union = Helper.union(set1, set2); + return 1 - (union.size() - intersection.size()) / (double) union.size(); + } + // computes accuracy from coverage and protusion (changing this function may // make it necessary to change the appoximation too) private double getAccuracy(double coverage, double protusion) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-12-17 15:18:25
|
Revision: 1932 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1932&view=rev Author: jenslehmann Date: 2009-12-17 15:18:17 +0000 (Thu, 17 Dec 2009) Log Message: ----------- option instanceBasedDisjoints in CELOE and OCEL Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -164,6 +164,7 @@ options.add(CommonConfigOptions.getMaxDepth(7)); options.add(CommonConfigOptions.maxNrOfResults(10)); options.add(new BooleanConfigOption("singleSuggestionMode", "Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples.", false)); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); return options; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -239,6 +239,7 @@ options.add(CommonConfigOptions.minExecutionTimeInSeconds()); options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); options.add(CommonConfigOptions.getLogLevel()); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); return options; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -214,6 +214,7 @@ options.add(new DoubleConfigOption("startNodeBonus", "You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).",0.0)); options.add(new IntegerConfigOption("negationPenalty", "Penalty on negations (TODO: better explanation).", 0)); options.add(CommonConfigOptions.getExpansionPenaltyFactor(0.02)); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); return options; } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -183,6 +183,15 @@ public boolean getSingleSuggestionMode() { return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "singleSuggestionMode") ; } +/** +* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getInstanceBasedDisjoints() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "instanceBasedDisjoints") ; +} /** * @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. @@ -310,6 +319,15 @@ ComponentManager.getInstance().applyConfigEntry(cELOE, "singleSuggestionMode", singleSuggestionMode); reinitNecessary = true; } +/** +* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "instanceBasedDisjoints", instanceBasedDisjoints); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -413,6 +413,15 @@ public double getExpansionPenaltyFactor() { return (Double) ComponentManager.getInstance().getConfigOptionValue(rOLComponent2, "expansionPenaltyFactor") ; } +/** +* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getInstanceBasedDisjoints() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLComponent2, "instanceBasedDisjoints") ; +} /** * @param writeSearchTree specifies whether to write a search tree. @@ -765,6 +774,15 @@ ComponentManager.getInstance().applyConfigEntry(rOLComponent2, "expansionPenaltyFactor", expansionPenaltyFactor); reinitNecessary = true; } +/** +* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { +ComponentManager.getInstance().applyConfigEntry(rOLComponent2, "instanceBasedDisjoints", instanceBasedDisjoints); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -287,6 +287,15 @@ public String getLogLevel() { return (String) ComponentManager.getInstance().getConfigOptionValue(rOLearner, "logLevel") ; } +/** +* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getInstanceBasedDisjoints() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLearner, "instanceBasedDisjoints") ; +} /** * @param writeSearchTree specifies whether to write a search tree. @@ -513,6 +522,15 @@ ComponentManager.getInstance().applyConfigEntry(rOLearner, "logLevel", logLevel); reinitNecessary = true; } +/** +* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { +ComponentManager.getInstance().applyConfigEntry(rOLearner, "instanceBasedDisjoints", instanceBasedDisjoints); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -39,6 +39,8 @@ // below are optional parameters (neutral return values choosen) + public abstract boolean getInstanceBasedDisjoints(); + public boolean getUseHasValueConstructor() { return false; } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-12-15 22:17:07 UTC (rev 1931) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-12-17 15:18:17 UTC (rev 1932) @@ -228,6 +228,7 @@ this.useBooleanDatatypes = useBooleanDatatypes; this.useDoubleDatatypes = useDoubleDatatypes; useStringDatatypes = configurator.getUseStringDatatypes(); + instanceBasedDisjoints = configurator.getInstanceBasedDisjoints(); if(startClass != null) { this.startClass = startClass; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-12-15 22:17:21
|
Revision: 1931 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1931&view=rev Author: lorenz_b Date: 2009-12-15 22:17:07 +0000 (Tue, 15 Dec 2009) Log Message: ----------- Fixed SPARQL-extraction, now cursor is set to default after canceling task. Added table to last wizard step - here all changes during the repair process are shown. Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/UnsatClassesTableCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/rendering/ManchesterSyntaxTableCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/WizardController.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/RepairPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/SavePanel.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTableModel.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -70,7 +70,7 @@ private OWLDataFactory factory; private OWLOntologyManager manager; - private Set<OWLOntologyChange> globalChanges; + private List<OWLOntologyChange> globalChanges; @@ -80,7 +80,7 @@ this.factory = manager.getOWLDataFactory(); this.ontology = (reasoner.getOWLAPIOntologies()); - globalChanges = new HashSet<OWLOntologyChange>(); + globalChanges = new ArrayList<OWLOntologyChange>(); } @@ -115,12 +115,26 @@ } + public void addNewClassDescription(NamedClass old, Description newDesc){ + OWLDescription oldOWLAPIDesc = OWLAPIConverter.getOWLAPIDescription(old); + OWLDescription newOWLAPIDesc = OWLAPIConverter.getOWLAPIDescription(newDesc); + OWLEquivalentClassesAxiom equivAxiom = factory.getOWLEquivalentClassesAxiom(oldOWLAPIDesc, newOWLAPIDesc); + AddAxiom add = new AddAxiom(ontology, equivAxiom); + try { + manager.applyChange(add); + globalChanges.add(add); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + /** * Rewrite ontology by replacing old class with new learned class description. * @param newDesc * @param oldClass */ - public List<OWLOntologyChange> rewriteClassDescription(Description newDesc, Description oldClass){ + public List<OWLOntologyChange> rewriteClassDescription(NamedClass newDesc, Description oldClass){ OWLDescription newClassDesc = OWLAPIDescriptionConvertVisitor.getOWLDescription(newDesc); // OWLDescription oldClassDesc = OWLAPIDescriptionConvertVisitor.getOWLDescription(oldClass); @@ -492,6 +506,10 @@ } + public List<OWLOntologyChange> getChanges(){ + return globalChanges; + } + /** * checks whether desc1 and desc2 are disjoint. * @param desc1 class 1 Modified: trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -11,7 +11,6 @@ import org.semanticweb.owl.model.AddAxiom; import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLOntologyChange; -import org.semanticweb.owl.model.OWLOntologyChangeException; import org.semanticweb.owl.model.OWLOntologyManager; import org.semanticweb.owl.model.RemoveAxiom; Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTable.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -84,7 +84,7 @@ return b; } }); - getColumn(4).setHeaderValue(new ImageIcon("src/dl-learner/org/dllearner/tools/ore/DeleteCross.gif")); + getColumn(4).setHeaderValue(new ImageIcon(this.getClass().getResource("../DeleteCross.gif"))); getSelectionModel().addListSelectionListener( new ListSelectionListener() { @@ -200,7 +200,7 @@ setForeground(table.getForeground()); setBackground(UIManager.getColor("Button.background")); } - setIcon(new ImageIcon("src/dl-learner/org/dllearner/tools/ore/Edit16.gif")); + setIcon(new ImageIcon(this.getClass().getResource("../Edit16.gif"))); setText(""); return this; } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExtractFromSparqlDialog.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.SortedSet; import java.util.TreeSet; @@ -41,6 +42,7 @@ import javax.swing.JToggleButton; import javax.swing.ProgressMonitor; import javax.swing.SwingWorker; +import javax.swing.Timer; import javax.swing.border.TitledBorder; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; @@ -84,26 +86,41 @@ private SparqlExtractOptionsPanel optionsPanel; private JToggleButton optionsButton; - private ImageIcon toggledIcon = new ImageIcon("src/dl-learner/org/dllearner/tools/ore/toggled.gif"); - private ImageIcon untoggledIcon = new ImageIcon("src/dl-learner/org/dllearner/tools/ore/untoggled.gif"); + private ImageIcon toggledIcon = new ImageIcon(this.getClass().getResource("../toggled.gif")); + private ImageIcon untoggledIcon = new ImageIcon(this.getClass().getResource("../untoggled.gif")); - + private final String URLHelpText = "<html><table border=\"1\">" + + "<tr>" + + "<th>SPARQL endpoint URL</th>" + + "<th>The URL of the SPARQL endpoint</th>" + + "</tr>" + + "<tr>" + + "<th>Default graph URI</th>" + + "<th>Absolute URL of RDF data source(s) to populate the background graph</th>" + + "</tr> " + + "</table></html>"; + + private final String classHelpText = "Enter a class uri or label for which a " + + "relevant fragment should be extracted."; + private SPARQLTasks task; private SparqlKnowledgeSource ks; private OntologyExtractingTask extractTask; private ProgressMonitor mon; + private Timer t; private Map<URL, List<String>> endpointToDefaultGraph; public ExtractFromSparqlDialog(JFrame owner) { super(owner, "Extract fragment from SPARQL endpoint", true); - + getLocale().setDefault(Locale.ENGLISH); + // Create the controls createControls(); //create main panel createSparqlPanel(); - //add predifined endpoints - addPredifinedEndpoints(); + //add predefined endpoints + addPredefinedEndpoints(); positionErrorDialog(owner); } @@ -159,6 +176,7 @@ endPointHolderPanel.add(new JLabel("Default graph URI (optional)")); endPointHolderPanel.add(defaultGraphField); HelpablePanel endPointHelpPanel = new HelpablePanel(endPointHolderPanel); + endPointHelpPanel.setHelpText(URLHelpText); endPointHelpPanel.setBorder(new TitledBorder("SPARQL endpoint")); panel.add(endPointHelpPanel, c); @@ -181,6 +199,7 @@ classField.getDocument().addDocumentListener(this); classHolderPanel.add(classField); HelpablePanel classHelpPanel = new HelpablePanel(classHolderPanel); + classHelpPanel.setHelpText(classHelpText); classHelpPanel.setBorder(new TitledBorder("Class to investigate")); panel.add(classHelpPanel, c); @@ -246,7 +265,7 @@ getContentPane().add(panel, BorderLayout.CENTER); } - private void addPredifinedEndpoints(){ + private void addPredefinedEndpoints(){ endpointToDefaultGraph = new HashMap<URL, List<String>>(); for(SparqlEndpoint endpoint : SparqlEndpoint.listEndpoints()){ endpointToDefaultGraph.put(endpoint.getURL(), endpoint.getDefaultGraphURIs()); @@ -318,12 +337,35 @@ message.setText("Checking SPARQL endpoint availability"); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + setLocale(Locale.ENGLISH); mon = new ProgressMonitor(this, "Extracting fragment", "", 0, 100); + mon.setMillisToDecideToPopup(0); + mon.setMillisToPopup(0); + mon.getAccessibleContext().getLocale().setDefault(Locale.ENGLISH); + t = new Timer(1000,new ActionListener() { + + + @Override + public void actionPerformed(ActionEvent e) { + + if(mon.isCanceled()){ + extractTask.cancel(true); + setCursor(null); + t.stop(); + + } + + } + }); + t.start(); + extractTask = new OntologyExtractingTask(this, mon); extractTask.addPropertyChangeListener(this); extractTask.execute(); + + } private boolean urlIsConnectable() @@ -470,9 +512,13 @@ okButton.setEnabled(true); message.setText("<html><font color=\"green\">Fragment successfully extracted</html>"); + } else if(isCancelled()){ + System.out.println("Canceled"); } } + + private SortedSet<String> getPosExamples(String concept){ SortedSet<String> examples = new TreeSet<String>(); SortedSet<String> superClasses = task.getSuperClasses(concept, 2); @@ -529,6 +575,7 @@ if ("progress" == evt.getPropertyName() ) { if(mon.isCanceled()){ extractTask.cancel(true); + this.setCursor(null); } } } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/RepairTable.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -27,7 +27,7 @@ * */ private static final long serialVersionUID = -621497634521668635L; - private final Icon deleteIcon = new ImageIcon("src/dl-learner/org/dllearner/tools/ore/Delete16.gif"); + private final Icon deleteIcon = new ImageIcon(this.getClass().getResource("../Delete16.gif")); public RepairTable() { super(new RepairTableModel()); Added: trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTable.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTable.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -0,0 +1,39 @@ +package org.dllearner.tools.ore.ui; + +import java.awt.Color; +import java.util.List; + +import javax.swing.ListSelectionModel; + +import org.dllearner.tools.ore.ui.rendering.ManchesterSyntaxTableCellRenderer; +import org.jdesktop.swingx.JXTable; +import org.semanticweb.owl.model.OWLOntologyChange; + +public class StatsTable extends JXTable { + + /** + * + */ + private static final long serialVersionUID = -653996873095101940L; + + public StatsTable(){ + + setModel(new StatsTableModel()); + setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + setEditable(false); + setTableHeader(null); + setGridColor(Color.LIGHT_GRAY); + setRowHeight(getRowHeight() + 4); + getColumn(0).setMaxWidth(100); + setShowGrid(false); +// getColumn(1).setCellRenderer(new ManchesterSyntaxTableCellRenderer()); + setRowSelectionAllowed(false); + setCellSelectionEnabled(false); + setColumnSelectionAllowed(false); + } + + public void setChanges(List<OWLOntologyChange> changes){ + ((StatsTableModel)getModel()).setChanges(changes); + } + +} Added: trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTableModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTableModel.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/StatsTableModel.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -0,0 +1,53 @@ +package org.dllearner.tools.ore.ui; + +import java.util.ArrayList; +import java.util.List; + +import javax.swing.table.AbstractTableModel; + +import org.dllearner.tools.ore.ui.rendering.ManchesterSyntaxRenderer; +import org.semanticweb.owl.model.OWLOntologyChange; +import org.semanticweb.owl.model.RemoveAxiom; + +public class StatsTableModel extends AbstractTableModel { + + /** + * + */ + private static final long serialVersionUID = 3186572572333098359L; + private List<OWLOntologyChange> changes; + + public StatsTableModel(){ + changes = new ArrayList<OWLOntologyChange>(); + } + + @Override + public int getColumnCount() { + return 2; + } + + @Override + public int getRowCount() { + return changes.size(); + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + if(columnIndex == 0){ + if(changes.get(rowIndex) instanceof RemoveAxiom){ + return "Removed"; + } else { + return "Added"; + } + } else { + return ManchesterSyntaxRenderer.render(changes.get(rowIndex).getAxiom(), false, 0); + } + } + + public void setChanges(List<OWLOntologyChange> changes){ + this.changes.clear(); + this.changes.addAll(changes); + fireTableDataChanged(); + } + +} Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/UnsatClassesTableCellRenderer.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/UnsatClassesTableCellRenderer.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/UnsatClassesTableCellRenderer.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -28,7 +28,7 @@ if(value instanceof OWLClass){ if(rootClasses.contains((OWLClass)value)){ // setText(value.toString() ); - setIcon(new ImageIcon("src/dl-learner/org/dllearner/tools/ore/information.png")); + setIcon(new ImageIcon(this.getClass().getResource("../information.png"))); // setHorizontalTextPosition(LEADING); } else { Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/rendering/ManchesterSyntaxTableCellRenderer.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/rendering/ManchesterSyntaxTableCellRenderer.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/rendering/ManchesterSyntaxTableCellRenderer.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -34,7 +34,7 @@ } @Override - protected void setValue(Object value) { + protected void setValue(Object value) {System.out.println(value); if(value instanceof Description){ OWLDescription desc = OWLAPIDescriptionConvertVisitor.getOWLDescription((Description)value); render(desc); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/WizardController.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/WizardController.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/WizardController.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -178,9 +178,14 @@ LearningManager.getInstance().setNewDescriptions(descriptions); } + } else if(currentPanelDescriptor.getPanelDescriptorIdentifier().equals(ManualLearnPanelDescriptor.IDENTIFIER)){ + OREManager oreMan = OREManager.getInstance(); + oreMan.getModifier().addNewClassDescription(oreMan.getCurrentClass2Learn(), + oreMan.getNewClassDescription().getDescription()); } else if(nextPanelDescriptor.equals(RepairPanelDescriptor.IDENTIFIER)){ + RepairPanelDescriptor repair = ((RepairPanelDescriptor) model .getPanelHashMap().get(nextPanelDescriptor)); if(LearningManager.getInstance().getLearningMode() == LearningManager.AUTO_LEARN_MODE){ @@ -205,6 +210,22 @@ // .getOntologyChanges().addAll(changes); } + if(nextPanelDescriptor.equals(RepairPanelDescriptor.IDENTIFIER)){ + + RepairPanelDescriptor repair = ((RepairPanelDescriptor) model + .getPanelHashMap().get(nextPanelDescriptor)); + if(LearningManager.getInstance().getLearningMode() == LearningManager.AUTO_LEARN_MODE){ + repair.setManualPanel(false); + repair.fillExamplesLists(); + } else { + repair.setManualPanel(true); + repair.fillExamplesLists(); + } + + + + + } if (nextPanelDescriptor instanceof WizardPanelDescriptor.FinishIdentifier) { wizard.close(Wizard.FINISH_RETURN_CODE); } else { Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/RepairPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/RepairPanelDescriptor.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/RepairPanelDescriptor.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -108,13 +108,13 @@ public void setManualPanel(boolean value){ repairPanel.setManualStyle(value); + repairPanel.addActionListeners(this); } /** * Method to control actions by button pressed. */ public void actionPerformed(ActionEvent event) { - if(event.getActionCommand().equals("next")){ LearningManager.getInstance().setNextDescription(); } else { Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -81,6 +81,7 @@ @Override public void aboutToDisplayPanel() { getWizard().getInformationField().setText(INFORMATION); + savePanel.updateChangesTable(); } @Override @@ -129,6 +130,8 @@ } } + + } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/SavePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/SavePanel.java 2009-12-14 20:14:32 UTC (rev 1930) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/SavePanel.java 2009-12-15 22:17:07 UTC (rev 1931) @@ -20,11 +20,19 @@ package org.dllearner.tools.ore.ui.wizard.panels; +import java.awt.GridBagConstraints; +import java.awt.GridLayout; import java.awt.event.ActionListener; +import javax.swing.BoxLayout; import javax.swing.JButton; +import javax.swing.JFrame; import javax.swing.JPanel; +import javax.swing.JScrollPane; +import org.dllearner.tools.ore.OREManager; +import org.dllearner.tools.ore.ui.StatsTable; + /** * JPanel where to buttons are added to save and go back to class choose panel. * @author Lorenz Buehmann @@ -38,13 +46,26 @@ private static final long serialVersionUID = 4301954036023325496L; private JButton saveExit; private JButton saveGoBack; + private StatsTable changesTable; public SavePanel(){ - super(); + setLayout(new GridLayout(0,1)); + GridBagConstraints c = new GridBagConstraints(); + c.fill = GridBagConstraints.BOTH; + c.weightx = 1.0; + c.weighty = 1.0; + changesTable = new StatsTable(); + add(new JScrollPane(changesTable), c); + JPanel buttonHolderPanel = new JPanel(); + buttonHolderPanel.setLayout(new BoxLayout(buttonHolderPanel, BoxLayout.X_AXIS)); + saveExit = new JButton("Save and Exit"); + buttonHolderPanel.add(saveExit); + saveGoBack = new JButton("Save and go to class choose panel"); - add(saveExit); - add(saveGoBack); + buttonHolderPanel.add(saveGoBack); + + add(buttonHolderPanel, c); } /** @@ -55,4 +76,15 @@ saveExit.addActionListener(aL); saveGoBack.addActionListener(aL); } + + public void updateChangesTable(){ + changesTable.setChanges(OREManager.getInstance().getModifier().getChanges()); + } + + public static void main(String[] args){ + JFrame frame = new JFrame(); + frame.add(new SavePanel()); + frame.setSize(400, 400); + frame.setVisible(true); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-12-14 20:14:39
|
Revision: 1930 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1930&view=rev Author: lorenz_b Date: 2009-12-14 20:14:32 +0000 (Mon, 14 Dec 2009) Log Message: ----------- Modified build task. Provided showing executed actions in last step. Modified Paths: -------------- trunk/build.xml trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/tools/ore/log4j.properties Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:ignore - .lastUsedExample .settings .project .classpath classes log cache cachePersistant reports results local rdbtoonto the_log.txt tmp fragmentOntology.owl output ling + .lastUsedExample .settings .project .classpath classes log cache cachePersistant reports results local rdbtoonto the_log.txt tmp fragmentOntology.owl output ling bin log Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-12-08 21:47:58 UTC (rev 1929) +++ trunk/build.xml 2009-12-14 20:14:32 UTC (rev 1930) @@ -15,6 +15,9 @@ <property name="version_dir" value="dllearner-${today}" /> <property name="release_tmp_dir" value="release/${version_dir}" /> <property name="release_php_client_tmp_dir" value="release/php-client-${today}" /> + <property name="release_ore_dir" value="release/ore-${today}" /> + <property name="version_ore_dir" value="ore-${today}" /> + <!-- other settings --> <!-- maximum amount of allocated memory in startup scripts --> @@ -493,58 +496,58 @@ <!-- we also need to copy some images, which should be included in dllearner.jar --> <copy toDir="classes_tmp" > - <fileset dir="${source_dir}" includes="**/*.gif,**/*.html,**/*.txt"/> + <fileset dir="${source_dir}" includes="**/*.gif,**/*.png,**/*.html,**/*.txt"/> </copy> - <mkdir dir="${release_tmp_dir}"/> - <mkdir dir="${release_tmp_dir}/lib/"/> - <jar jarfile="${release_tmp_dir}/lib/dllearner.jar"> + <mkdir dir="${release_ore_dir}"/> + <mkdir dir="${release_ore_dir}/lib/"/> + <jar jarfile="${release_ore_dir}/lib/dllearner.jar"> <fileset dir="classes_tmp"/> </jar> <delete dir="classes_tmp"/> <!-- copy all other libraries --> - <copy toDir="${release_tmp_dir}/lib"> + <copy toDir="${release_ore_dir}/lib"> <fileset dir="${lib_dir}" /> </copy> <!-- copy binary files and examples --> - <copy toDir="${release_tmp_dir}/examples"> - <fileset dir="examples"/> + <copy toDir="${release_ore_dir}/examples"> + <fileset dir="examples/ore"/> </copy> - <copy toDir="${release_tmp_dir}"> + <copy toDir="${release_ore_dir}"> <fileset dir="bin"/> </copy> <!-- create file containing the build info --> - <echo file="${release_tmp_dir}/build.txt" append="false">DL-Learner Build ${today}</echo> + <echo file="${release_ore_dir}/build.txt" append="false">ORE Build ${today}</echo> <!-- create empty log directory for release --> - <mkdir dir="${release_tmp_dir}/log" /> + <mkdir dir="${release_ore_dir}/log" /> <!-- create tar.gz files (allows storing whether a file is executable) --> <tar longfile="gnu" destfile="ore-nosource-${today}.tar.gz" compression="gzip"> <!-- extra set for executable files --> <tarfileset dir="release/" mode="755"> - <include name="${version_dir}/OREApplication" /> + <include name="${version_ore_dir}/ore" /> </tarfileset> <tarfileset dir="release/"> - <exclude name="${version_dir}/OREApplication"/> + <exclude name="${version_ore_dir}/ore"/> </tarfileset> </tar> <!-- copy source code --> - <mkdir dir="${release_tmp_dir}/src/"/> - <copy toDir="${release_tmp_dir}/src/"> - <fileset dir="${source_dir}" includes="**/*.java,**/*.html,**/*.gif,**/*.jjt,build.xml"/> + <mkdir dir="${release_ore_dir}/src/"/> + <copy toDir="${release_ore_dir}/src/"> + <fileset dir="${source_dir}" includes="**/*.java,**/*.html,**/*.gif,**/*.png,*/*.jjt,build.xml"/> </copy> <!-- create backup (= standard build + source code + developer documentation) --> <tar longfile="gnu" destfile="ore-${today}.tar.gz" compression="gzip"> <tarfileset dir="release/" mode="755"> - <include name="${version_dir}/OREApplication" /> + <include name="${version_ore_dir}/ore" /> </tarfileset> <tarfileset dir="release/"> - <exclude name="${version_dir}/OREApplication"/> + <exclude name="${version_ore_dir}/ore"/> </tarfileset> </tar> <delete dir="release"/> Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java 2009-12-08 21:47:58 UTC (rev 1929) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OREApplication.java 2009-12-14 20:14:32 UTC (rev 1930) @@ -23,8 +23,6 @@ import java.awt.Dimension; import java.awt.Font; import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; import java.util.Collections; import java.util.Comparator; import java.util.Locale; @@ -36,7 +34,6 @@ import javax.swing.UnsupportedLookAndFeelException; import javax.swing.plaf.FontUIResource; -import org.apache.log4j.PropertyConfigurator; import org.dllearner.tools.ore.ui.wizard.Wizard; import org.dllearner.tools.ore.ui.wizard.WizardPanelDescriptor; import org.dllearner.tools.ore.ui.wizard.descriptors.AutoLearnPanelDescriptor; @@ -61,13 +58,9 @@ * @param args possible is to use URI as parameter */ public static void main(String[] args) { - try { - PropertyConfigurator.configure(new URL("file:src/dl-learner/org/dllearner/tools/ore/log4j.properties")); - } catch (MalformedURLException e1) { - e1.printStackTrace(); - } + try { // UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-12-08 21:47:58 UTC (rev 1929) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-12-14 20:14:32 UTC (rev 1930) @@ -20,7 +20,6 @@ package org.dllearner.tools.ore; -import java.io.File; import java.net.URI; import java.util.ArrayList; import java.util.Collection; @@ -40,7 +39,6 @@ import org.dllearner.reasoning.PelletReasoner; import org.dllearner.utilities.owl.OWLAPIConverter; import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; -import org.semanticweb.owl.io.OWLXMLOntologyFormat; import org.semanticweb.owl.model.AddAxiom; import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLClass; @@ -57,9 +55,7 @@ import org.semanticweb.owl.model.OWLOntologyChange; import org.semanticweb.owl.model.OWLOntologyChangeException; import org.semanticweb.owl.model.OWLOntologyManager; -import org.semanticweb.owl.model.OWLOntologyStorageException; import org.semanticweb.owl.model.RemoveAxiom; -import org.semanticweb.owl.model.UnknownOWLOntologyException; import org.semanticweb.owl.util.OWLEntityRemover; /** @@ -74,14 +70,18 @@ private OWLDataFactory factory; private OWLOntologyManager manager; + private Set<OWLOntologyChange> globalChanges; + public OntologyModifier(PelletReasoner reasoner){ this.reasoner = reasoner; this.manager = reasoner.getOWLOntologyManager(); this.factory = manager.getOWLDataFactory(); this.ontology = (reasoner.getOWLAPIOntologies()); + globalChanges = new HashSet<OWLOntologyChange>(); + } /** @@ -105,10 +105,12 @@ AddAxiom axiom = new AddAxiom(ontology, axiomOWLAPI); try { manager.applyChange(axiom); + globalChanges.add(axiom); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } + return axiom; } @@ -146,6 +148,7 @@ //apply changes to ontology try { manager.applyChanges(changes); + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { System.err.println("Error: rewriting class description failed"); e.printStackTrace(); @@ -173,16 +176,14 @@ try { reasoner.updateCWAOntology(changes); manager.applyChanges(changes); - return changes; + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } + return changes; - - return null; - } /** * Removes a classAssertion. @@ -204,15 +205,13 @@ try { reasoner.updateCWAOntology(changes); manager.applyChange(rm); - return changes; + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - - return null; + return changes; } /** @@ -235,16 +234,16 @@ try { reasoner.updateCWAOntology(changes); manager.applyChange(am); - return changes; + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } + + return changes; - return null; - } /** @@ -277,14 +276,16 @@ try { reasoner.updateCWAOntology(changes); manager.applyChanges(changes); - return changes; + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } - return null; + return changes; + + } /** @@ -335,13 +336,14 @@ try { reasoner.updateCWAOntology(changes); manager.applyChanges(changes); - return changes; + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } - return null; + + return changes; } @@ -378,7 +380,7 @@ if(remove != null){ reasoner.updateCWAOntology(changes); manager.applyChange(remove); - return changes; + globalChanges.addAll(changes); } } catch (OWLOntologyChangeException e) { @@ -386,7 +388,7 @@ e.printStackTrace(); } - return null; + return changes; } @@ -412,13 +414,12 @@ try { reasoner.updateCWAOntology(changes); manager.applyChanges(changes); - return changes; - - + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } + return changes; } @@ -443,16 +444,24 @@ try { reasoner.updateCWAOntology(changes); manager.applyChange(axiom); - return changes; + globalChanges.addAll(changes); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } - return null; + return changes; } - + public void applyOntologyChanges(List<OWLOntologyChange> changes){ + try { + manager.applyChanges(changes); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + globalChanges.addAll(changes); + } /** * undo changes of type {@link OWLOntologyChange}. @@ -478,7 +487,7 @@ // TODO Auto-generated catch block e.printStackTrace(); } - + globalChanges.removeAll(changes); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java 2009-12-08 21:47:58 UTC (rev 1929) +++ trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java 2009-12-14 20:14:32 UTC (rev 1930) @@ -145,13 +145,14 @@ } public void executeRepairPlan(){ - - try { - manager.applyChanges(new ArrayList<OWLOntologyChange>(repairPlan)); - } catch (OWLOntologyChangeException e) { - System.out.println("Error in Repairmanager: Couldn't apply ontology changes"); - e.printStackTrace(); - } + OREManager.getInstance().getModifier().applyOntologyChanges(new ArrayList<OWLOntologyChange>(repairPlan)); +// try { +// +// manager.applyChanges(new ArrayList<OWLOntologyChange>(repairPlan)); +// } catch (OWLOntologyChangeException e) { +// System.out.println("Error in Repairmanager: Couldn't apply ontology changes"); +// e.printStackTrace(); +// } undoStack.push(new ArrayList<OWLOntologyChange>(repairPlan)); List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(repairPlan); @@ -163,14 +164,14 @@ public void undo(){ List<OWLOntologyChange> changes = undoStack.pop(); redoStack.push(changes); + OREManager.getInstance().getModifier().applyOntologyChanges(getInverseChanges(changes)); +// try { +// manager.applyChanges(getInverseChanges(changes)); +// } catch (OWLOntologyChangeException e) { +// System.out.println("Error in Repairmanager: Couldn't apply ontology changes"); +// e.printStackTrace(); +// } - try { - manager.applyChanges(getInverseChanges(changes)); - } catch (OWLOntologyChangeException e) { - System.out.println("Error in Repairmanager: Couldn't apply ontology changes"); - e.printStackTrace(); - } - fireRepairPlanExecuted(changes); } Deleted: trunk/src/dl-learner/org/dllearner/tools/ore/log4j.properties =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/log4j.properties 2009-12-08 21:47:58 UTC (rev 1929) +++ trunk/src/dl-learner/org/dllearner/tools/ore/log4j.properties 2009-12-14 20:14:32 UTC (rev 1930) @@ -1,6 +0,0 @@ -log4j.rootLogger=INFO, A -log4j.logger.org.dllearner.tools.ore.explanation = DEBUG, A -log4j.logger.org.dllearner.tools.ore.explanation.HSTExplanationGenerator = INFO, A -log4j.appender.A=org.apache.log4j.ConsoleAppender -log4j.appender.A.layout=org.apache.log4j.PatternLayout -log4j.appender.A.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c: %m%n This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-12-08 21:48:07
|
Revision: 1929 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1929&view=rev Author: jenslehmann Date: 2009-12-08 21:47:58 +0000 (Tue, 08 Dec 2009) Log Message: ----------- operator test added Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java trunk/src/dl-learner/org/dllearner/test/junit/RefinementOperatorTests.java trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-12-02 08:56:36 UTC (rev 1928) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-12-08 21:47:58 UTC (rev 1929) @@ -159,8 +159,11 @@ // convert tree to standard description Description description = descriptionTree.transformToDescription(); + +// double accuracy = getLearningProblem().getAccuracyOrTooWeak(description, 0); int negCovers = getLearningProblem().coveredNegativeExamplesOrTooWeak(description); if(negCovers == -1) { +// if(accuracy == -1) { node.setTooWeak(); } else { node.setCoveredNegatives(negCovers); @@ -200,6 +203,7 @@ private boolean stoppingCriteriaSatisfied() { // in some cases, there could be no candidate left ... if(candidates.isEmpty()) { +// System.out.println("EMPTY"); return true; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java 2009-12-02 08:56:36 UTC (rev 1928) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/StableHeuristic.java 2009-12-08 21:47:58 UTC (rev 1929) @@ -19,6 +19,7 @@ */ package org.dllearner.algorithms.el; + /** * A stable comparator for search tree nodes. Stable means that the order * of nodes will not change during the run of the learning algorithm. In @@ -30,10 +31,30 @@ */ public class StableHeuristic implements ELHeuristic { + private ELDescriptionTreeComparator cmp = new ELDescriptionTreeComparator(); + @Override public int compare(SearchTreeNode o1, SearchTreeNode o2) { - // TODO Auto-generated method stub - return 0; + + double diff = o2.getCoveredNegatives() - o1.getCoveredNegatives(); + + if(diff>0) { + return 1; + } else if(diff<0) { + return -1; + } else { + + double sizeDiff = o2.getDescriptionTree().size - o1.getDescriptionTree().size; + + if(sizeDiff == 0) { + return cmp.compare(o1.getDescriptionTree(), o2.getDescriptionTree()); + } else if(sizeDiff>0) { + return 1; + } else { + return -1; + } + + } } } Modified: trunk/src/dl-learner/org/dllearner/test/junit/RefinementOperatorTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/RefinementOperatorTests.java 2009-12-02 08:56:36 UTC (rev 1928) +++ trunk/src/dl-learner/org/dllearner/test/junit/RefinementOperatorTests.java 2009-12-08 21:47:58 UTC (rev 1929) @@ -42,6 +42,8 @@ import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; import org.dllearner.reasoning.OWLAPIReasoner; +import org.dllearner.refinementoperators.ELDown2; +import org.dllearner.refinementoperators.RefinementOperator; import org.dllearner.refinementoperators.RhoDRDown; import org.dllearner.test.junit.TestOntologies.TestOntology; import org.dllearner.utilities.Helper; @@ -174,6 +176,19 @@ assertTrue(results.size()==desiredResultSize); } + @Test + public void rhoDRDownTest4() throws ParseException, LearningProblemUnsupportedException { + ReasonerComponent rs = TestOntologies.getTestOntology(TestOntology.RHO1); + RefinementOperator operator = new RhoDRDown(rs); + Description concept = KBParser.parseConcept("(car AND EXISTS hasOwner.person)"); +// Description concept = Thing.instance; + Set<Description> refinements = operator.refine(concept, 6); + for(Description refinement : refinements) { + System.out.println(refinement); + } + } + + private String uri(String name) { return "\""+baseURI+name+"\""; } Modified: trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-12-02 08:56:36 UTC (rev 1928) +++ trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-12-08 21:47:58 UTC (rev 1929) @@ -42,7 +42,7 @@ */ public final class TestOntologies { - public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE, DBPEDIA_OWL, TRAINS_OWL }; + public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE, DBPEDIA_OWL, TRAINS_OWL, RHO1 }; public static ReasonerComponent getTestOntology(TestOntology ont) { String kbString = ""; @@ -110,6 +110,15 @@ kbString += "r3(a,b).\n"; kbString += "r4(a,b).\n"; kbString += "r5(a,b).\n"; + } else if(ont.equals(TestOntology.RHO1)) { + kbString += "suv SUB car.\n"; + kbString += "limo SUB car.\n"; + kbString += "man SUB person.\n"; + kbString += "woman SUB person.\n"; + kbString += "(person AND car) = BOTTOM.\n"; + kbString += "OPDOMAIN(hasOwner) = car.\n"; + kbString += "OPRANGE(hasOwner) = person.\n"; + kbString += "hasOwner(opel123,person123).\n"; } else if(ont.equals(TestOntology.FATHER_OE)) { owlFile = "examples/family/father_oe.owl"; } else if(ont.equals(TestOntology.CARCINOGENESIS)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-12-02 08:56:46
|
Revision: 1928 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1928&view=rev Author: lorenz_b Date: 2009-12-02 08:56:36 +0000 (Wed, 02 Dec 2009) Log Message: ----------- Added 'save as' function for the modified ontologies. Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/OREManager.java trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/ui/OverrideFileChooser.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OREManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OREManager.java 2009-12-01 17:59:11 UTC (rev 1927) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OREManager.java 2009-12-02 08:56:36 UTC (rev 1928) @@ -1,5 +1,6 @@ package org.dllearner.tools.ore; +import java.io.File; import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; @@ -36,10 +37,13 @@ import org.dllearner.utilities.owl.OWLAPIConverter; import org.mindswap.pellet.exceptions.InconsistentOntologyException; import org.mindswap.pellet.utils.SetUtils; +import org.semanticweb.owl.io.OWLXMLOntologyFormat; import org.semanticweb.owl.model.OWLDataFactory; import org.semanticweb.owl.model.OWLDescription; import org.semanticweb.owl.model.OWLObjectProperty; import org.semanticweb.owl.model.OWLOntologyCreationException; +import org.semanticweb.owl.model.OWLOntologyStorageException; +import org.semanticweb.owl.model.UnknownOWLOntologyException; public class OREManager { @@ -169,6 +173,23 @@ reasoner.loadOntologies(); } + /** + * Save the ontology in OWL/XML format. + * @param file The file to save as. + * @throws OWLOntologyStorageException + * + */ + public void saveOntology(File file) throws OWLOntologyStorageException{ + + try { + reasoner.getOWLOntologyManager().saveOntology(reasoner.getOWLAPIOntologies(), new OWLXMLOntologyFormat(), file.toURI()); + } catch (UnknownOWLOntologyException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + public void makeOWAToCWA(){ reasoner.dematerialise(); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-12-01 17:59:11 UTC (rev 1927) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-12-02 08:56:36 UTC (rev 1928) @@ -20,6 +20,7 @@ package org.dllearner.tools.ore; +import java.io.File; import java.net.URI; import java.util.ArrayList; import java.util.Collection; @@ -39,7 +40,7 @@ import org.dllearner.reasoning.PelletReasoner; import org.dllearner.utilities.owl.OWLAPIConverter; import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; -import org.semanticweb.owl.io.RDFXMLOntologyFormat; +import org.semanticweb.owl.io.OWLXMLOntologyFormat; import org.semanticweb.owl.model.AddAxiom; import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLClass; @@ -154,26 +155,7 @@ } - /** - * Saves the ontology as RDF-file. - */ - public void saveOntology(){ - - - URI physicalURI2 = URI.create("file:/tmp/MyOnt2.owl"); - - try { - manager.saveOntology(ontology, new RDFXMLOntologyFormat(), physicalURI2); - } catch (UnknownOWLOntologyException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (OWLOntologyStorageException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } /** * Deletes the complete individual from the ontology. * @param ind the individual to delete Added: trunk/src/dl-learner/org/dllearner/tools/ore/ui/OverrideFileChooser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/OverrideFileChooser.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/OverrideFileChooser.java 2009-12-02 08:56:36 UTC (rev 1928) @@ -0,0 +1,45 @@ +package org.dllearner.tools.ore.ui; + +import java.io.File; + +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; + +import org.dllearner.tools.ore.OREManager; +import org.semanticweb.owl.model.OWLOntologyStorageException; + +public class OverrideFileChooser extends JFileChooser { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void approveSelection() { + File f = super.getSelectedFile(); + if (f.exists()) { + int ans = JOptionPane.showConfirmDialog(null, "" + f.getName() + " already exists. Overwrite?", "Confirm Overwrite", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); + if (ans == JOptionPane.OK_OPTION) { + try { + OREManager.getInstance().saveOntology(f); + super.approveSelection(); + } catch (OWLOntologyStorageException e) { + JOptionPane.showMessageDialog(this, "Could not save file: " + e.getCause(), "Error", JOptionPane.ERROR_MESSAGE); + } + + } + } else { + try { + OREManager.getInstance().saveOntology(f); + super.approveSelection(); + } catch (OWLOntologyStorageException e) { + JOptionPane.showMessageDialog(this, "Could not save file: " + e.getCause(), "Error", JOptionPane.ERROR_MESSAGE); + } + } + + } + + + +} Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java 2009-12-01 17:59:11 UTC (rev 1927) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java 2009-12-02 08:56:36 UTC (rev 1928) @@ -41,8 +41,10 @@ import org.dllearner.tools.ore.ui.wizard.panels.KnowledgeSourcePanel; import org.protege.editor.core.ui.OpenFromURIPanel; import org.protege.editor.core.ui.error.ErrorLogPanel; +import org.protege.editor.owl.model.OntologyFileFilter; import org.semanticweb.owl.io.UnparsableOntologyException; import org.semanticweb.owl.model.OWLOntologyCreationException; +import org.semanticweb.owl.model.OWLOntologyFormat; /** * Wizard panel descriptor where knowledge source is selected. @@ -180,7 +182,7 @@ } private void updateRecentList(){ - knowledgePanel.updateRecentList(); + knowledgePanel.updateRecentList(this); } public KnowledgeSourcePanel getPanel() { Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java 2009-12-01 17:59:11 UTC (rev 1927) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java 2009-12-02 08:56:36 UTC (rev 1928) @@ -22,10 +22,14 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileFilter; + import org.dllearner.tools.ore.LearningManager; import org.dllearner.tools.ore.OREManager; -import org.dllearner.tools.ore.OntologyModifier; +import org.dllearner.tools.ore.ui.OverrideFileChooser; import org.dllearner.tools.ore.ui.wizard.WizardPanelDescriptor; import org.dllearner.tools.ore.ui.wizard.panels.SavePanel; @@ -40,6 +44,8 @@ "or 'Save and choose another class' button to save the changes and go back to class choose panel."; private SavePanel savePanel; + final JFileChooser fc = new OverrideFileChooser(); + public SavePanelDescriptor() { savePanel = new SavePanel(); @@ -48,6 +54,22 @@ setPanelDescriptorIdentifier(IDENTIFIER); setPanelComponent(savePanel); + fc.setFileFilter(new FileFilter() { + + @Override + public String getDescription() { + return "RDF/XML, OWL/XML"; + } + + @Override + public boolean accept(File f) { + if (f.isDirectory()) { + return true; + } + return f.getName().toLowerCase().endsWith(".owl") + || f.getName().toLowerCase().endsWith(".rdf"); + } + }); } @@ -77,21 +99,36 @@ @Override public void actionPerformed(ActionEvent e) { - OntologyModifier modifier = OREManager.getInstance().getModifier(); + if(e.getActionCommand().equals("Save and go to class choose panel")){ - modifier.saveOntology(); - if(LearningManager.getInstance().getLearningMode() == LearningManager.MANUAL_LEARN_MODE){ - getWizard().setCurrentPanel(ClassChoosePanelDescriptor.IDENTIFIER); - } else { - getWizard().setCurrentPanel(AutoLearnPanelDescriptor.IDENTIFIER); + if(saveOntology()){ + if(LearningManager.getInstance().getLearningMode() == LearningManager.MANUAL_LEARN_MODE){ + getWizard().setCurrentPanel(ClassChoosePanelDescriptor.IDENTIFIER); + } else { + getWizard().setCurrentPanel(AutoLearnPanelDescriptor.IDENTIFIER); + } } + }else if(e.getActionCommand().equals("Save and Exit")){ - modifier.saveOntology(); - getWizard().close(0); + if(saveOntology()){ + getWizard().close(0); + } + } } + + private boolean saveOntology(){ + int ret = fc.showSaveDialog(savePanel); + + if(ret == JFileChooser.APPROVE_OPTION){ + return true; + } else { + return false; + } + + } } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java 2009-12-01 17:59:11 UTC (rev 1927) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java 2009-12-02 08:56:36 UTC (rev 1928) @@ -124,7 +124,7 @@ metricsPanel.setVisible(true); } - public void updateRecentList(){ + public void updateRecentList(ActionListener aL){ recentLinkBox.removeAll(); openFromRecentLinks.clear(); LinkLabel link; @@ -133,8 +133,9 @@ link.setName("recent"); openFromRecentLinks.add(link); recentLinkBox.add(link); - + link.addLinkListener(aL); } + } public void addListeners(ActionListener aL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-12-01 17:59:18
|
Revision: 1927 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1927&view=rev Author: jenslehmann Date: 2009-12-01 17:59:11 +0000 (Tue, 01 Dec 2009) Log Message: ----------- - max execution time for EL base algorithm implemented - cross benchmark extended - several small changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java Added Paths: ----------- trunk/examples/cross-benchmark/arch/arch_el.conf trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf trunk/examples/cross-benchmark/forte/uncle_el.conf trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf trunk/examples/cross-benchmark/poker/pair_el.conf trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf trunk/examples/cross-benchmark/poker/straight_el.conf trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf trunk/examples/cross-benchmark/trains/trains_el.conf trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf Added: trunk/examples/cross-benchmark/arch/arch_el.conf =================================================================== --- trunk/examples/cross-benchmark/arch/arch_el.conf (rev 0) +++ trunk/examples/cross-benchmark/arch/arch_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,10 @@ +algorithm = el; +el.instanceBasedDisjoints = false; +reasoner = owlAPIReasoner; +import("arch.owl"); + ++c1 ++c4 +-c2 +-c3 +-c5 Added: trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/arch/arch_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,10 @@ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +reasoner = owlAPIReasoner; +import("arch.owl"); + ++c1 ++c4 +-c2 +-c3 +-c5 Added: trunk/examples/cross-benchmark/forte/uncle_el.conf =================================================================== --- trunk/examples/cross-benchmark/forte/uncle_el.conf (rev 0) +++ trunk/examples/cross-benchmark/forte/uncle_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,116 @@ +/** + * Extracted from the FORTE (First Order Revision of Theories from Examples) + * data set: + * + * http://www.cs.utexas.edu/users/ml/forte.html + * + * The goal of this learning problem is to learn the concept of an uncle. + * + * In the file forte_family.kb, you can find a graphical representation of the + * family tree corresponding to the facts in this file. + * + * possible solution: (male AND (EXISTS hasSibling.EXISTS hasChild.TOP + * OR EXISTS married.EXISTS hasSibling.EXISTS hasChild.TOP)) + * + * Copyright (C) 2007, Jens Lehmann + */ + + +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("forte_family.owl"); + +/** examples **/ + + +// complete example set ++art ++calvin ++carlos ++david ++eric ++fred ++frederick ++george ++harry ++jack ++james ++jonas ++karl ++leon ++mark ++melvin ++neil ++nero ++owen ++paul ++peter ++umo ++walt + +-alfred +-alice +-angela +-ann +-beatrice +-bob +-callie +-carl +-christy +-cornelia +-deanna +-elisa +-f12 +-f14 +-f19 +-f2 +-f20 +-f21 +-f22 +-f23 +-f25 +-f26 +-f28 +-f8 +-fannie +-gail +-helen +-jane +-janet +-kari +-lorrie +-m1 +-m10 +-m11 +-m13 +-m15 +-m16 +-m17 +-m18 +-m24 +-m27 +-m29 +-m3 +-m4 +-m5 +-m6 +-m7 +-m9 +-maria +-martha +-nancy +-nonnie +-oma +-paula +-prissie +-rachel +-ray +-regina +-steve +-susan +-terri +-terry +-wendy + Added: trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/forte/uncle_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,116 @@ +/** + * Extracted from the FORTE (First Order Revision of Theories from Examples) + * data set: + * + * http://www.cs.utexas.edu/users/ml/forte.html + * + * The goal of this learning problem is to learn the concept of an uncle. + * + * In the file forte_family.kb, you can find a graphical representation of the + * family tree corresponding to the facts in this file. + * + * possible solution: (male AND (EXISTS hasSibling.EXISTS hasChild.TOP + * OR EXISTS married.EXISTS hasSibling.EXISTS hasChild.TOP)) + * + * Copyright (C) 2007, Jens Lehmann + */ + + +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("forte_family.owl"); + +/** examples **/ + + +// complete example set ++art ++calvin ++carlos ++david ++eric ++fred ++frederick ++george ++harry ++jack ++james ++jonas ++karl ++leon ++mark ++melvin ++neil ++nero ++owen ++paul ++peter ++umo ++walt + +-alfred +-alice +-angela +-ann +-beatrice +-bob +-callie +-carl +-christy +-cornelia +-deanna +-elisa +-f12 +-f14 +-f19 +-f2 +-f20 +-f21 +-f22 +-f23 +-f25 +-f26 +-f28 +-f8 +-fannie +-gail +-helen +-jane +-janet +-kari +-lorrie +-m1 +-m10 +-m11 +-m13 +-m15 +-m16 +-m17 +-m18 +-m24 +-m27 +-m29 +-m3 +-m4 +-m5 +-m6 +-m7 +-m9 +-maria +-martha +-nancy +-nonnie +-oma +-paula +-prissie +-rachel +-ray +-regina +-steve +-susan +-terri +-terry +-wendy + Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution is: +(severity_harm AND (NOT benefit_victim) AND (vicarious OR voluntary)) + + + Examples: + 23 positive + 20 negative + + ***********************/ + algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +/** background knowledge **/ +import("moral_43instances_complex.owl"); + + +/** Examples **/ ++p0 ++p1 ++p2 ++p3 ++p4 ++p5 ++p6 ++p7 ++p8 ++p9 ++p10 ++p90 ++p91 ++p92 ++p93 ++p94 ++p95 ++p96 ++p97 ++p98 ++p99 ++p100 ++p101 +-n0 +-n1 +-n2 +-n3 +//-n4 +-n5 +-n6 +-n7 +-n8 +-n9 +-n10 +-n90 +-n91 +-n92 +-n93 +-n94 +-n95 +-n96 +-n97 +-n98 +-n99 Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_complex_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution is: +(severity_harm AND (NOT benefit_victim) AND (vicarious OR voluntary)) + + + Examples: + 23 positive + 20 negative + + ***********************/ + algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +/** background knowledge **/ +import("moral_43instances_complex.owl"); + + +/** Examples **/ ++p0 ++p1 ++p2 ++p3 ++p4 ++p5 ++p6 ++p7 ++p8 ++p9 ++p10 ++p90 ++p91 ++p92 ++p93 ++p94 ++p95 ++p96 ++p97 ++p98 ++p99 ++p100 ++p101 +-n0 +-n1 +-n2 +-n3 +//-n4 +-n5 +-n6 +-n7 +-n8 +-n9 +-n10 +-n90 +-n91 +-n92 +-n93 +-n94 +-n95 +-n96 +-n97 +-n98 +-n99 Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution should be: + guilty = (blameworthy OR vicarious_blame ). + + + Examples: + 23 positive + 20 negative + + ***********************/ +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + /** background knowledge **/ + import("moral_43instances.owl"); + + + /** Examples **/ + +p0 + +p1 + +p2 + +p3 + +p4 + +p5 + +p6 + +p7 + +p8 + +p9 + +p10 + +p90 + +p91 + +p92 + +p93 + +p94 + +p95 + +p96 + +p97 + +p98 + +p99 + +p100 + +p101 + -n0 + -n1 + -n2 + -n3 + //-n4 + -n5 + -n6 + -n7 + -n8 + -n9 + -n10 + -n90 + -n91 + -n92 + -n93 + -n94 + -n95 + -n96 + -n97 + -n98 + -n99 Added: trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/moral_reasoner/moral_43examples_simple_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,63 @@ + /*********************** + solution should be: + guilty = (blameworthy OR vicarious_blame ). + + + Examples: + 23 positive + 20 negative + + ***********************/ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + /** background knowledge **/ + import("moral_43instances.owl"); + + + /** Examples **/ + +p0 + +p1 + +p2 + +p3 + +p4 + +p5 + +p6 + +p7 + +p8 + +p9 + +p10 + +p90 + +p91 + +p92 + +p93 + +p94 + +p95 + +p96 + +p97 + +p98 + +p99 + +p100 + +p101 + -n0 + -n1 + -n2 + -n3 + //-n4 + -n5 + -n6 + -n7 + -n8 + -n9 + -n10 + -n90 + -n91 + -n92 + -n93 + -n94 + -n95 + -n96 + -n97 + -n98 + -n99 Added: trunk/examples/cross-benchmark/poker/pair_el.conf =================================================================== --- trunk/examples/cross-benchmark/poker/pair_el.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/pair_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,64 @@ +/** + * See pair.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + +/*Background knowledge*/ +import("pair50.owl"); + +/*Examples*/ +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand1" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" ++"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" ++"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" ++"http://localhost/foo#hand18" ++"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" ++"http://localhost/foo#hand21" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand23" ++"http://localhost/foo#hand24" ++"http://localhost/foo#hand25" ++"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" ++"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" ++"http://localhost/foo#hand35" ++"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" ++"http://localhost/foo#hand38" ++"http://localhost/foo#hand39" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" ++"http://localhost/foo#hand43" +-"http://localhost/foo#hand44" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" ++"http://localhost/foo#hand47" ++"http://localhost/foo#hand48" Added: trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/pair_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,64 @@ +/** + * See pair.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; + +/*Background knowledge*/ +import("pair50.owl"); + +/*Examples*/ +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand1" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" ++"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" ++"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" ++"http://localhost/foo#hand18" ++"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" ++"http://localhost/foo#hand21" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand23" ++"http://localhost/foo#hand24" ++"http://localhost/foo#hand25" ++"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" ++"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" ++"http://localhost/foo#hand35" ++"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" ++"http://localhost/foo#hand38" ++"http://localhost/foo#hand39" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" ++"http://localhost/foo#hand43" +-"http://localhost/foo#hand44" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" ++"http://localhost/foo#hand47" ++"http://localhost/foo#hand48" Added: trunk/examples/cross-benchmark/poker/straight_el.conf =================================================================== --- trunk/examples/cross-benchmark/poker/straight_el.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/straight_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,71 @@ +/** + * See straight.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +/*Background knowledge*/ +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("straight.owl"); + +/*Examples*/ ++"http://localhost/foo#hand1" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand44" + +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" +-"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" +-"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" +-"http://localhost/foo#hand18" +-"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" +-"http://localhost/foo#hand21" +-"http://localhost/foo#hand23" +-"http://localhost/foo#hand24" +-"http://localhost/foo#hand25" +-"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" +-"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" +-"http://localhost/foo#hand35" +-"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" +-"http://localhost/foo#hand38" +-"http://localhost/foo#hand39" +-"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" +-"http://localhost/foo#hand43" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" +-"http://localhost/foo#hand47" +-"http://localhost/foo#hand48" +-"http://localhost/foo#hand49" +-"http://localhost/foo#hand50" +-"http://localhost/foo#hand51" +-"http://localhost/foo#hand52" +-"http://localhost/foo#hand53" +-"http://localhost/foo#hand54" Added: trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/poker/straight_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,71 @@ +/** + * See straight.conf. This is the same learning problem, but loading + * background knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +/*Background knowledge*/ +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +import("straight.owl"); + +/*Examples*/ ++"http://localhost/foo#hand1" ++"http://localhost/foo#hand22" ++"http://localhost/foo#hand40" ++"http://localhost/foo#hand44" + +-"http://localhost/foo#hand0" +-"http://localhost/foo#hand2" +-"http://localhost/foo#hand3" +-"http://localhost/foo#hand4" +-"http://localhost/foo#hand5" +-"http://localhost/foo#hand6" +-"http://localhost/foo#hand7" +-"http://localhost/foo#hand8" +-"http://localhost/foo#hand9" +-"http://localhost/foo#hand10" +-"http://localhost/foo#hand11" +-"http://localhost/foo#hand12" +-"http://localhost/foo#hand13" +-"http://localhost/foo#hand14" +-"http://localhost/foo#hand15" +-"http://localhost/foo#hand16" +-"http://localhost/foo#hand17" +-"http://localhost/foo#hand18" +-"http://localhost/foo#hand19" +-"http://localhost/foo#hand20" +-"http://localhost/foo#hand21" +-"http://localhost/foo#hand23" +-"http://localhost/foo#hand24" +-"http://localhost/foo#hand25" +-"http://localhost/foo#hand26" +-"http://localhost/foo#hand27" +-"http://localhost/foo#hand28" +-"http://localhost/foo#hand29" +-"http://localhost/foo#hand30" +-"http://localhost/foo#hand31" +-"http://localhost/foo#hand32" +-"http://localhost/foo#hand33" +-"http://localhost/foo#hand34" +-"http://localhost/foo#hand35" +-"http://localhost/foo#hand36" +-"http://localhost/foo#hand37" +-"http://localhost/foo#hand38" +-"http://localhost/foo#hand39" +-"http://localhost/foo#hand41" +-"http://localhost/foo#hand42" +-"http://localhost/foo#hand43" +-"http://localhost/foo#hand45" +-"http://localhost/foo#hand46" +-"http://localhost/foo#hand47" +-"http://localhost/foo#hand48" +-"http://localhost/foo#hand49" +-"http://localhost/foo#hand50" +-"http://localhost/foo#hand51" +-"http://localhost/foo#hand52" +-"http://localhost/foo#hand53" +-"http://localhost/foo#hand54" Added: trunk/examples/cross-benchmark/trains/trains_el.conf =================================================================== --- trunk/examples/cross-benchmark/trains/trains_el.conf (rev 0) +++ trunk/examples/cross-benchmark/trains/trains_el.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,28 @@ +/** + * See arch.conf. This is the same learning problem, but loading background + * knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +algorithm = el; +el.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +hidePrefix = "http://example.com/foo#"; + +/*Background knowledge*/ + +import("trains.owl"); + +/*Examples*/ ++"http://example.com/foo#east1" ++"http://example.com/foo#east2" ++"http://example.com/foo#east3" ++"http://example.com/foo#east4" ++"http://example.com/foo#east5" +-"http://example.com/foo#west6" +-"http://example.com/foo#west7" +-"http://example.com/foo#west8" +-"http://example.com/foo#west9" +-"http://example.com/foo#west10" Added: trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf =================================================================== --- trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf (rev 0) +++ trunk/examples/cross-benchmark/trains/trains_el_disjunctive.conf 2009-12-01 17:59:11 UTC (rev 1927) @@ -0,0 +1,28 @@ +/** + * See arch.conf. This is the same learning problem, but loading background + * knowledge from an OWL file instead. + * + * Copyright (C) 2007, Jens Lehmann + */ + +algorithm = disjunctiveEL; +disjunctiveEL.instanceBasedDisjoints = false; +refexamples.useCardinalityRestrictions = false; +reasoner = owlAPIReasoner; +hidePrefix = "http://example.com/foo#"; + +/*Background knowledge*/ + +import("trains.owl"); + +/*Examples*/ ++"http://example.com/foo#east1" ++"http://example.com/foo#east2" ++"http://example.com/foo#east3" ++"http://example.com/foo#east4" ++"http://example.com/foo#east5" +-"http://example.com/foo#west6" +-"http://example.com/foo#west7" +-"http://example.com/foo#west8" +-"http://example.com/foo#west9" +-"http://example.com/foo#west10" Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -49,6 +49,7 @@ import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.refinementoperators.RefinementOperator; import org.dllearner.refinementoperators.RhoDRDown; @@ -393,7 +394,7 @@ if(accuracy > bestAccuracy) { bestAccuracy = accuracy; bestDescription = description; - logger.info("more accurate (" + dfPercent.format(bestAccuracy) + ") class expression found: " + descriptionToString(bestDescription)); + logger.info("more accurate (" + dfPercent.format(bestAccuracy) + ") class expression found: " + descriptionToString(bestDescription)); // + getTemporaryString(bestDescription)); } return true; } @@ -574,12 +575,21 @@ int current = 1; String str = ""; for(EvaluatedDescription ed : bestEvaluatedDescriptions.getSet().descendingSet()) { - str += current + ": " + descriptionToString(ed.getDescription()) + " " + dfPercent.format(ed.getAccuracy()) + "\n"; + // temporary code + if(learningProblem instanceof PosNegLPStandard) { + str += current + ": " + descriptionToString(ed.getDescription()) + " (pred. acc.: " + dfPercent.format(((PosNegLPStandard)learningProblem).getPredAccuracyOrTooWeakExact(ed.getDescription(),1)) + ", F-measure: "+ dfPercent.format(((PosNegLPStandard)learningProblem).getFMeasureOrTooWeakExact(ed.getDescription(),1)) + ")\n"; + } else { + str += current + ": " + descriptionToString(ed.getDescription()) + " " + dfPercent.format(ed.getAccuracy()) + "\n"; + } current++; } return str; } +// private String getTemporaryString(Description description) { +// return descriptionToString(description) + " (pred. acc.: " + dfPercent.format(((PosNegLPStandard)learningProblem).getPredAccuracyOrTooWeakExact(description,1)) + ", F-measure: "+ dfPercent.format(((PosNegLPStandard)learningProblem).getFMeasureOrTooWeakExact(description,1)) + ")"; +// } + private void updateMinMaxHorizExp(OENode node) { int newHorizExp = node.getHorizontalExpansion(); Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -34,7 +34,7 @@ public class OEHeuristicRuntime implements Comparator<OENode>{ // strong penalty for long descriptions - private double expansionPenaltyFactor = 0.1; + private double expansionPenaltyFactor = 0.01; // 0.1; // bonus for being better than parent node private double gainBonusFactor = 0.3; // penalty if a node description has very many refinements since exploring Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -32,6 +32,9 @@ import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.Configurator; import org.dllearner.core.configurators.ELLearningAlgorithmConfigurator; +import org.dllearner.core.options.CommonConfigOptions; +import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; @@ -59,6 +62,9 @@ private boolean isRunning = false; private boolean stop = false; + private double treeSearchTimeSeconds = 1.0; + private long treeStartTime; + // a set with limited size (currently the ordering is defined in the class itself) private EvaluatedDescriptionSet bestEvaluatedDescriptions = new EvaluatedDescriptionSet(LearningAlgorithm.MAX_NR_OF_RESULTS); @@ -68,6 +74,7 @@ public ELLearningAlgorithm(PosNegLP problem, ReasonerComponent reasoner) { super(problem, reasoner); + configurator = new ELLearningAlgorithmConfigurator(this); } public static String getName() { @@ -90,13 +97,21 @@ return configurator; } + public static Collection<ConfigOption<?>> createConfigOptions() { + Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); +// options.add(CommonConfigOptions.getNoisePercentage()); +// options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); + return options; + } + @Override public void init() throws ComponentInitException { // currently we use the stable heuristic heuristic = new StableHeuristic(); candidates = new TreeSet<SearchTreeNode>(heuristic); - operator = new ELDown2(reasoner); + operator = new ELDown2(reasoner, configurator.getInstanceBasedDisjoints()); } @Override @@ -104,6 +119,7 @@ stop = false; isRunning = true; reset(); + treeStartTime = System.nanoTime(); // create start node ELDescriptionTree top = new ELDescriptionTree(reasoner, Thing.instance); @@ -157,9 +173,13 @@ parentNode.addChild(node); } +// System.out.println("TEST"); + if(!node.isTooWeak()) { // add as candidate candidates.add(node); + +// System.out.println("TEST2"); // check whether we want to add it to the best evaluated descriptions; // to do this we pick the worst considered evaluated description @@ -178,6 +198,19 @@ } private boolean stoppingCriteriaSatisfied() { + // in some cases, there could be no candidate left ... + if(candidates.isEmpty()) { + return true; + } + + // stop when max time is reached + long runTime = System.nanoTime() - treeStartTime; + double runTimeSeconds = runTime / (double) 1000000000; + + if(runTimeSeconds >= treeSearchTimeSeconds) { + return true; + } + // stop if we have a node covering all positives and none of the negatives SearchTreeNode bestNode = candidates.last(); return (bestNode.getCoveredNegatives() == 0); Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -141,6 +141,7 @@ Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); options.add(CommonConfigOptions.getNoisePercentage()); options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); return options; } @@ -165,7 +166,7 @@ } else { startClass = Thing.instance; } - operator = new ELDown2(reasoner); + operator = new ELDown2(reasoner, configurator.getInstanceBasedDisjoints()); // noise = configurator.getNoisePercentage()/(double)100; @@ -365,6 +366,11 @@ } private boolean treeCriteriaSatisfied() { + // stop if there are no more candidates (unlikely, but can happen) + if(candidates.isEmpty()) { + return true; + } + long runTime = System.nanoTime() - treeStartTime; double runTimeSeconds = runTime / (double) 1000000000; @@ -376,6 +382,7 @@ } private boolean stoppingCriteriaSatisfied() { + // stop if we have a node covering all positives and none of the negatives // SearchTreeNode bestNode = candidates.last(); // return (bestNode.getCoveredNegatives() == 0); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -55,7 +55,25 @@ return component; } +/** +* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getInstanceBasedDisjoints() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(eLLearningAlgorithm, "instanceBasedDisjoints") ; +} +/** +* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { +ComponentManager.getInstance().applyConfigEntry(eLLearningAlgorithm, "instanceBasedDisjoints", instanceBasedDisjoints); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmDisjunctiveConfigurator.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -73,6 +73,15 @@ public String getStartClass() { return (String) ComponentManager.getInstance().getConfigOptionValue(eLLearningAlgorithmDisjunctive, "startClass") ; } +/** +* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getInstanceBasedDisjoints() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(eLLearningAlgorithmDisjunctive, "instanceBasedDisjoints") ; +} /** * @param noisePercentage the (approximated) percentage of noise within the examples. @@ -92,6 +101,15 @@ ComponentManager.getInstance().applyConfigEntry(eLLearningAlgorithmDisjunctive, "startClass", startClass); reinitNecessary = true; } +/** +* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { +ComponentManager.getInstance().applyConfigEntry(eLLearningAlgorithmDisjunctive, "instanceBasedDisjoints", instanceBasedDisjoints); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -106,7 +106,7 @@ /** * useApproximations whether to use stochastic approximations for computing accuracy. * mandatory: false| reinit necessary: true -* default value: true +* default value: false * @return boolean **/ public boolean getUseApproximations() { @@ -124,7 +124,7 @@ /** * accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true -* default value: standard +* default value: predacc * @return String **/ public String getAccuracyMethod() { @@ -177,7 +177,7 @@ /** * @param useApproximations whether to use stochastic approximations for computing accuracy. * mandatory: false| reinit necessary: true -* default value: true +* default value: false **/ public void setUseApproximations(boolean useApproximations) { ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "useApproximations", useApproximations); @@ -195,7 +195,7 @@ /** * @param accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true -* default value: standard +* default value: predacc **/ public void setAccuracyMethod(String accuracyMethod) { ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "accuracyMethod", accuracyMethod); Modified: trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -57,6 +57,7 @@ public static String logLevelDefault = "DEBUG"; public static double noisePercentageDefault = 0.0; public static boolean terminateOnNoiseReachedDefault = true; + public static boolean instanceBasedDisjointsDefault = true; public static StringConfigOption getVerbosityOption() { StringConfigOption verbosityOption = new StringConfigOption("verbosity", "control verbosity of output for this component", "warning"); @@ -195,4 +196,8 @@ public static StringConfigOption getLogLevel() { return new StringConfigOption("logLevel", "determines the logLevel for this component, can be {TRACE, DEBUG, INFO}",logLevelDefault); } + + public static BooleanConfigOption getInstanceBasedDisjoints() { + return new BooleanConfigOption("instanceBasedDisjoints", "Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.", instanceBasedDisjointsDefault); + } } Modified: trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -371,7 +371,7 @@ // generate a class with all positive examples (optional) if(generatePosExampleClass) { String phenotype = rs.getString("phenotype"); - if(phenotype.toLowerCase().contains("polymorphism")) { + if(!phenotype.toLowerCase().contains("polymorphism")) { kb.addAxiom(new ClassAssertionAxiom(deleteriousMutationClass, mutationInd)); } } @@ -385,13 +385,13 @@ long startWriteTime = System.nanoTime(); OWLAPIReasoner.exportKBToOWL(owlFile, kb, ontologyURI); long writeDuration = System.nanoTime() - startWriteTime; - System.out.println("OK (time: " + Helper.prettyPrintNanoSeconds(writeDuration) + "; file size: " + owlFile.length()/1024 + " KB)."); + System.out.println("OK (entities: " + count + "; time: " + Helper.prettyPrintNanoSeconds(writeDuration) + "; file size: " + owlFile.length()/1024 + " KB)."); // selecting examples // -> only a fraction of examples are selected as positive/negative if(pgSQL) { rs = stmt.executeQuery("SELECT * FROM fiche_mutant, mutants WHERE fiche_mutant.id=mutants.id AND " //lower(phenotype) not like 'polymorphism' AND " - + " (gain_contact is not null) AND (gain_contact != 0)"); + + " (gain_contact is not null)"); // AND (gain_contact != 0)"); } else { rs = stmt.executeQuery("SELECT * FROM " + table + " WHERE " //lower(phenotype) not like 'polymorphism' AND " + " (gain_contact is not null) AND (gain_contact != 0)"); @@ -407,33 +407,28 @@ posExamples.add(new Individual(getURI("mutation" + mutationID))); } } - - // conf example: - -// import("mutation.owl"); -// -// reasoner = fastInstanceChecker; -// -// problem = classLearning; -// classLearning.classToDescribe = "http://dl-learner.org/mutation#DeletoriousMutation"; -// classLearning.accuracyMethod = "fmeasure"; -// classLearning.approxAccuracy = 0.03; -// -// algorithm = celoe; -// celoe.maxExecutionTimeInSeconds = 10; -// celoe.noisePercentage = 10; -// celoe.maxNrOfResults = 1; -// celoe.singleSuggestionMode = true; - + // writing conf file Files.clearFile(confFile); String confHeader = "import(\"" + owlFile.getName() + "\");\n\n"; confHeader += "reasoner = fastInstanceChecker;\n"; + confHeader += "problem = classLearning;\n"; - confHeader += "classLearning.classToDescribe = \"" + deleteriousMutationClass + "\";\n"; + confHeader += "classLearning.classToDescribe = \"" + deleteriousMutationClass + "\";\n"; + confHeader += "classLearning.accuracyMethod = \"fmeasure\";\n"; + confHeader += "classLearning.approxAccuracy = 0.03;\n"; + +// confHeader += "problem = posNegLPStandard;\n"; +// confHeader += "posNegLPStandard.useApproximations = true;\n"; +// confHeader += "posNegLPStandard.accuracyMethod = \"fmeasure\";\n"; +// confHeader += "posNegLPStandard.approxAccuracy = 0.03;\n"; + confHeader += "algorithm = celoe;\n"; - confHeader += "celoe.maxExecutionTimeInSeconds = 100;\n"; - confHeader += "celoe.noisePercentage = 25;\n"; + confHeader += "celoe.maxExecutionTimeInSeconds = 10;\n"; + confHeader += "celoe.noisePercentage = 10;\n"; + confHeader += "celoe.singleSuggestionMode = true;\n"; + confHeader += "celoe.useNegation = true;\n"; + // confHeader += "refexamples.noisePercentage = 15;\n"; // confHeader += "refexamples.startClass = \"" + getURI("Mutation") + "\";\n"; // confHeader += "refexamples.writeSearchTree = false;\n"; @@ -446,6 +441,7 @@ } long runTime = System.nanoTime() - startTime; + System.out.println("Conf file written with " + posExamples.size() + " positive and " + negExamples.size() + " negative examples."); System.out.println("Database successfully converted in " + Helper.prettyPrintNanoSeconds(runTime) + "."); } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -138,6 +138,8 @@ Random rand = new Random(1); Collections.shuffle(classInstances, rand); Collections.shuffle(superClassInstances, rand); + + System.out.println(classInstances.size() + " " + superClassInstances.size()); } /** Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -293,14 +293,14 @@ throw new Error("approximating pred. acc not implemented"); } } else { - return getAccuracyOrTooWeakExact(description, noise); + return getPredAccuracyOrTooWeakExact(description, noise); } } /* (non-Javadoc) * @see org.dllearner.core.LearningProblem#getAccuracyOrTooWeak(org.dllearner.core.owl.Description, double) */ - public double getAccuracyOrTooWeakExact(Description description, double noise) { + public double getPredAccuracyOrTooWeakExact(Description description, double noise) { int maxNotCovered = (int) Math.ceil(noise*positiveExamples.size()); @@ -321,9 +321,41 @@ } } - return positiveExamples.size() - notCoveredPos + notCoveredNeg / (double) allExamples.size(); +// if(useFMeasure) { +// double recall = (positiveExamples.size() - notCoveredPos) / (double) positiveExamples.size(); +// double precision = (positiveExamples.size() - notCoveredPos) / (double) (allExamples.size() - notCoveredPos - notCoveredNeg); +// return getFMeasure(recall, precision); +// } else { + return (positiveExamples.size() - notCoveredPos + notCoveredNeg) / (double) allExamples.size(); +// } } + public double getFMeasureOrTooWeakExact(Description description, double noise) { + int additionalInstances = 0; + for(Individual ind : negativeExamples) { + if(reasoner.hasType(description, ind)) { + additionalInstances++; + } + } + + int coveredInstances = 0; + for(Individual ind : positiveExamples) { + if(reasoner.hasType(description, ind)) { + coveredInstances++; + } + } + + double recall = coveredInstances/(double)positiveExamples.size(); + + if(recall < 1 - noise) { + return -1; + } + + double precision = (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); + + return getFMeasure(recall, precision); + } + // instead of using the standard operation, we use optimisation // and approximation here public double getFMeasureOrTooWeakApprox(Description description, double noise) { @@ -438,6 +470,12 @@ precision = 0; } +// System.out.println("description: " + description); +// System.out.println("recall: " + recall); +// System.out.println("precision: " + precision); +// System.out.println("F-measure: " + getFMeasure(recall, precision)); +// System.out.println("exact: " + getAccuracyOrTooWeakExact(description, noise)); + return getFMeasure(recall, precision); } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown2.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -103,6 +103,10 @@ private TreeAndRoleSetComparator mComp = new TreeAndRoleSetComparator(); public ELDown2(ReasonerComponent rs) { + this(rs, true); + } + + public ELDown2(ReasonerComponent rs, boolean instanceBasedDisjoints) { this.rs = rs; subsumptionHierarchy = rs.getClassHierarchy(); opHierarchy = rs.getObjectPropertyHierarchy(); @@ -114,7 +118,7 @@ opRanges.put(op, rs.getRange(op)); } - utility = new Utility(rs, opDomains); + utility = new Utility(rs, opDomains, instanceBasedDisjoints); } /* (non-Javadoc) @@ -182,6 +186,9 @@ // call ncc (see paper) Set<NamedClass> candidates = utility.getClassCandidates(index, v.getLabel()); +// System.out.println("index: " + index + " label: " + v.getLabel()); +// System.out.println("candidates: " + candidates); + for(NamedClass nc : candidates) { // clone operation ELDescriptionTree clonedTree = tree.clone(); Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -58,7 +58,6 @@ // specifies whether to do real disjoint tests or check that // two named classes do not have common instances - // TODO: turn this into a parameter private boolean instanceBasedDisjoints = true; // cache for reasoner queries @@ -71,11 +70,12 @@ throw new Error("not implemented yet"); } - public Utility(ReasonerComponent rs, Map<ObjectProperty,Description> opDomains) { + public Utility(ReasonerComponent rs, Map<ObjectProperty,Description> opDomains, boolean instanceBasedDisjoints) { this.reasoner = rs; sh = rs.getClassHierarchy(); // we cache object property domains this.opDomains = opDomains; + this.instanceBasedDisjoints = instanceBasedDisjoints; } /** @@ -134,6 +134,7 @@ // for 2 of them we can stop further traversal in the subsumption // hierarchy for(Description d : sh.getSubClasses(upperClass)) { +// System.out.println("d: " + d); // owl:Nothing is never a candidate (not in EL) if(!(d instanceof Nothing)) { NamedClass candidate = (NamedClass) d; @@ -151,6 +152,7 @@ // candidate went successfully through all checks candidates.add(candidate); } else { +// System.out.println("k32: " + candidate + " index " + index + " cond1 " + isDisjoint(new Negation(candidate),index) + " cond2 " + checkSuperClasses(existingClasses,candidate)); // descend subsumption hierarchy to find candidates candidates.addAll(getClassCandidatesRecursive(index, existingClasses, candidate)); } Modified: trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -119,8 +119,10 @@ String[] algorithmPostfix = new String[4]; algorithmPostfix[0] = "_refexamples"; algorithmPostfix[1] = "_refexamples_fast"; - algorithmPostfix[2] = "_gp"; - algorithmPostfix[3] = "_hybrid"; + algorithmPostfix[2] = "_el"; + algorithmPostfix[3] = "_el_disjunctive"; +// algorithmPostfix[4] = "_gp"; +// algorithmPostfix[5] = "_hybrid"; int startAlgorithmNr = 0; // only max. 4 folds for straight problem Modified: trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -41,6 +41,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.Thing; import org.dllearner.kb.OWLFile; import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; @@ -313,6 +314,21 @@ } + @Test + public void test5() { + ReasonerComponent rs = TestOntologies.getTestOntology(TestOntology.TRAINS_OWL); + RefinementOperator operator = new ELDown2(rs); + Set<Description> refinements = operator.refine(Thing.instance); + for(Description refinement : refinements) { + System.out.println(refinement); + } + +// Set<Description> subClasses = rs.getSubClasses(Thing.instance); +// for(Description cl : subClasses) { +// System.out.println(cl); +// } + } + // not part of the regular test suite, since Galen 2 is required // @Test public void asTest() throws ComponentInitException, MalformedURLException { Modified: trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-11-30 15:49:23 UTC (rev 1926) +++ trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-12-01 17:59:11 UTC (rev 1927) @@ -32,6 +32,7 @@ import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.reasoning.OWLAPIReasoner; /** * Some ontologies to simplify unit tests. @@ -41,7 +42,7 @@ */ public final class TestOntologies { - public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE, DBPEDIA_OWL }; + public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE, DBPEDIA_OWL, TRAINS_OWL }; public static ReasonerComponent getTestOntology(TestOntology ont) { String kbString = ""; @@ -119,7 +120,9 @@ owlFile = "examples/krk/KRK_ZERO_ONE.owl"; } else if(ont.equals(TestOntology.DBPEDIA_OWL)) { owlFile = "/home/jl/promotion/ontologien/dbpedia.owl"; - } + } else if(ont.equals(TestOntology.TRAINS_OWL)) { + owlFile = "examples/cross-benchmark/trains/trains.owl"; + } try { ComponentManager cm = ComponentManager.getInstance(); @@ -139,7 +142,8 @@ } } - ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, source); + ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, source); +// ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, source); source.init(); rc.init(); return rc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-11-30 15:49:32
|
Revision: 1926 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1926&view=rev Author: lorenz_b Date: 2009-11-30 15:49:23 +0000 (Mon, 30 Nov 2009) Log Message: ----------- Recent-files list is now updated immediately. Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java 2009-11-30 02:47:39 UTC (rev 1925) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/KnowledgeSourcePanelDescriptor.java 2009-11-30 15:49:23 UTC (rev 1926) @@ -178,6 +178,10 @@ private void updateMetrics(){ knowledgePanel.updateMetrics(); } + + private void updateRecentList(){ + knowledgePanel.updateRecentList(); + } public KnowledgeSourcePanel getPanel() { return knowledgePanel; @@ -258,7 +262,9 @@ if(!isCancelled()){ TaskManager.getInstance().setTaskFinished(); getWizard().setNextFinishButtonEnabled(true); + updateRecentList(); updateMetrics(); + } } } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java 2009-11-30 02:47:39 UTC (rev 1925) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/KnowledgeSourcePanel.java 2009-11-30 15:49:23 UTC (rev 1926) @@ -124,6 +124,19 @@ metricsPanel.setVisible(true); } + public void updateRecentList(){ + recentLinkBox.removeAll(); + openFromRecentLinks.clear(); + LinkLabel link; + for (final URI uri : RecentManager.getInstance().getURIs()) { + link = new LinkLabel(uri.toString()); + link.setName("recent"); + openFromRecentLinks.add(link); + recentLinkBox.add(link); + + } + } + public void addListeners(ActionListener aL) { openFromFileLink.addLinkListener(aL); openFromURILink.addLinkListener(aL); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <neb...@us...> - 2009-11-30 02:47:49
|
Revision: 1925 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1925&view=rev Author: nebelschwade Date: 2009-11-30 02:47:39 +0000 (Mon, 30 Nov 2009) Log Message: ----------- - this is almost the final diploma-thesis-version, - added README.txt - changed some SPARQL-Queries - optimized config.ini - documentation added to code - performanceTesting Script Modified Paths: -------------- trunk/src/moosique.net/README.txt trunk/src/moosique.net/css/reset.css trunk/src/moosique.net/css/style.css trunk/src/moosique.net/index.php trunk/src/moosique.net/js/start.js trunk/src/moosique.net/moosique/classes/Config.php trunk/src/moosique.net/moosique/classes/DllearnerConnection.php trunk/src/moosique.net/moosique/classes/Recommendations.php trunk/src/moosique.net/moosique/classes/SparqlQueryBuilder.php trunk/src/moosique.net/moosique/classes/View.php trunk/src/moosique.net/moosique/config.ini trunk/src/moosique.net/moosique/data/allTagsByPopularity.txt trunk/src/moosique.net/moosique/helpers/getAllTags.php trunk/src/moosique.net/moosique/helpers/tagsToOwl.php trunk/src/moosique.net/moosique/main.wsdl Added Paths: ----------- trunk/src/moosique.net/moosique/helpers/getAllTaggedRecords.php trunk/src/moosique.net/moosique/testing/learnPerformanceTest.php trunk/src/moosique.net/moosique.owl Removed Paths: ------------- trunk/src/moosique.net/moosique/data/moosique.owl trunk/src/moosique.net/moosique/testing/def0.xsd trunk/src/moosique.net/moosique/testing/def1.xsd trunk/src/moosique.net/moosique/testing/main.wsdl Modified: trunk/src/moosique.net/README.txt =================================================================== --- trunk/src/moosique.net/README.txt 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/README.txt 2009-11-30 02:47:39 UTC (rev 1925) @@ -1,18 +1,17 @@ Installation-Requirements: ========================== - -TODO: write me! - -See /moosique/config.ini - - PHP 5.2.x or above (yes, 5.3 works) - output_buffering has to be enabled to use debugging features (if enabled in config.ini) - (FirePHP is included in this package) + (FirePHP is included in this package, but you have to install FirePHP in Firefox of course) - PEAR-Packages HTTP and HTTP_Request (used by Utilities.php from DL-Learner) - - - + - PHP Soap functionality has to be enabled (compile --enable-soap or use sth. like "yum install php-soap") - A running DL-Learner Webservice Instance - - Set paths/URLs in config.ini + - Set paths/URLs in config.ini (default values are set) + - For compiling and usage instructions visit: http://dl-learner.org/Projects/DLLearner + - Java Version 6 is required! +- If you want to use your own sparql-endpoint (virtuoso, sesame etc.) just set + "jamendo" in config.ini +- Have a look at /moosique/config.ini for all configuration options and explanation Notes: @@ -20,24 +19,43 @@ - This is a modern piece of websoftware, use a modern browser! Tested and working in: - Firefox 3.5.x - - Safari 4.x and Webkit nightly build r50383 - - Chromium Build 30678 + - Safari 4.x and Webkit nightly builds + - Chromium nightly builds and Google Chrome 4.x - Opera 10.x (though not as beautiful) -- JavaScript has to be enabled, this is an after all an AJAX-Application +- Not tested in Internet Explorer, IE8 should work, though +- JavaScript has to be enabled, this is after all an AJAX-Application - Debugging makes use of Firebug/FirePHP, thus only working in Firefox +- A decent broadband connection will be helpful for streaming and downloading music -- - Known Bugs: =========== -- Moving the current playing song in the playlist down or up - breaks the order of the playlist in the Yahoo Media Player`` +- On Mac OS X Snow Leopard if using the default JVM everything will be terribly + slow. Using another JVM (soylatte, openjdk) will cause some problems, but there + is a fix for this in the config.ini Planned Features: ================= - RDFa Support for artist information -- Unique URLs for ajax (bookmarkable, Back-Button) -- Scrobbling-Support for last.fm -- Playlist export and Download +- Unique URLs for ajax (bookmarkable, Back-Button-Support), + see: http://ajaxpatterns.org/Unique_URLs +- Better accessibility and keyboard support + + +Maybe someday: +============== +- User profiles --> + - Scrobbling-Support for last.fm + - Playlist export and Download, saving the playlist state for future visits +- Geonames-based search + + + +Questions? Visit me at http://nebelschwa.de and write me an email, or use +the DL-Learner racker for reporting bugs or posting feature Requests: +http://sourceforge.net/tracker/?group_id=203619 + +Best regards, + +Steffen Becker. \ No newline at end of file Modified: trunk/src/moosique.net/css/reset.css =================================================================== --- trunk/src/moosique.net/css/reset.css 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/css/reset.css 2009-11-30 02:47:39 UTC (rev 1925) @@ -1,5 +1,5 @@ -/* default minimal basic css reset by Steffen Becker */ -/* =================================================================== */ +/* default minimal basic css reset by Steffen Becker, based on YUI and eric meyers css-reset */ +/* ========================================================================================= */ @media all { html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, Modified: trunk/src/moosique.net/css/style.css =================================================================== --- trunk/src/moosique.net/css/style.css 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/css/style.css 2009-11-30 02:47:39 UTC (rev 1925) @@ -11,7 +11,7 @@ */ -@media screen { +@media screen, projection { /*=============== Default Styling ===============*/ body { font: normal 14px/20px Verdana, Arial, sans-serif; color: #f1f7e4; background: url('../img/bg.png') top left repeat #3a3a3a; } Modified: trunk/src/moosique.net/index.php =================================================================== --- trunk/src/moosique.net/index.php 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/index.php 2009-11-30 02:47:39 UTC (rev 1925) @@ -79,7 +79,7 @@ <form id="autoAdd" method="get" action=""> <div> <label for="autoAddCheckbox" title="Check this to automatically add a random song from your recommendations to your playlist everytime your recommendations are updated.">Autoadd recommendations</label> - <input type="checkbox" id="autoAddCheckbox" checked="checked" /> + <input type="checkbox" id="autoAddCheckbox" /> </div> </form> <h2>Recommendations</h2> @@ -193,7 +193,7 @@ <?php include('moosique/classes/Config.php'); $c = new Config(); - if ($c->getConfig('debug') == 1) /* if debugging is active include js without compressing anything */ { + if ($c->getConfig('debug')) { /* if debugging is active include js without compressing anything */ ?> <script src="http://mediaplayer.yahoo.com/js"></script> <script src="js/mootools-1.2.4-core-nc.js"></script> Modified: trunk/src/moosique.net/js/start.js =================================================================== --- trunk/src/moosique.net/js/start.js 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/js/start.js 2009-11-30 02:47:39 UTC (rev 1925) @@ -7,5 +7,5 @@ }; // Create an instance of the moosique.net -var moo = new Moosique({ timeToScrobble: 0.05 }); // debugging - shorter generation time -// var moo = new Moosique({ timeToScrobble: 0.5 }); +// var moo = new Moosique({ timeToScrobble: 0.05 }); // debugging - shorter generation time +var moo = new Moosique({ timeToScrobble: 0.5 }); Modified: trunk/src/moosique.net/moosique/classes/Config.php =================================================================== --- trunk/src/moosique.net/moosique/classes/Config.php 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/classes/Config.php 2009-11-30 02:47:39 UTC (rev 1925) @@ -21,7 +21,7 @@ $this->config = parse_ini_file(dirname(__FILE__) . '/../config.ini', true); // we activate the debugger output if debugging is active - if ($this->getConfig('debug') == 1) { + if ($this->getConfig('debug')) { require_once('Debugger.php'); $this->debugger = new Debugger(); ob_start(); Modified: trunk/src/moosique.net/moosique/classes/DllearnerConnection.php =================================================================== --- trunk/src/moosique.net/moosique/classes/DllearnerConnection.php 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/classes/DllearnerConnection.php 2009-11-30 02:47:39 UTC (rev 1925) @@ -143,15 +143,16 @@ $conf = $this->getConfigLearning(); if ($this->debugger) $this->debugger->log(array($instances, $positiveExamples), "Instances and positive examples are"); - /* FIXME extra ID is necessary?! - if using the already created sessionID and knowLedgeSourceID for learning, - there will always be an error, when trying to use initAll - */ - $id = $_SESSION['sessionID']; - $kID = $this->knowledgeSourceID; - // the two lines below will work, the two lines above won't - // $id = $this->client->generateID(); - // $kID = $this->client->addKnowledgeSource($id, 'sparql', $this->endpoint); + // if there are any problems with java, generate a new ID, this + // fixes broken openjdk/soap implementations + if ($this->getConfig('javaProblems')) { + $id = $this->client->generateID(); + $kID = $this->client->addKnowledgeSource($id, 'sparql', $this->endpoint); + + } else { + $id = $_SESSION['sessionID']; + $kID = $this->knowledgeSourceID; + } $this->client->addKnowledgeSource($id, 'owlfile', $this->getConfigUrl('tagOntology')); $this->client->setReasoner($id, $conf['reasoner']); @@ -164,7 +165,10 @@ // recursion-depth and fragment saving $this->client->applyConfigEntryInt($id, $kID, 'recursionDepth', $conf['recursionDepth']); $this->client->applyConfigEntryBoolean($id, $kID, 'saveExtractedFragment', $conf['saveExtractedFragment']); - + + // cache the sparql-queries? + $this->client->applyConfigEntryBoolean($id, $kID, 'useCache', $this->getConfig('useCache')); + // algorithm config $learnID = $this->client->setLearningAlgorithm($id, $conf['algorithm']); $this->client->applyConfigEntryInt($id, $learnID, 'maxExecutionTimeInSeconds', $conf['maxExecutionTimeInSeconds']); @@ -176,8 +180,11 @@ array($this->getConfigPrefixes('tags') . 'taggedWithTag'), array($this->getConfigPrefixes('rdf') . 'type') ); - // and exclude some items from this learning process fastening up things a bit - $this->client->applyConfigEntryStringArray($id, $kID, 'predList', $this->getExclusions($conf)); + // and exclude some items from this learning process to fasten things up + $exclude = $this->getExclusions($conf); + if ($conf['recursionDepth'] > 1 && is_array($exclude) && !empty($exclude)) { + $this->client->applyConfigEntryStringArray($id, $kID, 'predList', $exclude); + } // after we have set all conf-values, we initialize the learning process $this->client->initAll($id); Modified: trunk/src/moosique.net/moosique/classes/Recommendations.php =================================================================== --- trunk/src/moosique.net/moosique/classes/Recommendations.php 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/classes/Recommendations.php 2009-11-30 02:47:39 UTC (rev 1925) @@ -48,25 +48,23 @@ // precentage-value, can also be used for display, nicely formatted $score = round($solution->scoreValue*100, 2); // scores below threshold are not used for recommendations - if ($score > $this->getConfig('threshold')) { + if ($score >= $this->getConfig('threshold')) { // check for everything that is quoted $match = true; $kbSyntax = $solution->descriptionKBSyntax; - $this->debugger->log($kbSyntax); - // everything in quotes is a potential tag preg_match_all('/\"(\\.|[^\"])*\"/', $kbSyntax, $quoted); foreach($quoted[0] as $url) { if (preg_match('/^\"http:\/\//', $url)) { // if a URL, check if URL to Tag // if only one of the URLS used is not a tag, we don't use it if (!preg_match('/^\"http:\/\/dbtune\.org\/jamendo\/tag\//', $url)) { - //$match = false; + $match = false; } } } if ($match) { - $sparql = $connection->kbToSqarql($solution->descriptionKBSyntax); + $sparql = $connection->kbToSqarql($kbSyntax); // extract the subtring we use for the final sparql-query $sparql = str_replace("SELECT ?subject \nWHERE", '', $sparql); $sparql = str_replace('LIMIT ' . $this->getConfig('maxResults'), '', $sparql); @@ -74,7 +72,7 @@ // push it to the queries-array and $queries[] = $sparql; $scores[] = $score; - $kbSyntaxes[] = $solution->descriptionKBSyntax; + $kbSyntaxes[] = $kbSyntax; } } } @@ -113,7 +111,6 @@ foreach($recent as $link) { // extract relation from the cookie-link preg_match_all('#<a\s*(?:rel=[\'"]([^\'"]+)[\'"])?.*?>((?:(?!</a>).)*)</a>#i', $link, $record); - $this->debugger->log($record); $posExamples[] = $record[1][0]; $posExamples = array_unique($posExamples); $this->posExamples = $posExamples; Modified: trunk/src/moosique.net/moosique/classes/SparqlQueryBuilder.php =================================================================== --- trunk/src/moosique.net/moosique/classes/SparqlQueryBuilder.php 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/classes/SparqlQueryBuilder.php 2009-11-30 02:47:39 UTC (rev 1925) @@ -39,8 +39,8 @@ $prefixes .= 'PREFIX ' . $prefix . ': <' . $resource . '>' . "\n"; } - // if the globalLimit-config-value is set, we use maxResults as LIMIT - if ($this->getConfig('globalLimit') == 1) { + // if the globalLimit-config-value is set to true, we use maxResults as LIMIT + if ($this->getConfig('globalLimit')) { $limit = "\n" . 'LIMIT ' . $this->getConfig('maxResults'); } else { $limit = ''; @@ -48,17 +48,18 @@ // we need all information we are asking for everytime, thus * $beginStatement = 'SELECT DISTINCT * WHERE { ' . "\n"; + // we always want the xspf-playlist only, the search filters is // flagged with "i" for case-insensitive search $endStatement = "\n" . ' FILTER (regex(str(?playlist), "xspf", "i")) . } ' . $limit; - $baseQuery = ' { + $baseQuery = ' ?artist rdf:type mo:MusicArtist ; foaf:name ?artistName ; foaf:made ?record . ?record rdf:type mo:Record ; dc:title ?albumTitle . - } '; + '; $query = ''; switch($searchType) { Modified: trunk/src/moosique.net/moosique/classes/View.php =================================================================== --- trunk/src/moosique.net/moosique/classes/View.php 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/classes/View.php 2009-11-30 02:47:39 UTC (rev 1925) @@ -118,7 +118,7 @@ $count = count($data); // dont limit anything if limit == 0 if ($count > $this->limit && $this->limit > 0) { - if ($this->getConfig('randomize') == 1) { + if ($this->getConfig('randomize')) { $random = array_rand($data, $this->limit); $newData = array(); foreach($random as $randRecord) { @@ -179,7 +179,7 @@ * @author Steffen Becker */ private function showRandomLimitNote($count) { - if ($this->getConfig('randomize') == 1) { + if ($this->getConfig('randomize')) { return '<p><strong>Note:</strong> Found ' . $count . ' results, showing ' . $this->limit . ' random results.'; } else { return '<p><strong>Note:</strong> Found ' . $count . ' results, showing the first ' . $this->limit . ' results.'; @@ -373,12 +373,14 @@ * Builds the HTML for additional information for and artist * * @param array $data An array of additional information + * @param string $type the type of search * @author Steffen Becker */ private function infoHTML($data, $type) { $template = $this->getTemplate($type); $artist = $this->getValue($data['artist']); $artistName = $this->getValue($data['artistName']); + // TODO $albumList = $this->createAlbumListHTML(array($data), 'tagSearch'); $homepage = ''; // could be empty Modified: trunk/src/moosique.net/moosique/config.ini =================================================================== --- trunk/src/moosique.net/moosique/config.ini 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/config.ini 2009-11-30 02:47:39 UTC (rev 1925) @@ -1,39 +1,60 @@ ; Config file for moosique.net +; Use this values to config your installation of DL-Learner and the +; usage of the webapplication moosqiue.net [general] ; Activates global debugging, using FirePHP and Firebug -debug = 1 -; If globalLimit = 1 maxResults is used for a global SPARQL-Query LIMIT, -; if set to 0 maxResults will only be used for viewing results +debug = true +; If globalLimit = true maxResults is used for a global SPARQL-Query LIMIT, +; if set to false maxResults will only be used for viewing results ; PLEASE NOTE: global limiting to e.g. 20 may show only one result, because ; one result can have >20 tags, and this counts as total-limit -globalLimit = 0 +globalLimit = false ; setting this to 0 disables result-limitation for everything -; recommendation results and last-fm search always uses this value +; recommendation results and last-fm search always use this value +; it is highly recommended to not set this value to sth. btw. 10 and 100 +; depending on how much results you want to show the user and how +; fast you want them do display in the frontend maxResults = 20 -; this should always be 1, else the results are always the same (first ones) -randomize = 1 -; %-score a recommendation needs to have to be recommended -threshold = 30 +; this should always be true, else the results are always the same (first ones) +randomize = true +; %-score a recommendation-result needs to have to be recommended +threshold = 80 +; de/avtivate caching of sparql-queries, active = true = default +; this is mainly used for endpoint-performance testing, dont deactivate +; this in a live enviroment, searching and learning will be sloooow +useCache = true +; this is used for crappy mac osx java implementation. set to true +; if you have problems with the learning process and get soap-errors +javaProblems = true [url] +; the url the webapplication is running under base = "http://localhost/moosique.net/" +; the absolute path on your system, this is needed for the owl-file absPath = "/Users/nebelschwade/Sites/moosique.net/" -local = "http://127.0.0.1/" +; this is where the dl-learner webservice will be reachable, don't +; change this value, if you are using a default installation of the ws wsdl = "http://localhost:8181/services?wsdl" +; this is where the knowledge comes from, DBTune ftw! jamendo = "http://dbtune.org/jamendo/sparql/" -musicbrainz = "http://dbtune.org/musicbrainz/sparql/" -zitgistdata = "http://dataviewer.zitgist.com/?uri=" -; using relative paths here, abspath or base-path are added automatically +; You can use a local sparql-endpoint too, of course. +; jamendo = "http://localhost:8890/sparql/" +; using relative paths for the next values, +; abspath or base-path are added automatically +; the wdsl-file for the soap-connection, default wsdlLocal = "moosique/main.wsdl" +; this is where the random instances are gathered from allRecords = "moosique/data/allRecordsWithTags.txt" -tagOntology = "moosique/data/moosique.owl" +; the ontology of tags +tagOntology = "moosique.owl" [lastFM] ; change the api-key if you have your own apiKey = "b9877a7391416d0846ad5f240a1838f9" +; some urls for data retrieval from the last-fm api topTagsUrl = "http://ws.audioscrobbler.com/2.0/?method=user.gettoptags" topArtistsUrl = "http://ws.audioscrobbler.com/2.0/?method=user.gettopartists" artistsTopTagsUrl = "http://ws.audioscrobbler.com/2.0/?method=artist.gettoptags" @@ -46,33 +67,46 @@ ; you don't have to change [learning]-config-vars in most cases [learning] +; the learning problem here ist positive examples only +problem = "posOnlyLP" +; here we define the used learning algorithm, celoe ist the best +; one, you could also use bruteForce or Random for posOnlyLP algorithm = "celoe" -maxExecutionTimeInSeconds = 10 +; 2-5 seconds seem to be the optimum, depending on server speed +; for more than 5 seconds, the algorithm does not give any better +; results, thus higher than 5 seconds ist not needed in most cases +maxExecutionTimeInSeconds = 3 useHasValueConstructor = true valueFrequencyThreshold = 2 -problem = "posOnlyLP" +; using the default dl-learner reasoner, faster than the others (fact, pellet) reasoner = "fastInstanceChecker" -recursionDepth = 2 +recursionDepth = 1 +; save the owl in the cache-library saveExtractedFragment = true -instances = 3 +; the number of random instances to add to the posExamples +; 3-5 will give the best results +instances = 4 ; excluding predicates from sparql-extraction for faster learning, ; with prefixes - comma-seperated list -exclude = "mo:image,mo:available_as,mo:track,serql:directType" +exclude = "mo:image,mo:available_as,mo:track,serql:directType,dc:title" + ; you don't have to change the prefixes in most cases, but you can of course add some +; all used prefixes are already here, some used concepts from jamendo/dbtune are also +; defined here, but since they are not used in the sparql queries, they are commented out [prefix] -bio = "http://purl.org/vocab/bio/0.1/" -db = "http://dbtune.org/musicbrainz/resource/" dc = "http://purl.org/dc/elements/1.1/" -event = "http://purl.org/NET/c4dm/event.owl#" foaf = "http://xmlns.com/foaf/0.1/" geo = "http://www.geonames.org/ontology#" -mbz = "http://purl.org/ontology/mbz#" mo = "http://purl.org/ontology/mo/" owl = "http://www.w3.org/2002/07/owl#" rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" rdfs = "http://www.w3.org/2000/01/rdf-schema#" -rel = "http://purl.org/vocab/relationship/" tags = "http://www.holygoat.co.uk/owl/redwood/0.1/tags/" xsd = "http://www.w3.org/2001/XMLSchema#" -serql = "http://www.openrdf.org/schema/serql#" +;bio = "http://purl.org/vocab/bio/0.1/" +;db = "http://dbtune.org/musicbrainz/resource/" +;rel = "http://purl.org/vocab/relationship/" +;mbz = "http://purl.org/ontology/mbz#" +;event = "http://purl.org/NET/c4dm/event.owl#" +;serql = "http://www.openrdf.org/schema/serql#" Modified: trunk/src/moosique.net/moosique/data/allTagsByPopularity.txt =================================================================== --- trunk/src/moosique.net/moosique/data/allTagsByPopularity.txt 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/data/allTagsByPopularity.txt 2009-11-30 02:47:39 UTC (rev 1925) @@ -91,21 +91,21 @@ #http://dbtune.org/jamendo/tag/breakbeat : 96 # http://dbtune.org/jamendo/tag/rockfrancais : 94 # http://dbtune.org/jamendo/tag/zen : 93 -http://dbtune.org/jamendo/tag/original : 93 -http://dbtune.org/jamendo/tag/new : 92 + #http://dbtune.org/jamendo/tag/original : 93 + # http://dbtune.org/jamendo/tag/new : 92 #http://dbtune.org/jamendo/tag/postrock : 92 # http://dbtune.org/jamendo/tag/classical : 91 # http://dbtune.org/jamendo/tag/70s : 90 -http://dbtune.org/jamendo/tag/batterie : 88 + # http://dbtune.org/jamendo/tag/batterie : 88 #http://dbtune.org/jamendo/tag/ska : 87 # http://dbtune.org/jamendo/tag/fun : 86 #http://dbtune.org/jamendo/tag/chansons : 85 -http://dbtune.org/jamendo/tag/libre : 83 + # http://dbtune.org/jamendo/tag/libre : 83 # http://dbtune.org/jamendo/tag/80s : 82 -http://dbtune.org/jamendo/tag/festif : 82 +# http://dbtune.org/jamendo/tag/festif : 82 #http://dbtune.org/jamendo/tag/trash : 81 # http://dbtune.org/jamendo/tag/film : 80 - #http://dbtune.org/jamendo/tag/inclassable : 79 + #http://dbtune.org/jamendo/tag/inclassable : 79 ------ yeah, right. #http://dbtune.org/jamendo/tag/rockindependant : 79 http://dbtune.org/jamendo/tag/beat : 78 #http://dbtune.org/jamendo/tag/electropop : 78 @@ -113,7 +113,7 @@ #http://dbtune.org/jamendo/tag/acid : 76 http://dbtune.org/jamendo/tag/underground : 75 http://dbtune.org/jamendo/tag/live : 75 -http://dbtune.org/jamendo/tag/courdesmiracles : 73 + # http://dbtune.org/jamendo/tag/courdesmiracles : 73 http://dbtune.org/jamendo/tag/solo : 71 #http://dbtune.org/jamendo/tag/death : 70 #http://dbtune.org/jamendo/tag/electrojazz : 68 @@ -121,7 +121,7 @@ # http://dbtune.org/jamendo/tag/energique : 68 # http://dbtune.org/jamendo/tag/tacelectronic : 66 #http://dbtune.org/jamendo/tag/garage : 66 - #http://dbtune.org/jamendo/tag/free : 66 ------------ ??? (free style, free jazz etc.) + #http://dbtune.org/jamendo/tag/free : 66 ------------ ??? (free style, free jazz, free music? etc.) http://dbtune.org/jamendo/tag/sympa : 65 http://dbtune.org/jamendo/tag/ghisa : 65 http://dbtune.org/jamendo/tag/artlibre : 64 @@ -130,18 +130,18 @@ # http://dbtune.org/jamendo/tag/meditation : 63 # http://dbtune.org/jamendo/tag/relaxing : 62 http://dbtune.org/jamendo/tag/club : 61 -http://dbtune.org/jamendo/tag/soft : 61 +# http://dbtune.org/jamendo/tag/soft : 61 #http://dbtune.org/jamendo/tag/drumnbass : 61 #http://dbtune.org/jamendo/tag/excellent : 60 #http://dbtune.org/jamendo/tag/gothic : 60 http://dbtune.org/jamendo/tag/ballade : 59 http://dbtune.org/jamendo/tag/intimiste : 59 #http://dbtune.org/jamendo/tag/musicbrainz : 59 - #http://dbtune.org/jamendo/tag/good : 59 -http://dbtune.org/jamendo/tag/doux : 59 -http://dbtune.org/jamendo/tag/reposant : 58 + #http://dbtune.org/jamendo/tag/good : 59 +# http://dbtune.org/jamendo/tag/doux : 59 +# http://dbtune.org/jamendo/tag/reposant : 58 #http://dbtune.org/jamendo/tag/independant : 57 -http://dbtune.org/jamendo/tag/psycho : 56 +# http://dbtune.org/jamendo/tag/psycho : 56 #http://dbtune.org/jamendo/tag/jamendo : 56 #http://dbtune.org/jamendo/tag/rocknroll : 56 # http://dbtune.org/jamendo/tag/symphonique : 55 @@ -149,23 +149,23 @@ #http://dbtune.org/jamendo/tag/soul : 54 # http://dbtune.org/jamendo/tag/german : 54 # http://dbtune.org/jamendo/tag/easylistening : 54 -http://dbtune.org/jamendo/tag/poetique : 54 +# http://dbtune.org/jamendo/tag/poetique : 54 # http://dbtune.org/jamendo/tag/france : 53 #http://dbtune.org/jamendo/tag/jazzrock : 53 -http://dbtune.org/jamendo/tag/delirant : 53 +# http://dbtune.org/jamendo/tag/delirant : 53 #http://dbtune.org/jamendo/tag/electrorock : 53 -http://dbtune.org/jamendo/tag/poesie : 52 +# http://dbtune.org/jamendo/tag/poesie : 52 #http://dbtune.org/jamendo/tag/emo : 52 # http://dbtune.org/jamendo/tag/violon : 51 # http://dbtune.org/jamendo/tag/prog : 50 #http://dbtune.org/jamendo/tag/elektro : 50 -http://dbtune.org/jamendo/tag/envoutant : 49 +# http://dbtune.org/jamendo/tag/envoutant : 49 #http://dbtune.org/jamendo/tag/genial : 49 #http://dbtune.org/jamendo/tag/mix : 49 #http://dbtune.org/jamendo/tag/super : 49 http://dbtune.org/jamendo/tag/age : 49 -http://dbtune.org/jamendo/tag/slow : 49 -http://dbtune.org/jamendo/tag/smooth : 48 +# http://dbtune.org/jamendo/tag/slow : 49 +# http://dbtune.org/jamendo/tag/smooth : 48 # http://dbtune.org/jamendo/tag/malesinger : 48 # http://dbtune.org/jamendo/tag/synthetiseur : 48 # http://dbtune.org/jamendo/tag/flute : 47 @@ -184,7 +184,7 @@ # http://dbtune.org/jamendo/tag/retro : 44 # http://dbtune.org/jamendo/tag/oriental : 44 # http://dbtune.org/jamendo/tag/love : 44 -http://dbtune.org/jamendo/tag/indus : 44 +# http://dbtune.org/jamendo/tag/indus : 44 # http://dbtune.org/jamendo/tag/synth : 44 #http://dbtune.org/jamendo/tag/ambience : 43 #http://dbtune.org/jamendo/tag/ethnic : 43 @@ -208,7 +208,7 @@ #http://dbtune.org/jamendo/tag/black : 38 # http://dbtune.org/jamendo/tag/deutsch : 38 # http://dbtune.org/jamendo/tag/electroacoustique : 38 -http://dbtune.org/jamendo/tag/puissant : 37 +# http://dbtune.org/jamendo/tag/puissant : 37 # http://dbtune.org/jamendo/tag/espanol : 37 #http://dbtune.org/jamendo/tag/ebm : 37 #http://dbtune.org/jamendo/tag/album : 37 @@ -227,7 +227,7 @@ http://dbtune.org/jamendo/tag/culte : 35 http://dbtune.org/jamendo/tag/engage : 35 # http://dbtune.org/jamendo/tag/electrique : 35 -http://dbtune.org/jamendo/tag/mystic : 35 +# http://dbtune.org/jamendo/tag/mystic : 35 # http://dbtune.org/jamendo/tag/roots : 34 # http://dbtune.org/jamendo/tag/accordeon : 34 http://dbtune.org/jamendo/tag/rythme : 34 @@ -241,7 +241,7 @@ http://dbtune.org/jamendo/tag/power : 33 #http://dbtune.org/jamendo/tag/bien : 33 # http://dbtune.org/jamendo/tag/meditative : 33 -http://dbtune.org/jamendo/tag/trippant : 33 +# http://dbtune.org/jamendo/tag/trippant : 33 #http://dbtune.org/jamendo/tag/drumbass : 33 # http://dbtune.org/jamendo/tag/kitsch : 33 #http://dbtune.org/jamendo/tag/nujazz : 32 @@ -254,22 +254,22 @@ # http://dbtune.org/jamendo/tag/bizarre : 32 # http://dbtune.org/jamendo/tag/crossover : 31 # http://dbtune.org/jamendo/tag/avantgarde : 31 -http://dbtune.org/jamendo/tag/melodico : 31 -http://dbtune.org/jamendo/tag/son : 31 +# http://dbtune.org/jamendo/tag/melodico : 31 + # http://dbtune.org/jamendo/tag/son : 31 http://dbtune.org/jamendo/tag/bossa : 31 #http://dbtune.org/jamendo/tag/d : 31 # http://dbtune.org/jamendo/tag/ambiente : 31 http://dbtune.org/jamendo/tag/break : 31 # http://dbtune.org/jamendo/tag/relaxant : 31 # http://dbtune.org/jamendo/tag/psyche : 31 -http://dbtune.org/jamendo/tag/amour : 31 -http://dbtune.org/jamendo/tag/romantic : 31 +# http://dbtune.org/jamendo/tag/amour : 31 +# http://dbtune.org/jamendo/tag/romantic : 31 #http://dbtune.org/jamendo/tag/ethno : 31 http://dbtune.org/jamendo/tag/politique : 30 http://dbtune.org/jamendo/tag/neo : 30 #http://dbtune.org/jamendo/tag/et : 30 # http://dbtune.org/jamendo/tag/tranquille : 30 -http://dbtune.org/jamendo/tag/dreams : 30 +# http://dbtune.org/jamendo/tag/dreams : 30 #http://dbtune.org/jamendo/tag/la : 30 # http://dbtune.org/jamendo/tag/english : 30 # http://dbtune.org/jamendo/tag/celtique : 30 @@ -280,13 +280,13 @@ http://dbtune.org/jamendo/tag/school : 29 #http://dbtune.org/jamendo/tag/musica : 29 http://dbtune.org/jamendo/tag/paroles : 29 -http://dbtune.org/jamendo/tag/sensual : 29 -http://dbtune.org/jamendo/tag/impressive : 28 +# http://dbtune.org/jamendo/tag/sensual : 29 + # http://dbtune.org/jamendo/tag/impressive : 28 # http://dbtune.org/jamendo/tag/whawha : 28 # http://dbtune.org/jamendo/tag/psy : 28 #http://dbtune.org/jamendo/tag/worldmusic : 28 -http://dbtune.org/jamendo/tag/rigolo : 28 -http://dbtune.org/jamendo/tag/agreable : 28 +# http://dbtune.org/jamendo/tag/rigolo : 28 +# http://dbtune.org/jamendo/tag/agreable : 28 # http://dbtune.org/jamendo/tag/espagnol : 27 #http://dbtune.org/jamendo/tag/tribal : 27 #http://dbtune.org/jamendo/tag/copyleft : 27 @@ -299,7 +299,7 @@ #http://dbtune.org/jamendo/tag/bigbeat : 27 http://dbtune.org/jamendo/tag/samples : 26 #http://dbtune.org/jamendo/tag/country : 26 -http://dbtune.org/jamendo/tag/soyouthinkyoucantell : 26 + # http://dbtune.org/jamendo/tag/soyouthinkyoucantell : 26 http://dbtune.org/jamendo/tag/concept : 26 # http://dbtune.org/jamendo/tag/minimalistic : 26 # http://dbtune.org/jamendo/tag/chansonatexte : 26 @@ -313,7 +313,7 @@ # http://dbtune.org/jamendo/tag/berlin : 25 # http://dbtune.org/jamendo/tag/sad : 25 # http://dbtune.org/jamendo/tag/brasil : 25 -http://dbtune.org/jamendo/tag/sensuel : 25 +# http://dbtune.org/jamendo/tag/sensuel : 25 #http://dbtune.org/jamendo/tag/heavymetal : 25 #http://dbtune.org/jamendo/tag/thrash : 25 http://dbtune.org/jamendo/tag/sexy : 25 @@ -343,7 +343,7 @@ # http://dbtune.org/jamendo/tag/out : 23 http://dbtune.org/jamendo/tag/pechu : 23 http://dbtune.org/jamendo/tag/female : 23 -http://dbtune.org/jamendo/tag/emotional : 22 +# http://dbtune.org/jamendo/tag/emotional : 22 http://dbtune.org/jamendo/tag/spiritual : 22 # http://dbtune.org/jamendo/tag/bretagne : 22 #http://dbtune.org/jamendo/tag/stoner : 22 @@ -352,7 +352,7 @@ #http://dbtune.org/jamendo/tag/compilation : 22 http://dbtune.org/jamendo/tag/cuivres : 22 http://dbtune.org/jamendo/tag/chanteuse : 22 -http://dbtune.org/jamendo/tag/talentueux : 22 + # http://dbtune.org/jamendo/tag/talentueux : 22 http://dbtune.org/jamendo/tag/univers : 22 #http://dbtune.org/jamendo/tag/independent : 22 # http://dbtune.org/jamendo/tag/trombone : 22 @@ -370,7 +370,7 @@ # http://dbtune.org/jamendo/tag/percussion : 21 http://dbtune.org/jamendo/tag/art : 20 #http://dbtune.org/jamendo/tag/of : 20 -http://dbtune.org/jamendo/tag/nice : 20 + # http://dbtune.org/jamendo/tag/nice : 20 http://dbtune.org/jamendo/tag/fantasy : 20 http://dbtune.org/jamendo/tag/game : 20 http://dbtune.org/jamendo/tag/epic : 20 @@ -390,7 +390,7 @@ # http://dbtune.org/jamendo/tag/poland : 19 http://dbtune.org/jamendo/tag/dejante : 19 http://dbtune.org/jamendo/tag/sciencefiction : 19 -http://dbtune.org/jamendo/tag/acustico : 18 +# http://dbtune.org/jamendo/tag/acustico : 18 # http://dbtune.org/jamendo/tag/hardstyle : 18 http://dbtune.org/jamendo/tag/cosmic : 18 #http://dbtune.org/jamendo/tag/pro : 18 @@ -414,7 +414,7 @@ #http://dbtune.org/jamendo/tag/dancehall : 17 #http://dbtune.org/jamendo/tag/in : 17 http://dbtune.org/jamendo/tag/cold : 17 -http://dbtune.org/jamendo/tag/dreamy : 17 +# http://dbtune.org/jamendo/tag/dreamy : 17 # http://dbtune.org/jamendo/tag/italian : 17 #http://dbtune.org/jamendo/tag/realnice : 17 # http://dbtune.org/jamendo/tag/saxo : 17 @@ -423,7 +423,7 @@ #http://dbtune.org/jamendo/tag/cyberpunk : 17 #http://dbtune.org/jamendo/tag/darkambient : 17 # http://dbtune.org/jamendo/tag/powerpop : 17 -http://dbtune.org/jamendo/tag/weird : 17 +# http://dbtune.org/jamendo/tag/weird : 17 http://dbtune.org/jamendo/tag/bruitiste : 17 # http://dbtune.org/jamendo/tag/alternativo : 17 # http://dbtune.org/jamendo/tag/chiptune : 17 @@ -437,7 +437,7 @@ # http://dbtune.org/jamendo/tag/ambiental : 16 # http://dbtune.org/jamendo/tag/alternativ : 16 http://dbtune.org/jamendo/tag/political : 16 -http://dbtune.org/jamendo/tag/funny : 16 +# http://dbtune.org/jamendo/tag/funny : 16 http://dbtune.org/jamendo/tag/conscient : 16 http://dbtune.org/jamendo/tag/synthetique : 16 #http://dbtune.org/jamendo/tag/8bits : 16 @@ -451,7 +451,7 @@ # http://dbtune.org/jamendo/tag/sitar : 15 http://dbtune.org/jamendo/tag/horror : 15 # http://dbtune.org/jamendo/tag/guitares : 15 -http://dbtune.org/jamendo/tag/magique : 15 +# http://dbtune.org/jamendo/tag/magique : 15 http://dbtune.org/jamendo/tag/simple : 15 http://dbtune.org/jamendo/tag/energic : 15 http://dbtune.org/jamendo/tag/mysterieux : 15 @@ -466,24 +466,24 @@ #http://dbtune.org/jamendo/tag/tecno : 15 http://dbtune.org/jamendo/tag/style : 15 http://dbtune.org/jamendo/tag/mozeclic : 15 -http://dbtune.org/jamendo/tag/quiet : 15 -http://dbtune.org/jamendo/tag/debile : 15 +# http://dbtune.org/jamendo/tag/quiet : 15 +# http://dbtune.org/jamendo/tag/debile : 15 #http://dbtune.org/jamendo/tag/goth : 15 # http://dbtune.org/jamendo/tag/polska : 15 # http://dbtune.org/jamendo/tag/videogame : 15 # http://dbtune.org/jamendo/tag/midi : 14 -http://dbtune.org/jamendo/tag/melodies : 14 +# http://dbtune.org/jamendo/tag/melodies : 14 http://dbtune.org/jamendo/tag/piec : 14 #http://dbtune.org/jamendo/tag/skapunk : 14 # http://dbtune.org/jamendo/tag/paris : 14 -http://dbtune.org/jamendo/tag/touchant : 14 +# http://dbtune.org/jamendo/tag/touchant : 14 # http://dbtune.org/jamendo/tag/reggaeton : 14 # http://dbtune.org/jamendo/tag/clarinette : 14 #http://dbtune.org/jamendo/tag/mp3 : 14 #http://dbtune.org/jamendo/tag/very : 14 #http://dbtune.org/jamendo/tag/flamenco : 14 # http://dbtune.org/jamendo/tag/tacfolk : 14 -http://dbtune.org/jamendo/tag/hypnotic : 14 +# http://dbtune.org/jamendo/tag/hypnotic : 14 #http://dbtune.org/jamendo/tag/realgood : 14 http://dbtune.org/jamendo/tag/background : 14 # http://dbtune.org/jamendo/tag/freestyle : 14 @@ -491,12 +491,12 @@ #http://dbtune.org/jamendo/tag/tekno : 14 #http://dbtune.org/jamendo/tag/perfect : 14 #http://dbtune.org/jamendo/tag/n : 14 -http://dbtune.org/jamendo/tag/theatre : 14 +# http://dbtune.org/jamendo/tag/theatre : 14 # http://dbtune.org/jamendo/tag/downbeat : 14 http://dbtune.org/jamendo/tag/brutal : 14 -http://dbtune.org/jamendo/tag/contemporary : 14 +# http://dbtune.org/jamendo/tag/contemporary : 14 # http://dbtune.org/jamendo/tag/drums : 14 -http://dbtune.org/jamendo/tag/gesang : 13 +# http://dbtune.org/jamendo/tag/gesang : 13 http://dbtune.org/jamendo/tag/modern : 13 # http://dbtune.org/jamendo/tag/electronoise : 13 #http://dbtune.org/jamendo/tag/hot : 13 @@ -521,17 +521,17 @@ http://dbtune.org/jamendo/tag/detente : 12 # http://dbtune.org/jamendo/tag/italiano : 12 http://dbtune.org/jamendo/tag/marrant : 12 -http://dbtune.org/jamendo/tag/trippy : 12 -http://dbtune.org/jamendo/tag/enfant : 12 +# http://dbtune.org/jamendo/tag/trippy : 12 +# http://dbtune.org/jamendo/tag/enfant : 12 # http://dbtune.org/jamendo/tag/depressive : 12 # http://dbtune.org/jamendo/tag/medieval : 12 http://dbtune.org/jamendo/tag/flow : 12 # http://dbtune.org/jamendo/tag/doom : 12 -http://dbtune.org/jamendo/tag/electroindus : 12 +# http://dbtune.org/jamendo/tag/electroindus : 12 http://dbtune.org/jamendo/tag/nostalgique : 12 # http://dbtune.org/jamendo/tag/italia : 12 # http://dbtune.org/jamendo/tag/britpop : 12 -http://dbtune.org/jamendo/tag/emotions : 12 +# http://dbtune.org/jamendo/tag/emotions : 12 # http://dbtune.org/jamendo/tag/japan : 12 http://dbtune.org/jamendo/tag/lyrics : 12 # http://dbtune.org/jamendo/tag/hardtrance : 12 @@ -621,7 +621,7 @@ http://dbtune.org/jamendo/tag/spoken : 10 # http://dbtune.org/jamendo/tag/espana : 10 # http://dbtune.org/jamendo/tag/christian : 10 -http://dbtune.org/jamendo/tag/rockfestif : 10 +# http://dbtune.org/jamendo/tag/rockfestif : 10 # http://dbtune.org/jamendo/tag/electrodark : 10 # http://dbtune.org/jamendo/tag/numetal : 10 # http://dbtune.org/jamendo/tag/distorsion : 10 @@ -641,7 +641,7 @@ # http://dbtune.org/jamendo/tag/arabic : 10 # http://dbtune.org/jamendo/tag/neoclassical : 10 http://dbtune.org/jamendo/tag/barre : 9 -http://dbtune.org/jamendo/tag/parodie : 9 +# http://dbtune.org/jamendo/tag/parodie : 9 http://dbtune.org/jamendo/tag/energy : 9 # http://dbtune.org/jamendo/tag/bioteckrecords : 9 http://dbtune.org/jamendo/tag/air : 9 @@ -817,7 +817,7 @@ http://dbtune.org/jamendo/tag/recherche : 7 # http://dbtune.org/jamendo/tag/italodance : 7 http://dbtune.org/jamendo/tag/cantautor : 7 -http://dbtune.org/jamendo/tag/femalevocals : 7 +# http://dbtune.org/jamendo/tag/femalevocals : 7 http://dbtune.org/jamendo/tag/lento : 7 http://dbtune.org/jamendo/tag/violento : 7 http://dbtune.org/jamendo/tag/real : 7 @@ -858,12 +858,12 @@ http://dbtune.org/jamendo/tag/soulful : 7 http://dbtune.org/jamendo/tag/vate : 7 http://dbtune.org/jamendo/tag/dulce : 7 -http://dbtune.org/jamendo/tag/rockguitar : 7 +# http://dbtune.org/jamendo/tag/rockguitar : 7 # http://dbtune.org/jamendo/tag/est : 7 http://dbtune.org/jamendo/tag/relajante : 7 # http://dbtune.org/jamendo/tag/us : 7 http://dbtune.org/jamendo/tag/tipunk : 7 -http://dbtune.org/jamendo/tag/distortion : 7 +# http://dbtune.org/jamendo/tag/distortion : 7 http://dbtune.org/jamendo/tag/sense : 7 http://dbtune.org/jamendo/tag/nexus : 7 http://dbtune.org/jamendo/tag/cabaret : 7 Deleted: trunk/src/moosique.net/moosique/data/moosique.owl =================================================================== --- trunk/src/moosique.net/moosique/data/moosique.owl 2009-11-26 14:18:29 UTC (rev 1924) +++ trunk/src/moosique.net/moosique/data/moosique.owl 2009-11-30 02:47:39 UTC (rev 1925) @@ -1,4298 +0,0 @@ -@prefix : <http://dbtune.org/jamendo/tag/> . -@prefix mo: <http://purl.org/ontology/mo/> . -@prefix dc: <http://purl.org/dc/elements/1.1/> . -@prefix moosique: <http://moosique.net/> . -@prefix tag: <http://dbtune.org/jamendo/tag/> . -@prefix tag4: <http://dbtune.org/jamendo/tag/90> . -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . -@prefix tag5: <http://dbtune.org/jamendo/tag/8> . -@prefix tag2: <http://dbtune.org/jamendo/tag/80> . -@prefix tag3: <http://dbtune.org/jamendo/tag/60> . -@prefix owl2xml: <http://www.w3.org/2006/12/owl2-xml#> . -@prefix tag6: <http://dbtune.org/jamendo/tag/70> . -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . -@prefix owl: <http://www.w3.org/2002/07/owl#> . -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . -@base <http://dbtune.org/jamendo/tag/> . - -<http://dbtune.org/jamendo/tag/> rdf:type owl:Ontology . - - -################################################################# -# -# Classes -# -################################################################# - - -### http://dbtune.org/jamendo/tag/60s - -tag3:s rdf:type owl:Class ; - - rdfs:subClassOf :rock . - - - -### http://dbtune.org/jamendo/tag/70s - -tag6:s rdf:type owl:Class ; - - rdfs:subClassOf :pop . - - - -### http://dbtune.org/jamendo/tag/80s - -tag2:s rdf:type owl:Class ; - - rdfs:subClassOf :pop . - - - -### http://dbtune.org/jamendo/tag/8bit - -tag5:bit rdf:type owl:Class ; - - owl:equivalentClass tag5:bits , - :atari , - :chiptune , - :midi ; - - rdfs:subClassOf :computer . - - - -### http://dbtune.org/jamendo/tag/8bits - -tag5:bits rdf:type owl:Class ; - - rdfs:subClassOf :computer . - - - -### http://dbtune.org/jamendo/tag/90s - -tag4:s rdf:type owl:Class ; - - rdfs:subClassOf :pop . - - - -### http://dbtune.org/jamendo/tag/accordeon - -:accordeon rdf:type owl:Class ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/acid - -:acid rdf:type owl:Class ; - - owl:equivalentClass :bigbeat ; - - rdfs:subClassOf :house . - - - -### http://dbtune.org/jamendo/tag/acidjazz - -:acidjazz rdf:type owl:Class ; - - rdfs:subClassOf :jazz . - - - -### http://dbtune.org/jamendo/tag/acidrock - -:acidrock rdf:type owl:Class ; - - rdfs:subClassOf :psychedelic . - - - -### http://dbtune.org/jamendo/tag/acoustique - -:acoustique rdf:type owl:Class ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/africa - -:africa rdf:type owl:Class ; - - owl:equivalentClass :afrique ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/afrique - -:afrique rdf:type owl:Class ; - - owl:equivalentClass :afro ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/afro - -:afro rdf:type owl:Class ; - - rdfs:subClassOf :world . - - - -### http://dbtune.org/jamendo/tag/alternatif - -:alternatif rdf:type owl:Class ; - - owl:equivalentClass :alternativ , - :alternativo ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/alternativ - -:alternativ rdf:type owl:Class ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/alternativo - -:alternativo rdf:type owl:Class ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/ambiance - -:ambiance rdf:type owl:Class ; - - owl:equivalentClass :ambience , - :ambient ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/ambience - -:ambience rdf:type owl:Class ; - - owl:equivalentClass :ambient ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/ambient - -:ambient rdf:type owl:Class ; - - owl:equivalentClass :ambiental , - :ambiente , - :downtempo , - :planant , - :tacambient ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/ambiental - -:ambiental rdf:type owl:Class ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/ambiente - -:ambiente rdf:type owl:Class ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/anarchie - -:anarchie rdf:type owl:Class ; - - rdfs:subClassOf :punkrock . - - - -### http://dbtune.org/jamendo/tag/anglais - -:anglais rdf:type owl:Class ; - - owl:equivalentClass :english ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/arabic - -:arabic rdf:type owl:Class ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/argentina - -:argentina rdf:type owl:Class ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/asia - -:asia rdf:type owl:Class ; - - owl:equivalentClass :asian ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/asian - -:asian rdf:type owl:Class ; - - owl:equivalentClass :eastern ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/atari - -:atari rdf:type owl:Class ; - - rdfs:subClassOf :computer . - - - -### http://dbtune.org/jamendo/tag/atmospherique - -:atmospherique rdf:type owl:Class ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/avantgarde - -:avantgarde rdf:type owl:Class ; - - rdfs:subClassOf :electro , - :experimental , - :jazz . - - - -### http://dbtune.org/jamendo/tag/barcelona - -:barcelona rdf:type owl:Class ; - - rdfs:subClassOf :spanish . - - - -### http://dbtune.org/jamendo/tag/baroque - -:baroque rdf:type owl:Class ; - - rdfs:subClassOf :classique . - - - -### http://dbtune.org/jamendo/tag/basse - -:basse rdf:type owl:Class ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/belgique - -:belgique rdf:type owl:Class ; - - owl:equivalentClass :belgium ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/belgium - -:belgium rdf:type owl:Class ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/berlin - -:berlin rdf:type owl:Class ; - - rdfs:subClassOf :german . - - - -### http://dbtune.org/jamendo/tag/bigbeat - -:bigbeat rdf:type owl:Class ; - - rdfs:subClassOf :techno . - - - -### http://dbtune.org/jamendo/tag/bizzare - -:bizzare rdf:type owl:Class ; - - owl:equivalentClass :etrange ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/black - -:black rdf:type owl:Class ; - - owl:equivalentClass :blackmetal ; - - rdfs:subClassOf :house , - :metal , - :soul . - - - -### http://dbtune.org/jamendo/tag/blackmetal - -:blackmetal rdf:type owl:Class ; - - rdfs:subClassOf :metal . - - - -### http://dbtune.org/jamendo/tag/blues - -:blues rdf:type owl:Class ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/bluesrock - -:bluesrock rdf:type owl:Class ; - - rdfs:subClassOf :blues , - :rock . - - - -### http://dbtune.org/jamendo/tag/bossanova - -:bossanova rdf:type owl:Class ; - - rdfs:subClassOf :latin . - - - -### http://dbtune.org/jamendo/tag/brasil - -:brasil rdf:type owl:Class ; - - owl:equivalentClass :brazil , - :brazilian ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/brass - -:brass rdf:type owl:Class ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/brazil - -:brazil rdf:type owl:Class ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/brazilian - -:brazilian rdf:type owl:Class ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/breakbeat - -:breakbeat rdf:type owl:Class ; - - owl:equivalentClass :breakbeats ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/breakbeats - -:breakbeats rdf:type owl:Class ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/breakcore - -:breakcore rdf:type owl:Class ; - - rdfs:subClassOf :drumnbass , - :industriel , - :techno . - - - -### http://dbtune.org/jamendo/tag/bretagne - -:bretagne rdf:type owl:Class ; - - rdfs:subClassOf :francais . - - - -### http://dbtune.org/jamendo/tag/british - -:british rdf:type owl:Class ; - - owl:equivalentClass :britpop ; - - rdfs:subClassOf :uk . - - - -### http://dbtune.org/jamendo/tag/britpop - -:britpop rdf:type owl:Class ; - - rdfs:subClassOf :pop , - :uk . - - - -### http://dbtune.org/jamendo/tag/calm - -:calm rdf:type owl:Class ; - - owl:equivalentClass :calme ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/calme - -:calme rdf:type owl:Class ; - - owl:equivalentClass :tranquille ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/celta - -:celta rdf:type owl:Class ; - - owl:equivalentClass :celtique ; - - rdfs:subClassOf :world . - - - -### http://dbtune.org/jamendo/tag/celtique - -:celtique rdf:type owl:Class ; - - rdfs:subClassOf :world , - dc:language . - - - -### http://dbtune.org/jamendo/tag/chanson - -:chanson rdf:type owl:Class ; - - owl:equivalentClass :chansons ; - - rdfs:subClassOf :vocal . - - - -### http://dbtune.org/jamendo/tag/chansonatexte - -:chansonatexte rdf:type owl:Class ; - - rdfs:subClassOf :texte . - - - -### http://dbtune.org/jamendo/tag/chansonfrancaise - -:chansonfrancaise rdf:type owl:Class ; - - rdfs:subClassOf :chanson . - - - -### http://dbtune.org/jamendo/tag/chansons - -:chansons rdf:type owl:Class ; - - owl:equivalentClass :chant ; - - rdfs:subClassOf :vocal . - - - -### http://dbtune.org/jamendo/tag/chant - -:chant rdf:type owl:Class ; - - rdfs:subClassOf :vocal . - - - -### http://dbtune.org/jamendo/tag/chill - -:chill rdf:type owl:Class ; - - owl:equivalentClass :chillout ; - - rdfs:subClassOf :ambient . - - - -### http://dbtune.org/jamendo/tag/chillout - -:chillout rdf:type owl:Class ; - - rdfs:subClassOf :ambient . - - - -### http://dbtune.org/jamendo/tag/chiptune - -:chiptune rdf:type owl:Class ; - - owl:equivalentClass :chiptunes , - :videogame ; - - rdfs:subClassOf :computer , - :synth . - - - -### http://dbtune.org/jamendo/tag/chiptunes - -:chiptunes rdf:type owl:Class ; - - rdfs:subClassOf :computer . - - - -### http://dbtune.org/jamendo/tag/christian - -:christian rdf:type owl:Class ; - - owl:equivalentClass :gospel ; - - rdfs:subClassOf :world . - - - -### http://dbtune.org/jamendo/tag/clarinette - -:clarinette rdf:type owl:Class ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/clash - -:clash rdf:type owl:Class ; - - owl:equivalentClass :electroclash ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/classic - -:classic rdf:type owl:Class ; - - owl:equivalentClass :classique ; - - rdfs:subClassOf :rock , - mo:Genre . - - - -### http://dbtune.org/jamendo/tag/classical - -:classical rdf:type owl:Class ; - - owl:equivalentClass :classique ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/classique - -:classique rdf:type owl:Class ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/clavier - -:clavier rdf:type owl:Class ; - - owl:equivalentClass :claviers , - :piano ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/claviers - -:claviers rdf:type owl:Class ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/computer - -:computer rdf:type owl:Class ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/contrebass - -:contrebass rdf:type owl:Class ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/cooljazz - -:cooljazz rdf:type owl:Class ; - - rdfs:subClassOf :jazz . - - - -### http://dbtune.org/jamendo/tag/country - -:country rdf:type owl:Class ; - - rdfs:subClassOf mo:Genre . - - - -### http://dbtune.org/jamendo/tag/crossover - -:crossover rdf:type owl:Class ; - - rdfs:subClassOf :rock . - - - -### http://dbtune.org/jamendo/tag/cyperpunk - -:cyperpunk rdf:type owl:Class ; - - rdfs:subClassOf :punk . - - - -### http://dbtune.org/jamendo/tag/dance - -:dance rdf:type owl:Class ; - - owl:equivalentClass :danse ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/dancefloor - -:dancefloor rdf:type owl:Class ; - - rdfs:subClassOf :dance , - :techno . - - - -### http://dbtune.org/jamendo/tag/dancehall - -:dancehall rdf:type owl:Class ; - - rdfs:subClassOf :hiphop , - :reggae . - - - -### http://dbtune.org/jamendo/tag/danse - -:danse rdf:type owl:Class ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/dark - -:dark rdf:type owl:Class ; - - owl:equivalentClass :darkelectro , - :electrodark , - :sombre ; - - rdfs:subClassOf :ambient , - :electro , - :house , - :metal . - - - -### http://dbtune.org/jamendo/tag/darkambient - -:darkambient rdf:type owl:Class ; - - rdfs:subClassOf :ambient . - - - -### http://dbtune.org/jamendo/tag/darkelectro - -:darkelectro rdf:type owl:Class ; - - owl:equivalentClass :electrodark ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/darkwave - -:darkwave rdf:type owl:Class ; - - rdfs:subClassOf :newwave . - - - -### http://dbtune.org/jamendo/tag/death - -:death rdf:type owl:Class ; - - owl:equivalentClass :deathmetal ; - - rdfs:subClassOf :metal . - - - -### http://dbtune.org/jamendo/tag/deathmetal - -:deathmetal rdf:type owl:Class ; - - rdfs:subClassOf :metal . - - - -### http://dbtune.org/jamendo/tag/deephouse - -:deephouse rdf:type owl:Class ; - - rdfs:subClassOf :house . - - - -### http://dbtune.org/jamendo/tag/delirant - -:delirant rdf:type owl:Class ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/depressif - -:depressif rdf:type owl:Class ; - - owl:equivalentClass :depressive ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/depressive - -:depressive rdf:type owl:Class ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/deutsch - -:deutsch rdf:type owl:Class ; - - owl:equivalentClass :german ; - - rdfs:subClassOf dc:language . - - - -### http://dbtune.org/jamendo/tag/deutschpunk - -:deutschpunk rdf:type owl:Class ; - - rdfs:subClassOf :german , - :punk . - - - -### http://dbtune.org/jamendo/tag/didgeridoo - -:didgeridoo rdf:type owl:Class ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/disco - -:disco rdf:type owl:Class ; - - rdfs:subClassOf :electro , - :funk . - - - -### http://dbtune.org/jamendo/tag/distorsion - -:distorsion rdf:type owl:Class ; - - owl:equivalentClass :distortion , - :fuzz ; - - rdfs:subClassOf :guitare . - - - -### http://dbtune.org/jamendo/tag/distortion - -:distortion rdf:type owl:Class ; - - rdfs:subClassOf :guitare . - - - -### http://dbtune.org/jamendo/tag/dj - -:dj rdf:type owl:Class ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/dnb - -:dnb rdf:type owl:Class ; - - owl:equivalentClass :drumnbass ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/doom - -:doom rdf:type owl:Class ; - - rdfs:subClassOf :metal . - - - -### http://dbtune.org/jamendo/tag/downbeat - -:downbeat rdf:type owl:Class ; - - owl:equivalentClass :downtempo ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/downtempo - -:downtempo rdf:type owl:Class ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/dream - -:dream rdf:type owl:Class ; - - rdfs:subClassOf mo:Mood . - - - -### http://dbtune.org/jamendo/tag/drone - -:drone rdf:type owl:Class ; - - rdfs:subClassOf :doom . - - - -### http://dbtune.org/jamendo/tag/drum - -:drum rdf:type owl:Class ; - - owl:equivalentClass :drums ; - - rdfs:subClassOf mo:Instrument . - - - -### http://dbtune.org/jamendo/tag/drumandbass - -:drumandbass rdf:type owl:Class ; - - owl:equivalentClass :drumnbass ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/drumbass - -:drumbass rdf:type owl:Class ; - - owl:equivalentClass :drumnbass ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/drumn - -:drumn rdf:type owl:Class ; - - owl:equivalentClass :drumnbass ; - - rdfs:subClassOf :electro . - - - -### http://dbtune.org/jamendo/tag/drumnbass - -:drumnbass rdf:type owl:Class ; - - rdfs... [truncated message content] |
From: <hee...@us...> - 2009-11-26 14:18:37
|
Revision: 1924 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1924&view=rev Author: heeroyuy Date: 2009-11-26 14:18:29 +0000 (Thu, 26 Nov 2009) Log Message: ----------- -added additional library to protege build path Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-11-26 14:10:09 UTC (rev 1923) +++ trunk/build.xml 2009-11-26 14:18:29 UTC (rev 1924) @@ -350,9 +350,13 @@ <mkdir dir="${temp}/lib/pellet" /> <mkdir dir="${temp}/lib/jena" /> <mkdir dir="${temp}/lib/ore-tool" /> + <mkdir dir="${temp}/lib/owlapi" /> <copy toDir="${temp}/META-INF" > <fileset dir="${source}/META-INF" includes="MANIFEST.MF," /> </copy> + <copy toDir="${temp}/lib/owlapi" > + <fileset dir="${lib_dir}/owlapi" includes="owlapiV3-bin.jar" /> + </copy> <copy toDir="${temp}/lib/ore-tool" > <fileset dir="${lib_dir}/ore-tool" includes="BrowserLauncher2-all-1_3.jar" /> </copy> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-11-26 14:10:18
|
Revision: 1923 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1923&view=rev Author: heeroyuy Date: 2009-11-26 14:10:09 +0000 (Thu, 26 Nov 2009) Log Message: ----------- -added some additional information on graphical panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -564,6 +564,10 @@ public boolean getIsKnowledgeSourceIsUpdated() { return knowledgeSourceIsUpdated; } + + public OWLEditorKit getOWLEditorKit() { + return editor; + } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -35,6 +35,7 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.owl.Individual; import org.dllearner.learningproblems.EvaluatedDescriptionClass; +import org.semanticweb.owl.model.OWLDataFactory; /** * This class draws the graphical coverage of a learned concept. @@ -87,6 +88,7 @@ private final Color darkGreen; private final Color darkRed; private int notCoveredInd; + private OWLDataFactory factory; /** * @@ -137,6 +139,7 @@ + adjustment, ELLIPSE_Y_AXIS, WIDTH + distortionOld, HEIGHT + distortionOld); } + factory = model.getOWLEditorKit().getOWLModelManager().getOWLDataFactory(); this.computeIndividualPoints(); this.addMouseMotionListener(handler); this.addMouseListener(handler); @@ -497,7 +500,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { posCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } i++; @@ -545,7 +548,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { posNotCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } } else { @@ -553,7 +556,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { additionalIndividuals.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } } @@ -594,7 +597,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { posNotCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } k++; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -37,6 +37,12 @@ import org.dllearner.core.owl.ObjectProperty; import org.dllearner.learningproblems.EvaluatedDescriptionClass; import org.dllearner.reasoning.FastInstanceChecker; +import org.semanticweb.owl.model.OWLDataPropertyAssertionAxiom; +import org.semanticweb.owl.model.OWLDifferentIndividualsAxiom; +import org.semanticweb.owl.model.OWLNegativeDataPropertyAssertionAxiom; +import org.semanticweb.owl.model.OWLNegativeObjectPropertyAssertionAxiom; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLSameIndividualsAxiom; /** * This class takes care of all events happening in the GraphicalCoveragePanel. @@ -55,6 +61,7 @@ private BasicComboPopup scrollPopup; private final Vector<String> individualComboBox; private JComboBox indiBox; + private OWLOntology ontology; /** * This is the constructor for the handler. @@ -71,6 +78,8 @@ this.panel = p; description = eval; model = m; + ontology = model.getOWLEditorKit().getOWLModelManager() + .getActiveOntology(); individualComboBox = new Vector<String>(); } @@ -113,12 +122,13 @@ && v.get(i).getXAxis() <= m.getX() + 5 && v.get(i).getYAxis() >= m.getY() - 5 && v.get(i).getYAxis() <= m.getY() + 5) { - String individualInformation = "<html><body>" - + v.get(i).getIndividualName().toString(); + String individualInformation = "<html><body><b>" + + v.get(i).getIndividualName().toString() + "</b>"; if (v.get(i).getDLLearnerIndividual() != null) { + Set<NamedClass> types = reasoner.getTypes(v.get(i) .getDLLearnerIndividual()); - individualInformation += "<br><b>Types:</b><br>"; + individualInformation += "<br><br><b>Types:</b><br>"; for (NamedClass dlLearnerClass : types) { individualInformation += dlLearnerClass .toManchesterSyntaxString( @@ -146,6 +156,43 @@ } individualInformation += "<br>"; } + if (v.get(i).getIndividualOWL() != null) { + Set<OWLDataPropertyAssertionAxiom> dataProperties = ontology + .getDataPropertyAssertionAxioms(v.get(i) + .getIndividualOWL()); + individualInformation += "<br><b>Dataproperties</b><br>"; + for (OWLDataPropertyAssertionAxiom dataProperty : dataProperties) { + individualInformation += dataProperty.toString() + + "<br>"; + } + + Set<OWLNegativeObjectPropertyAssertionAxiom> negObjects = ontology.getNegativeObjectPropertyAssertionAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>negative ObjectProperties</b><br>"; + for (OWLNegativeObjectPropertyAssertionAxiom negObject : negObjects) { + individualInformation += negObject.toString() + + "<br>"; + } + + Set<OWLNegativeDataPropertyAssertionAxiom> negDatas = ontology.getNegativeDataPropertyAssertionAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>negative Dataproperties</b><br>"; + for (OWLNegativeDataPropertyAssertionAxiom negData : negDatas) { + individualInformation += negData.toString() + + "<br>"; + } + Set<OWLSameIndividualsAxiom> sameIndies = ontology.getSameIndividualAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>Same Individuals</b><br>"; + for (OWLSameIndividualsAxiom sameIndie : sameIndies) { + individualInformation += sameIndie.toString() + + "<br>"; + } + + Set<OWLDifferentIndividualsAxiom> differentIndies = ontology.getDifferentIndividualAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>Different Individuals</b><br>"; + for (OWLDifferentIndividualsAxiom differentIndie : differentIndies) { + individualInformation += differentIndie.toString() + + "<br>"; + } + } } individualInformation += "</body></htlm>"; panel.getGraphicalCoveragePanel().setToolTipText( Modified: trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -22,6 +22,7 @@ import java.awt.geom.Ellipse2D; import org.dllearner.core.owl.Individual; +import org.semanticweb.owl.model.OWLIndividual; /** * This class is a datastructure for one individual shown in @@ -38,6 +39,7 @@ private final Ellipse2D circlePoint; private Individual individualDLLearner; private String baseUri; + private OWLIndividual individualOWL; /** * Constructor of the class. @@ -74,6 +76,27 @@ this.individualDLLearner = indi; this.baseUri = base; } + + /** + * + * @param p + * @param x + * @param y + * @param ind + * @param indi + * @param base + */ + public IndividualPoint(String p, int x, int y, String ind, OWLIndividual indi, Individual indiDLLearner, String base) { + this.point = p; + this.xAxis = x; + this.yAxis = y; + this.circlePoint = new Ellipse2D.Double(x-1, y-1, 4, 4); + this.individual = ind; + this.individualOWL = indi; + this.individualDLLearner = indiDLLearner; + this.baseUri = base; + + } /** * This method returns the display string of the individual. @@ -130,4 +153,12 @@ public String getBaseUri() { return baseUri; } + + /** + * + * @return + */ + public OWLIndividual getIndividualOWL() { + return individualOWL; + } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF 2009-11-26 14:10:09 UTC (rev 1923) @@ -6,7 +6,7 @@ Bundle-Description: Protege DL-Learner Plugin Bundle-Vendor: DL-Learner Project Bundle-DocURL: http://dl-learner.org/wiki/ProtegePlugin -Bundle-ClassPath: .,lib/junit-4.4.jar,lib/jamon-2.7.jar,lib/pellet/pellet-core.jar,lib/pellet/pellet-datatypes.jar,lib/ore-tool/BrowserLauncher2-all-1_3.jar,lib/pellet/pellet-el.jar,lib/pellet/pellet-explanation.jar,lib/pellet/pellet-owlapi.jar,lib/pellet/pellet-rules.jar,lib/pellet/aterm-java-1.6.jar,lib/jena/json.jar,lib/pellet/relaxngDatatype.jar,lib/pellet/xsdlib.jar,lib/jena/commons-logging-1.1.1.jar,lib/ore-tool/swingx-0.9.2.jar +Bundle-ClassPath: .,lib/junit-4.4.jar,lib/jamon-2.7.jar,lib/pellet/pellet-core.jar,lib/pellet/pellet-datatypes.jar,lib/ore-tool/BrowserLauncher2-all-1_3.jar,lib/pellet/pellet-el.jar,lib/pellet/pellet-explanation.jar,lib/pellet/pellet-owlapi.jar,lib/pellet/pellet-rules.jar,lib/pellet/aterm-java-1.6.jar,lib/jena/json.jar,lib/pellet/relaxngDatatype.jar,lib/pellet/xsdlib.jar,lib/jena/commons-logging-1.1.1.jar,lib/ore-tool/swingx-0.9.2.jar,lib/owlapi/owlapiV3-bin.jar Import-Package: org.osgi.framework,org.apache.log4j Export-Package: lib Bundle-Version: 0.5.2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-11-26 13:25:02
|
Revision: 1922 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1922&view=rev Author: lorenz_b Date: 2009-11-26 13:24:53 +0000 (Thu, 26 Nov 2009) Log Message: ----------- Added necessary lib OWLAPI-V3 to work with final Pellet version 2.0. Added Paths: ----------- trunk/lib/owlapi/owlapiV3-bin.jar Added: trunk/lib/owlapi/owlapiV3-bin.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/owlapi/owlapiV3-bin.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-11-26 08:24:00
|
Revision: 1921 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1921&view=rev Author: heeroyuy Date: 2009-11-26 08:23:53 +0000 (Thu, 26 Nov 2009) Log Message: ----------- -some code cleanup Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-11-25 10:59:10 UTC (rev 1920) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-11-26 08:23:53 UTC (rev 1921) @@ -21,13 +21,13 @@ import java.awt.Color; import java.util.HashSet; -import java.util.List; import java.util.Set; -import java.util.SortedSet; +import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.utilities.owl.OWLAPIConverter; import org.protege.editor.owl.OWLEditorKit; import org.semanticweb.owl.model.OWLClass; @@ -95,43 +95,21 @@ current = editor.getOWLWorkspace().getOWLSelectionModel() .getLastSelectedClass(); if (current != null) { - SortedSet<Individual> individuals = null; hasIndividuals = false; // checks if selected concept is thing when yes then it selects all // individuals - if (!(current.toString().equals("Thing"))) { - List<NamedClass> classList = reasoner.getAtomicConceptsList(); - for (NamedClass concept : classList) { - // if individuals is null - if (individuals == null) { - // checks if the concept is the selected concept in - // protege - for (String onto : ontologieURI) { - if (concept.toString().contains(onto)) { - if (concept.toString().equals( - onto + current.toString())) { - // if individuals is not null it gets all - // individuals of - // the concept - currentConcept = concept; - if (reasoner.getIndividuals(concept) != null) { - if (reasoner.getIndividuals(concept) - .size() > 0) { - hasIndividuals = true; - } - individual = reasoner - .getIndividuals(concept); - model.setIndividuals(individual); - model.setHasIndividuals(hasIndividuals); - model.setCurrentConcept(currentConcept); - view.getRunButton().setEnabled(true); - break; - } - } - } - } - } + if (!current.isOWLThing()) { + Description desc = OWLAPIConverter.convertClass(current); + individual = reasoner.getIndividuals(desc); + model.setIndividuals(individual); + model.setHasIndividuals(hasIndividuals); + model.setCurrentConcept(new NamedClass(desc.toString())); + view.getRunButton().setEnabled(true); + if (reasoner.getIndividuals(desc) + .size() > 0) { + hasIndividuals = true; } + } else { if (reasoner.getIndividuals().size() > 0) { hasIndividuals = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-11-25 10:59:23
|
Revision: 1920 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1920&view=rev Author: heeroyuy Date: 2009-11-25 10:59:10 +0000 (Wed, 25 Nov 2009) Log Message: ----------- -fixed bug that individuals in some classes where not recognized Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-11-25 10:57:13 UTC (rev 1919) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-11-25 10:59:10 UTC (rev 1920) @@ -148,13 +148,21 @@ } } if (z.toString().contains(HELP_BUTTON_STRING)) { - String helpText = "<html><font size=\"3\">What does a sentence like 'Learning started. Currently searching class expressions with length between 4 and 7.' mean?<br>" - + "Length: In Manchester OWL Syntax (the syntax used for class expressions in Protege), we define length simply as the number of words needed to write down the class expression.<br><br>" - + "The learning algorithm (called CELOE) for suggesting class expressions starts with the most general expression owl:Thing and then further specializes it.<br>" - + "Those class expressions, which fit the existing instances of a given class ($currentClass in this case) get a high accuracy and are displayed as suggestions.<br>" - + "The learning algorithm prefers short expressions. 'Currently searching class expressions with length between 4 and 7.' means that it has already evaluated all class expressions of length 1 to 3<br>" - + "or excluded them as possible suggestions. All the expressions currently evaluated have length between 4 and 7. If you want to search for longer expressions, then you have to increase<br>" - + "the maximum runtime setting (it is set to $defaultRuntime seconds by default).<br><br>" + + Set<String> uris = model.getOntologyURIString(); + String currentClass = ""; + for(String uri : uris) { + if(model.getCurrentConcept().toString().contains(uri)) { + currentClass = model.getCurrentConcept().toManchesterSyntaxString(uri, null); + } + } + String helpText = "<html><font size=\"3\">What does a sentence like 'Learning started. Currently searching class expressions with length between 4 and 7.' mean?<br><br>" + + "Length: In Manchester OWL Syntax (the syntax used for class expressions in Protege), we define length <br>simply as the number of words needed to write down the class expression.<br><br>" + + "The learning algorithm (called CELOE) for suggesting class expressions starts with the most general expression <br>owl:Thing and then further specializes it.<br>" + + "Those class expressions, which fit the existing instances of a given class (" + currentClass + " in this case) get <br>a high accuracy and are displayed as suggestions.<br>" + + "The learning algorithm prefers short expressions. 'Currently searching class expressions with length between 4 and 7.' <br>means that it has already evaluated all class expressions of length 1 to 3<br>" + + "or excluded them as possible suggestions. All the expressions currently evaluated have length between 4 and 7. If you <br>want to search for longer expressions, then you have to increase<br>" + + "the maximum runtime setting (it is set to " + view.getPosAndNegSelectPanel().getOptionPanel().getMaxExecutionTime() + " <br>seconds by default).<br><br>" + "See <a href=\"http://dl-learner.org/wiki/ProtegePlugin\">Protege Plugin Wiki</a> for more details.</font></html>"; help = new JTextPane(); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-11-25 10:57:13 UTC (rev 1919) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-11-25 10:59:10 UTC (rev 1920) @@ -516,7 +516,7 @@ String message = "<html><font size=\"3\" color=\"black\">Learning successful. All expressions up to length " + (celoe.getMinimumHorizontalExpansion()-1) + " and some expressions up to <br>length " + celoe.getMaximumHorizontalExpansion() + " searched."; hint.setForeground(Color.RED); if(isInconsistent) { - message +="<font size=\"3\" color=\"red\"><br>Class expressions marked red will lead to an inconsistent ontology. <br>Please double click on them to view detail information.</font></html>"; + message +="<font size=\"3\" color=\"red\"><br>Class expressions marked red will lead to an inconsistent ontology. <br>Please click on them to view detail information.</font></html>"; } else { message +="<br>To view details about why a class expression was suggested, please click on it.</font><html>"; } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-25 10:57:13 UTC (rev 1919) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-25 10:59:10 UTC (rev 1920) @@ -164,7 +164,7 @@ Ellipse2D circlePoint = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint); g2D.setColor(Color.BLACK); - g2D.drawString("individuals covered by", 320, p); + g2D.drawString("<html>individuals covered by", 320, p); g2D.setColor(Color.ORANGE); g2D.fillOval(455, p - 9, 9, 9); g2D.setColor(Color.BLACK); @@ -173,51 +173,51 @@ g2D.fillOval(525, p - 9, 9, 9); g2D.setColor(Color.BLACK); p = p + 20; - g2D.drawString("(OK)", 320, p); + g2D.drawString("(OK)</html>", 320, p); p = p + 20; if(id.equals(EQUI_STRING)) { g2D.setColor(darkRed); Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint2); g2D.setColor(Color.BLACK); - g2D.drawString("individuals covered by", 320, p); + g2D.drawString("<html>individuals covered by", 320, p); g2D.setColor(Color.ORANGE); g2D.fillOval(455, p - 9, 9, 9); g2D.setColor(Color.BLACK); p = p + 20; - g2D.drawString("(potential problem)", 320, p); + g2D.drawString("(potential problem)</html>", 320, p); p = p + 20; g2D.setColor(darkRed); Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint3); g2D.setColor(Color.BLACK); - g2D.drawString("individuals covered by", 320, p); + g2D.drawString("<html>individuals covered by", 320, p); g2D.setColor(Color.YELLOW); g2D.fillOval(455, p - 9, 9, 9); g2D.setColor(Color.BLACK); p = p + 20; - g2D.drawString("(potential problem)", 320, p); + g2D.drawString("(potential problem)</html>", 320, p); } else { g2D.setColor(Color.BLACK); Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint2); - g2D.drawString("individuals covered by", 320, p); + g2D.drawString("<html>individuals covered by", 320, p); g2D.setColor(Color.ORANGE); g2D.fillOval(455, p - 9, 9, 9); g2D.setColor(Color.BLACK); p = p + 20; - g2D.drawString("(no problem)", 320, p); + g2D.drawString("(no problem)</html>", 320, p); p = p + 20; g2D.setColor(darkRed); Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint3); g2D.setColor(Color.BLACK); - g2D.drawString("individuals covered by", 320, p); + g2D.drawString("<html>individuals covered by", 320, p); g2D.setColor(Color.YELLOW); g2D.fillOval(455, p - 9, 9, 9); g2D.setColor(Color.BLACK); p = p + 20; - g2D.drawString("(potential problem)", 320, p); + g2D.drawString("(potential problem)</html>", 320, p); } g2D.setColor(Color.YELLOW); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-11-25 10:57:13 UTC (rev 1919) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-11-25 10:59:10 UTC (rev 1920) @@ -30,16 +30,15 @@ import org.dllearner.reasoning.FastInstanceChecker; import org.protege.editor.owl.OWLEditorKit; import org.semanticweb.owl.model.OWLClass; -import org.semanticweb.owl.model.OWLOntology; /** * This class reads the ontologie in a separate thread. + * * @author Christian Koetteritzsch - * + * */ public class ReadingOntologyThread extends Thread { - private boolean hasIndividuals; private FastInstanceChecker reasoner; private NamedClass currentConcept; @@ -50,52 +49,64 @@ private boolean isInconsistent; private OWLClass current; private DLLearnerView view; - + /** * This is the constructor of the ReadingOntologyThread. - * @param editorKit OWLEditorKit - * @param v DL-Learner view - * @param m DL-Learner model + * + * @param editorKit + * OWLEditorKit + * @param v + * DL-Learner view + * @param m + * DL-Learner model */ - public ReadingOntologyThread(OWLEditorKit editorKit, DLLearnerView v, DLLearnerModel m) { + public ReadingOntologyThread(OWLEditorKit editorKit, DLLearnerView v, + DLLearnerModel m) { this.editor = editorKit; this.view = v; this.model = m; } - + /** * This method sets the view of the DL-Learner plugin. - * @param v DLLearnerView + * + * @param v + * DLLearnerView */ public void setDLLearnerView(DLLearnerView v) { this.view = v; } - + /** * This method sets the model of the DL-Learner plugin. - * @param m DLLearnerModel + * + * @param m + * DLLearnerModel */ public void setDLLearnerModel(DLLearnerModel m) { this.model = m; } + /** * This method sets the individuals that belong to the concept which is * chosen in protege. */ private void setPositiveConcept() { - current = editor.getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); - if(current != null) { + current = editor.getOWLWorkspace().getOWLSelectionModel() + .getLastSelectedClass(); + if (current != null) { SortedSet<Individual> individuals = null; hasIndividuals = false; // checks if selected concept is thing when yes then it selects all // individuals if (!(current.toString().equals("Thing"))) { List<NamedClass> classList = reasoner.getAtomicConceptsList(); - for(NamedClass concept : classList) { + for (NamedClass concept : classList) { // if individuals is null if (individuals == null) { - // checks if the concept is the selected concept in protege - for(String onto : ontologieURI) { + // checks if the concept is the selected concept in + // protege + for (String onto : ontologieURI) { if (concept.toString().contains(onto)) { if (concept.toString().equals( onto + current.toString())) { @@ -104,10 +115,12 @@ // the concept currentConcept = concept; if (reasoner.getIndividuals(concept) != null) { - if (reasoner.getIndividuals(concept).size() > 0) { + if (reasoner.getIndividuals(concept) + .size() > 0) { hasIndividuals = true; } - individual = reasoner.getIndividuals(concept); + individual = reasoner + .getIndividuals(concept); model.setIndividuals(individual); model.setHasIndividuals(hasIndividuals); model.setCurrentConcept(currentConcept); @@ -122,7 +135,7 @@ } else { if (reasoner.getIndividuals().size() > 0) { hasIndividuals = true; - + } individual = reasoner.getIndividuals(); model.setIndividuals(individual); @@ -130,7 +143,7 @@ } } } - + /** * This Method checks if the selected class has any individuals. * @@ -139,66 +152,87 @@ public boolean hasIndividuals() { return hasIndividuals; } - + /** - * Checks the URI if a "#" is in it. + * Puts every base uri in a HashSet. */ private void checkURI() { ontologieURI = new HashSet<String>(); - Set<OWLOntology> ont = editor.getModelManager().getActiveOntologies(); Set<Individual> indi = reasoner.getIndividuals(); - for(OWLOntology onto : ont) { - String ontURI = onto.getURI().toString(); - for(Individual ind : indi) { - if(ind.toString().contains(ontURI)) { - if(ind.toString().contains("#")) { - ontologieURI.add(onto.getURI().toString()+"#"); + for (Individual ind : indi) { + int ontURI = ind.toString().lastIndexOf("/"); + int ontURI2 = ind.toString().lastIndexOf("#"); + String uriNeu = ""; + String uriAlt = ""; + if (ontURI2 != -1) { + uriNeu = ind.toString().substring(0, ontURI2 + 1); + if (uriNeu != uriAlt) { + ontologieURI.add(uriNeu); + uriAlt = uriNeu; + uriNeu = ""; + String uriTest = indi.toString().replace(uriAlt, ""); + if(!uriTest.contains("/") && !uriTest.contains("#")) { break; - } else { - ontologieURI.add(onto.getURI().toString()); - break; } } - } + } else { + uriNeu = ind.toString().substring(0, ontURI + 1); + if (uriNeu != uriAlt) { + ontologieURI.add(uriNeu); + uriAlt = uriNeu; + uriNeu = ""; + String uriTest = indi.toString().replace(uriAlt, ""); + if(!uriTest.contains("/") && !uriTest.contains("#")) { + break; + } + + } + } } model.setOntologyURIString(ontologieURI); } - + @Override public void run() { - String loading ="<html><font size=\"3\">loading instances...</font></html>"; + String loading = "<html><font size=\"3\">loading instances...</font></html>"; view.getHintPanel().setForeground(Color.RED); view.setHintMessage(loading); - if(!model.isReasonerSet() || model.getIsKnowledgeSourceIsUpdated() == true) { + if (!model.isReasonerSet() + || model.getIsKnowledgeSourceIsUpdated() == true) { model.setKnowledgeSource(); model.setReasoner(); } reasoner = model.getReasoner(); isInconsistent = view.getIsInconsistent(); - if(!isInconsistent) { + if (!isInconsistent) { this.checkURI(); this.setPositiveConcept(); if (this.hasIndividuals()) { view.getRunButton().setEnabled(true); view.getHintPanel().setForeground(Color.BLACK); - view.setHintMessage("<html><font size=\"3\">To get suggestions for class descriptions, please click the button above.</font></html>"); - + view + .setHintMessage("<html><font size=\"3\">To get suggestions for class descriptions, please click the button above.</font></html>"); + } else { view.getRunButton().setEnabled(false); view.getHintPanel().setVisible(true); - String message ="<html><font size=\"3\" color=\"red\">There are no Instances for " + current + " available. Please insert some Instances.</font></html>"; + String message = "<html><font size=\"3\" color=\"red\">There are no Instances for " + + current + + " available. Please insert some Instances.</font></html>"; view.getHintPanel().setForeground(Color.RED); view.setHintMessage(message); } } else { view.getHintPanel().setForeground(Color.RED); view.getRunButton().setEnabled(false); - view.setHintMessage("The ontology is inconsistent and suggestions for class descriptions can only \nbe computed on consistent ontologies. Please repair the ontology first"); + view + .setHintMessage("The ontology is inconsistent and suggestions for class descriptions can only \nbe computed on consistent ontologies. Please repair the ontology first"); } } - + /** * This method returns the NamedClass for the currently selected class. + * * @return NamedClass of the currently selected class */ public NamedClass getCurrentConcept() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-11-25 10:57:36
|
Revision: 1919 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1919&view=rev Author: heeroyuy Date: 2009-11-25 10:57:13 +0000 (Wed, 25 Nov 2009) Log Message: ----------- -removed not necessary library Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-11-24 15:28:33 UTC (rev 1918) +++ trunk/build.xml 2009-11-25 10:57:13 UTC (rev 1919) @@ -4,7 +4,7 @@ <!-- directory settings --> <property name="lib_dir" value="lib" /> <property name="source_dir" value="src/dl-learner" /> - <property name="protege_dir" value="C:\Program Files\Protege_4.0\plugins" /> + <property name="protege_dir" value="C:\Program Files\Protege_4.0.1\plugins" /> <property name="class_dir" value="classes" /> <property name="ontowiki_dir" value="${user.home}/workspace/ontowiki/ontowiki/src/extensions/components/dllearner/dllearner" /> @@ -354,7 +354,7 @@ <fileset dir="${source}/META-INF" includes="MANIFEST.MF," /> </copy> <copy toDir="${temp}/lib/ore-tool" > - <fileset dir="${lib_dir}/ore-tool" includes="swingx-1.0.jar,BrowserLauncher2-all-1_3.jar" /> + <fileset dir="${lib_dir}/ore-tool" includes="BrowserLauncher2-all-1_3.jar" /> </copy> <copy toDir="${temp}/lib" > <fileset dir="${lib_dir}" includes="junit-4.4.jar,jamon-2.7.jar" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-11-24 15:28:40
|
Revision: 1918 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1918&view=rev Author: jenslehmann Date: 2009-11-24 15:28:33 +0000 (Tue, 24 Nov 2009) Log Message: ----------- preliminary approximation support for pos/neg problems Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-11-24 08:48:27 UTC (rev 1917) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-11-24 15:28:33 UTC (rev 1918) @@ -103,6 +103,33 @@ public String getUseMultiInstanceChecks() { return (String) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "useMultiInstanceChecks") ; } +/** +* useApproximations whether to use stochastic approximations for computing accuracy. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getUseApproximations() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "useApproximations") ; +} +/** +* approxAccuracy accuracy of the approximation (only for expert use). +* mandatory: false| reinit necessary: true +* default value: 0.05 +* @return double +**/ +public double getApproxAccuracy() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "approxAccuracy") ; +} +/** +* accuracyMethod Specifies, which method/function to use for computing accuracy.. +* mandatory: false| reinit necessary: true +* default value: standard +* @return String +**/ +public String getAccuracyMethod() { +return (String) ComponentManager.getInstance().getConfigOptionValue(posNegLPStandard, "accuracyMethod") ; +} /** * @param positiveExamples positive examples. @@ -147,6 +174,33 @@ ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "useMultiInstanceChecks", useMultiInstanceChecks); reinitNecessary = true; } +/** +* @param useApproximations whether to use stochastic approximations for computing accuracy. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setUseApproximations(boolean useApproximations) { +ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "useApproximations", useApproximations); +reinitNecessary = true; +} +/** +* @param approxAccuracy accuracy of the approximation (only for expert use). +* mandatory: false| reinit necessary: true +* default value: 0.05 +**/ +public void setApproxAccuracy(double approxAccuracy) { +ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "approxAccuracy", approxAccuracy); +reinitNecessary = true; +} +/** +* @param accuracyMethod Specifies, which method/function to use for computing accuracy.. +* mandatory: false| reinit necessary: true +* default value: standard +**/ +public void setAccuracyMethod(String accuracyMethod) { +ComponentManager.getInstance().applyConfigEntry(posNegLPStandard, "accuracyMethod", accuracyMethod); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-24 08:48:27 UTC (rev 1917) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-24 15:28:33 UTC (rev 1918) @@ -487,7 +487,7 @@ } // see paper: expression used in confidence interval estimation - private static double p3(double p1, int total) { + public static double p3(double p1, int total) { return 1.96 * Math.sqrt(p1*(1-p1)/(total+4)); } @@ -498,7 +498,7 @@ // } // see paper: p' - private static double p1(int success, int total) { + public static double p1(int success, int total) { return (success+2)/(double)(total+4); } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-11-24 08:48:27 UTC (rev 1917) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-11-24 15:28:33 UTC (rev 1918) @@ -20,6 +20,7 @@ package org.dllearner.learningproblems; import java.util.Collection; +import java.util.LinkedList; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -27,7 +28,10 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.PosNegLPStandardConfigurator; +import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.DoubleConfigOption; +import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.utilities.Helper; @@ -49,6 +53,13 @@ private PosNegLPStandardConfigurator configurator; + // approximation and F-measure + // (taken from class learning => super class instances corresponds to negative examples + // and class instances to positive examples) + private double approx = 0.05; + private boolean useApproximations; + private boolean useFMeasure; + @Override public PosNegLPStandardConfigurator getConfigurator() { return configurator; @@ -66,6 +77,19 @@ this.configurator = new PosNegLPStandardConfigurator(this); } + public void init() { + super.init(); + useApproximations = configurator.getUseApproximations(); + useFMeasure = configurator.getAccuracyMethod().equals("fmeasure"); + + if((!useApproximations && useFMeasure) || (useApproximations && !useFMeasure)) { + System.err.println("Currently F measure can only be used in combination with approximated reasoning."); + System.exit(0); + } + + approx = configurator.getApproxAccuracy(); + } + /* * (non-Javadoc) * @@ -75,9 +99,16 @@ return "pos neg learning problem"; } - public static Collection<ConfigOption<?>> createConfigOptions() { - return PosNegLP.createConfigOptions(); + Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(PosNegLP.createConfigOptions()); + BooleanConfigOption approx = new BooleanConfigOption("useApproximations", "whether to use stochastic approximations for computing accuracy", false); + options.add(approx); + DoubleConfigOption approxAccuracy = new DoubleConfigOption("approxAccuracy", "accuracy of the approximation (only for expert use)", 0.05); + options.add(approxAccuracy); + StringConfigOption accMethod = new StringConfigOption("accuracyMethod", "Specifies, which method/function to use for computing accuracy.","predacc"); // or domain/range of a property. + accMethod.setAllowedValues(new String[] {"fmeasure", "predacc"}); + options.add(accMethod); + return options; } /** @@ -253,11 +284,23 @@ return coveredPos + negativeExamples.size() - coveredNeg / (double) allExamples.size(); } + @Override + public double getAccuracyOrTooWeak(Description description, double noise) { + if(useApproximations) { + if(useFMeasure) { + return getFMeasureOrTooWeakApprox(description, noise); + } else { + throw new Error("approximating pred. acc not implemented"); + } + } else { + return getAccuracyOrTooWeakExact(description, noise); + } + } + /* (non-Javadoc) * @see org.dllearner.core.LearningProblem#getAccuracyOrTooWeak(org.dllearner.core.owl.Description, double) */ - @Override - public double getAccuracyOrTooWeak(Description description, double noise) { + public double getAccuracyOrTooWeakExact(Description description, double noise) { int maxNotCovered = (int) Math.ceil(noise*positiveExamples.size()); @@ -281,6 +324,124 @@ return positiveExamples.size() - notCoveredPos + notCoveredNeg / (double) allExamples.size(); } + // instead of using the standard operation, we use optimisation + // and approximation here + public double getFMeasureOrTooWeakApprox(Description description, double noise) { + // we abort when there are too many uncovered positives + int maxNotCovered = (int) Math.ceil(noise*positiveExamples.size()); + int instancesCovered = 0; + int instancesNotCovered = 0; + int total = 0; + boolean estimatedA = false; + + double lowerBorderA = 0; + int lowerEstimateA = 0; + double upperBorderA = 1; + int upperEstimateA = positiveExamples.size(); + + for(Individual ind : positiveExamples) { + if(reasoner.hasType(description, ind)) { + instancesCovered++; + } else { + instancesNotCovered ++; + if(instancesNotCovered > maxNotCovered) { + return -1; + } + } + + // approximation step (starting after 10 tests) + total = instancesCovered + instancesNotCovered; + if(total > 10) { + // compute confidence interval + double p1 = ClassLearningProblem.p1(instancesCovered, total); + double p2 = ClassLearningProblem.p3(p1, total); + lowerBorderA = Math.max(0, p1 - p2); + upperBorderA = Math.min(1, p1 + p2); + double size = upperBorderA - lowerBorderA; + // if the interval has a size smaller than 10%, we can be confident + if(size < 2 * approx) { + // we have to distinguish the cases that the accuracy limit is + // below, within, or above the limit and that the mean is below + // or above the limit + double mean = instancesCovered/(double)total; + + // if the mean is greater than the required minimum, we can accept; + // we also accept if the interval is small and close to the minimum + // (worst case is to accept a few inaccurate descriptions) + if(mean > 1-noise || (upperBorderA > mean && size < 0.03)) { + instancesCovered = (int) (instancesCovered/(double)total * positiveExamples.size()); + upperEstimateA = (int) (upperBorderA * positiveExamples.size()); + lowerEstimateA = (int) (lowerBorderA * positiveExamples.size()); + estimatedA = true; + break; + } + + // reject only if the upper border is far away (we are very + // certain not to lose a potential solution) + if(upperBorderA + 0.1 < 1-noise) { + return -1; + } + } + } + } + + double recall = instancesCovered/(double)positiveExamples.size(); + +// MonitorFactory.add("estimatedA","count", estimatedA ? 1 : 0); +// MonitorFactory.add("aInstances","count", total); + + // we know that a definition candidate is always subclass of the + // intersection of all super classes, so we test only the relevant instances + // (leads to undesired effects for descriptions not following this rule, + // but improves performance a lot); + // for learning a superclass of a defined class, similar observations apply; + + + int testsPerformed = 0; + int instancesDescription = 0; +// boolean estimatedB = false; + + for(Individual ind : negativeExamples) { + + if(reasoner.hasType(description, ind)) { + instancesDescription++; + } + + testsPerformed++; + + if(testsPerformed > 10) { + + // compute confidence interval + double p1 = ClassLearningProblem.p1(instancesDescription, testsPerformed); + double p2 = ClassLearningProblem.p3(p1, testsPerformed); + double lowerBorder = Math.max(0, p1 - p2); + double upperBorder = Math.min(1, p1 + p2); + int lowerEstimate = (int) (lowerBorder * negativeExamples.size()); + int upperEstimate = (int) (upperBorder * negativeExamples.size()); + + double size; + if(estimatedA) { + size = getFMeasure(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getFMeasure(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); + } else { + size = getFMeasure(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getFMeasure(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); + } + + if(size < 0.1) { + instancesDescription = (int) (instancesDescription/(double)testsPerformed * negativeExamples.size()); + break; + } + } + } + + double precision = instancesCovered/(double)(instancesDescription+instancesCovered); + if(instancesCovered + instancesDescription == 0) { + precision = 0; + } + + return getFMeasure(recall, precision); + } + + /* (non-Javadoc) * @see org.dllearner.core.LearningProblem#evaluate(org.dllearner.core.owl.Description) */ @@ -290,4 +451,8 @@ return new EvaluatedDescriptionPosNeg(description, score); } + private double getFMeasure(double recall, double precision) { + return 2 * precision * recall / (precision + recall); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-11-24 08:48:37
|
Revision: 1917 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1917&view=rev Author: lorenz_b Date: 2009-11-24 08:48:27 +0000 (Tue, 24 Nov 2009) Log Message: ----------- Modified workflow - now in automatic learning mode, pressing the 'Save and go back to class choose panel' button in the last wizard step brings back to automatic learning view. Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/ConcurrencyBug.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ConcurrencyBug.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ConcurrencyBug.java 2009-11-24 07:14:29 UTC (rev 1916) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ConcurrencyBug.java 2009-11-24 08:48:27 UTC (rev 1917) @@ -4,18 +4,32 @@ import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; -import java.util.Timer; -import java.util.TimerTask; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.reasoning.PelletReasoner; +import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLDataFactory; +import org.semanticweb.owl.model.OWLDescription; +import org.semanticweb.owl.model.OWLEntity; +import org.semanticweb.owl.model.OWLOntology; import org.semanticweb.owl.model.OWLOntologyCreationException; +import org.semanticweb.owl.model.OWLOntologyManager; +import uk.ac.manchester.cs.owl.modularity.ModuleType; + +import com.clarkparsia.explanation.util.OntologyUtils; +import com.clarkparsia.modularity.ModularityUtils; + public class ConcurrencyBug { /** @@ -27,15 +41,29 @@ * @throws LearningProblemUnsupportedException */ public static void main(String[] args) throws MalformedURLException, ComponentInitException, OWLOntologyCreationException, URISyntaxException, LearningProblemUnsupportedException { - File file = new File("examples/swore/swore.rdf"); - URL classToDescribe = new URL("http://ns.softwiki.de/req/CustomerRequirement"); + File file = new File("examples/family-benchmark/family-benchmark_rich_background.owl"); + URL classToDescribe = new URL("http://www.benchmark.org/family#Father"); + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + OWLDataFactory factory = manager.getOWLDataFactory(); + OWLClass father = factory.getOWLClass(classToDescribe.toURI()); + OWLOntology ontology = manager.loadOntologyFromPhysicalURI(file.toURI()); + Set<OWLEntity> signature = new HashSet<OWLEntity>(); + for(OWLDescription d : father.getSuperClasses(ontology)){ + signature.addAll(d.getSignature()); + } + signature.addAll(father.getSignature()); + + OWLOntology module = com.clarkparsia.owlapi.OntologyUtils.getOntologyFromAxioms(ModularityUtils.extractModule(ontology, signature, ModuleType.TOP_OF_BOT)); ComponentManager cm = ComponentManager.getInstance(); + OWLAPIOntology ont = new OWLAPIOntology(module); + ont.init(); + OWLFile ks = cm.knowledgeSource(OWLFile.class); ((OWLFile)ks).getConfigurator().setUrl(file.toURI().toURL()); ks.init(); - PelletReasoner reasoner = cm.reasoner(PelletReasoner.class, ks); + PelletReasoner reasoner = cm.reasoner(PelletReasoner.class, ont); reasoner.init(); reasoner.loadOntologies(); reasoner.dematerialise(); @@ -53,19 +81,19 @@ la.getConfigurator().setMaxNrOfResults(10); la.init(); - Timer timer = new Timer(); - timer.schedule(new TimerTask() { - - @Override - public void run() { - if(la.isRunning()){ - System.out.println(la.getCurrentlyBestEvaluatedDescriptions(10, 0.8, true)); - } else { - cancel(); - } - - } - }, 1000, 1000); +// Timer timer = new Timer(); +// timer.schedule(new TimerTask() { +// +// @Override +// public void run() { +// if(la.isRunning()){ +// System.out.println(la.getCurrentlyBestEvaluatedDescriptions(10, 0.8, true)); +// } else { +// cancel(); +// } +// +// } +// }, 1000, 1000); la.start(); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java 2009-11-24 07:14:29 UTC (rev 1916) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/SavePanelDescriptor.java 2009-11-24 08:48:27 UTC (rev 1917) @@ -80,7 +80,11 @@ OntologyModifier modifier = OREManager.getInstance().getModifier(); if(e.getActionCommand().equals("Save and go to class choose panel")){ modifier.saveOntology(); - getWizard().setCurrentPanel(ClassChoosePanelDescriptor.IDENTIFIER); + if(LearningManager.getInstance().getLearningMode() == LearningManager.MANUAL_LEARN_MODE){ + getWizard().setCurrentPanel(ClassChoosePanelDescriptor.IDENTIFIER); + } else { + getWizard().setCurrentPanel(AutoLearnPanelDescriptor.IDENTIFIER); + } }else if(e.getActionCommand().equals("Save and Exit")){ modifier.saveOntology(); getWizard().close(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-11-24 07:14:35
|
Revision: 1916 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1916&view=rev Author: jenslehmann Date: 2009-11-24 07:14:29 +0000 (Tue, 24 Nov 2009) Log Message: ----------- introduced parameter for controlling approximate coverage test + minor improvements Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -301,9 +301,9 @@ } if (stop) { - logger.info("Algorithm stopped ("+expressionTests+" descriptions tested).\n"); + logger.info("Algorithm stopped ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); } else { - logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested).\n"); + logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); } if(singleSuggestionMode) { Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -82,6 +82,15 @@ return (Boolean) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "useApproximations") ; } /** +* approxAccuracy accuracy of the approximation (only for expert use). +* mandatory: false| reinit necessary: true +* default value: 0.05 +* @return double +**/ +public double getApproxAccuracy() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "approxAccuracy") ; +} +/** * accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true * default value: standard @@ -118,6 +127,15 @@ reinitNecessary = true; } /** +* @param approxAccuracy accuracy of the approximation (only for expert use). +* mandatory: false| reinit necessary: true +* default value: 0.05 +**/ +public void setApproxAccuracy(double approxAccuracy) { +ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "approxAccuracy", approxAccuracy); +reinitNecessary = true; +} +/** * @param accuracyMethod Specifies, which method/function to use for computing accuracy.. * mandatory: false| reinit necessary: true * default value: standard Modified: trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -408,6 +408,23 @@ } } + // conf example: + +// import("mutation.owl"); +// +// reasoner = fastInstanceChecker; +// +// problem = classLearning; +// classLearning.classToDescribe = "http://dl-learner.org/mutation#DeletoriousMutation"; +// classLearning.accuracyMethod = "fmeasure"; +// classLearning.approxAccuracy = 0.03; +// +// algorithm = celoe; +// celoe.maxExecutionTimeInSeconds = 10; +// celoe.noisePercentage = 10; +// celoe.maxNrOfResults = 1; +// celoe.singleSuggestionMode = true; + // writing conf file Files.clearFile(confFile); String confHeader = "import(\"" + owlFile.getName() + "\");\n\n"; Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-23 20:57:15 UTC (rev 1915) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-24 07:14:29 UTC (rev 1916) @@ -33,6 +33,7 @@ import org.dllearner.core.configurators.ClassLearningProblemConfigurator; import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.DoubleConfigOption; import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.options.URLConfigOption; import org.dllearner.core.owl.Axiom; @@ -60,7 +61,7 @@ private boolean equivalence = true; private ClassLearningProblemConfigurator configurator; // approximation of accuracy +- 0.05 % - private static final double approx = 0.05; + private double approx = 0.05; private boolean useApproximations; private boolean useFMeasure; @@ -91,6 +92,8 @@ options.add(type); BooleanConfigOption approx = new BooleanConfigOption("useApproximations", "whether to use stochastic approximations for computing accuracy", true); options.add(approx); + DoubleConfigOption approxAccuracy = new DoubleConfigOption("approxAccuracy", "accuracy of the approximation (only for expert use)", 0.05); + options.add(approxAccuracy); StringConfigOption accMethod = new StringConfigOption("accuracyMethod", "Specifies, which method/function to use for computing accuracy.","standard"); // or domain/range of a property. accMethod.setAllowedValues(new String[] {"standard", "fmeasure", "predacc"}); options.add(accMethod); @@ -106,6 +109,7 @@ classToDescribe = new NamedClass(configurator.getClassToDescribe().toString()); useApproximations = configurator.getUseApproximations(); useFMeasure = configurator.getAccuracyMethod().equals("fmeasure"); + approx = configurator.getApproxAccuracy(); if(!reasoner.getNamedClasses().contains(classToDescribe)) { throw new ComponentInitException("The class \"" + configurator.getClassToDescribe() + "\" does not exist. Make sure you spelled it correctly."); @@ -333,10 +337,10 @@ double size; if(estimatedA) { // size = 1/(coverageFactor+1) * (coverageFactor * (upperBorderA-lowerBorderA) + Math.sqrt(upperEstimateA/(upperEstimateA+lowerEstimate)) + Math.sqrt(lowerEstimateA/(lowerEstimateA+upperEstimate))); - size = getAccuracy(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getAccuracy(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); + size = useFMeasure ? getFMeasure(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getFMeasure(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)) : getAccuracy(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getAccuracy(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); } else { // size = 1/(coverageFactor+1) * (coverageFactor * coverage + Math.sqrt(instancesCovered/(instancesCovered+lowerEstimate)) + Math.sqrt(instancesCovered/(instancesCovered+upperEstimate))); - size = getAccuracy(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); + size = useFMeasure ? getFMeasure(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getFMeasure(recall, instancesCovered/(double)(instancesCovered+upperEstimate)) : getAccuracy(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); } if(size < 0.1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-11-23 20:57:23
|
Revision: 1915 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1915&view=rev Author: lorenz_b Date: 2009-11-23 20:57:15 +0000 (Mon, 23 Nov 2009) Log Message: ----------- Fixed some bugs. Fixed wrong informations shown in class choose wizard step. Updated Pellet reasoner libs to final version 2.0. Modified Paths: -------------- trunk/lib/pellet/pellet-core.jar trunk/lib/pellet/pellet-datatypes.jar trunk/lib/pellet/pellet-el.jar trunk/lib/pellet/pellet-explanation.jar trunk/lib/pellet/pellet-modularity.jar trunk/lib/pellet/pellet-owlapi.jar trunk/lib/pellet/pellet-rules.jar trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java trunk/src/dl-learner/org/dllearner/tools/ore/LearningManager.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/CachedExplanationGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/LaconicExplanationGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTableModel.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/RemainingAxiomsTable.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/ClassChoosePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java Modified: trunk/lib/pellet/pellet-core.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-datatypes.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-el.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-explanation.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-modularity.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-owlapi.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-rules.jar =================================================================== (Binary files differ) Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -294,6 +294,10 @@ return gen.getSourceAxioms(ax); } + public Set<OWLAxiom> getLaconicSourceAxioms(OWLAxiom ax){ + return gen.getLaconicSourceAxioms(ax); + } + public Set<OWLAxiom> getRemainingAxioms(OWLAxiom source, OWLAxiom part){ return gen.getRemainingAxioms(source, part); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/LearningManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/LearningManager.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/LearningManager.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -26,7 +26,7 @@ private int currentDescriptionIndex = 0; - public static LearningManager getInstance(){ + public static synchronized LearningManager getInstance(){ if(instance == null){ instance = new LearningManager(); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/RepairManager.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -1,11 +1,15 @@ package org.dllearner.tools.ore; import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.Stack; import org.mindswap.pellet.owlapi.Reasoner; import org.semanticweb.owl.model.AddAxiom; +import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLOntologyChange; import org.semanticweb.owl.model.OWLOntologyChangeException; import org.semanticweb.owl.model.OWLOntologyManager; @@ -20,10 +24,15 @@ private OWLOntologyManager manager; private Reasoner reasoner; - private List<OWLOntologyChange> repairPlan; + private Set<OWLOntologyChange> repairPlan; private Stack<List<OWLOntologyChange>> undoStack; private Stack<List<OWLOntologyChange>> redoStack; + + private Set<OWLAxiom> selectedAxioms; + + private Set<OWLAxiom> scheduled2Remove; + private Set<OWLAxiom> scheduled2Add; private RepairManager(OREManager oreMan){ this.reasoner = oreMan.getReasoner().getReasoner(); @@ -34,8 +43,13 @@ undoStack = new Stack<List<OWLOntologyChange>>(); redoStack = new Stack<List<OWLOntologyChange>>(); - repairPlan = new ArrayList<OWLOntologyChange>(); + repairPlan = new LinkedHashSet<OWLOntologyChange>(); + selectedAxioms = new HashSet<OWLAxiom>(); + + scheduled2Remove = new HashSet<OWLAxiom>(); + scheduled2Add = new HashSet<OWLAxiom>(); + oreMan.addListener(this); } @@ -61,26 +75,69 @@ public void addToRepairPlan(OWLOntologyChange change){ repairPlan.add(change); + if(change instanceof RemoveAxiom){ + scheduled2Remove.add(change.getAxiom()); + } else { + scheduled2Add.add(change.getAxiom()); + } fireRepairPlanChanged(); } public void addToRepairPlan(List<OWLOntologyChange> changes){ - repairPlan.addAll(changes); + for(OWLOntologyChange change : changes){ + if(change instanceof RemoveAxiom){ + if(scheduled2Add.contains(change.getAxiom())){ + scheduled2Add.remove(change.getAxiom()); + repairPlan.remove(new AddAxiom(change.getOntology(), change.getAxiom())); + } else { + scheduled2Remove.add(change.getAxiom()); + repairPlan.add(change); + } + + } else { + scheduled2Add.add(change.getAxiom()); + repairPlan.add(change); + } + + } +// repairPlan.addAll(changes); fireRepairPlanChanged(); } public void removeFromRepairPlan(OWLOntologyChange change){ repairPlan.remove(change); + if(change instanceof RemoveAxiom){ + scheduled2Remove.remove(change.getAxiom()); + } else { + scheduled2Add.remove(change.getAxiom()); + } fireRepairPlanChanged(); } public void removeFromRepairPlan(List<OWLOntologyChange> changes){ - repairPlan.removeAll(changes); + for(OWLOntologyChange change : changes){ + if(change instanceof RemoveAxiom){ + scheduled2Remove.add(change.getAxiom()); + } else { + scheduled2Add.add(change.getAxiom()); + } + repairPlan.remove(change); + } +// repairPlan.removeAll(changes); fireRepairPlanChanged(); } + + public boolean isScheduled2Remove(OWLAxiom ax){ + return scheduled2Remove.contains(ax); + } + + public boolean isScheduled2Add(OWLAxiom ax){ + return scheduled2Add.contains(ax); + } + public List<OWLOntologyChange> getRepairPlan(){ - return repairPlan; + return new ArrayList<OWLOntologyChange>(repairPlan); } public boolean isUndoable(){ @@ -90,7 +147,7 @@ public void executeRepairPlan(){ try { - manager.applyChanges(repairPlan); + manager.applyChanges(new ArrayList<OWLOntologyChange>(repairPlan)); } catch (OWLOntologyChangeException e) { System.out.println("Error in Repairmanager: Couldn't apply ontology changes"); e.printStackTrace(); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/CachedExplanationGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/CachedExplanationGenerator.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/CachedExplanationGenerator.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -299,6 +299,10 @@ return laconicExpGen.getSourceAxioms(ax); } + public Set<OWLAxiom> getLaconicSourceAxioms(OWLAxiom ax){ + return laconicExpGen.getLaconicSourceAxioms(ax); + } + public Set<OWLAxiom> getRemainingAxioms(OWLAxiom source, OWLAxiom part){ return laconicExpGen.getRemainingAxioms(source, part); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/LaconicExplanationGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/LaconicExplanationGenerator.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/laconic/LaconicExplanationGenerator.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -333,9 +333,20 @@ return sourceAxioms; } + public Set<OWLAxiom> getLaconicSourceAxioms(OWLAxiom axiom){ + Map<OWLAxiom, Set<OWLAxiom>> axioms2SourceMap = oPlus.getAxiomsMap(); + Set<OWLAxiom> sourceAxioms = new HashSet<OWLAxiom>(); + sourceAxioms.addAll(axioms2SourceMap.get(axiom)); + + return sourceAxioms; + } + public Set<OWLAxiom> getRemainingAxioms(OWLAxiom source, OWLAxiom part){ Set<OWLAxiom> parts = computeOPlus(Collections.singleton(source)); - + for(OWLAxiom p : parts){ + System.out.println("Part: " + p); + System.out.println(oPlus.getAxiomsMap().get(p)); + } for(OWLAxiom ax : oPlus.getAxiomsMap().get(part)){ parts.remove(ax); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTableModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTableModel.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/ExplanationTableModel.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -81,7 +81,7 @@ OWLAxiom ax = getOWLAxiomAtRow(rowIndex); if(impMan.isSelected(ax)){ impMan.removeSelection(ax); - if(expMan.isLaconicMode() && !ont.containsAxiom(ax)){ + if(!ont.containsAxiom(ax)){ List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); for(OWLAxiom source : expMan.getSourceAxioms(ax)){ impMan.removeSelection(source); @@ -96,7 +96,7 @@ } } else { // impMan.addSelection(ax); - if(expMan.isLaconicMode() && !ont.containsAxiom(ax)){ + if(!ont.containsAxiom(ax)){ // List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>(); // for(OWLAxiom source : expMan.getSourceAxioms(ax)){ // impMan.addSelection(source); @@ -111,6 +111,12 @@ if(ret == RemainingAxiomsDialog.OK_RETURN_CODE){ impMan.addSelection(ax); List<OWLOntologyChange> changes = dialog.getChanges(); + for(OWLAxiom source : expMan.getLaconicSourceAxioms(ax)){ + if(repMan.isScheduled2Add(source)){ + changes.add(new RemoveAxiom(ont, source)); + } + + } repMan.addToRepairPlan(changes); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/RemainingAxiomsTable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/RemainingAxiomsTable.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/RemainingAxiomsTable.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -3,7 +3,7 @@ import java.awt.Color; import java.util.List; -import org.dllearner.tools.ore.ui.rendering.ManchesterSyntaxTableCellRenderer; +import org.dllearner.tools.ore.ui.rendering.TextAreaRenderer; import org.jdesktop.swingx.JXTable; import org.semanticweb.owl.model.OWLAxiom; @@ -18,8 +18,7 @@ setBackground(Color.WHITE); setModel(new RemainingAxiomsTableModel(remainingAxioms)); - setRowHeight(getRowHeight() + 5); - getColumn(0).setCellRenderer(new ManchesterSyntaxTableCellRenderer()); + getColumn(0).setCellRenderer(new TextAreaRenderer()); getColumn(1).setMaxWidth(30); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/ClassChoosePanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/ClassChoosePanelDescriptor.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/descriptors/ClassChoosePanelDescriptor.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -63,9 +63,12 @@ /** * Information string for class choose panel. */ - public static final String INFORMATION = "Above all atomic classes which have at least one individual are listed. " - + "Select one of them for which you want to learn equivalent class expressions," + - " then press <Next>"; + public static final String AUTO_LEARN_INFORMATION = "Adjust the parameters for automatic learning mode, " + +"then press <Next>"; + + public static final String MANUAL_LEARN_INFORMATION = "Above all atomic classes which have at least one individual are listed. " + + "Select one of them for which you want to learn equivalent class or superclass expressions," + + " then press <Next>"; private ClassChoosePanel classChoosePanel; private Map<Integer, Set<NamedClass>> instanceCountToClasses; @@ -104,7 +107,12 @@ @Override public void aboutToDisplayPanel() { - getWizard().getInformationField().setText(INFORMATION); + if(isAutoLearningMode()){ + getWizard().getInformationField().setText(AUTO_LEARN_INFORMATION); + } else { + getWizard().getInformationField().setText(MANUAL_LEARN_INFORMATION); + } + setNextButtonAccordingToConceptSelected(); } @@ -210,9 +218,11 @@ public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("auto")){ classChoosePanel.setAutoLearningPanel(true); + getWizard().getInformationField().setText(AUTO_LEARN_INFORMATION); LearningManager.getInstance().setLearningMode(LearningManager.AUTO_LEARN_MODE); } else { classChoosePanel.setAutoLearningPanel(false); + getWizard().getInformationField().setText(MANUAL_LEARN_INFORMATION); LearningManager.getInstance().setLearningMode(LearningManager.MANUAL_LEARN_MODE); retrieveClasses(); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java 2009-11-23 14:35:21 UTC (rev 1914) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ui/wizard/panels/UnsatisfiableExplanationPanel.java 2009-11-23 20:57:15 UTC (rev 1915) @@ -56,7 +56,10 @@ private JPanel buttonExplanationsPanel; + private final String EXPLANATION_TYPE_TEXT = ""; + private final String EXPLANATION_COUNT_TEXT = ""; + private ButtonGroup explanationType; private JRadioButton regularButton; @@ -185,8 +188,8 @@ explanationTypePanel.add(preciseButton, c); HelpablePanel explanationTypeHelpPanel = new HelpablePanel(explanationTypePanel); explanationTypeHelpPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); + explanationTypeHelpPanel.setHelpText(EXPLANATION_TYPE_TEXT); - JPanel explanationCountPanel = new JPanel(new GridBagLayout()); maxExplanationsSelector = new JSpinner(); @@ -212,6 +215,7 @@ HelpablePanel explanationCountHelpPanel = new HelpablePanel(explanationCountPanel); explanationCountHelpPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); + explanationCountHelpPanel.setHelpText(EXPLANATION_COUNT_TEXT); strikeOutBox = new JCheckBox("Strike out irrelevant parts"); strikeOutBox.setActionCommand("strike"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-11-23 14:35:30
|
Revision: 1914 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1914&view=rev Author: jenslehmann Date: 2009-11-23 14:35:21 +0000 (Mon, 23 Nov 2009) Log Message: ----------- added ability to optimise towards F-measure in class learning problems Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-11-16 22:09:55 UTC (rev 1913) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-11-23 14:35:21 UTC (rev 1914) @@ -81,6 +81,15 @@ public boolean getUseApproximations() { return (Boolean) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "useApproximations") ; } +/** +* accuracyMethod Specifies, which method/function to use for computing accuracy.. +* mandatory: false| reinit necessary: true +* default value: standard +* @return String +**/ +public String getAccuracyMethod() { +return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "accuracyMethod") ; +} /** * @param classToDescribe class of which a description should be learned. @@ -108,6 +117,15 @@ ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "useApproximations", useApproximations); reinitNecessary = true; } +/** +* @param accuracyMethod Specifies, which method/function to use for computing accuracy.. +* mandatory: false| reinit necessary: true +* default value: standard +**/ +public void setAccuracyMethod(String accuracyMethod) { +ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "accuracyMethod", accuracyMethod); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-16 22:09:55 UTC (rev 1913) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-11-23 14:35:21 UTC (rev 1914) @@ -51,6 +51,10 @@ */ public class ClassLearningProblem extends LearningProblem { + // TODO: naming needs to be cleaned up for consistency: + // coverage => recall + // protusion => precision + private NamedClass classToDescribe; private List<Individual> classInstances; private boolean equivalence = true; @@ -59,6 +63,7 @@ private static final double approx = 0.05; private boolean useApproximations; + private boolean useFMeasure; // factor for higher weight on coverage (needed for subclass learning) private double coverageFactor; @@ -86,6 +91,9 @@ options.add(type); BooleanConfigOption approx = new BooleanConfigOption("useApproximations", "whether to use stochastic approximations for computing accuracy", true); options.add(approx); + StringConfigOption accMethod = new StringConfigOption("accuracyMethod", "Specifies, which method/function to use for computing accuracy.","standard"); // or domain/range of a property. + accMethod.setAllowedValues(new String[] {"standard", "fmeasure", "predacc"}); + options.add(accMethod); return options; } @@ -97,6 +105,7 @@ public void init() throws ComponentInitException { classToDescribe = new NamedClass(configurator.getClassToDescribe().toString()); useApproximations = configurator.getUseApproximations(); + useFMeasure = configurator.getAccuracyMethod().equals("fmeasure"); if(!reasoner.getNamedClasses().contains(classToDescribe)) { throw new ComponentInitException("The class \"" + configurator.getClassToDescribe() + "\" does not exist. Make sure you spelled it correctly."); @@ -173,7 +182,8 @@ // we check whether the axiom already follows from the knowledge base boolean followsFromKB = reasoner.isSuperClassOf(description, classToDescribe); - return new ClassScore(coveredInstances, coverage, additionalInstances, protusion, getAccuracy(coverage, protusion), isConsistent, followsFromKB); + double acc = useFMeasure ? getFMeasure(coverage, protusion) : getAccuracy(coverage, protusion); + return new ClassScore(coveredInstances, coverage, additionalInstances, protusion, acc, isConsistent, followsFromKB); } public boolean isEquivalenceProblem() { @@ -210,11 +220,19 @@ @Override public double getAccuracyOrTooWeak(Description description, double noise) { - if(useApproximations) { - return getAccuracyOrTooWeakApprox(description, noise); - } else { - return getAccuracyOrTooWeakExact(description, noise); - } +// if(useFMeasure) { +// if(useApproximations) { +// return getFMeasureOrTooWeakApprox(description, noise); +// } else { +// return getFMeasureOrTooWeakExact(description, noise); +// } +// } else { + if(useApproximations) { + return getAccuracyOrTooWeakApprox(description, noise); + } else { + return getAccuracyOrTooWeakExact(description, noise); + } +// } } // instead of using the standard operation, we use optimisation @@ -278,7 +296,7 @@ } } - double coverage = instancesCovered/(double)classInstances.size(); + double recall = instancesCovered/(double)classInstances.size(); // MonitorFactory.add("estimatedA","count", estimatedA ? 1 : 0); // MonitorFactory.add("aInstances","count", total); @@ -318,7 +336,7 @@ size = getAccuracy(upperBorderA, upperEstimateA/(double)(upperEstimateA+lowerEstimate)) - getAccuracy(lowerBorderA, lowerEstimateA/(double)(lowerEstimateA+upperEstimate)); } else { // size = 1/(coverageFactor+1) * (coverageFactor * coverage + Math.sqrt(instancesCovered/(instancesCovered+lowerEstimate)) + Math.sqrt(instancesCovered/(instancesCovered+upperEstimate))); - size = getAccuracy(coverage, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(coverage, instancesCovered/(double)(instancesCovered+upperEstimate)); + size = getAccuracy(recall, instancesCovered/(double)(instancesCovered+lowerEstimate)) - getAccuracy(recall, instancesCovered/(double)(instancesCovered+upperEstimate)); } if(size < 0.1) { @@ -336,20 +354,26 @@ // since we measured/estimated accuracy only on instances outside A (superClassInstances // does not include instances of A), we need to add it in the denominator - double protusion = instancesCovered/(double)(instancesDescription+instancesCovered); + double precision = instancesCovered/(double)(instancesDescription+instancesCovered); if(instancesCovered + instancesDescription == 0) { - protusion = 0; + precision = 0; } // MonitorFactory.add("estimatedB","count", estimatedB ? 1 : 0); // MonitorFactory.add("bInstances","count", testsPerformed); - return getAccuracy(coverage, protusion); + // debug code to compare the two measures +// System.out.println("recall: " + recall); +// System.out.println("precision: " + precision); +// System.out.println("F-measure: " + getFMeasure(recall, precision)); +// System.out.println("standard acc: " + getAccuracy(recall, precision)); + +// return getAccuracy(recall, precision); + return useFMeasure ? getFMeasure(recall, precision) : getAccuracy(recall, precision); } public double getAccuracyOrTooWeakExact(Description description, double noise) { - // overhang int additionalInstances = 0; for(Individual ind : superClassInstances) { if(reasoner.hasType(description, ind)) { @@ -357,7 +381,6 @@ } } - // coverage int coveredInstances = 0; for(Individual ind : classInstances) { if(reasoner.hasType(description, ind)) { @@ -365,16 +388,15 @@ } } - double coverage = coveredInstances/(double)classInstances.size(); + double recall = coveredInstances/(double)classInstances.size(); - if(coverage < 1 - noise) { + if(recall < 1 - noise) { return -1; } -// double protusion = additionalInstances == 0 ? 0 : coveredInstances/(double)(coveredInstances+additionalInstances); - double protusion = (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); + double precision = (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); - return getAccuracy(coverage, protusion); + return useFMeasure ? getFMeasure(recall, precision) : getAccuracy(recall, precision); } // @Deprecated @@ -389,12 +411,77 @@ // } // } + // please note that getting recall and precision wastes some computational + // resource, because both methods need to compute the covered instances + public double getRecall(Description description) { + int coveredInstances = 0; + for(Individual ind : classInstances) { + if(reasoner.hasType(description, ind)) { + coveredInstances++; + } + } + return coveredInstances/(double)classInstances.size(); + } + + public double getPrecision(Description description) { + + int additionalInstances = 0; + for(Individual ind : superClassInstances) { + if(reasoner.hasType(description, ind)) { + additionalInstances++; + } + } + + int coveredInstances = 0; + for(Individual ind : classInstances) { + if(reasoner.hasType(description, ind)) { + coveredInstances++; + } + } + + return (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); + } + + public double getPredictiveAccuracy() { + return 0; + } + + // see http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-WS/Vol-426/swap2008_submission_14.pdf + // for all methods below (currently dummies) + public double getMatchRate() { + return 0; + } + + public double getOmissionError() { + return 0; + } + + public double getInductionRate() { + return 0; + } + + public double getComissionError() { + return 0; + } + + public double getGeneralisedRecall() { + return 0; + } + + public double getGeneralisedPrecision() { + return 0; + } + // computes accuracy from coverage and protusion (changing this function may // make it necessary to change the appoximation too) private double getAccuracy(double coverage, double protusion) { return (coverageFactor * coverage + Math.sqrt(protusion)) / (coverageFactor + 1); } + private double getFMeasure(double recall, double precision) { + return 2 * precision * recall / (precision + recall); + } + // see paper: expression used in confidence interval estimation private static double p3(double p1, int total) { return 1.96 * Math.sqrt(p1*(1-p1)/(total+4)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-11-16 22:10:01
|
Revision: 1913 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1913&view=rev Author: jenslehmann Date: 2009-11-16 22:09:55 +0000 (Mon, 16 Nov 2009) Log Message: ----------- implemented CELOE single suggestion mode for learning problems with >1000 examples (i.e. all evaluations should be approximated for performance reasons) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-15 13:55:34 UTC (rev 1912) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-11-16 22:09:55 UTC (rev 1913) @@ -21,6 +21,7 @@ import java.text.DecimalFormat; import java.util.Collection; +import java.util.Date; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -36,6 +37,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.CELOEConfigurator; +import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.CommonConfigOptions; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.owl.ClassHierarchy; @@ -95,6 +97,12 @@ private EvaluatedDescriptionSet bestEvaluatedDescriptions; + // if true, then each solution is evaluated exactly instead of approximately + // private boolean exactBestDescriptionEvaluation = false; + private boolean singleSuggestionMode; + private Description bestDescription; + private double bestAccuracy = Double.MIN_VALUE; + private NamedClass classToDescribe; // examples are either 1.) instances of the class to describe 2.) positive examples // 3.) union of pos.+neg. examples depending on the learning problem at hand @@ -154,6 +162,7 @@ options.add(CommonConfigOptions.getNoisePercentage()); options.add(CommonConfigOptions.getMaxDepth(7)); options.add(CommonConfigOptions.maxNrOfResults(10)); + options.add(new BooleanConfigOption("singleSuggestionMode", "Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples.", false)); return options; } @@ -172,6 +181,8 @@ startClass = Thing.instance; + singleSuggestionMode = configurator.getSingleSuggestionMode(); + // create refinement operator operator = new RhoDRDown(reasoner, classHierarchy, startClass, configurator); baseURI = reasoner.getBaseURI(); @@ -246,7 +257,7 @@ int loop = 0; while (!terminationCriteriaSatisfied()) { - if(bestEvaluatedDescriptions.getBest().getAccuracy() > highestAccuracy) { + if(!singleSuggestionMode && bestEvaluatedDescriptions.getBest().getAccuracy() > highestAccuracy) { highestAccuracy = bestEvaluatedDescriptions.getBest().getAccuracy(); logger.info("more accurate (" + dfPercent.format(highestAccuracy) + ") class expression found: " + descriptionToString(bestEvaluatedDescriptions.getBest().getDescription())); } @@ -260,6 +271,11 @@ TreeSet<Description> refinements = refineNode(nextNode); mon.stop(); +// System.out.println("next node: " + nextNode); +// for(Description refinement : refinements) { +// System.out.println("refinement: " + refinement); +// } + while(refinements.size() != 0) { // pick element from set Description refinement = refinements.pollFirst(); @@ -269,24 +285,30 @@ // (this also avoids duplicate node children) if(length > horizExp && refinement.getDepth() <= maxDepth) { +// System.out.println("potentially adding " + refinement + " to search tree as child of " + nextNode + " " + new Date()); Monitor mon2 = MonitorFactory.start("addNode"); addNode(refinement, nextNode); mon2.stop(); - +// System.out.println("addNode finished" + " " + new Date()); } } updateMinMaxHorizExp(nextNode); +// System.out.println(loop); loop++; } - + if (stop) { logger.info("Algorithm stopped ("+expressionTests+" descriptions tested).\n"); } else { logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested).\n"); } + + if(singleSuggestionMode) { + bestEvaluatedDescriptions.add(bestDescription, bestAccuracy, learningProblem); + } // print solution(s) logger.info("solutions:\n" + getSolutionString()); @@ -343,8 +365,10 @@ return false; } +// System.out.println("Test " + new Date()); // quality of description (return if too weak) double accuracy = learningProblem.getAccuracyOrTooWeak(description, noise); +// System.out.println("Test2 " + new Date()); expressionTests++; // System.out.println(description + " " + accuracy); if(accuracy == -1) { @@ -361,7 +385,19 @@ } nodes.add(node); +// System.out.println("Test3 " + new Date()); + // in some cases (e.g. mutation) fully evaluating even a single description is too expensive + // due to the high number of examples -- so we just stick to the approximate accuracy + if(singleSuggestionMode) { + if(accuracy > bestAccuracy) { + bestAccuracy = accuracy; + bestDescription = description; + logger.info("more accurate (" + dfPercent.format(bestAccuracy) + ") class expression found: " + descriptionToString(bestDescription)); + } + return true; + } + // maybe add to best descriptions (method keeps set size fixed); // we need to make sure that this does not get called more often than // necessary since rewriting is expensive @@ -374,6 +410,7 @@ (accuracy >= accThreshold && description.getLength() < worst.getDescriptionLength())); } +// System.out.println("Test4 " + new Date()); if(isCandidate) { Description niceDescription = rewriteNode(node); ConceptTransformation.transformToOrderedForm(niceDescription, descriptionComparator); @@ -383,18 +420,20 @@ // a subdescription of this one unless accuracy is different boolean shorterDescriptionExists = false; for(EvaluatedDescription ed : bestEvaluatedDescriptions.getSet()) { - if(ed.getAccuracy()==accuracy && ConceptTransformation.isSubdescription(niceDescription, ed.getDescription())) { + if(Math.abs(ed.getAccuracy()-accuracy) <= 0.00001 && ConceptTransformation.isSubdescription(niceDescription, ed.getDescription())) { shorterDescriptionExists = true; break; } } if(!shorterDescriptionExists) { - bestEvaluatedDescriptions.add(niceDescription, accuracy, learningProblem); + bestEvaluatedDescriptions.add(niceDescription, accuracy, learningProblem); } } +// System.out.println("Test5 " + new Date()); +// System.out.println("best evaluated descriptions size: " + bestEvaluatedDescriptions.size() + " worst: " + bestEvaluatedDescriptions.getWorst()); return true; } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-11-15 13:55:34 UTC (rev 1912) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-11-16 22:09:55 UTC (rev 1913) @@ -174,6 +174,15 @@ public int getMaxNrOfResults() { return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxNrOfResults") ; } +/** +* singleSuggestionMode Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples.. +* mandatory: false| reinit necessary: true +* default value: false +* @return boolean +**/ +public boolean getSingleSuggestionMode() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "singleSuggestionMode") ; +} /** * @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. @@ -292,6 +301,15 @@ ComponentManager.getInstance().applyConfigEntry(cELOE, "maxNrOfResults", maxNrOfResults); reinitNecessary = true; } +/** +* @param singleSuggestionMode Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples.. +* mandatory: false| reinit necessary: true +* default value: false +**/ +public void setSingleSuggestionMode(boolean singleSuggestionMode) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "singleSuggestionMode", singleSuggestionMode); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java 2009-11-15 13:55:34 UTC (rev 1912) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java 2009-11-16 22:09:55 UTC (rev 1913) @@ -21,7 +21,6 @@ package org.dllearner.core.configurators; import java.util.Set; - import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.reasoning.PelletReasoner; @@ -73,7 +72,6 @@ reinitNecessary = true; } - /** * true, if this component needs reinitializsation. * @return boolean Modified: trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-15 13:55:34 UTC (rev 1912) +++ trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-16 22:09:55 UTC (rev 1913) @@ -63,6 +63,9 @@ private static boolean generatePosExampleClass = true; // set to true if accessing PostreSQL and false for MySQL private static boolean pgSQL = true; + // generate fragment => limits the number of individuals in the ontology + // to speed up learning +// private static boolean onlyFragment = true; public static void main(String[] args) throws ClassNotFoundException, BackingStoreException, SQLException { @@ -233,6 +236,10 @@ kb.addAxiom(new DatatypePropertyDomainAxiom(reliabilityDeltagProp, mutationClass)); kb.addAxiom(new DatatypePropertyRangeAxiom(reliabilityDeltagProp, Datatype.DOUBLE)); + if(generatePosExampleClass) { + kb.addAxiom(new SubClassAxiom(deleteriousMutationClass, mutationClass)); + } + // select data (restricted to pos/neg examples for efficiency) Statement stmt = conn.createStatement(); ResultSet rs = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <neb...@us...> - 2009-11-15 13:55:41
|
Revision: 1912 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1912&view=rev Author: nebelschwade Date: 2009-11-15 13:55:34 +0000 (Sun, 15 Nov 2009) Log Message: ----------- Bug-Showcase for learning-method using the same sessionID as for searching Modified Paths: -------------- trunk/src/moosique.net/moosique/classes/DllearnerConnection.php trunk/src/moosique.net/moosique/testing/salsaTest.php Modified: trunk/src/moosique.net/moosique/classes/DllearnerConnection.php =================================================================== --- trunk/src/moosique.net/moosique/classes/DllearnerConnection.php 2009-11-14 21:07:39 UTC (rev 1911) +++ trunk/src/moosique.net/moosique/classes/DllearnerConnection.php 2009-11-15 13:55:34 UTC (rev 1912) @@ -147,10 +147,11 @@ if using the already created sessionID and knowLedgeSourceID for learning, there will always be an error, when trying to use initAll */ - // $id = $_SESSION['sessionID']; - // $kID = $this->knowledgeSourceID; - $id = $this->client->generateID(); - $kID = $this->client->addKnowledgeSource($id, 'sparql', $this->endpoint); + $id = $_SESSION['sessionID']; + $kID = $this->knowledgeSourceID; + // the two lines below will work, the two lines above won't + // $id = $this->client->generateID(); + // $kID = $this->client->addKnowledgeSource($id, 'sparql', $this->endpoint); $this->client->addKnowledgeSource($id, 'owlfile', $this->getConfigUrl('tagOntology')); $this->client->setReasoner($id, $conf['reasoner']); Modified: trunk/src/moosique.net/moosique/testing/salsaTest.php =================================================================== --- trunk/src/moosique.net/moosique/testing/salsaTest.php 2009-11-14 21:07:39 UTC (rev 1911) +++ trunk/src/moosique.net/moosique/testing/salsaTest.php 2009-11-15 13:55:34 UTC (rev 1912) @@ -1,11 +1,6 @@ <?php session_start(); -require('../classes/Config.php'); -require('../classes/DllearnerConnection.php'); - -$c = new DllearnerConnection(); - // Instances are the positive Examples mixed up with some // other examples, thus random records $instances = array( @@ -21,7 +16,24 @@ "http://dbtune.org/jamendo/record/1372" ); + +require('../classes/Config.php'); +require('../classes/DllearnerConnection.php'); +require('../classes/SparqlQueryBuilder.php'); + +$c = new DllearnerConnection(); +$s = new SparqlQueryBuilder('salsa', 'tagSearch'); +$q = $s->getQuery(); + +$json = $c->sparqlQuery($q); +// convert to useable object +$result = json_decode($json); + + echo '<pre>'; +echo "SESSION-ID" . $_SESSION['sessionID'] . "\n" . "\n"; + +print_r($result); print_r($instances); print_r($posExamples); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <neb...@us...> - 2009-11-14 21:07:54
|
Revision: 1911 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1911&view=rev Author: nebelschwade Date: 2009-11-14 21:07:39 +0000 (Sat, 14 Nov 2009) Log Message: ----------- Added a log-history for adding/removing items to the playlist Fixed a major bug that made continuous playing impossible due to a Yahoo-Media-Player-"Bug" Enhanced OWL Major DRY-Refactoring Minor View/Frontend-Issues Help Modified Paths: -------------- trunk/src/moosique.net/README.txt trunk/src/moosique.net/css/style.css trunk/src/moosique.net/index.php trunk/src/moosique.net/js/index.php trunk/src/moosique.net/js/moosique.js trunk/src/moosique.net/js/mootools-1.2.4.2-more-yc.js trunk/src/moosique.net/js/start.js trunk/src/moosique.net/moosique/classes/DataHelper.php trunk/src/moosique.net/moosique/classes/DllearnerConnection.php trunk/src/moosique.net/moosique/classes/Recommendations.php trunk/src/moosique.net/moosique/classes/RequestHandler.php trunk/src/moosique.net/moosique/classes/SparqlQueryBuilder.php trunk/src/moosique.net/moosique/classes/View.php trunk/src/moosique.net/moosique/config.ini trunk/src/moosique.net/moosique/data/moosique.owl trunk/src/moosique.net/moosique/testing/nodeExtractionBug.conf Added Paths: ----------- trunk/src/moosique.net/moosique/testing/salsaTest.php trunk/src/moosique.net/moosique/testing/stonerTest.php trunk/src/moosique.net/moosique/testing/stonerTestSmall.php Removed Paths: ------------- trunk/src/moosique.net/moosique/testing/jamendo.owl trunk/src/moosique.net/moosique/testing/jamendo_complete.owl trunk/src/moosique.net/moosique/testing/learnTest.php trunk/src/moosique.net/moosique/testing/moosique.conf trunk/src/moosique.net/moosique/testing/moreThan80.owl trunk/src/moosique.net/moosique/testing/newOwl.owl trunk/src/moosique.net/moosique/testing/nodeExtractionBug_2.conf trunk/src/moosique.net/moosique/testing/rocksubset.owl Modified: trunk/src/moosique.net/README.txt =================================================================== --- trunk/src/moosique.net/README.txt 2009-11-11 21:04:26 UTC (rev 1910) +++ trunk/src/moosique.net/README.txt 2009-11-14 21:07:39 UTC (rev 1911) @@ -5,32 +5,25 @@ See /moosique/config.ini -- PHP 5.2.x +- PHP 5.2.x or above (yes, 5.3 works) - output_buffering has to be enabled to use debugging features (if enabled in config.ini) (FirePHP is included in this package) - - installed PEAR-Packages HTTP and HTTP_Request (used by Utilities.php from DL-Learner) + - PEAR-Packages HTTP and HTTP_Request (used by Utilities.php from DL-Learner) - - A running DL-Learner Webservice Instance - - Set paths in config.ini + - Set paths/URLs in config.ini Notes: ====== - This is a modern piece of websoftware, use a modern browser! - - Tested and working in: - - Firefox 3.5.x - - Safari 4.x and Webkit nightly build r49764 - - Google Chrome 4.0.x - - Opera 10.x - - Untested: - - Internet Explorer and other platform-unindependent browsers - -- JavaScript has to be enabled, this is an AJAX-Application and uses the - Yahoo Media Player-Script! - -- - + Tested and working in: + - Firefox 3.5.x + - Safari 4.x and Webkit nightly build r50383 + - Chromium Build 30678 + - Opera 10.x (though not as beautiful) +- JavaScript has to be enabled, this is an after all an AJAX-Application - Debugging makes use of Firebug/FirePHP, thus only working in Firefox - @@ -38,5 +31,13 @@ Known Bugs: =========== +- Moving the current playing song in the playlist down or up + breaks the order of the playlist in the Yahoo Media Player`` -- \ No newline at end of file + +Planned Features: +================= +- RDFa Support for artist information +- Unique URLs for ajax (bookmarkable, Back-Button) +- Scrobbling-Support for last.fm +- Playlist export and Download Modified: trunk/src/moosique.net/css/style.css =================================================================== --- trunk/src/moosique.net/css/style.css 2009-11-11 21:04:26 UTC (rev 1910) +++ trunk/src/moosique.net/css/style.css 2009-11-14 21:07:39 UTC (rev 1911) @@ -21,12 +21,12 @@ a:hover { color: #1fd611; } a.button { background: #4a4a4a; color: #f1f7e4; padding: 5px 10px; text-decoration: none; } a.button:hover { border: 1px solid #1fd611; padding: 4px 9px; } -h1 { font: 36px/36px Georgia, Times, serif; } -h2 { font: 30px/30px Georgia, Times, serif; } -h3 { font: 24px/24px Georgia, Times, serif; } -h4 { font: 18px/18px Georgia, Times, serif; } -h5 { font: 14px/14px Georgia, Times, serif; } -h6 { font: 12px/12px Georgia, Times, serif; } +h1 { font: 36px/42px Georgia, Times, serif; } +h2 { font: 30px/36px Georgia, Times, serif; } +h3 { font: 24px/28px Georgia, Times, serif; } +h4 { font: 18px/20px Georgia, Times, serif; } +h5 { font: 14px/16px Verdana, Arial, sans-serif; } +h6 { font: 12px/14px Verdana, Arial, sans-serif; } pre { font: normal 10px/14px Monaco, Courier, monospace; } p, h1, h2, h3, h4, h5, h6, ul, ol, pre, form { margin-bottom: 20px; } @@ -43,14 +43,14 @@ #nav a { -moz-border-radius-bottomleft: 10px; -moz-border-radius-bottomright: 10px; -webkit-border-bottom-left-radius: 10px; -webkit-border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-bottom-left-radius: 10px; } -#info .linkList li { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; +#info .externalLinks li { -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px; -webkit-border-top-left-radius: 10px; -webkit-border-top-right-radius: 10px; border-top-left-radius: 10px; border-top-left-radius: 10px; } #content, #status, #playing, #playerControls, #topBorder, #searchValue, #searchType, #searchSubmit, #nav a, -#info .linkList li { -moz-box-shadow: 2px 2px 3px #191919; -webkit-box-shadow: 2px 2px 3px #191919; +#info .externalLinks li { -moz-box-shadow: 2px 2px 3px #191919; -webkit-box-shadow: 2px 2px 3px #191919; box-shadow: 2px 2px 3px #191919; } #nav .active a, .results img, a.button, #info .image img { -moz-box-shadow: 3px 3px 3px #191919; -webkit-box-shadow: 3px 3px 3px #191919; @@ -64,7 +64,7 @@ #container { width: 900px; margin: 0 auto; } #header { height: 175px; padding-top: 25px; } #content { background: #292929; padding: 25px; } -#footer { font: normal 11px/14px Verdana, Arial, sans-serif; padding-top: 40px; text-align: center; } +#footer { font: normal 11px/14px Verdana, Arial, sans-serif; padding-top: 40px; height: 54px; text-align: center; } /*=============== Player Controls, Status, Playing ===============*/ @@ -97,6 +97,7 @@ /*=============== Content & General ===============*/ #addRandom { text-decoration: underline; } +#autoAdd { float: right; } #footer a { padding: 0 12px; color: #5a5a5a; } #footer a:hover { color: #f1f7e4; } #help ul { list-style: disc; margin-left: 40px; } @@ -112,30 +113,20 @@ #nav a:hover { text-decoration: none; background: #5a5a5a; } -/*=============== Search Results, Recommendations & Playlist ===============*/ +/*=============== Search Results & Recommendations ===============*/ .results h3 a { font-weight: normal; } -.results img { max-width: 373px; max-height: 373px; } -.results li { float: left; width: 373px; border: 1px solid #5a5a5a; padding: 20px; margin-bottom: 20px; } +.results img { max-width: 373px; max-height: 373px;} +.results ul > li { float: left; width: 373px; border: 1px solid #5a5a5a; padding: 20px; margin-bottom: 20px; } .results li.odd { margin-right: 20px; clear: both; } -.results ul ul { list-style: disc; margin-bottom: 0; } -.results li li, -.artistSearch li li, -.tagSearch li li, -#info li li { border: none; display: list-item; padding: 0; margin: 0 0 0 36px; - width: auto; height: auto; float: none; } +.results ul ul, #log { clear: both; list-style: disc; margin-bottom: 0; } +.results li li, #log li { border: none; display: list-item; padding: 0; margin: 0 0 0 20px; width: auto; } +.results .image { text-align: center; } +.results .tagList { margin-top: 20px; } -.results h4 { display: inline; } -#recommendationResults ul ul, -.tagSearch ul ul, -#info ul ul { clear: both; } -.results .image { text-align: center; margin-bottom: 20px; } -#recommendationResults.results .image, -.results .tagSearch .image { margin: 0 20px 20px 0; width: 104px; height: 104px; float: left; } -#autoAdd { float: right; } - +/*=============== Recently & Playlist ===============*/ #playlist, #recently { margin-left: 36px; list-style: decimal; } #playlist li, #recently li { line-height: 24px; } -#playlist .ymp-btn-page-pause { font-weight: bold; } +#playlist .currentlyPlaying a { font-weight: bold; color: #1fd611; } #playlist .delete, #playlist .moveUp, #playlist .moveDown { position: absolute; display: block; top: 5px; right: 20px; width: 14px; height: 14px; @@ -149,12 +140,13 @@ /*=============== Information & Help ===============*/ +#info .image { float: left; margin: 0 20px 20px 0; } +#info .tagList { margin-bottom: 20px; } #info h3 { clear: both; } -#info .image { width: auto; float: left; margin: 0 20px 20px 0;} #info iframe { border: 1px solid #5a5a5a; width: 100%; height: 600px; } -#info .linkList { overflow: hidden; margin: 0 0 0 20px; } -#info .linkList li { float: left; padding: 10px; margin-right: 10px; background: #4a4a4a; } -#info .linkList li.active { background: #1fd611; } +#info .externalLinks { overflow: hidden; margin: 0 0 0 20px; } +#info .externalLinks li { float: left; padding: 10px; margin-right: 10px; background: #4a4a4a; } +#info .externalLinks li.active { background: #1fd611; } } /* end @media screen */ \ No newline at end of file Modified: trunk/src/moosique.net/index.php =================================================================== --- trunk/src/moosique.net/index.php 2009-11-11 21:04:26 UTC (rev 1910) +++ trunk/src/moosique.net/index.php 2009-11-14 21:07:39 UTC (rev 1911) @@ -1,10 +1,9 @@ <?php - session_start(); - /* - Welcome to moosique.net - a semantic web based internet-radio - - see README.txt for more details - */ +session_start(); +/* +Welcome to moosique.net - a semantic web based internet-radio +see README.txt and moosique/config.ini for more details +*/ ?> <!DOCTYPE html> <html lang="en"> @@ -61,17 +60,18 @@ <div id="results" class="results"> <h2>Welcome to moosique.net!</h2> <p> - Want to listen to some good free music? Search for something you like and add it to your playlist. + Want to listen to some good free music? Search for something you like and add it to your playlist. + You can search for artists, albums, songs and of course tags. + You can also enter your <a href="http://last.fm">last.fm</a>-username to automatically use your + most-used tags to generate a initial list of recommendations. By listening to songs you like, moosique will automatically try to learn about your musical taste and generate recommendations. You can find them in the tab »Recommendations«. - You can also enter your <a href="http://last.fm">last.fm</a>-username to automatically use your - most-used tags to generate a initial list of recommendations. </p> <p> After you have found something you want to listen to, just add it to your playlist and click the play-button. </p> <p> - Need help? Click on the »Help«-Tab to get more information about how to use moosique.net + Need help? Click on the »Help«-Tab to get more information about how to use moosique.net. </p> </div> </div> @@ -114,6 +114,10 @@ <li></li> </ol> <p><a href="#" id="resetRecently" class="button" title="Click here to reset your »recently listened to«-list.">Reset</a></p> + <h2>History</h2> + <ul id="log"> + <li>Nothing happened yet.</li> + </ul> </div> <div id="help"> <h2>How to use moosique.net</h2> @@ -126,12 +130,44 @@ If you are searching for tags, and your search is more than one word, the results will be better. For example: a search for "rock" will give you lots of results, where a search for "hard rock" will be more specific, giving you better search results. Just try it, you can't break anything. + Sometimes searching can take quite some time, this is where you just have to be patient... but + the system will always give you feedback on what it is doing at the moment. </p> + <h3>Player and playlist functions</h3> + <p> + The player-interface is visible, no matter where on the page your are or what you are doing. + You can always get information about the currently playing song in the status-planel on the + left, and you can always control the player with the buttons on the top-right. If you click + on the tab »Playlist« you will see what songs will play next and you can change + their order, or even delete songs from your playlist. There is also a »Recently listened + to«-list where you have an overview of the last 10 songs you have listened to. + You can reset both of these lists to "restart" from the beginning. + You can always download a song to your computer you are listening to by clicking on the link + »Download this song« in the player status panel. + </p> <h3>Recommendations</h3> <p> - moosique.net uses the mighty <a href="http://aksw.org/Projects/DLLearner">DL-Learner</a> to generate recommendations - based on the songs you have listened to. + moosique.net uses <a href="http://aksw.org/Projects/DLLearner">DL-Learner</a> to generate recommendations + based on the songs you have listened to. These songs can be found when clicking on the tab »Playlist«. + The recommendations are based on the tags of an album, or song + from an album, you have listened to. Recommendations are created every time you listen to a song for at + least half its length, just like scrobbling on last.fm. You can also manually generate your recommendations + by clicking on the corresponding link. If you have »Autoadd recommendations« checked, a new + song from your recommendations is added, everytime they are generated. The system always remembers your + 10 most recently listened to songs by storing them in a cookie. So you can come back a week later and + restart, where you left. </p> + <p> + If something goes wrong and you don't get any recommendations or they are not what you expected, + just try resetting your »recently listened to«-list and listen to some more songs. + </p> + <h3>More Info</h3> + <p> + Every time you start listening to a song, the tab »More Info« refreshes to show + more infomation about the artist, you are currently listening to. If there are any external + sources of information, you can access them at the bottom of the page, by clicking on the + different tabs (such as Geonames location, last.fm profile etc.). + </p> <h3>Requirements</h3> <p> To use moosique.net you should have: @@ -140,7 +176,7 @@ <li>A decent, modern browser, such as <a href="http://getfirefox.com">Firefox</a>, <a href="http://apple.com/de/safari/download/">Safari</a> or <a href="http://google.com/chrome/">Google Chrome</a></li> <li>JavaScript activated</li> <li>The <a href="http://www.adobe.com/se/products/flashplayer/">Adobe Flash Player</a> plugin for your browser</li> - <li>A fast internet connection</li> + <li>A fast internet connection, it's a streaming application...</li> <li>Some good headphones or loudspeakers of course. It's moosique after all!</li> </ul> </div> Modified: trunk/src/moosique.net/js/index.php =================================================================== --- trunk/src/moosique.net/js/index.php 2009-11-11 21:04:26 UTC (rev 1910) +++ trunk/src/moosique.net/js/index.php 2009-11-14 21:07:39 UTC (rev 1911) @@ -22,7 +22,7 @@ /* the javascript-files to include and compress */ include('mootools-1.2.4-core-yc.js'); -include('mootools-1.2.4.2-more-yc-min.js'); +include('mootools-1.2.4.2-more-yc.js'); include('moosique.js'); include('start.js'); Modified: trunk/src/moosique.net/js/moosique.js =================================================================== --- trunk/src/moosique.net/js/moosique.js 2009-11-11 21:04:26 UTC (rev 1910) +++ trunk/src/moosique.net/js/moosique.js 2009-11-14 21:07:39 UTC (rev 1911) @@ -1,13 +1,18 @@ /** * moosique-Player-Class * - * TODO - * - * * @package moosique.net * @author Steffen Becker */ var Moosique = new Class({ Implements: Options, + + /* used for the ymp-bug when refreshing the playlist + Explanation: If the playlist for the YMP ist reloaded using + YAHOO.MediaPlayer.addTracks(that.playlist, null, true) the "active" + track will always be reset to the first on in the playlist. + Thus we try to remember where the active track was before reloading + the playlist and use this number as next/previous multiplicator */ + currentPlaylistPosition: 0, // set some default options options: { @@ -59,6 +64,7 @@ // playlist and recently this.playlist = document.id('playlist'); this.recently = document.id('recently'); + this.log = document.id('log'); this.resetPlaylist = document.id('resetPlaylist'); this.resetRecently = document.id('resetRecently'); // recommendations @@ -75,6 +81,7 @@ this.info = document.id('info'); }, + /** * Applies Config-Vars to the Yahoo Media Player as described in http://mediaplayer.yahoo.com/api/ * for the YMP-Events and initializes the Player. Events are: @@ -100,7 +107,6 @@ if (Math.ceil(YAHOO.MediaPlayer.getTrackPosition()) == Math.ceil(YAHOO.MediaPlayer.getTrackDuration() * that.options.timeToScrobble)) { - // first, we update the cookie with the last played song and then var lastListenedListItem = YAHOO.MediaPlayer.getMetaData().anchor.getParent().clone(); var lastListened = lastListenedListItem.getFirst(); @@ -132,7 +138,6 @@ } } recentlyListened.push(last); // add the last played to the array - // update the cookie recentlyListenedObject = { 'recentlyListened' : recentlyListened }; recentlyListenedCookie = Cookie.write( /* save for one year */ @@ -147,59 +152,12 @@ /** * playlistUpdate: every time the playlist is updated we add the events for - * delete/up/down-buttons to each playlistitem and update the status on what happened + * delete/up/down-buttons to each playlistitem */ var playlistUpdate = function() { - // delete button - that.playlist.getElements('.delete').each(function(del) { - del.removeEvents(); - del.addEvent('click', function(e) { - e.stop(); // don't folow link - // if current or the last song from the playlist stop playing - if (YAHOO.MediaPlayer.getMetaData().anchor.getParent() == this.getParent()) { - that.stopPlaying(); - } - this.getParent().destroy(); // deletes the li-element - that.refreshPlaylist(); - }); - }); - - // up-button - that.playlist.getElements('.moveUp').each(function(up) { - up.removeEvents(); - up.addEvent('click', function(e) { - e.stop(); - if (YAHOO.MediaPlayer.getMetaData().anchor.getParent() == this.getParent()) { - that.stopPlaying(); - } - var li = up.getParent(); - var before = li.getPrevious(); - if (before) { // it's not the first one - li.inject(before, 'before'); - that.refreshPlaylist(); - } - }); - }); - - // down button - that.playlist.getElements('.moveDown').each(function(down) { - down.removeEvents(); - down.addEvent('click', function(e) { - e.stop(); - if (YAHOO.MediaPlayer.getMetaData().anchor.getParent() == this.getParent()) { - that.stopPlaying(); - } - var li = down.getParent(); - var after = li.getNext(); - if (after) { // it's not the first one - li.inject(after, 'after'); - that.refreshPlaylist(); - } - }); - }); - that.displayStatusMessage('Playlist updated.'); + that.addEventsToPlaylistButtons(); }; - + /** * trackPause: we change the Pause-Button to a Play-Button * and Update the status on #now @@ -208,17 +166,19 @@ that.nowPlayingInfo.set('text', 'Player paused.'); that.playPause.setStyle('background-position', '0px 0px'); }; - + /** * trackStart: we change the Play-Button to a Pause-Button * and Update the status on #now and display whats playing - * TODO: when a track started playing, fetch additional information about artist etc. using musicbrainz + * and fetch/display more information about the artist in the + * more-info-tab */ var trackStart = function() { that.nowPlayingInfo.set('text', 'Currently playing:'); that.nowPlayingTrack.set('text', YAHOO.MediaPlayer.getMetaData().title); that.download.set('href', YAHOO.MediaPlayer.getMetaData().anchor.get('href')); that.playPause.setStyle('background-position', '0px -40px'); // sprite offset + that.toggleCurrentlyPlaying(); // send a request to gather additional artist-information var nowPlayingAlbum = YAHOO.MediaPlayer.getMetaData().anchor.get('rel'); @@ -232,16 +192,19 @@ } }).send('info=' + nowPlayingAlbum); }; - + /** * trackComplete: we change the Pause-Button to a Play-Button - * and execute the autoAdd-Function for adding recommendations + * and stop playing, use the special nextTrack() function to get rid + * of the "restart from the beginning"-YMP-bug and start start playing again */ var trackComplete = function() { that.playPause.setStyle('background-position', '0px 0px'); - that.autoAddToPlaylist(); + that.stopPlaying(); + that.nextTrack(); + YAHOO.MediaPlayer.play(); }; - + // add the configuration to the events by subscribing YAHOO.MediaPlayer.onProgress.subscribe(progress); YAHOO.MediaPlayer.onPlaylistUpdate.subscribe(playlistUpdate); @@ -249,7 +212,6 @@ YAHOO.MediaPlayer.onTrackStart.subscribe(trackStart); YAHOO.MediaPlayer.onTrackComplete.subscribe(trackComplete); }; - // Initialize YMP if ready and apply the config YAHOO.MediaPlayer.onAPIReady.subscribe(playerConfig); }, @@ -269,11 +231,9 @@ onRequest: function() { that.recResults.set('html', '<h2>Generating new recommendations...</h2><p>Please be patient, this may take up to a minute...</p>'); }, - onFailure: function() { that.recResults.set('html', '<h2>Unable to get recommendations. Please reset and try again.</h2>'); }, - onSuccess: function(response) { response = response.trim(); if (response != '') { @@ -281,9 +241,9 @@ that.makeAddable($$('a.addToPlaylist')); that.showTab('recommendations'); that.displayStatusMessage('You have new recommendations!'); - + if (that.autoAddCheckbox.checked) { - that.addRandomToPlaylist(); + that.addRandomToPlaylist('auto'); } else { debug.log('Autoadding songs from recommendations is disabled.'); } @@ -323,70 +283,45 @@ that.recently.set('html', '<li></li>'); } }, - - + + /** - * Adds click-events to all player-related buttons, like play, next etc. buttons + * This function is called everytime a track starts playing + * and adds the class currentlyPlaying to the parent-li of + * the currently playing song */ - addEventsToButtons: function() { + toggleCurrentlyPlaying: function() { var that = this; - - that.prev.addEvent('click', function(e) { - e.stop(); - YAHOO.MediaPlayer.previous(); - }); - - that.next.addEvent('click', function(e) { - e.stop(); - YAHOO.MediaPlayer.next(); - }); - - // the Play-Pause Button - that.playPause.addEvent('click', function(e) { - e.stop(); - // STOPPED: 0, PAUSED: 1, PLAYING: 2,BUFFERING: 5, ENDED: 7 - // see http://mediaplayer.yahoo.com/api/ - if (YAHOO.MediaPlayer.getPlayerState() == 0 || - YAHOO.MediaPlayer.getPlayerState() == 1 || - YAHOO.MediaPlayer.getPlayerState() == 7) { - YAHOO.MediaPlayer.play(); - } else { - YAHOO.MediaPlayer.pause(); - } - }); - - // the Stop-Playing Button - that.stop.addEvent('click', function(e) { - e.stop(); - that.stopPlaying(); - }); - - // Mute-Toggle-Switch - that.mute.addEvent('click', function(e) { - e.stop(); - if (YAHOO.MediaPlayer.getVolume() > 0) { - YAHOO.MediaPlayer.setVolume(0); - that.mute.setStyle('background-position', '0px -240px'); - that.displayStatusMessage('Player muted.'); - } else { - YAHOO.MediaPlayer.setVolume(1); - that.mute.setStyle('background-position', '0px -280px'); - that.displayStatusMessage('Player unmuted.'); - } - }); + that.playlist.getElements('li.currentlyPlaying').removeClass('currentlyPlaying'); + var currentTrack = YAHOO.MediaPlayer.getMetaData().anchor; + currentTrack.getParent().addClass('currentlyPlaying'); }, - + /** - * Refreshes the YMP-playlist by emptying the current one - * and re-adding all items from the the playlist-container + * Set the current active playlist position using the class + * currentlyPlaying to determine the active item. Saves the + * position as an int in this.currentPlaylistPosition */ - refreshPlaylist: function() { + setCurrentPlaylistPosition: function() { var that = this; - YAHOO.MediaPlayer.addTracks(that.playlist, '', true); + var tracks = that.playlist.getChildren(); + var tracksInPlaylist = tracks.length; + var playing = false; + // go through all playlistitems and save the position of the currentlyPlaying one + for (var i = 0; i < tracksInPlaylist; i++ ) { + if (tracks[i].get('class') == 'currentlyPlaying') { + that.currentPlaylistPosition = i; + playing = true; + } + } + // if there was no currentlyPlaying-item set the currentPlaylistPosition to 0 + if (!playing) { + that.currentPlaylistPosition = 0; + } }, - - + + /** * This function stops the player and displays the default * status-message "Player stopped", also refreshes the playlist @@ -399,112 +334,32 @@ that.nowPlayingTime.set('text', '0:00 / 0:00'); that.download.set('href', '#'); YAHOO.MediaPlayer.stop(); - // and reload the playlist + // and refresh the playlist that.refreshPlaylist(); }, - - - /** - * Displays a status message, fades out nicely - * - * @param {String} message - */ - displayStatusMessage: function(message) { - // Update Status and fade out - var that = this; - var fadeFX = new Fx.Tween(that.status, { - property: 'opacity', - duration: that.options.messageFadeTime / 2, - transition: Fx.Transitions.Expo.easeOut, - link: 'chain' - }); - - that.status.set('text', message); - fadeFX.start(0, 1); - fadeFX.start(1, 0); - }, /** - * Adds click-Events to the Interface for Tabs and invokes - * addEventsToButtons() + * Skips to the track for x+1 times from the beginning, where x is + * the current active position in the playlist */ - initInterface: function() { + nextTrack: function() { var that = this; - // tabbed nav - that.nav.getElements('a').each(function(tab) { - tab.addEvent('click', function(e) { - e.stop(); // dont follow link - that.showTab(tab.get('class').toString()); - }); - }); - // generating recommendations clickable - that.generate.addEvent('click', function(e) { - e.stop(); - that.generateRecommendations(); - }); - // enable resetting recently list - that.resetRecently.addEvent('click', function(e) { - e.stop(); - Cookie.dispose('moosique'); - that.updateRecently(); - }); - // enable resetting the playlist - that.resetPlaylist.addEvent('click', function(e) { - e.stop(); - that.playlist.empty(); - that.stopPlaying(); - }); - // enable the manual add random to playlist - that.addRandom.addEvent('click', function(e) { - e.stop(); - that.addRandomToPlaylist(); - }); - // make player-buttons functional - this.addEventsToButtons(); + for (var i = 0; i < that.currentPlaylistPosition + 1; i++) { + YAHOO.MediaPlayer.next(); + } }, /** - * Make the search-Form an ajax-Search form, displaying the results - * on the homepage if successful + * Skips to the track for x-1 times from the beginning, where x is + * the current active position in the playlist */ - activateSearch: function() { + previousTrack: function() { var that = this; - var spinner = new Spinner(that.searchSubmit); - - that.searchForm.addEvent('submit', function(e) { - e.stop(); // prevent form submitting the non-ajax way - this.set('send', { - - onRequest: function() { - spinner.show(); - that.searchSubmit.set('disabled', 'disabled'); - that.showTab('home'); - that.results.set('html', '<h2>Searching...</h2><p>Please be patient, this may take up to a minute...</p>'); - }, - - onFailure: function() { - spinner.hide(); - that.results.set('html', '<h2>Unable to process your search. Try again.</h2>'); - }, - - onSuccess: function(response) { - spinner.hide(); - that.searchSubmit.erase('disabled'); // reenable submitbutton - that.results.set('html', response); - // addEvents to result-links - that.makeAddable($$('a.addToPlaylist')); - } - }); - - // only send form if value is at least 3 chars long - if (that.searchValue.get('value').length >= 3) { - this.send(); - } else { - that.displayStatusMessage('Please enter at least 3 chars for searching...'); - } - }); + for (var i = 0; i < that.currentPlaylistPosition - 1; i++) { + YAHOO.MediaPlayer.next(); + } }, @@ -538,6 +393,7 @@ var getPlaylist = new Request({method: 'get', url: 'moosique/index.php', onSuccess: function(response) { that.insertIntoPlaylist(response); + that.addToLog(a, 0, ''); that.showTab('player'); } }).send('get=' + type + '&playlist=' + href + '&rel=' + rel); @@ -545,6 +401,7 @@ if (type == 'mp3File') { var itemHTML = '<li>' + a.getParent().get('html') + '</li>'; that.insertIntoPlaylist(itemHTML); + that.addToLog(a, 0, ''); that.showTab('player'); } }); @@ -553,6 +410,22 @@ /** + * Resets the class for all music-links in the playlist to htrack + */ + cleanPlaylist: function() { + var that = this; + // remove all classes from the links, except for htrack + that.playlist.getElements('a').each(function(a) { + if (a.hasClass('moveUp') || a.hasClass('moveDown') || a.hasClass('delete')) { + // we don't touch the playlist-moving-buttons + } else { // reset to htrack, nothing else + a.set('class', 'htrack'); + } + }); + }, + + + /** * appends prepared html code to the playlist, empties the playlist if the first * element is an empty li and refreshed the playlist and shows the playlist tab * @@ -560,7 +433,6 @@ */ insertIntoPlaylist: function(newItems) { var that = this; - // if the first li item of the playlist is empty, kill it if (that.playlist.getFirst()) { if (that.playlist.getFirst().get('text') == '') { @@ -570,6 +442,7 @@ // append new html to the playlist var oldPlaylist = that.playlist.get('html'); that.playlist.set('html', oldPlaylist + newItems); + that.cleanPlaylist(); // add the delete, moveUp, moveDown Buttons that.playlist.getChildren().each(function(li) { @@ -592,10 +465,24 @@ /** + * Refreshes the YMP-playlist by emptying the current one + * and re-adding all items from the the playlist-container + */ + refreshPlaylist: function() { + var that = this; + that.cleanPlaylist(); + that.setCurrentPlaylistPosition(); + YAHOO.MediaPlayer.addTracks(that.playlist, null, true); + }, + + + /** * This function adds a random song from a random record from the * recommendations results to the playlist (enqueue at the end) + * + * @param {String} type can be set to auto */ - addRandomToPlaylist: function() { + addRandomToPlaylist: function(type) { var that = this; var addableAlbums = that.recResults.getElements('.addToPlaylist'); // pick a random album @@ -604,7 +491,7 @@ if (randomAlbum) { var href = randomAlbum.get('href'); var rel = randomAlbum.get('rel'); - + var getPlaylist = new Request({method: 'get', url: 'moosique/index.php', onSuccess: function(response) { // yay, we have the playlist, choose a random song and add it @@ -612,40 +499,283 @@ var songs = Elements.from(response); var randomSong = songs.getRandom(); that.insertIntoPlaylist('<li>' + randomSong.get('html') + '</li>'); + // add an item to the history-log with additionalInfo + var extraInfoH3 = randomAlbum.getParent().getParent().getParent().getPrevious(); + var extraInfo = '(From ' + extraInfoH3.get('text') + ')'; + if (type == 'auto') { + that.addToLog(randomSong.get('html'), 2, extraInfo); + } else { + that.addToLog(randomSong.get('html'), 0, extraInfo); + } that.displayStatusMessage('Added a random song to your playlist.'); } }).send('get=playlist&playlist=' + href + '&rel=' + rel); } else { that.displayStatusMessage('You currently have no recommendations, nothing was added.'); - debug.log('You currently have no recommendations, adding a random song will not work.'); } }, /** - * Shows the given tab in the nav, and hides all others + * Adds a history-log entry for given link-elements * - * @param {String} tabID ID of the Tab to show + * @param {String} text The Text to add to the history-log + * @param {int} deleted If set to 1, the text displayed will be "You deleted..." if 2 "The System added" */ - showTab: function(tabID) { + addToLog: function(a, mode, extraString) { var that = this; - that.nav.getElements('li').removeClass('active'); - that.nav.getElements('a.' + tabID).getParent().toggleClass('active'); - that.content.getChildren().setStyle('display', 'none'); - document.id(tabID).setStyle('display', 'block'); + var item = false; + if ($type(a) == 'string') { item = Elements.from(a)[0]; } + else { item = a.clone(); } + // if the first item of the log is empty, remove it + if (that.log.getFirst()) { + if (that.log.getFirst().get('text') == 'Nothing happened yet.') { + that.log.empty(); + } + } + // slighty format the link + item.set('href', item.get('rel')); + item.removeProperties('rel', 'title', 'class'); + + if (item.getFirst()) { + if (item.getFirst().get('tag') == 'img') { + var title = item.getFirst().get('alt'); + item.set('text', title); + } + } + // a helper parent to convert to html + var parent = new Element('div'); + item.inject(parent); + + var text = 'You added <em>' + parent.get('html') + '</em> to your playlist'; + if (mode == 1) { text = 'You deleted the song <em>' + parent.get('html') + '</em> from your playlist.'; } + if (mode == 2) { text = 'The system added the song <em>' + parent.get('html') + 'to your playlist.'; } + + if (extraString != '') { text = text + ' ' + extraString; } + + var time = new Date().format('%H:%M:%S'); + var newLogEntry = new Element('li', { + 'class': 'someclass', + 'html': time + " — " + text + }); + newLogEntry.inject(that.log, 'top'); }, /** - * - * + * Adds click-Events to the Interface for Tabs and invokes + * addEventsToPlayerButtons() */ + initInterface: function() { + var that = this; + // tabbed nav + that.nav.getElements('a').each(function(tab) { + tab.addEvent('click', function(e) { + e.stop(); // dont follow link + that.showTab(tab.get('class').toString()); + }); + }); + // generating recommendations clickable + that.generate.addEvent('click', function(e) { + e.stop(); + that.generateRecommendations(); + }); + // enable resetting recently list + that.resetRecently.addEvent('click', function(e) { + e.stop(); + Cookie.dispose('moosique'); + that.updateRecently(); + }); + // enable resetting the playlist + that.resetPlaylist.addEvent('click', function(e) { + e.stop(); + that.playlist.empty(); + that.stopPlaying(); + }); + // enable the manual add random to playlist + that.addRandom.addEvent('click', function(e) { + e.stop(); + that.addRandomToPlaylist(''); + }); + // make player-buttons functional + this.addEventsToPlayerButtons(); + }, + + + /** + * Adds the events to the playlist buttons for removing or moving + * them around from/in the playlist + */ + addEventsToPlaylistButtons: function() { + var that = this; + // all buttons + that.playlist.getElements('.delete, .moveUp, .moveDown').each(function(all) { + all.removeEvents(); + all.addEvent('click', function(e) { + e.stop(); // don't folow link + // if current or the last song from the playlist stop playing + if (YAHOO.MediaPlayer.getMetaData().anchor.getParent() == this.getParent()) { + that.stopPlaying(); + } + // switch/case different buttons + var typeOfButton = all.get('class'); + var li = all.getParent(); + switch(typeOfButton) { + case 'delete' : + that.addToLog(this.getParent().getFirst(), 1, ''); + li.destroy(); // deletes the li-element + break; + case 'moveUp' : + var before = li.getPrevious(); + if (before) { // it's not the first one + li.inject(before, 'before'); + that.refreshPlaylist(); + } + break; + case 'moveDown' : + var after = li.getNext(); + if (after) { // it's not the first one + li.inject(after, 'after'); + that.refreshPlaylist(); + } + break; + } + // always refresh the playlist + that.refreshPlaylist(); + }); + }); + }, + + + /** + * Adds click-events to all player-related buttons, like play, next etc. buttons + */ + addEventsToPlayerButtons: function() { + var that = this; + + that.prev.addEvent('click', function(e) { + e.stop(); + that.stopPlaying(); + that.previousTrack(); + YAHOO.MediaPlayer.play(); + }); + + that.next.addEvent('click', function(e) { + e.stop(); + that.stopPlaying(); + that.nextTrack(); + YAHOO.MediaPlayer.play(); + }); + + // the Play-Pause Button + that.playPause.addEvent('click', function(e) { + e.stop(); + // STOPPED: 0, PAUSED: 1, PLAYING: 2,BUFFERING: 5, ENDED: 7 + // see http://mediaplayer.yahoo.com/api/ + if (YAHOO.MediaPlayer.getPlayerState() == 0 || + YAHOO.MediaPlayer.getPlayerState() == 1 || + YAHOO.MediaPlayer.getPlayerState() == 7) { + YAHOO.MediaPlayer.play(); + } else { + YAHOO.MediaPlayer.pause(); + } + }); + + // the Stop-Playing Button + that.stop.addEvent('click', function(e) { + e.stop(); + that.stopPlaying(); + }); + + // Mute-Toggle-Switch + that.mute.addEvent('click', function(e) { + e.stop(); + if (YAHOO.MediaPlayer.getVolume() > 0) { + YAHOO.MediaPlayer.setVolume(0); + that.mute.setStyle('background-position', '0px -240px'); + that.displayStatusMessage('Player muted.'); + } else { + YAHOO.MediaPlayer.setVolume(1); + that.mute.setStyle('background-position', '0px -280px'); + that.displayStatusMessage('Player unmuted.'); + } + }); + }, + + + /** + * Make the search-Form an ajax-Search form, displaying the results + * on the homepage if successful + */ + activateSearch: function() { + var that = this; + var spinner = new Spinner(that.searchSubmit); + + that.searchForm.addEvent('submit', function(e) { + e.stop(); // prevent form submitting the non-ajax way + this.set('send', { + + onRequest: function() { + spinner.show(); + that.searchSubmit.set('disabled', 'disabled'); + that.showTab('home'); + that.results.set('html', '<h2>Searching...</h2><p>Please be patient, this may take up to a minute...</p>'); + }, + + onFailure: function() { + spinner.hide(); + that.results.set('html', '<h2>Unable to process your search. Try again.</h2>'); + }, + + onSuccess: function(response) { + spinner.hide(); + that.searchSubmit.erase('disabled'); // reenable submitbutton + that.results.set('html', response); + // addEvents to result-links + that.makeAddable($$('a.addToPlaylist')); + } + }); + + // only send form if value is at least 3 chars long + if (that.searchValue.get('value').length >= 3) { + this.send(); + } else { + that.displayStatusMessage('Please enter at least 3 chars for searching...'); + } + }); + }, + + + /** + * Displays a status message, fades out nicely + * + * @param {String} message + */ + displayStatusMessage: function(message) { + // Update Status and fade out + var that = this; + var fadeFX = new Fx.Tween(that.status, { + property: 'opacity', + duration: that.options.messageFadeTime / 5, + transition: Fx.Transitions.Expo.easeOut, + link: 'chain' + }); + + that.status.set('text', message); + fadeFX.start(0, 1).wait(that.options.messageFadeTime).start(1, 0); + }, + + + /** + * This function makes the external links from more Information behave + * so, that clicking opens the link in the iframe below. + */ addLinkListItemToIframe: function() { var that = this; - that.info.getElements('.linkList a').each(function(a) { + that.info.getElements('.externalLinks a').each(function(a) { a.addEvent('click', function(e) { e.stop(); - that.info.getElements('.linkList li').removeClass('active'); + that.info.getElements('.externalLinks li').removeClass('active'); a.getParent().addClass('active'); href = a.get('href'); that.info.getElements('iframe').set('src', href); @@ -654,7 +784,20 @@ }, + /** + * Shows the given tab in the nav, and hides all others + * + * @param {String} tabID ID of the Tab to show + */ + showTab: function(tabID) { + var that = this; + that.nav.getElements('li').removeClass('active'); + that.nav.getElements('a.' + tabID).getParent().toggleClass('active'); + that.content.getChildren().setStyle('display', 'none'); + document.id(tabID).setStyle('display', 'block'); + }, + /** * Converts seconds into a string formatted minutes:seconds * with leading zeros for seconds for a nicer display @@ -672,5 +815,4 @@ return minsec; } - }); \ No newline at end of file Modified: trunk/src/moosique.net/js/mootools-1.2.4.2-more-yc.js =================================================================== --- trunk/src/moosique.net/js/mootools-1.2.4.2-more-yc.js 2009-11-11 21:04:26 UTC (rev 1910) +++ trunk/src/moosique.net/js/mootools-1.2.4.2-more-yc.js 2009-11-14 21:07:39 UTC (rev 1911) @@ -1,37 +1,79 @@ //MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License. -MooTools.More={version:"1.2.4.2",build:"bd5a93c0913cce25917c48cbdacde568e15e02ef"};(function(){var c=this;var b=function(){if(c.console&&console.log){try{console.log.apply(console,arguments); -}catch(d){console.log(Array.slice(arguments));}}else{Log.logged.push(arguments);}return this;};var a=function(){this.logged.push(arguments);return this; -};this.Log=new Class({logged:[],log:a,resetLog:function(){this.logged.empty();return this;},enableLog:function(){this.log=b;this.logged.each(function(d){this.log.apply(this,d); -},this);return this.resetLog();},disableLog:function(){this.log=a;return this;}});Log.extend(new Log).enableLog();Log.logger=function(){return this.log.apply(this,arguments); -};})();Class.refactor=function(b,a){$each(a,function(e,d){var c=b.prototype[d];if(c&&(c=c._origin)&&typeof e=="function"){b.implement(d,function(){var f=this.previous; -this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g;});}else{b.implement(d,e);}});return b;};Class.Mutators.Binds=function(a){return a; -};Class.Mutators.initialize=function(a){return function(){$splat(this.Binds).each(function(b){var c=this[b];if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments); -};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property);if(a&&!$defined(this.occluded)){return this.occluded=a; -}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});String.implement({parseQueryString:function(){var b=this.split(/[&;]/),a={}; -if(b.length){b.each(function(g){var c=g.indexOf("="),d=c<0?[""]:g.substr(0,c).match(/[^\]\[]+/g),e=decodeURIComponent(g.substr(c+1)),f=a;d.each(function(j,h){var k=f[j]; -if(h<d.length-1){f=f[j]=k||{};}else{if($type(k)=="array"){k.push(e);}else{f[j]=$defined(k)?[k,e]:e;}}});});}return a;},cleanQueryString:function(a){return this.split("&").filter(function(e){var b=e.indexOf("="),c=b<0?"":e.substr(0,b),d=e.substr(b+1); -return a?a.run([c,d]):$chk(d);}).join("&");}});Elements.from=function(e,d){if($pick(d,true)){e=e.stripScripts();}var b,c=e.match(/^\s*<(t[dhr]|tbody|tfoot|thead)/i); -if(c){b=new Element("table");var a=c[1].toLowerCase();if(["td","th","tr"].contains(a)){b=new Element("tbody").inject(b);if(a!="tr"){b=new Element("tr").inject(b); -}}}return(b||new Element("div")).set("html",e).getChildren();};(function(){var d=/(.*?):relay\(([^)]+)\)$/,c=/[+>~\s]/,f=function(g){var h=g.match(d);return !h?{event:g}:{event:h[1],selector:h[2]}; -},b=function(m,g){var k=m.target;if(c.test(g=g.trim())){var j=this.getElements(g);for(var h=j.length;h--;){var l=j[h];if(k==l||l.hasChild(k)){return l; -}}}else{for(;k&&k!=this;k=k.parentNode){if(Element.match(k,g)){return document.id(k);}}}return null;};var a=Element.prototype.addEvent,e=Element.prototype.removeEvent; -Element.implement({addEvent:function(j,i){var k=f(j);if(k.selector){var h=this.retrieve("$moo:delegateMonitors",{});if(!h[j]){var g=function(m){var l=b.call(this,m,k.selector); -if(l){this.fireEvent(j,[m,l],0,l);}}.bind(this);h[j]=g;a.call(this,k.event,g);}}return a.apply(this,arguments);},removeEvent:function(j,i){var k=f(j);if(k.selector){var h=this.retrieve("events"); -if(!h||!h[j]||(i&&!h[j].keys.contains(i))){return this;}if(i){e.apply(this,[j,i]);}else{e.apply(this,j);}h=this.retrieve("events");if(h&&h[j]&&h[j].length==0){var g=this.retrieve("$moo:delegateMonitors",{}); -e.apply(this,[k.event,g[j]]);delete g[j];}return this;}return e.apply(this,arguments);},fireEvent:function(j,h,g,k){var i=this.retrieve("events");if(!i||!i[j]){return this; -}i[j].keys.each(function(l){l.create({bind:k||this,delay:g,arguments:h})();},this);return this;}});})();Element.implement({measure:function(e){var g=function(h){return !!(!h||h.offsetHeight||h.offsetWidth); -};if(g(this)){return e.apply(this);}var d=this.getParent(),f=[],b=[];while(!g(d)&&d!=document.body){b.push(d.expose());d=d.getParent();}var c=this.expose(); -var a=e.apply(this);c();b.each(function(h){h();});return a;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var a=this.style.cssText; -this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a;}.bind(this);},getDimensions:function(a){a=$merge({computeSize:false},a); -var f={};var d=function(g,e){return(e.computeSize)?g.getComputedSize(e):g.getSize();};var b=this.getParent("body");if(b&&this.getStyle("display")=="none"){f=this.measure(function(){return d(this,a); -});}else{if(b){try{f=d(this,a);}catch(c){}}else{f={x:0,y:0};}}return $chk(f.x)?$extend(f,{width:f.x,height:f.y}):$extend(f,{x:f.width,y:f.height});},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a); -var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height; -break;}var b=[];$each(a.plains,function(g,f){g.each(function(h){a.styles.each(function(i){b.push((i=="border")?i+"-"+h+"-width":i+"-"+h);});});});var e={}; -b.each(function(f){e[f]=this.getComputedStyle(f);},this);var d=[];$each(a.plains,function(g,f){var h=f.capitalize();c["total"+h]=c["computed"+h]=0;g.each(function(i){c["computed"+i.capitalize()]=0; -b.each(function(k,j){if(k.test(i)){e[k]=e[k].toInt()||0;c["total"+h]=c["total"+h]+e[k];c["computed"+i.capitalize()]=c["computed"+i.capitalize()]+e[k];}if(k.test(i)&&f!=k&&(k.test("border")||k.test("padding"))&&!d.contains(k)){d.push(k); -c["computed"+h]=c["computed"+h]-e[k];}});});});["Width","Height"].each(function(g){var f=g.toLowerCase();if(!$chk(c[f])){return;}c[f]=c[f]+this["offset"+g]+c["computed"+g]; -c["total"+g]=c[f]+c["total"+g];delete c["computed"+g];},this);return $extend(e,c);}});(function(){var a=Element.prototype.position;Element.implement({position:function(h){if(h&&($defined(h.x)||$defined(h.y))){return a?a.apply(this,arguments):this; +MooTools.More={version:"1.2.4.2",build:"bd5a93c0913cce25917c48cbdacde568e15e02ef"};(function(){var a={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]}; +var b;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(c){if(!a.languages[c]){return this;}a.language=c;this.load();this.fireEvent("langChange",c); +return this;},load:function(){var c=this.cascade(this.getCurrentLanguage());b={};$each(c,function(e,d){b[d]=this.lambda(e);},this);},getCurrentLanguage:function(){return a.language; +},addLanguage:function(c){a.languages[c]=a.languages[c]||{};return this;},cascade:function(e){var c=(a.languages[e]||{}).cascades||[];c.combine(a.cascades); +c.erase(e).push(e);var d=c.map(function(f){return a.languages[f];},this);return $merge.apply(this,d);},lambda:function(c){(c||{}).get=function(e,d){return $lambda(c[e]).apply(this,$splat(d)); +};return c;},get:function(e,d,c){if(b&&b[e]){return(d?b[e].get(d,c):b[e]);}},set:function(d,e,c){this.addLanguage(d);langData=a.languages[d];if(!langData[e]){langData[e]={}; +}$extend(langData[e],c);if(d==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",d);}return this;},list:function(){return Hash.getKeys(a.languages); +}});})();(function(){var c=this;var b=function(){if(c.console&&console.log){try{console.log.apply(console,arguments);}catch(d){console.log(Array.slice(arguments)); +}}else{Log.logged.push(arguments);}return this;};var a=function(){this.logged.push(arguments);return this;};this.Log=new Class({logged:[],log:a,resetLog:function(){this.logged.empty(); +return this;},enableLog:function(){this.log=b;this.logged.each(function(d){this.log.apply(this,d);},this);return this.resetLog();},disableLog:function(){this.log=a; +return this;}});Log.extend(new Log).enableLog();Log.logger=function(){return this.log.apply(this,arguments);};})();Class.refactor=function(b,a){$each(a,function(e,d){var c=b.prototype[d]; +if(c&&(c=c._origin)&&typeof e=="function"){b.implement(d,function(){var f=this.previous;this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g; +});}else{b.implement(d,e);}});return b;};Class.Mutators.Binds=function(a){return a;};Class.Mutators.initialize=function(a){return function(){$splat(this.Binds).each(function(b){var c=this[b]; +if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments);};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property); +if(a&&!$defined(this.occluded)){return this.occluded=a;}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});(function(){var a={wait:function(b){return this.chain(function(){this.callChain.delay($pick(b,500),this); +}.bind(this));}};Chain.implement(a);if(window.Fx){Fx.implement(a);["Css","Tween","Elements"].each(function(b){if(Fx[b]){Fx[b].implement(a);}});}Element.implement({chains:function(b){$splat($pick(b,["tween","morph","reveal"])).each(function(c){c=this.get(c); +if(!c){return;}c.setOptions({link:"chain"});},this);return this;},pauseFx:function(c,b){this.chains(b).get($pick(b,"tween")).wait(c);return this;}});})(); +(function(){var i=this.Date;if(!i.now){i.now=$time;}i.Methods={ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","LastDayOfMonth","UTCDate","UTCDay","UTCFullYear","AMPM","Ordinal","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(p){i.Methods[p.toLowerCase()]=p; +});var d=function(q,p){return new Array(p-String(q).length+1).join("0")+q;};i.implement({set:function(t,r){switch($type(t)){case"object":for(var s in t){this.set(s,t[s]); +}break;case"string":t=t.toLowerCase();var q=i.Methods;if(q[t]){this["set"+q[t]](r);}}return this;},get:function(q){q=q.toLowerCase();var p=i.Methods;if(p[q]){return this["get"+p[q]](); +}return null;},clone:function(){return new i(this.get("time"));},increment:function(p,r){p=p||"day";r=$pick(r,1);switch(p){case"year":return this.increment("month",r*12); +case"month":var q=this.get("date");this.set("date",1).set("mo",this.get("mo")+r);return this.set("date",q.min(this.get("lastdayofmonth")));case"week":return this.increment("day",r*7); +case"day":return this.set("date",this.get("date")+r);}if(!i.units[p]){throw new Error(p+" is not a supported interval");}return this.set("time",this.get("time")+r*i.units[p]()); +},decrement:function(p,q){return this.increment(p,-1*$pick(q,1));},isLeapYear:function(){return i.isLeapYear(this.get("year"));},clearTime:function(){return this.set({hr:0,min:0,sec:0,ms:0}); +},diff:function(q,p){if($type(q)=="string"){q=i.parse(q);}return((q-this)/i.units[p||"day"](3,3)).toInt();},getLastDayOfMonth:function(){return i.daysInMonth(this.get("mo"),this.get("year")); +},getDayOfYear:function(){return(i.UTC(this.get("year"),this.get("mo"),this.get("date")+1)-i.UTC(this.get("year"),0,1))/i.units.day();},getWeek:function(){return(this.get("dayofyear")/7).ceil(); +},getOrdinal:function(p){return i.getMsg("ordinal",p||this.get("date"));},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3"); +},getGMTOffset:function(){var p=this.get("timezoneOffset");return((p>0)?"-":"+")+d((p.abs()/60).floor(),2)+d(p%60,2);},setAMPM:function(p){p=p.toUpperCase(); +var q=this.get("hr");if(q>11&&p=="AM"){return this.decrement("hour",12);}else{if(q<12&&p=="PM"){return this.increment("hour",12);}}return this;},getAMPM:function(){return(this.get("hr")<12)?"AM":"PM"; +},parse:function(p){this.set("time",i.parse(p));return this;},isValid:function(p){return !!(p||this).valueOf();},format:function(p){if(!this.isValid()){return"invalid date"; +}p=p||"%x %X";p=k[p.toLowerCase()]||p;var q=this;return p.replace(/%([a-z%])/gi,function(s,r){switch(r){case"a":return i.getMsg("days")[q.get("day")].substr(0,3); +case"A":return i.getMsg("days")[q.get("day")];case"b":return i.getMsg("months")[q.get("month")].substr(0,3);case"B":return i.getMsg("months")[q.get("month")]; +case"c":return q.toString();case"d":return d(q.get("date"),2);case"H":return d(q.get("hr"),2);case"I":return((q.get("hr")%12)||12);case"j":return d(q.get("dayofyear"),3); +case"m":return d((q.get("mo")+1),2);case"M":return d(q.get("min"),2);case"o":return q.get("ordinal");case"p":return i.getMsg(q.get("ampm"));case"S":return d(q.get("seconds"),2); +case"U":return d(q.get("week"),2);case"w":return q.get("day");case"x":return q.format(i.getMsg("shortDate"));case"X":return q.format(i.getMsg("shortTime")); +case"y":return q.get("year").toString().substr(2);case"Y":return q.get("year");case"T":return q.get("GMTOffset");case"Z":return q.get("Timezone");}return r; +});},toISOString:function(){return this.format("iso8601");}});i.alias("toISOString","toJSON");i.alias("diff","compare");i.alias("format","strftime");var k={db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"}; +var g=[];var e=i.parse;var n=function(s,u,r){var q=-1;var t=i.getMsg(s+"s");switch($type(u)){case"object":q=t[u.get(s)];break;case"number":q=t[month-1]; +if(!q){throw new Error("Invalid "+s+" index: "+index);}break;case"string":var p=t.filter(function(v){return this.test(v);},new RegExp("^"+u,"i"));if(!p.length){throw new Error("Invalid "+s+" string"); +}if(p.length>1){throw new Error("Ambiguous "+s);}q=p[0];}return(r)?t.indexOf(q):q;};i.extend({getMsg:function(q,p){return MooTools.lang.get("Date",q,p); +},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lamb... [truncated message content] |
From: <jen...@us...> - 2009-11-11 21:04:38
|
Revision: 1910 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1910&view=rev Author: jenslehmann Date: 2009-11-11 21:04:26 +0000 (Wed, 11 Nov 2009) Log Message: ----------- PostgreSQL ms2ph to OWL conversion implemented Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java Added Paths: ----------- trunk/lib/db/ trunk/lib/db/postgresql-8.4-701.jdbc4.jar Removed Paths: ------------- trunk/lib/mysql/ Added: trunk/lib/db/postgresql-8.4-701.jdbc4.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/db/postgresql-8.4-701.jdbc4.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-05 09:06:10 UTC (rev 1909) +++ trunk/src/dl-learner/org/dllearner/examples/MonogenicDiseases.java 2009-11-11 21:04:26 UTC (rev 1910) @@ -62,7 +62,7 @@ // whether to generate a class containing the positive examples private static boolean generatePosExampleClass = true; // set to true if accessing PostreSQL and false for MySQL - private static boolean pgSQL = false; + private static boolean pgSQL = true; public static void main(String[] args) throws ClassNotFoundException, BackingStoreException, SQLException { @@ -79,7 +79,8 @@ String url = "jdbc:"; if(pgSQL) { Class.forName("org.postgresql.Driver"); - url += "postgresql://"+dbServer+":5432/"+dbName; + // adapt the port if necessary + url += "postgresql://"+dbServer+":5433/"+dbName; } else { Class.forName("com.mysql.jdbc.Driver"); url += "mysql://"+dbServer+":3306/"+dbName; @@ -234,7 +235,13 @@ // select data (restricted to pos/neg examples for efficiency) Statement stmt = conn.createStatement(); - ResultSet rs = stmt.executeQuery("SELECT * FROM " + table + " WHERE (gain_contact is not null) && (gain_contact != 0)"); + ResultSet rs = null; + if(pgSQL) { + // join tables + rs = stmt.executeQuery("SELECT * FROM fiche_mutant, mutants WHERE fiche_mutant.id = mutants.id AND(gain_contact is not null)"); + } else { + rs = stmt.executeQuery("SELECT * FROM " + table + " WHERE (gain_contact is not null) AND (gain_contact != 0)"); + } int count = 0; while(rs.next()) { @@ -375,8 +382,13 @@ // selecting examples // -> only a fraction of examples are selected as positive/negative - rs = stmt.executeQuery("SELECT * FROM " + table + " WHERE " //lower(phenotype) not like 'polymorphism' AND " - + " (gain_contact is not null) && (gain_contact != 0)"); + if(pgSQL) { + rs = stmt.executeQuery("SELECT * FROM fiche_mutant, mutants WHERE fiche_mutant.id=mutants.id AND " //lower(phenotype) not like 'polymorphism' AND " + + " (gain_contact is not null) AND (gain_contact != 0)"); + } else { + rs = stmt.executeQuery("SELECT * FROM " + table + " WHERE " //lower(phenotype) not like 'polymorphism' AND " + + " (gain_contact is not null) AND (gain_contact != 0)"); + } List<Individual> posExamples = new LinkedList<Individual>(); List<Individual> negExamples = new LinkedList<Individual>(); while(rs.next()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-11-05 09:06:23
|
Revision: 1909 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1909&view=rev Author: heeroyuy Date: 2009-11-05 09:06:10 +0000 (Thu, 05 Nov 2009) Log Message: ----------- -fixed bug in HyperLinkHandler Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-11-05 08:51:04 UTC (rev 1908) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-11-05 09:06:10 UTC (rev 1909) @@ -155,7 +155,7 @@ + "The learning algorithm prefers short expressions. 'Currently searching class expressions with length between 4 and 7.' means that it has already evaluated all class expressions of length 1 to 3<br>" + "or excluded them as possible suggestions. All the expressions currently evaluated have length between 4 and 7. If you want to search for longer expressions, then you have to increase<br>" + "the maximum runtime setting (it is set to $defaultRuntime seconds by default).<br><br>" - + "See <a href=\"http://dl-learner.org/wiki/ProtegePlugin\">http://dl-learner.org/wiki/ProtegePlugin</a> for more details.</font></html>"; + + "See <a href=\"http://dl-learner.org/wiki/ProtegePlugin\">Protege Plugin Wiki</a> for more details.</font></html>"; help = new JTextPane(); help.setEditable(false); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-11-05 08:51:04 UTC (rev 1908) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-11-05 09:06:10 UTC (rev 1909) @@ -123,7 +123,7 @@ private int individualSize; private SuggestClassPanelHandler sugPanelHandler; private StatusBar stat; - private static final String WIKI_STRING = "<html><font size=\"3\">See <a href=\"http://dl-learner.org/wiki/ProtegePlugin\">http://dl-learner.org/wiki/ProtegePlugin</a> for an introduction.</font></html>"; + private static final String WIKI_STRING = "<html><font size=\"3\">See <a href=\"http://dl-learner.org/wiki/ProtegePlugin\">Protege Plugin Wiki</a> for an introduction.</font></html>"; /** * The constructor for the DL-Learner tab in the class description @@ -135,6 +135,7 @@ editorKit = editor; labels = ""; individualSize = 0; + hyperHandler = new HyperLinkHandler(); model = new DLLearnerModel(editorKit, this); sugPanel = new SuggestClassPanel(model, this); learnerPanel = new JPanel(); @@ -147,6 +148,7 @@ wikiPane.setBackground(learnerScroll.getBackground()); wikiPane.setEditable(false); wikiPane.setText(WIKI_STRING); + wikiPane.addHyperlinkListener(hyperHandler); URL iconUrl = this.getClass().getResource("arrow.gif"); icon = new ImageIcon(iconUrl); URL toggledIconUrl = this.getClass().getResource("arrow2.gif"); @@ -171,7 +173,6 @@ hint.setContentType("text/html"); hint.setEditable(false); hint.setText("<html><font size=\"3\">To get suggestions for class expression, please click the button above.</font></html>"); - hint.addHyperlinkListener(hyperHandler); learner = new JPanel(); advanced.setSize(20, 20); learner.setLayout(new GridBagLayout()); @@ -185,7 +186,6 @@ sugPanelHandler = new SuggestClassPanelHandler(this, model, action); sugPanel.addSuggestPanelMouseListener(sugPanelHandler); sugPanel.getSuggestList().addListSelectionListener(sugPanelHandler); - hyperHandler = new HyperLinkHandler(); this.addAcceptButtonListener(this.action); this.addRunButtonListener(this.action); this.addAdvancedButtonListener(this.action); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |