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-06-25 10:17:17
|
Revision: 1808 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1808&view=rev Author: jenslehmann Date: 2009-06-25 10:17:14 +0000 (Thu, 25 Jun 2009) Log Message: ----------- started algorithm for learning disjunctions of EL trees Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/el/DisjunctiveHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-06-18 13:37:47 UTC (rev 1807) +++ trunk/lib/components.ini 2009-06-25 10:17:14 UTC (rev 1808) @@ -23,4 +23,5 @@ org.dllearner.algorithms.refinement2.ROLComponent2 org.dllearner.algorithms.gp.GP org.dllearner.algorithms.el.ELLearningAlgorithm +org.dllearner.algorithms.el.ELLearningAlgorithmDisjunctive org.dllearner.algorithms.celoe.CELOE Added: trunk/src/dl-learner/org/dllearner/algorithms/el/DisjunctiveHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/DisjunctiveHeuristic.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/DisjunctiveHeuristic.java 2009-06-25 10:17:14 UTC (rev 1808) @@ -0,0 +1,16 @@ +package org.dllearner.algorithms.el; + +public class DisjunctiveHeuristic implements ELHeuristic { + + ELDescriptionTreeComparator edt = new ELDescriptionTreeComparator(); + + public int compare(SearchTreeNode tree1, SearchTreeNode tree2) { + double diff = tree1.getScore()-tree2.getScore(); + if(diff < 0.00001 && diff > -0.00001) { + return edt.compare(tree1.getDescriptionTree(), tree2.getDescriptionTree()); + } else { + return (int)Math.signum(diff); + } + } + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java 2009-06-25 10:17:14 UTC (rev 1808) @@ -0,0 +1,340 @@ +/** + * Copyright (C) 2007-2009, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.algorithms.el; + +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.Logger; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.LearningProblem; +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.Individual; +import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.Union; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.refinementoperators.ELDown2; + +/** + * A learning algorithm for EL, which will based on an + * ideal refinement operator. + * + * The algorithm learns disjunctions of EL trees as follows: + * - given pos. and neg. examples, noise in %, min coverage per tree x % + * - it searches for an EL tree, which covers at least x % of all positive examples + * and at most (coverage_on_positives * noise) negative examples + * - the covered examples are removed from the pos. and neg. examples + * - termination: all(?) positive examples covered + * + * ev. besser: feste Suchzeiten pro Baum => es wird dann jeweils der beste Baum gewählt + * => Terminierung, wenn alles gecovered ist oder kein Baum mit ausreichender Qualität + * in dem Zeitfenster gefunden wird + * + * In contrast to many other algorithms, only one solution is returned. Additionally, + * the algorithm is not really an anytime algorithm, since the solution is constructed + * stepwise as a set of trees. + * + * TODO redundancy check + * + * @author Jens Lehmann + * + */ +public class ELLearningAlgorithmDisjunctive extends LearningAlgorithm { + + private static Logger logger = Logger.getLogger(ELLearningAlgorithmDisjunctive.class); + private ELLearningAlgorithmConfigurator configurator; + + private ELDown2 operator; + + private boolean isRunning = false; + private boolean stop = false; + + private SearchTreeNode startNode; + private ELHeuristic heuristic; + private TreeSet<SearchTreeNode> candidates; + + // tree search + private List<ELDescriptionTree> currentSolution = new LinkedList<ELDescriptionTree>(); + private EvaluatedDescription bestEvaluatedDescription; + // how important not cover + private double posWeight = 5; + private int startPosExamplesSize; + private int startNegExamplesSize; + private SortedSet<Individual> currentPosExamples; + private SortedSet<Individual> currentNegExamples; + private ELDescriptionTree bestCurrentTree; + private double bestCurrentScore = 0; + private long treeStartTime; + + public ELLearningAlgorithmDisjunctive(PosNegLP problem, ReasonerComponent reasoner) { + super(problem, reasoner); + } + + public static String getName() { + return "disjunctive EL learning algorithm"; + } + + public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { + Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); + problems.add(PosNegLP.class); + return problems; + } + + + 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)")); + return options; + } + + // we can assume a PosNegLP, because it is the only supported one + private PosNegLP getLearningProblem() { + return (PosNegLP) learningProblem; + } + + @Override + public Configurator getConfigurator() { + return configurator; + } + + @Override + public void init() throws ComponentInitException { + heuristic = new DisjunctiveHeuristic(); + candidates = new TreeSet<SearchTreeNode>(heuristic); + + operator = new ELDown2(reasoner); + } + + @Override + public void start() { + stop = false; + isRunning = true; + reset(); + int treeCount = 0; + + while(!stop && !stoppingCriteriaSatisfied()) { + + treeStartTime = System.nanoTime(); + // create start node + ELDescriptionTree top = new ELDescriptionTree(reasoner, Thing.instance); + addDescriptionTree(top, null); + bestCurrentTree = top; + bestCurrentScore = Double.NEGATIVE_INFINITY; + + // main loop + int loop = 0; + while(!stop && !treeCriteriaSatisfied()) { + // pick the best candidate according to the heuristic + SearchTreeNode best = candidates.pollLast(); + // apply operator + List<ELDescriptionTree> refinements = operator.refine(best.getDescriptionTree()); + // add all refinements to search tree, candidates, best descriptions + for(ELDescriptionTree refinement : refinements) { + addDescriptionTree(refinement, best); + } + loop++; + // logging + if(logger.isTraceEnabled()) { + logger.trace("Choosen node " + best); + logger.trace(startNode.getTreeString()); + logger.trace("Loop " + loop + " completed."); + } + } + + // we found a tree (partial solution) + currentSolution.add(bestCurrentTree); + Description bestDescription = bestCurrentTree.transformToDescription(); + // form union of trees found so far with + if(treeCount==0) { + bestEvaluatedDescription = learningProblem.evaluate(bestDescription); + } else { + Union union = new Union(bestEvaluatedDescription.getDescription(), bestDescription); + bestEvaluatedDescription = learningProblem.evaluate(union); + } + + // remove already covered examples + Iterator<Individual> it = currentPosExamples.iterator(); + int posCov = 0; + while(it.hasNext()) { + Individual ind = it.next(); + if(reasoner.hasType(bestDescription, ind)) { + it.remove(); + posCov++; + } + } + it = currentNegExamples.iterator(); + int negCov = 0; + while(it.hasNext()) { + Individual ind = it.next(); + if(reasoner.hasType(bestDescription, ind)) { + it.remove(); + negCov++; + } + } + logger.info("tree found: " + bestDescription + " (" + posCov + " pos covered, " + currentPosExamples.size() + " remaining, " + negCov + " neg covered, " + currentNegExamples.size() + " remaining"); + + treeCount++; + } + + // print solution + logger.info("solution : " + bestEvaluatedDescription); + + isRunning = false; + } + + // evaluates a description in tree form + private void addDescriptionTree(ELDescriptionTree descriptionTree, SearchTreeNode parentNode) { + + // create search tree node + SearchTreeNode node = new SearchTreeNode(descriptionTree); + + // compute score + double score = getTreeScore(descriptionTree); + node.setScore(score); + + // link to parent (unless start node) + if(parentNode == null) { + startNode = node; + } else { + parentNode.addChild(node); + } + + // TODO: define "too weak" as a coverage on negative examples, which is + // too high for the tree to be considered + + candidates.add(node); + + // check whether this is the best tree + if(score > bestCurrentScore) { + bestCurrentTree = descriptionTree; + bestCurrentScore = score; + } + } + + private double getTreeScore(ELDescriptionTree tree) { + + Description d = tree.transformToDescription(); + + double score = 0; + + // test coverage on current positive examples + int posCovered = 0; + for(Individual ind : currentPosExamples) { + if(reasoner.hasType(d, ind)) { + posCovered++; + score += 1; + } + } +// double posPercentage = posCovered/(double)currentPosExamples.size(); + + // penalty if a minimum coverage is not achieved (avoids too many trees where + // each tree has only little impact) + if(startPosExamplesSize > 10 && posCovered<3 || posCovered < 1) { + score -= 10; + } + + // test coverage on current negative examples + int negCovered = 0; + for(Individual ind : currentNegExamples) { + if(reasoner.hasType(d, ind)) { + negCovered++; + score -= posWeight; + } + } +// double negPercentage = negCovered/(double)currentNegExamples.size(); + + // length penalty + score -= 0.1*tree.getSize(); + + return score; + } + + private boolean treeCriteriaSatisfied() { + long runTime = System.nanoTime() - treeStartTime; + // more than one second has passed + if(runTime / 1000000000 > 1) { + return true; + } else { + return false; + } + } + + 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); + + // stop whan all positive examples have been covered + return (currentPosExamples.size()==0); + } + + private void reset() { + // set all values back to their default values (used for running + // the algorithm more than once) + candidates.clear(); + currentSolution.clear(); + bestEvaluatedDescription = learningProblem.evaluate(Thing.instance); + currentPosExamples = getLearningProblem().getPositiveExamples(); + currentNegExamples = getLearningProblem().getNegativeExamples(); + startPosExamplesSize = currentPosExamples.size(); + startNegExamplesSize = currentNegExamples.size(); + } + + @Override + public void stop() { + stop = true; + } + + @Override + public boolean isRunning() { + return isRunning; + } + + @Override + public Description getCurrentlyBestDescription() { + return bestEvaluatedDescription.getDescription(); + } + + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + return bestEvaluatedDescription; + } + + /** + * @return the startNode + */ + public SearchTreeNode getStartNode() { + return startNode; + } + +} Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java 2009-06-18 13:37:47 UTC (rev 1807) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/SearchTreeNode.java 2009-06-25 10:17:14 UTC (rev 1808) @@ -37,6 +37,8 @@ private int coveredNegatives; private boolean tooWeak = false; + private double score; + public SearchTreeNode(ELDescriptionTree descriptionTree) { this.descriptionTree = descriptionTree; } @@ -96,6 +98,7 @@ else ret += coveredNegatives; ret += ", children:" + children.size() + "]"; + ret += " score: " + score; return ret; } @@ -114,6 +117,14 @@ treeString.append(child.getTreeString(depth+1)); } return treeString; + } + + public double getScore() { + return score; + } + + public void setScore(double score) { + this.score = score; } } Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-06-18 13:37:47 UTC (rev 1807) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-06-25 10:17:14 UTC (rev 1808) @@ -30,6 +30,7 @@ import org.dllearner.algorithms.RandomGuesser; import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; +import org.dllearner.algorithms.el.ELLearningAlgorithmDisjunctive; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refinement.ROLearner; import org.dllearner.algorithms.refinement2.ROLComponent2; @@ -101,6 +102,7 @@ learningAlgorithmMapping.put("refinement", ROLearner.class); learningAlgorithmMapping.put("refexamples", ROLComponent2.class); learningAlgorithmMapping.put("el", ELLearningAlgorithm.class); + learningAlgorithmMapping.put("disjunctiveEL", ELLearningAlgorithmDisjunctive.class); learningAlgorithmMapping.put("celoe", CELOE.class); // you do not need to edit anything below Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-18 13:37:47 UTC (rev 1807) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-25 10:17:14 UTC (rev 1808) @@ -78,10 +78,10 @@ private static DecimalFormat df = new DecimalFormat(); // for performance measurements and development - private static boolean autoMode = false; + private static boolean autoMode = true; private static boolean useFastInstanceChecker = true; - private static boolean useApproximations = true; - private static boolean computeApproxDiff = false; + private static boolean useApproximations = false; + private static boolean computeApproxDiff = true; @SuppressWarnings("unchecked") public static void main(String[] args) throws ComponentInitException, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-18 14:22:32
|
Revision: 1807 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1807&view=rev Author: jenslehmann Date: 2009-06-18 13:37:47 +0000 (Thu, 18 Jun 2009) Log Message: ----------- small bug fixes in evaluation Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-18 12:02:16 UTC (rev 1806) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-18 13:37:47 UTC (rev 1807) @@ -243,7 +243,10 @@ double approx = lp.getAccuracyOrTooWeakApprox(d, noisePercent/(double)100); double exact = lp.getAccuracyOrTooWeakExact(d, noisePercent/(double)100); double diff = Math.abs(approx-exact); - approxDiffStat.addNumber(diff); + // do not count "too weak" + if(approx > -0.01 && exact > -0.01) { + approxDiffStat.addNumber(diff); + } // if(diff>0.1) { // System.out.println("description: " + d); // System.out.println("approx: " + approx); Modified: trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-18 12:02:16 UTC (rev 1806) +++ trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-18 13:37:47 UTC (rev 1807) @@ -132,7 +132,7 @@ } public String prettyPrint(String unit) { - if(sum > 0) { + if(count > 0) { DecimalFormat df = new DecimalFormat(); String str = "av. " + df.format(getMean()) + unit; str += " (deviation " + df.format(getStandardDeviation()) + unit + "; "; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-18 13:25:34
|
Revision: 1806 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1806&view=rev Author: jenslehmann Date: 2009-06-18 12:02:16 +0000 (Thu, 18 Jun 2009) Log Message: ----------- performance measurements Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-18 11:53:56 UTC (rev 1805) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-18 12:02:16 UTC (rev 1806) @@ -242,7 +242,15 @@ Description d = ed.getDescription(); double approx = lp.getAccuracyOrTooWeakApprox(d, noisePercent/(double)100); double exact = lp.getAccuracyOrTooWeakExact(d, noisePercent/(double)100); - approxDiffStat.addNumber(approx-exact); + double diff = Math.abs(approx-exact); + approxDiffStat.addNumber(diff); +// if(diff>0.1) { +// System.out.println("description: " + d); +// System.out.println("approx: " + approx); +// System.out.println("exact: " + exact); +// System.out.println("evaluated: " + lp.evaluate(d).getAccuracy()); +// System.exit(0); +// } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-18 11:55:20
|
Revision: 1805 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1805&view=rev Author: jenslehmann Date: 2009-06-18 11:53:56 +0000 (Thu, 18 Jun 2009) Log Message: ----------- small fix 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-06-18 07:53:24 UTC (rev 1804) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-06-18 11:53:56 UTC (rev 1805) @@ -345,6 +345,7 @@ } public double getAccuracyOrTooWeakExact(Description description, double noise) { + // overhang int additionalInstances = 0; for(Individual ind : superClassInstances) { @@ -367,7 +368,8 @@ return -1; } - double protusion = additionalInstances == 0 ? 0 : coveredInstances/(double)(coveredInstances+additionalInstances); +// double protusion = additionalInstances == 0 ? 0 : coveredInstances/(double)(coveredInstances+additionalInstances); + double protusion = (additionalInstances + coveredInstances == 0) ? 0 : coveredInstances / (double) (coveredInstances + additionalInstances); return getAccuracy(coverage, protusion); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-18 07:54:00
|
Revision: 1804 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1804&view=rev Author: lorenz_b Date: 2009-06-18 07:53:24 +0000 (Thu, 18 Jun 2009) Log Message: ----------- swapped out axiom selection Function to static class Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/RootFinder.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomSelector.java Added: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomSelector.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomSelector.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomSelector.java 2009-06-18 07:53:24 UTC (rev 1804) @@ -0,0 +1,52 @@ +package org.dllearner.tools.ore.explanation; + +import java.util.HashSet; +import java.util.Set; + +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLOntology; + +public class AxiomSelector { + + public static Set<OWLAxiom> getSyntacticRelevantAxioms( + OWLOntology ontology, OWLClass cl) { + + Set<OWLAxiom> relevantAxioms = new HashSet<OWLAxiom>(); + + for (OWLAxiom ax : ontology.getLogicalAxioms()) { + if (isSyntacticRelevant(ax,cl)) { + relevantAxioms.add(ax); + } + } + + return relevantAxioms; + } + + public static Set<OWLAxiom> getSyntacticRelevantAxioms( + OWLOntology ontology, Set<OWLAxiom> axioms) { + + Set<OWLAxiom> relevantAxioms = new HashSet<OWLAxiom>(); + + for (OWLAxiom ax : ontology.getLogicalAxioms()) { + for (OWLAxiom ax2 : axioms) { + if (isSyntacticRelevant(ax, ax2)) { + relevantAxioms.add(ax); + } + } + + } + + return relevantAxioms; + } + + private static boolean isSyntacticRelevant(OWLAxiom ax1, OWLAxiom ax2) { + return org.mindswap.pellet.utils.SetUtils.intersects( + ax1.getSignature(), ax2.getSignature()); + } + + private static boolean isSyntacticRelevant(OWLAxiom ax, OWLClass cl) { + return org.mindswap.pellet.utils.SetUtils.intersects(ax.getSignature(), + cl.getSignature()); + } +} Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java 2009-06-18 07:37:37 UTC (rev 1803) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java 2009-06-18 07:53:24 UTC (rev 1804) @@ -7,6 +7,11 @@ public class HittingSet extends HashSet<OWLAxiom> { + /** + * + */ + private static final long serialVersionUID = 7704909550386943944L; + public HittingSet(Set<OWLAxiom> axioms){ addAll(axioms); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/RootFinder.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/RootFinder.java 2009-06-18 07:37:37 UTC (rev 1803) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/RootFinder.java 2009-06-18 07:53:24 UTC (rev 1804) @@ -15,7 +15,6 @@ import org.semanticweb.owl.inference.OWLReasonerException; import org.semanticweb.owl.inference.OWLReasonerFactory; import org.semanticweb.owl.model.AxiomType; -import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLClass; import org.semanticweb.owl.model.OWLDataAllRestriction; import org.semanticweb.owl.model.OWLDataExactCardinalityRestriction; Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java 2009-06-18 07:37:37 UTC (rev 1803) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java 2009-06-18 07:53:24 UTC (rev 1804) @@ -77,7 +77,7 @@ } localReasoner.loadOntology(ont); - Set<OWLAxiom> relevant = getSyntacticRelevantAxioms(unsat, k); + Set<OWLAxiom> relevant = AxiomSelector.getSyntacticRelevantAxioms(ontology, unsat);//getSyntacticRelevantAxioms(unsat, k); Set<HittingSet> hittingSets = new HashSet<HittingSet>(); Set<HittingSet> hittingSetLocal = new HashSet<HittingSet>(); @@ -155,7 +155,7 @@ hittingSetLocal.addAll((Set<HittingSet>)result.get(1)); } k++; - relevant = getSyntacticRelevantAxioms(unsat, k); + relevant = AxiomSelector.getSyntacticRelevantAxioms(ontology, relevant);//getSyntacticRelevantAxioms(unsat, k); } return justifications; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-18 07:37:58
|
Revision: 1803 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1803&view=rev Author: lorenz_b Date: 2009-06-18 07:37:37 +0000 (Thu, 18 Jun 2009) Log Message: ----------- pellet library update to release candidate 7 ->all seems to work correct 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 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) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-16 16:35:15
|
Revision: 1802 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1802&view=rev Author: jenslehmann Date: 2009-06-16 16:35:07 +0000 (Tue, 16 Jun 2009) Log Message: ----------- wrote performance evaluation Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-06-16 09:03:15 UTC (rev 1801) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-06-16 16:35:07 UTC (rev 1802) @@ -72,6 +72,15 @@ public String getType() { return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "type") ; } +/** +* 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(classLearningProblem, "useApproximations") ; +} /** * @param classToDescribe class of which a description should be learned. @@ -90,6 +99,15 @@ ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "type", type); 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(classLearningProblem, "useApproximations", useApproximations); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-06-16 09:03:15 UTC (rev 1801) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-06-16 16:35:07 UTC (rev 1802) @@ -45,6 +45,7 @@ import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; import org.dllearner.reasoning.OWLAPIReasoner; +import org.dllearner.reasoning.PelletReasoner; /** * automatically generated, do not edit manually. @@ -118,6 +119,14 @@ } /** +* @param knowledgeSource see KnowledgeSource +* @return a component ready for initialization PelletReasoner +**/ +public static PelletReasoner getPelletReasoner(Set<KnowledgeSource> knowledgeSource) { +return PelletReasonerConfigurator.getPelletReasoner(knowledgeSource); +} + +/** * @param classToDescribe class of which a description should be learned * @param reasoningService see ReasoningService * @return a component ready for initialization ClassLearningProblem Added: trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PelletReasonerConfigurator.java 2009-06-16 16:35:07 UTC (rev 1802) @@ -0,0 +1,66 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +package org.dllearner.core.configurators; + +import java.util.Set; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.reasoning.PelletReasoner; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class PelletReasonerConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private PelletReasoner pelletReasoner; + +/** +* @param pelletReasoner see PelletReasoner +**/ +public PelletReasonerConfigurator(PelletReasoner pelletReasoner){ +this.pelletReasoner = pelletReasoner; +} + +/** +* @param knowledgeSource see knowledgeSource +* @return PelletReasoner +**/ +public static PelletReasoner getPelletReasoner(Set<KnowledgeSource> knowledgeSource) { +PelletReasoner component = ComponentManager.getInstance().reasoner(PelletReasoner.class, knowledgeSource); +return component; +} + + + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-06-16 09:03:15 UTC (rev 1801) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-06-16 16:35:07 UTC (rev 1802) @@ -31,6 +31,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ClassLearningProblemConfigurator; +import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.options.URLConfigOption; @@ -57,6 +58,8 @@ // approximation of accuracy +- 0.05 % private static final double approx = 0.05; + private boolean useApproximations; + // factor for higher weight on coverage (needed for subclass learning) private double coverageFactor; @@ -80,7 +83,9 @@ options.add(classToDescribeOption); StringConfigOption type = new StringConfigOption("type", "whether to learn an equivalence class or super class axiom","equivalence"); // or domain/range of a property. type.setAllowedValues(new String[] {"equivalence", "superClass"}); // , "domain", "range"}); - options.add(type); + options.add(type); + BooleanConfigOption approx = new BooleanConfigOption("useApproximations", "whether to use stochastic approximations for computing accuracy", true); + options.add(approx); return options; } @@ -91,6 +96,7 @@ @Override public void init() throws ComponentInitException { classToDescribe = new NamedClass(configurator.getClassToDescribe().toString()); + useApproximations = configurator.getUseApproximations(); if(!reasoner.getNamedClasses().contains(classToDescribe)) { throw new ComponentInitException("The class \"" + configurator.getClassToDescribe() + "\" does not exist. Make sure you spelled it correctly."); @@ -201,9 +207,16 @@ @Override public double getAccuracyOrTooWeak(Description description, double noise) { - // instead of using the standard operation, we use optimisation - // and approximation here - + if(useApproximations) { + return getAccuracyOrTooWeakApprox(description, noise); + } else { + return getAccuracyOrTooWeakExact(description, noise); + } + } + + // instead of using the standard operation, we use optimisation + // and approximation here + public double getAccuracyOrTooWeakApprox(Description description, double noise) { // we abort when there are too many uncovered positives int maxNotCovered = (int) Math.ceil(noise*classInstances.size()); int instancesCovered = 0; @@ -245,7 +258,7 @@ // 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 > noise || (upperBorderA > mean && size < 0.03)) { + if(mean > 1-noise || (upperBorderA > mean && size < 0.03)) { instancesCovered = (int) (instancesCovered/(double)total * classInstances.size()); upperEstimateA = (int) (upperBorderA * classInstances.size()); lowerEstimateA = (int) (lowerBorderA * classInstances.size()); @@ -255,7 +268,7 @@ // reject only if the upper border is far away (we are very // certain not to lose a potential solution) - if(upperBorderA + 0.1 < noise) { + if(upperBorderA + 0.1 < 1-noise) { return -1; } } @@ -328,21 +341,49 @@ // MonitorFactory.add("estimatedB","count", estimatedB ? 1 : 0); // MonitorFactory.add("bInstances","count", testsPerformed); - return getAccuracy(coverage, protusion); - } + return getAccuracy(coverage, protusion); + } - @Deprecated - public double getAccuracyOrTooWeakStandard(Description description, double minAccuracy) { - // since we have to perform a retrieval operation anyway, we cannot easily - // get a benefit from the accuracy limit - double accuracy = getAccuracy(description); - if(accuracy >= minAccuracy) { - return accuracy; - } else { + public double getAccuracyOrTooWeakExact(Description description, double noise) { + // overhang + int additionalInstances = 0; + for(Individual ind : superClassInstances) { + if(reasoner.hasType(description, ind)) { + additionalInstances++; + } + } + + // coverage + int coveredInstances = 0; + for(Individual ind : classInstances) { + if(reasoner.hasType(description, ind)) { + coveredInstances++; + } + } + + double coverage = coveredInstances/(double)classInstances.size(); + + if(coverage < 1 - noise) { return -1; } + + double protusion = additionalInstances == 0 ? 0 : coveredInstances/(double)(coveredInstances+additionalInstances); + + return getAccuracy(coverage, protusion); } +// @Deprecated +// public double getAccuracyOrTooWeakStandard(Description description, double minAccuracy) { +// // since we have to perform a retrieval operation anyway, we cannot easily +// // get a benefit from the accuracy limit +// double accuracy = getAccuracy(description); +// if(accuracy >= minAccuracy) { +// return accuracy; +// } else { +// return -1; +// } +// } + // 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) { Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-16 09:03:15 UTC (rev 1801) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-16 16:35:07 UTC (rev 1802) @@ -23,6 +23,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStreamReader; +import java.net.URL; import java.text.DecimalFormat; import java.util.Arrays; import java.util.Iterator; @@ -41,6 +42,7 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.CELOEConfigurator; +import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Thing; @@ -48,6 +50,7 @@ import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.EvaluatedDescriptionClass; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.reasoning.OWLAPIReasoner; import org.dllearner.utilities.statistics.Stat; /** @@ -65,6 +68,8 @@ public class OntologyEngineering { private static double minAccuracy = 0.85; + + private static double noisePercent = 5.0; private static int minInstanceCount = 3; @@ -72,6 +77,12 @@ private static DecimalFormat df = new DecimalFormat(); + // for performance measurements and development + private static boolean autoMode = false; + private static boolean useFastInstanceChecker = true; + private static boolean useApproximations = true; + private static boolean computeApproxDiff = false; + @SuppressWarnings("unchecked") public static void main(String[] args) throws ComponentInitException, LearningProblemUnsupportedException, IOException { @@ -83,15 +94,25 @@ System.out.println("You need to give an OWL file as argument."); System.exit(0); } - File owlFile = new File(args[0]); + ComponentManager cm = ComponentManager.getInstance(); // load OWL in reasoner OWLFile ks = cm.knowledgeSource(OWLFile.class); - ks.getConfigurator().setUrl(owlFile.toURI().toURL()); + if(args[0].startsWith("http")) { + ks.getConfigurator().setUrl(new URL(args[0])); + } else { + File owlFile = new File(args[0]); + ks.getConfigurator().setUrl(owlFile.toURI().toURL()); + } ks.init(); - ReasonerComponent reasoner = cm.reasoner(FastInstanceChecker.class, ks); + ReasonerComponent reasoner = null; + if(useFastInstanceChecker) { + reasoner = cm.reasoner(FastInstanceChecker.class, ks); + } else { + reasoner = cm.reasoner(OWLAPIReasoner.class, ks); + } reasoner.init(); System.out.println("Loaded ontology " + args[0] + "."); @@ -103,6 +124,7 @@ int classCandidatesCount = 0; Stat instanceCountStat = new Stat(); Stat classExpressionTestsStat = new Stat(); + Stat approxDiffStat = new Stat(); // equivalence classes int candidatesAboveThresholdCount = 0; @@ -168,6 +190,7 @@ + algorithmRuntimeInSeconds + " seconds)"); lp.getConfigurator().setType("superClass"); } + lp.getConfigurator().setUseApproximations(useApproximations); lp.init(); CELOE celoe = cm.learningAlgorithm(CELOE.class, lp, reasoner); @@ -175,7 +198,7 @@ cf.setUseNegation(false); cf.setValueFrequencyThreshold(3); cf.setMaxExecutionTimeInSeconds(algorithmRuntimeInSeconds); - cf.setNoisePercentage(0.05); + cf.setNoisePercentage(noisePercent); cf.setMaxNrOfResults(10); celoe.init(); @@ -214,6 +237,15 @@ List<EvaluatedDescriptionClass> suggestionsList = new LinkedList<EvaluatedDescriptionClass>( suggestions.descendingSet()); + if(computeApproxDiff) { + for(EvaluatedDescription ed : suggestionsList) { + Description d = ed.getDescription(); + double approx = lp.getAccuracyOrTooWeakApprox(d, noisePercent/(double)100); + double exact = lp.getAccuracyOrTooWeakExact(d, noisePercent/(double)100); + approxDiffStat.addNumber(approx-exact); + } + } + int nr = 0; for (EvaluatedDescription suggestion : suggestionsList) { System.out.println(nr @@ -243,11 +275,15 @@ List<String> allowedInputs = Arrays.asList(inputs); String input; - do { - BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); - input = br.readLine(); - } while (!allowedInputs.contains(input)); - + if(autoMode) { + input = "n"; + } else { + do { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + input = br.readLine(); + } while (!allowedInputs.contains(input)); + } + userInputProtocol += input; if (input.equals("m")) { @@ -340,6 +376,9 @@ System.out.println("classes with at least " + minInstanceCount + " instances: " + classCandidatesCount); System.out.println("class expressions tested: " + classExpressionTestsStat.prettyPrint("")); + if(computeApproxDiff) { + System.out.println("approximation difference: " + approxDiffStat.prettyPrint()); + } System.out.println(); System.out.println("statistics for equivalence axioms:"); Modified: trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-16 09:03:15 UTC (rev 1801) +++ trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-16 16:35:07 UTC (rev 1802) @@ -127,6 +127,10 @@ return max; } + public String prettyPrint() { + return prettyPrint(""); + } + public String prettyPrint(String unit) { if(sum > 0) { DecimalFormat df = new DecimalFormat(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-16 09:03:20
|
Revision: 1801 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1801&view=rev Author: lorenz_b Date: 2009-06-16 09:03:15 +0000 (Tue, 16 Jun 2009) Log Message: ----------- continued new explanation generator - added optimisation technique 'justification reuse' Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java 2009-06-16 06:23:58 UTC (rev 1800) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java 2009-06-16 09:03:15 UTC (rev 1801) @@ -3,8 +3,10 @@ import java.net.URI; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import org.apache.log4j.ConsoleAppender; @@ -13,11 +15,11 @@ import org.apache.log4j.SimpleLayout; import org.mindswap.pellet.owlapi.PelletReasonerFactory; import org.mindswap.pellet.owlapi.Reasoner; +import org.mindswap.pellet.utils.SetUtils; import org.semanticweb.owl.apibinding.OWLManager; import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLClass; import org.semanticweb.owl.model.OWLDataFactory; -import org.semanticweb.owl.model.OWLIndividual; import org.semanticweb.owl.model.OWLOntology; import org.semanticweb.owl.model.OWLOntologyChangeException; import org.semanticweb.owl.model.OWLOntologyCreationException; @@ -98,7 +100,7 @@ e.printStackTrace(); } reasoner.refresh(); - if(!hittingSetLocal.isEmpty()){ + if(!hittingSetLocal.isEmpty()){// checking for global hitting sets for(HittingSet hit : hittingSetLocal){ try { for(OWLAxiom ax : hit){ @@ -108,6 +110,7 @@ if(reasoner.isSatisfiable(unsat)){ hittingSets.add(hit); + logger.debug("step " + k + ": found global hitting set: " + hit); } manager.addAxioms(ontology, hit); reasoner.refresh(); @@ -118,7 +121,7 @@ } hittingSetLocal.removeAll(hittingSets); if( (!strategie.equals(Strategie.All_Just_Relevance) && !hittingSets.isEmpty()) || (hittingSetLocal.isEmpty()) ){ - logger.debug("early termination"); + logger.debug("early termination");System.out.println(hittingSets); return justifications; } Set<HittingSet> temp = new HashSet<HittingSet>(hittingSetLocal); @@ -127,7 +130,7 @@ for(OWLAxiom ax : hit){ man.applyChange(new RemoveAxiom(ont, ax)); } - List<Set<? extends Set<OWLAxiom>>> result = computeJustifications(unsat, ont); + List<Set<? extends Set<OWLAxiom>>> result = computeJustifications(unsat, ont, hit, justifications, k); justifications.addAll(result.get(0)); Set<HittingSet> localTemp = (Set<HittingSet>)result.get(1); for(HittingSet h : localTemp){ @@ -146,7 +149,7 @@ } else if(!localReasoner.isSatisfiable(unsat)){ - List<Set<? extends Set<OWLAxiom>>> result = computeJustifications(unsat, ont); + List<Set<? extends Set<OWLAxiom>>> result = computeJustifications(unsat, ont, null, null, k); logger.debug("step " + k + ": justifications computed : " + result.get(0)); justifications.addAll(result.get(0)); hittingSetLocal.addAll((Set<HittingSet>)result.get(1)); @@ -157,15 +160,27 @@ return justifications; } - private List<Set<? extends Set<OWLAxiom>>> computeJustifications(OWLClass unsat, OWLOntology ont){ - Set<Set<OWLAxiom>> justifications = new HashSet<Set<OWLAxiom>>(); + private List<Set<? extends Set<OWLAxiom>>> computeJustifications(OWLClass unsat, OWLOntology ont, HittingSet path, Set<Set<OWLAxiom>> justifications, int step){ + + Set<Set<OWLAxiom>> newJustifications = new HashSet<Set<OWLAxiom>>(); PelletExplanation expGen = new PelletExplanation(manager, Collections.singleton(ont)); Set<HittingSet> hittingSets = new HashSet<HittingSet>(); Set<HittingSet> hittingSets1 = new HashSet<HittingSet>(); + Set<OWLAxiom> justification = null; + if(path != null && !justifications.isEmpty()){ + for(Set<OWLAxiom> just : justifications){ + if(!SetUtils.intersects(path, just)){ + justification = just; + logger.debug("using justification reuse: " + just); + break; + } + } + } + if(justification == null){ + justification = expGen.getUnsatisfiableExplanation(unsat); + } - Set<OWLAxiom> justification = expGen.getUnsatisfiableExplanation(unsat); - - justifications.add(justification); + newJustifications.add(justification); for(OWLAxiom ax : justification){ hittingSets1.add(new HittingSet(ax)); } @@ -181,7 +196,7 @@ if(localReasoner.isSatisfiable(unsat)){ hittingSets.add(hit); - logger.debug("found local hitting set: " + hit); + logger.debug("step " + step +": found local hitting set: " + hit); } else { hittingSets2.add(hit); } @@ -194,25 +209,42 @@ } if( (!strategie.equals(Strategie.All_Just_Relevance) && !hittingSets.isEmpty() ) || hittingSets1.isEmpty() || hittingSets2.isEmpty()){ List<Set<? extends Set<OWLAxiom>>> result = new ArrayList<Set<? extends Set<OWLAxiom>>>(); - result.add(justifications); + result.add(newJustifications); result.add(hittingSets); return result; } hittingSets1.clear(); - for(Set<OWLAxiom> axioms : hittingSets2){ + for(HittingSet hit2 : hittingSets2){ try { - for(OWLAxiom ax : axioms){ + for(OWLAxiom ax : hit2){ manager.applyChange(new RemoveAxiom(ont, ax)); } - expGen = new PelletExplanation(manager, Collections.singleton(ont)); - Set<OWLAxiom> just = expGen.getUnsatisfiableExplanation(unsat); - justifications.add(just); + // justification reuse + Set<OWLAxiom> just = null; + if(!newJustifications.isEmpty()){ + for(Set<OWLAxiom> jus : newJustifications){ + if(!SetUtils.intersects(hit2, jus)){ + just = jus; + logger.debug("using justification reuse: " + just); + break; + } + } + } + if(just == null){ + expGen = new PelletExplanation(manager, Collections.singleton(ont)); + just = expGen.getUnsatisfiableExplanation(unsat); + } + ///////////////////// + + + + newJustifications.add(just); for(OWLAxiom a : just){ - HittingSet temp = new HittingSet(axioms); + HittingSet temp = new HittingSet(hit2); temp.add(a); hittingSets1.add(temp); } - manager.addAxioms(ont, axioms); + manager.addAxioms(ont, hit2); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -302,7 +334,10 @@ OWLClass g = factory.getOWLClass(URI.create("G")); OWLClass h = factory.getOWLClass(URI.create("H")); OWLClass k = factory.getOWLClass(URI.create("K")); - Set<OWLAxiom> examples = new HashSet<OWLAxiom>(); + List<OWLAxiom> examples = new ArrayList<OWLAxiom>(); + + + examples.add( factory.getOWLSubClassAxiom(u, a)); examples.add( factory.getOWLSubClassAxiom(u, factory.getOWLObjectComplementOf(a))); examples.add( factory.getOWLSubClassAxiom(u, c)); @@ -317,7 +352,12 @@ examples.add( factory.getOWLSubClassAxiom(c, k)); examples.add( factory.getOWLSubClassAxiom(k, factory.getOWLObjectComplementOf(h))); examples.add( factory.getOWLSubClassAxiom(b, h)); - OWLOntology example = manager.createOntology(examples); + OWLOntology example = manager.createOntology(new HashSet<OWLAxiom>(examples)); + Map<OWLAxiom, Integer > axiomMap = new HashMap<OWLAxiom, Integer >(); + for(int i = 1; i<=examples.size(); i++){ + + axiomMap.put(examples.get(i - 1), Integer.valueOf(i)); + } @@ -326,15 +366,17 @@ reasoner.loadOntologies(Collections.singleton(example)); SyntacticRelevanceBasedExplanationGenerator expGen = new SyntacticRelevanceBasedExplanationGenerator(reasoner, manager); - DLSyntaxObjectRenderer renderer = new DLSyntaxObjectRenderer(); - int i = 1; + + System.out.print("J = {"); for(Set<OWLAxiom> explanation : expGen.getExplanations(u, Strategie.CM_Just_Relevance)){ - System.out.println("Explanation " + i); - i++; + System.out.print("{"); for(OWLAxiom ax : explanation){ - System.out.println(renderer.render(ax)); + System.out.print(axiomMap.get(ax)); + System.out.print(","); } + System.out.print("}, "); } + System.out.print("}"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-16 06:24:01
|
Revision: 1800 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1800&view=rev Author: jenslehmann Date: 2009-06-16 06:23:58 +0000 (Tue, 16 Jun 2009) Log Message: ----------- extended eval script Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-15 13:22:29 UTC (rev 1799) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-16 06:23:58 UTC (rev 1800) @@ -43,6 +43,7 @@ import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Thing; import org.dllearner.kb.OWLFile; import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.EvaluatedDescriptionClass; @@ -189,11 +190,11 @@ } else { accStatSC.addNumber(bestAcc); } - if (bestAcc < minAccuracy) { + if (bestAcc < minAccuracy || (best.getDescription() instanceof Thing)) { System.out .println("The algorithm did not find a suggestion with an accuracy above the threshold of " + (100 * minAccuracy) - + "%. (The best one was \"" + + "% or the best description is not appropriate. (The best one was \"" + best.getDescription().toManchesterSyntaxString(baseURI, prefixes) + "\" with an accuracy of " @@ -347,6 +348,8 @@ System.out.println("axioms learned succesfully: " + foundDescriptionCount); System.out.println("axioms missed: " + missesCount); System.out.println("class with no sensible axioms: " + noSensibleDescriptionCount); + System.out.println("inconsistencies detected: " + inconsistencyDetected); + System.out.println("additional instances found: " + moreInstancesCountStat.prettyPrint("")); System.out.println("average accuracy overall: " + accStat.prettyPrint("")); System.out.println("average accuracy of selected expressions: " + accSelectedStat.prettyPrint("")); @@ -362,6 +365,8 @@ System.out.println("axioms learned succesfully: " + foundDescriptionCountSC); System.out.println("axioms missed: " + missesCountSC); System.out.println("class with no sensible axioms: " + noSensibleDescriptionCountSC); + System.out.println("inconsistencies detected: " + inconsistencyDetectedSC); + System.out.println("additional instances found: " + moreInstancesCountStatSC.prettyPrint("")); System.out.println("average accuracy overall: " + accStatSC.prettyPrint("")); System.out.println("average accuracy of selected expressions: " + accSelectedStatSC.prettyPrint("")); Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java 2009-06-15 13:22:29 UTC (rev 1799) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java 2009-06-16 06:23:58 UTC (rev 1800) @@ -86,11 +86,11 @@ } public EvaluatedDescription getBest() { - return set.last(); + return set.size()==0 ? null : set.last(); } public EvaluatedDescription getWorst() { - return set.first(); + return set.size()==0 ? null : set.first(); } /** Modified: trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-15 13:22:29 UTC (rev 1799) +++ trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-16 06:23:58 UTC (rev 1800) @@ -133,7 +133,8 @@ String str = "av. " + df.format(getMean()) + unit; str += " (deviation " + df.format(getStandardDeviation()) + unit + "; "; str += "min " + df.format(getMin()) + unit + "; "; - str += "max " + df.format(getMax()) + unit + ")"; + str += "max " + df.format(getMax()) + unit + "; "; + str += "count " + count + ")"; return str; } else { return "no data collected"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-15 13:22:33
|
Revision: 1799 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1799&view=rev Author: lorenz_b Date: 2009-06-15 13:22:29 +0000 (Mon, 15 Jun 2009) Log Message: ----------- continued new explanation generator Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java Added: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/HittingSet.java 2009-06-15 13:22:29 UTC (rev 1799) @@ -0,0 +1,17 @@ +package org.dllearner.tools.ore.explanation; + +import java.util.HashSet; +import java.util.Set; + +import org.semanticweb.owl.model.OWLAxiom; + +public class HittingSet extends HashSet<OWLAxiom> { + + public HittingSet(Set<OWLAxiom> axioms){ + addAll(axioms); + } + + public HittingSet(OWLAxiom axiom){ + add(axiom); + } +} Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java 2009-06-15 08:31:17 UTC (rev 1798) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java 2009-06-15 13:22:29 UTC (rev 1799) @@ -22,18 +22,25 @@ import org.semanticweb.owl.model.OWLOntologyChangeException; import org.semanticweb.owl.model.OWLOntologyCreationException; 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 uk.ac.manchester.cs.owl.dlsyntax.DLSyntaxObjectRenderer; + import com.clarkparsia.explanation.PelletExplanation; public class SyntacticRelevanceBasedExplanationGenerator { private Reasoner reasoner; + private Reasoner localReasoner; private OWLOntologyManager manager; private OWLOntology ontology; + public static enum Strategie{ + All_Just_Relevance, + CM_Just_Relevance; + } + private Strategie strategie; + private static Logger logger = Logger.getRootLogger(); public SyntacticRelevanceBasedExplanationGenerator(Reasoner reasoner, OWLOntologyManager manager){ @@ -48,7 +55,8 @@ } - public Set<Set<OWLAxiom>> getExplanations(OWLClass unsat){ + public Set<Set<OWLAxiom>> getExplanations(OWLClass unsat, Strategie strategie){ + this.strategie = strategie; return computeRelevantJustifications(unsat); } @@ -57,7 +65,7 @@ OWLOntology ont = null; Set<Set<OWLAxiom>> justifications = new HashSet<Set<OWLAxiom>>(); OWLOntologyManager man = OWLManager.createOWLOntologyManager(); - Reasoner reasoner = new PelletReasonerFactory().createReasoner(man); + localReasoner = new PelletReasonerFactory().createReasoner(man); int k = 1; try { ont = man.createOntology(URI.create("file:/home/lorenz/test.owl")); @@ -65,12 +73,12 @@ // TODO Auto-generated catch block e.printStackTrace(); } - reasoner.loadOntology(ont); + localReasoner.loadOntology(ont); Set<OWLAxiom> relevant = getSyntacticRelevantAxioms(unsat, k); - logger.debug("step " + k + ": selected axioms: " + relevant); - Set<OWLAxiom> hittingSets = new HashSet<OWLAxiom>(); - Set<Set<OWLAxiom>> hittingSetLocal = new HashSet<Set<OWLAxiom>>(); + + Set<HittingSet> hittingSets = new HashSet<HittingSet>(); + Set<HittingSet> hittingSetLocal = new HashSet<HittingSet>(); try { man.addAxioms(ont, relevant); } catch (OWLOntologyChangeException e) { @@ -82,6 +90,7 @@ while(!relevant.isEmpty()){ + logger.debug("step " + k + ": selected axioms: " + relevant); try { man.addAxioms(ont, relevant); } catch (OWLOntologyChangeException e) { @@ -90,12 +99,57 @@ } reasoner.refresh(); if(!hittingSetLocal.isEmpty()){ + for(HittingSet hit : hittingSetLocal){ + try { + for(OWLAxiom ax : hit){ + manager.applyChange(new RemoveAxiom(ontology, ax)); + } + reasoner.refresh(); + + if(reasoner.isSatisfiable(unsat)){ + hittingSets.add(hit); + } + manager.addAxioms(ontology, hit); + reasoner.refresh(); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + hittingSetLocal.removeAll(hittingSets); + if( (!strategie.equals(Strategie.All_Just_Relevance) && !hittingSets.isEmpty()) || (hittingSetLocal.isEmpty()) ){ + logger.debug("early termination"); + return justifications; + } + Set<HittingSet> temp = new HashSet<HittingSet>(hittingSetLocal); + for(HittingSet hit : temp){ + try { + for(OWLAxiom ax : hit){ + man.applyChange(new RemoveAxiom(ont, ax)); + } + List<Set<? extends Set<OWLAxiom>>> result = computeJustifications(unsat, ont); + justifications.addAll(result.get(0)); + Set<HittingSet> localTemp = (Set<HittingSet>)result.get(1); + for(HittingSet h : localTemp){ + h.addAll(hit); + hittingSetLocal.add(h); + } + hittingSetLocal.remove(hit); + man.addAxioms(ont, hit); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + } - } else if(!reasoner.isSatisfiable(unsat)){ - System.out.println(reasoner.getLoadedOntologies() + "" + reasoner.isSatisfiable(unsat)); - List<Set<Set<OWLAxiom>>> result = computeJustifications(unsat, ont); + } else if(!localReasoner.isSatisfiable(unsat)){ + + List<Set<? extends Set<OWLAxiom>>> result = computeJustifications(unsat, ont); + logger.debug("step " + k + ": justifications computed : " + result.get(0)); justifications.addAll(result.get(0)); - hittingSetLocal.addAll(result.get(1)); + hittingSetLocal.addAll((Set<HittingSet>)result.get(1)); } k++; relevant = getSyntacticRelevantAxioms(unsat, k); @@ -103,40 +157,43 @@ return justifications; } - private List<Set<Set<OWLAxiom>>> computeJustifications(OWLClass unsat, OWLOntology ont){ + private List<Set<? extends Set<OWLAxiom>>> computeJustifications(OWLClass unsat, OWLOntology ont){ Set<Set<OWLAxiom>> justifications = new HashSet<Set<OWLAxiom>>(); PelletExplanation expGen = new PelletExplanation(manager, Collections.singleton(ont)); - Set<Set<OWLAxiom>> hittingSets = new HashSet<Set<OWLAxiom>>(); - Set<Set<OWLAxiom>> hittingSets1 = new HashSet<Set<OWLAxiom>>(); + Set<HittingSet> hittingSets = new HashSet<HittingSet>(); + Set<HittingSet> hittingSets1 = new HashSet<HittingSet>(); Set<OWLAxiom> justification = expGen.getUnsatisfiableExplanation(unsat); - System.out.println(justification); + justifications.add(justification); for(OWLAxiom ax : justification){ - hittingSets1.add(Collections.singleton(ax)); + hittingSets1.add(new HittingSet(ax)); } while(true){ - Set<Set<OWLAxiom>> hittingSets2 = new HashSet<Set<OWLAxiom>>(); - for(Set<OWLAxiom> axioms : hittingSets1){ + Set<HittingSet> hittingSets2 = new HashSet<HittingSet>(); + for(HittingSet hit : hittingSets1){ try { - for(OWLAxiom ax : axioms){ + for(OWLAxiom ax : hit){ manager.applyChange(new RemoveAxiom(ont, ax)); } + localReasoner.refresh(); - if(reasoner.isSatisfiable(unsat)){ - hittingSets.add(axioms); + if(localReasoner.isSatisfiable(unsat)){ + hittingSets.add(hit); + logger.debug("found local hitting set: " + hit); } else { - hittingSets2.add(axioms); + hittingSets2.add(hit); } - manager.addAxioms(ont, axioms); + manager.addAxioms(ont, hit); + localReasoner.refresh(); } catch (OWLOntologyChangeException e) { // TODO Auto-generated catch block e.printStackTrace(); } } - if(hittingSets1.isEmpty() || hittingSets2.isEmpty()){ - List<Set<Set<OWLAxiom>>> result = new ArrayList<Set<Set<OWLAxiom>>>(); + if( (!strategie.equals(Strategie.All_Just_Relevance) && !hittingSets.isEmpty() ) || hittingSets1.isEmpty() || hittingSets2.isEmpty()){ + List<Set<? extends Set<OWLAxiom>>> result = new ArrayList<Set<? extends Set<OWLAxiom>>>(); result.add(justifications); result.add(hittingSets); return result; @@ -151,7 +208,7 @@ Set<OWLAxiom> just = expGen.getUnsatisfiableExplanation(unsat); justifications.add(just); for(OWLAxiom a : just){ - Set<OWLAxiom> temp = new HashSet<OWLAxiom>(axioms); + HittingSet temp = new HittingSet(axioms); temp.add(a); hittingSets1.add(temp); } @@ -167,37 +224,36 @@ - public Set<OWLAxiom> getSyntacticRelevantAxioms(OWLClass cl, int k){ - - Set<OWLAxiom> relevantAxioms = new HashSet<OWLAxiom>(); - - if(k == 1){ - for(OWLAxiom ax : ontology.getLogicalAxioms()){ - if(ax.getSignature().contains(cl)){ + public Set<OWLAxiom> getSyntacticRelevantAxioms(OWLClass cl, int k) { + + Set<OWLAxiom> relevantAxioms = new HashSet<OWLAxiom>(); + + if (k == 1) { + for (OWLAxiom ax : ontology.getLogicalAxioms()) { + if (ax.getSignature().contains(cl)) { relevantAxioms.add(ax); } } - + } else { Set<OWLAxiom> axioms = getSyntacticRelevantAxioms(cl, k - 1); - - for(OWLAxiom ax1 : axioms){ - - for(OWLAxiom ax2 : ontology.getLogicalAxioms()){ - - if(areSyntacticRelevant(ax1, ax2)){ - + + for (OWLAxiom ax1 : axioms) { + + for (OWLAxiom ax2 : ontology.getLogicalAxioms()) { + + if (areSyntacticRelevant(ax1, ax2)) { + relevantAxioms.add(ax2); } } } - for(int i = k - 1; i>= 1 ;i--){ - relevantAxioms.removeAll(getSyntacticRelevantAxioms(cl,i)); + for (int i = k - 1; i >= 1; i--) { + relevantAxioms.removeAll(getSyntacticRelevantAxioms(cl, i)); } - - + } - + return relevantAxioms; } @@ -208,7 +264,7 @@ public static void main(String[] args){ URI file = URI.create("file:examples/ore/koala.owl"); String base = "http://protege.stanford.edu/plugins/owl/owl-library/koala.owl"; - URI classURI = URI.create(base + "#Koala"); + URI classURI = URI.create(base + "#KoalaWithPhD"); try { OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); @@ -216,37 +272,73 @@ OWLClass cl = factory.getOWLClass(classURI); OWLOntology ontology = manager.loadOntologyFromPhysicalURI(file); - OWLClass cl1 = factory.getOWLClass(URI.create("Manager")); - OWLClass cl2 = factory.getOWLClass(URI.create("Employee")); - OWLClass cl3 = factory.getOWLClass(URI.create("JobPosition")); - OWLClass cl4 = factory.getOWLClass(URI.create("Leader")); - OWLClass cl5 = factory.getOWLClass(URI.create("Situation")); - OWLClass cl6 = factory.getOWLClass(URI.create("Happening")); - OWLClass cl7 = factory.getOWLClass(URI.create("Patent")); - OWLIndividual ind = factory.getOWLIndividual(URI.create("lectureship")); +// OWLClass cl1 = factory.getOWLClass(URI.create("Manager")); +// OWLClass cl2 = factory.getOWLClass(URI.create("Employee")); +// OWLClass cl3 = factory.getOWLClass(URI.create("JobPosition")); +// OWLClass cl4 = factory.getOWLClass(URI.create("Leader")); +// OWLClass cl5 = factory.getOWLClass(URI.create("Situation")); +// OWLClass cl6 = factory.getOWLClass(URI.create("Happening")); +// OWLClass cl7 = factory.getOWLClass(URI.create("Patent")); +// OWLIndividual ind = factory.getOWLIndividual(URI.create("lectureship")); +// Set<OWLAxiom> examples = new HashSet<OWLAxiom>(); +// examples.add(factory.getOWLSubClassAxiom(cl1, cl2)); +// examples.add(factory.getOWLSubClassAxiom(cl2, cl3)); +// examples.add(factory.getOWLSubClassAxiom(cl4, cl3)); +// examples.add(factory.getOWLSubClassAxiom(cl3, cl5)); +// examples.add(factory.getOWLSubClassAxiom(cl5, cl6)); +// examples.add(factory.getOWLSubClassAxiom(cl4, factory.getOWLObjectComplementOf(cl7))); +// examples.add(factory.getOWLSubClassAxiom(cl6, factory.getOWLObjectComplementOf(cl1))); +// examples.add(factory.getOWLSubClassAxiom(cl3, factory.getOWLObjectComplementOf(cl2))); +// examples.add(factory.getOWLClassAssertionAxiom(ind, cl3)); +// OWLOntology example = manager.createOntology(examples); + + OWLClass u = factory.getOWLClass(URI.create("U")); + OWLClass a = factory.getOWLClass(URI.create("A")); + OWLClass b = factory.getOWLClass(URI.create("B")); + OWLClass c = factory.getOWLClass(URI.create("C")); + OWLClass d = factory.getOWLClass(URI.create("D")); + OWLClass e = factory.getOWLClass(URI.create("E")); + OWLClass f = factory.getOWLClass(URI.create("F")); + OWLClass g = factory.getOWLClass(URI.create("G")); + OWLClass h = factory.getOWLClass(URI.create("H")); + OWLClass k = factory.getOWLClass(URI.create("K")); Set<OWLAxiom> examples = new HashSet<OWLAxiom>(); - examples.add(factory.getOWLSubClassAxiom(cl1, cl2)); - examples.add(factory.getOWLSubClassAxiom(cl2, cl3)); - examples.add(factory.getOWLSubClassAxiom(cl4, cl3)); - examples.add(factory.getOWLSubClassAxiom(cl3, cl5)); - examples.add(factory.getOWLSubClassAxiom(cl5, cl6)); - examples.add(factory.getOWLSubClassAxiom(cl4, factory.getOWLObjectComplementOf(cl7))); - examples.add(factory.getOWLSubClassAxiom(cl6, factory.getOWLObjectComplementOf(cl1))); - examples.add(factory.getOWLSubClassAxiom(cl3, factory.getOWLObjectComplementOf(cl2))); - examples.add(factory.getOWLClassAssertionAxiom(ind, cl3)); - + examples.add( factory.getOWLSubClassAxiom(u, a)); + examples.add( factory.getOWLSubClassAxiom(u, factory.getOWLObjectComplementOf(a))); + examples.add( factory.getOWLSubClassAxiom(u, c)); + examples.add( factory.getOWLSubClassAxiom(c, factory.getOWLObjectComplementOf(b))); + examples.add( factory.getOWLSubClassAxiom(a, b)); + examples.add( factory.getOWLSubClassAxiom(u, g)); + examples.add( factory.getOWLSubClassAxiom(g, e)); + examples.add( factory.getOWLSubClassAxiom(u, f)); + examples.add( factory.getOWLSubClassAxiom(f, factory.getOWLObjectComplementOf(e))); + examples.add( factory.getOWLSubClassAxiom(u, d)); + examples.add( factory.getOWLSubClassAxiom(d, e)); + examples.add( factory.getOWLSubClassAxiom(c, k)); + examples.add( factory.getOWLSubClassAxiom(k, factory.getOWLObjectComplementOf(h))); + examples.add( factory.getOWLSubClassAxiom(b, h)); OWLOntology example = manager.createOntology(examples); + + Reasoner reasoner = new PelletReasonerFactory().createReasoner(manager); - reasoner.loadOntologies(Collections.singleton(ontology)); + reasoner.loadOntologies(Collections.singleton(example)); SyntacticRelevanceBasedExplanationGenerator expGen = new SyntacticRelevanceBasedExplanationGenerator(reasoner, manager); + DLSyntaxObjectRenderer renderer = new DLSyntaxObjectRenderer(); + int i = 1; + for(Set<OWLAxiom> explanation : expGen.getExplanations(u, Strategie.CM_Just_Relevance)){ + System.out.println("Explanation " + i); + i++; + for(OWLAxiom ax : explanation){ + System.out.println(renderer.render(ax)); + } + } + - System.out.println(expGen.getExplanations(cl)); - } catch (OWLOntologyCreationException e) { // TODO Auto-generated catch block e.printStackTrace(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-15 08:31:33
|
Revision: 1798 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1798&view=rev Author: lorenz_b Date: 2009-06-15 08:31:17 +0000 (Mon, 15 Jun 2009) Log Message: ----------- started syntactic relevance based explanation generator Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java 2009-06-15 06:14:21 UTC (rev 1797) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java 2009-06-15 08:31:17 UTC (rev 1798) @@ -29,6 +29,8 @@ import org.semanticweb.owl.model.RemoveAxiom; import com.clarkparsia.modularity.IncrementalClassifier; +import com.clarkparsia.modularity.ModuleExtractor; +import com.clarkparsia.modularity.ModuleExtractorFactory; public class AxiomRanker { @@ -38,6 +40,7 @@ private Reasoner reasoner; private OWLOntologyManager manager; private OWLDataFactory factory; + private IncrementalClassifier classifier; boolean enableImpactUnsat; @@ -46,15 +49,17 @@ this.reasoner = reasoner; this.manager = mng; this.factory = manager.getOWLDataFactory(); + ModuleExtractor extractor = ModuleExtractorFactory.createModuleExtractor(); + classifier = new IncrementalClassifier(manager, reasoner, extractor); } public Set<OWLAxiom> computeImpactOnRemoval(OWLAxiom ax){ Set<OWLAxiom> impact = new HashSet<OWLAxiom>(); try { - IncrementalClassifier classifier = new IncrementalClassifier(manager); - classifier.loadOntology(ontology); - classifier.classify(); +// IncrementalClassifier classifier = new IncrementalClassifier(manager); +// classifier.loadOntology(ontology); +// classifier.classify(); Set<OWLClass> inc = classifier.getInconsistentClasses(); for(OWLDescription cl : ontology.getClassesInSignature()){ if(!inc.contains(cl)){ @@ -170,7 +175,7 @@ } } - return result; +// return result; } } else if (axiom instanceof OWLObjectPropertyDomainAxiom) { @@ -239,12 +244,12 @@ OWLAxiom ax = dFactory.getOWLSubClassAxiom(cl1, dFactory.getOWLObjectComplementOf(cl2)); Set<OWLClass> before = null; Set<OWLClass> after = null; - if(ax instanceof OWLSubClassAxiom){ + before = SetUtils.union(reasoner.getSuperClasses(cl1)); manager.applyChange(new RemoveAxiom(ontology, ax)); after = SetUtils.union(reasoner.getSuperClasses(cl1)); System.out.println(SetUtils.difference(before, after)); - } + System.out.println(cl1.getSuperClasses(ontology)); System.out.println(after); Added: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/SyntacticRelevanceBasedExplanationGenerator.java 2009-06-15 08:31:17 UTC (rev 1798) @@ -0,0 +1,258 @@ +package org.dllearner.tools.ore.explanation; + +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.apache.log4j.SimpleLayout; +import org.mindswap.pellet.owlapi.PelletReasonerFactory; +import org.mindswap.pellet.owlapi.Reasoner; +import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLDataFactory; +import org.semanticweb.owl.model.OWLIndividual; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLOntologyChangeException; +import org.semanticweb.owl.model.OWLOntologyCreationException; +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 com.clarkparsia.explanation.PelletExplanation; + +public class SyntacticRelevanceBasedExplanationGenerator { + + private Reasoner reasoner; + private OWLOntologyManager manager; + private OWLOntology ontology; + + private static Logger logger = Logger.getRootLogger(); + + public SyntacticRelevanceBasedExplanationGenerator(Reasoner reasoner, OWLOntologyManager manager){ + this.reasoner = reasoner; + this.manager = manager; + this.ontology = reasoner.getLoadedOntologies().iterator().next(); + + SimpleLayout layout = new SimpleLayout(); + ConsoleAppender consoleAppender = new ConsoleAppender( layout ); + logger.addAppender( consoleAppender ); + logger.setLevel(Level.DEBUG); + + } + + public Set<Set<OWLAxiom>> getExplanations(OWLClass unsat){ + return computeRelevantJustifications(unsat); + } + + private Set<Set<OWLAxiom>> computeRelevantJustifications(OWLClass unsat){ + + OWLOntology ont = null; + Set<Set<OWLAxiom>> justifications = new HashSet<Set<OWLAxiom>>(); + OWLOntologyManager man = OWLManager.createOWLOntologyManager(); + Reasoner reasoner = new PelletReasonerFactory().createReasoner(man); + int k = 1; + try { + ont = man.createOntology(URI.create("file:/home/lorenz/test.owl")); + } catch (OWLOntologyCreationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + reasoner.loadOntology(ont); + + Set<OWLAxiom> relevant = getSyntacticRelevantAxioms(unsat, k); + logger.debug("step " + k + ": selected axioms: " + relevant); + Set<OWLAxiom> hittingSets = new HashSet<OWLAxiom>(); + Set<Set<OWLAxiom>> hittingSetLocal = new HashSet<Set<OWLAxiom>>(); + try { + man.addAxioms(ont, relevant); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + + + while(!relevant.isEmpty()){ + try { + man.addAxioms(ont, relevant); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + reasoner.refresh(); + if(!hittingSetLocal.isEmpty()){ + + } else if(!reasoner.isSatisfiable(unsat)){ + System.out.println(reasoner.getLoadedOntologies() + "" + reasoner.isSatisfiable(unsat)); + List<Set<Set<OWLAxiom>>> result = computeJustifications(unsat, ont); + justifications.addAll(result.get(0)); + hittingSetLocal.addAll(result.get(1)); + } + k++; + relevant = getSyntacticRelevantAxioms(unsat, k); + } + return justifications; + } + + private List<Set<Set<OWLAxiom>>> computeJustifications(OWLClass unsat, OWLOntology ont){ + Set<Set<OWLAxiom>> justifications = new HashSet<Set<OWLAxiom>>(); + PelletExplanation expGen = new PelletExplanation(manager, Collections.singleton(ont)); + Set<Set<OWLAxiom>> hittingSets = new HashSet<Set<OWLAxiom>>(); + Set<Set<OWLAxiom>> hittingSets1 = new HashSet<Set<OWLAxiom>>(); + + Set<OWLAxiom> justification = expGen.getUnsatisfiableExplanation(unsat); + System.out.println(justification); + justifications.add(justification); + for(OWLAxiom ax : justification){ + hittingSets1.add(Collections.singleton(ax)); + } + + while(true){ + Set<Set<OWLAxiom>> hittingSets2 = new HashSet<Set<OWLAxiom>>(); + for(Set<OWLAxiom> axioms : hittingSets1){ + try { + for(OWLAxiom ax : axioms){ + manager.applyChange(new RemoveAxiom(ont, ax)); + } + + if(reasoner.isSatisfiable(unsat)){ + hittingSets.add(axioms); + } else { + hittingSets2.add(axioms); + } + manager.addAxioms(ont, axioms); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + if(hittingSets1.isEmpty() || hittingSets2.isEmpty()){ + List<Set<Set<OWLAxiom>>> result = new ArrayList<Set<Set<OWLAxiom>>>(); + result.add(justifications); + result.add(hittingSets); + return result; + } + hittingSets1.clear(); + for(Set<OWLAxiom> axioms : hittingSets2){ + try { + for(OWLAxiom ax : axioms){ + manager.applyChange(new RemoveAxiom(ont, ax)); + } + expGen = new PelletExplanation(manager, Collections.singleton(ont)); + Set<OWLAxiom> just = expGen.getUnsatisfiableExplanation(unsat); + justifications.add(just); + for(OWLAxiom a : just){ + Set<OWLAxiom> temp = new HashSet<OWLAxiom>(axioms); + temp.add(a); + hittingSets1.add(temp); + } + manager.addAxioms(ont, axioms); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + } + + + + public Set<OWLAxiom> getSyntacticRelevantAxioms(OWLClass cl, int k){ + + Set<OWLAxiom> relevantAxioms = new HashSet<OWLAxiom>(); + + if(k == 1){ + for(OWLAxiom ax : ontology.getLogicalAxioms()){ + if(ax.getSignature().contains(cl)){ + relevantAxioms.add(ax); + } + } + + } else { + Set<OWLAxiom> axioms = getSyntacticRelevantAxioms(cl, k - 1); + + for(OWLAxiom ax1 : axioms){ + + for(OWLAxiom ax2 : ontology.getLogicalAxioms()){ + + if(areSyntacticRelevant(ax1, ax2)){ + + relevantAxioms.add(ax2); + } + } + } + for(int i = k - 1; i>= 1 ;i--){ + relevantAxioms.removeAll(getSyntacticRelevantAxioms(cl,i)); + } + + + } + + return relevantAxioms; + } + + private boolean areSyntacticRelevant(OWLAxiom ax1, OWLAxiom ax2){ + return org.mindswap.pellet.utils.SetUtils.intersects(ax1.getSignature(), ax2.getSignature()); + } + + public static void main(String[] args){ + URI file = URI.create("file:examples/ore/koala.owl"); + String base = "http://protege.stanford.edu/plugins/owl/owl-library/koala.owl"; + URI classURI = URI.create(base + "#Koala"); + + try { + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + OWLDataFactory factory = manager.getOWLDataFactory(); + OWLClass cl = factory.getOWLClass(classURI); + OWLOntology ontology = manager.loadOntologyFromPhysicalURI(file); + + OWLClass cl1 = factory.getOWLClass(URI.create("Manager")); + OWLClass cl2 = factory.getOWLClass(URI.create("Employee")); + OWLClass cl3 = factory.getOWLClass(URI.create("JobPosition")); + OWLClass cl4 = factory.getOWLClass(URI.create("Leader")); + OWLClass cl5 = factory.getOWLClass(URI.create("Situation")); + OWLClass cl6 = factory.getOWLClass(URI.create("Happening")); + OWLClass cl7 = factory.getOWLClass(URI.create("Patent")); + OWLIndividual ind = factory.getOWLIndividual(URI.create("lectureship")); + Set<OWLAxiom> examples = new HashSet<OWLAxiom>(); + examples.add(factory.getOWLSubClassAxiom(cl1, cl2)); + examples.add(factory.getOWLSubClassAxiom(cl2, cl3)); + examples.add(factory.getOWLSubClassAxiom(cl4, cl3)); + examples.add(factory.getOWLSubClassAxiom(cl3, cl5)); + examples.add(factory.getOWLSubClassAxiom(cl5, cl6)); + examples.add(factory.getOWLSubClassAxiom(cl4, factory.getOWLObjectComplementOf(cl7))); + examples.add(factory.getOWLSubClassAxiom(cl6, factory.getOWLObjectComplementOf(cl1))); + examples.add(factory.getOWLSubClassAxiom(cl3, factory.getOWLObjectComplementOf(cl2))); + examples.add(factory.getOWLClassAssertionAxiom(ind, cl3)); + + OWLOntology example = manager.createOntology(examples); + + + Reasoner reasoner = new PelletReasonerFactory().createReasoner(manager); + reasoner.loadOntologies(Collections.singleton(ontology)); + SyntacticRelevanceBasedExplanationGenerator expGen = + new SyntacticRelevanceBasedExplanationGenerator(reasoner, manager); + + System.out.println(expGen.getExplanations(cl)); + + + + } catch (OWLOntologyCreationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (OWLOntologyChangeException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-15 06:15:31
|
Revision: 1797 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1797&view=rev Author: jenslehmann Date: 2009-06-15 06:14:21 +0000 (Mon, 15 Jun 2009) Log Message: ----------- collect more statistical values Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-06-15 05:47:44 UTC (rev 1796) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-06-15 06:14:21 UTC (rev 1797) @@ -118,7 +118,7 @@ private ConceptComparator descriptionComparator = new ConceptComparator(); // statistical variables - private int descriptionTests = 0; + private int expressionTests = 0; private int minHorizExp = 0; private int maxHorizExp = 0; @@ -283,9 +283,9 @@ } if (stop) { - logger.info("Algorithm stopped ("+descriptionTests+" descriptions tested).\n"); + logger.info("Algorithm stopped ("+expressionTests+" descriptions tested).\n"); } else { - logger.info("Algorithm terminated successfully ("+descriptionTests+" descriptions tested).\n"); + logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested).\n"); } // print solution(s) @@ -345,7 +345,7 @@ // quality of description (return if too weak) double accuracy = learningProblem.getAccuracyOrTooWeak(description, noise); - descriptionTests++; + expressionTests++; // System.out.println(description + " " + accuracy); if(accuracy == -1) { return false; @@ -503,7 +503,7 @@ nodes = new TreeSet<OENode>(heuristic); descriptions = new TreeSet<Description>(new ConceptComparator()); bestEvaluatedDescriptions.getSet().clear(); - descriptionTests = 0; + expressionTests = 0; } @Override @@ -582,4 +582,10 @@ return minHorizExp; } + /** + * @return the expressionTests + */ + public int getClassExpressionTests() { + return expressionTests; + } } Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-15 05:47:44 UTC (rev 1796) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-15 06:14:21 UTC (rev 1797) @@ -101,6 +101,7 @@ String userInputProtocol = ""; int classCandidatesCount = 0; Stat instanceCountStat = new Stat(); + Stat classExpressionTestsStat = new Stat(); // equivalence classes int candidatesAboveThresholdCount = 0; @@ -109,6 +110,7 @@ int noSensibleDescriptionCount = 0; int inconsistencyDetected = 0; int moreInstancesCount = 0; + int nonPerfectCount = 0; Stat moreInstancesCountStat = new Stat(); Stat accStat = new Stat(); Stat accSelectedStat = new Stat(); @@ -122,6 +124,7 @@ int noSensibleDescriptionCountSC = 0; int inconsistencyDetectedSC = 0; int moreInstancesCountSC = 0; + int nonPerfectCountSC = 0; Stat moreInstancesCountStatSC = new Stat(); Stat accStatSC = new Stat(); Stat accSelectedStatSC = new Stat(); @@ -176,7 +179,8 @@ celoe.init(); celoe.start(); - + classExpressionTestsStat.addNumber(celoe.getClassExpressionTests()); + // test whether a solution above the threshold was found EvaluatedDescription best = celoe.getCurrentlyBestEvaluatedDescription(); double bestAcc = best.getAccuracy(); @@ -295,6 +299,9 @@ moreInstancesCount++; moreInstancesCountStat.addNumber(additionalInstances); } + if(bestAcc < 0.9999) { + nonPerfectCount++; + } } else { accSelectedStatSC.addNumber(bestAcc); positionStatSC.addNumber(selectedNr); @@ -306,6 +313,9 @@ moreInstancesCountSC++; moreInstancesCountStatSC.addNumber(additionalInstances); } + if(bestAcc < 0.9999) { + nonPerfectCountSC++; + } } } } @@ -323,10 +333,12 @@ .println("knowledge engineering process finished successfully - summary shown below"); System.out.println(); System.out.println("ontology: " + args[0]); + System.out.println("settings: " + minAccuracy + " min accuracy, " + minInstanceCount + " min instances, " + algorithmRuntimeInSeconds + "s algorithm runtime"); System.out.println("user input protocol: " + userInputProtocol); System.out.println("classes in ontology: " + classes.size()); System.out.println("classes with at least " + minInstanceCount + " instances: " + classCandidatesCount); + System.out.println("class expressions tested: " + classExpressionTestsStat.prettyPrint("")); System.out.println(); System.out.println("statistics for equivalence axioms:"); @@ -334,13 +346,14 @@ + candidatesAboveThresholdCount); System.out.println("axioms learned succesfully: " + foundDescriptionCount); System.out.println("axioms missed: " + missesCount); - System.out.println("axiom with no sensible axioms: " + noSensibleDescriptionCount); + System.out.println("class with no sensible axioms: " + noSensibleDescriptionCount); System.out.println("average accuracy overall: " + accStat.prettyPrint("")); System.out.println("average accuracy of selected expressions: " + accSelectedStat.prettyPrint("")); - System.out.println("average accuracy of expressions above threshold " + System.out.println("average accuracy of expressions above threshold: " + accAboveThresholdStat.prettyPrint("")); - System.out.println("average number typed by user " + positionStat.prettyPrint("")); + System.out.println("non-perfect (not 100% accuracy) axioms selected: " + nonPerfectCount); + System.out.println("average number typed by user: " + positionStat.prettyPrint("")); System.out.println(); System.out.println("statistics for super class axioms:"); @@ -348,13 +361,14 @@ + candidatesAboveThresholdCountSC); System.out.println("axioms learned succesfully: " + foundDescriptionCountSC); System.out.println("axioms missed: " + missesCountSC); - System.out.println("axiom with no sensible axioms: " + noSensibleDescriptionCountSC); + System.out.println("class with no sensible axioms: " + noSensibleDescriptionCountSC); System.out.println("average accuracy overall: " + accStatSC.prettyPrint("")); System.out.println("average accuracy of selected expressions: " + accSelectedStatSC.prettyPrint("")); - System.out.println("average accuracy of expressions above threshold " + System.out.println("average accuracy of expressions above threshold: " + accAboveThresholdStatSC.prettyPrint("")); - System.out.println("average number typed by user " + positionStatSC.prettyPrint("")); + System.out.println("non-perfect (not 100% accuracy) axioms selected: " + nonPerfectCountSC); + System.out.println("average number typed by user: " + positionStatSC.prettyPrint("")); } @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-15 05:47:44 UTC (rev 1796) +++ trunk/src/dl-learner/org/dllearner/utilities/statistics/Stat.java 2009-06-15 06:14:21 UTC (rev 1797) @@ -128,12 +128,16 @@ } public String prettyPrint(String unit) { - DecimalFormat df = new DecimalFormat(); - String str = "av. " + df.format(getMean()) + unit; - str += " (deviation " + df.format(getStandardDeviation()) + unit + "; "; - str += "min " + df.format(getMin()) + unit + "; "; - str += "max " + df.format(getMax()) + unit + ")"; - return str; + if(sum > 0) { + DecimalFormat df = new DecimalFormat(); + String str = "av. " + df.format(getMean()) + unit; + str += " (deviation " + df.format(getStandardDeviation()) + unit + "; "; + str += "min " + df.format(getMin()) + unit + "; "; + str += "max " + df.format(getMax()) + unit + ")"; + return str; + } else { + return "no data collected"; + } } public String prettyPrint(String unit, DecimalFormat df) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-15 05:48:58
|
Revision: 1796 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1796&view=rev Author: jenslehmann Date: 2009-06-15 05:47:44 +0000 (Mon, 15 Jun 2009) Log Message: ----------- reduced memory consumption of evaluation script Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-12 11:30:46 UTC (rev 1795) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-15 05:47:44 UTC (rev 1796) @@ -309,6 +309,10 @@ } } } + + // remove components to save memory + cm.freeComponent(celoe); + cm.freeComponent(lp); } } } @@ -354,9 +358,9 @@ } @SuppressWarnings("unused") - private static void shrinkSet(Set set, int nrOfElements) { + private static void shrinkSet(Set<?> set, int nrOfElements) { while (set.size() > nrOfElements) { - Iterator it = set.iterator(); + Iterator<?> it = set.iterator(); it.next(); it.remove(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-12 11:30:55
|
Revision: 1795 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1795&view=rev Author: jenslehmann Date: 2009-06-12 11:30:46 +0000 (Fri, 12 Jun 2009) Log Message: ----------- adapted architecture picture for ontology engineering Modified Paths: -------------- trunk/src/php-examples/Suggestions.php Added Paths: ----------- trunk/resources/architecture_celoe.png trunk/resources/architecture_celoe.svg Property Changed: ---------------- trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java Added: trunk/resources/architecture_celoe.png =================================================================== (Binary files differ) Property changes on: trunk/resources/architecture_celoe.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/resources/architecture_celoe.svg =================================================================== --- trunk/resources/architecture_celoe.svg (rev 0) +++ trunk/resources/architecture_celoe.svg 2009-06-12 11:30:46 UTC (rev 1795) @@ -0,0 +1,371 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="744.09448819" + height="1052.3622047" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.46" + sodipodi:docname="architecture_celoe.svg" + sodipodi:docbase="/home/jl/promotion/dl-learner-svn/trunk/resources" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="/home/jl/promotion/dl-learner-svn/trunk/resources/architecture_celoe.png" + inkscape:export-xdpi="147.28065" + inkscape:export-ydpi="147.28065"> + <defs + id="defs4"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective64" /> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0.0" + refX="0.0" + id="TriangleOutL" + style="overflow:visible"> + <path + id="path3302" + d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutM" + orient="auto" + refY="0.0" + refX="0.0" + id="TriangleOutM" + style="overflow:visible"> + <path + id="path3299" + d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none" + transform="scale(0.4)" /> + </marker> + <marker + inkscape:stockid="Arrow2Lend" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lend" + style="overflow:visible;"> + <path + id="path3379" + style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) rotate(180) translate(1,0)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.7" + inkscape:cx="375" + inkscape:cy="577.14286" + inkscape:document-units="px" + inkscape:current-layer="layer1" + inkscape:window-width="1280" + inkscape:window-height="954" + inkscape:window-x="-5" + inkscape:window-y="-3" + showgrid="false" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <g + id="g2753" + transform="translate(0,28)"> + <rect + y="177.64302" + x="50.494846" + height="89.010307" + width="249.01031" + id="rect2160" + style="opacity:0.58500001;fill:#ffd42a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98969221;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + id="text2162" + y="203.79076" + x="71.428574" + style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + xml:space="preserve"><tspan + style="font-size:18px" + y="203.79076" + x="71.428574" + id="tspan2164" + sodipodi:role="line">background knowledge</tspan><tspan + style="font-size:18px" + id="tspan2166" + y="226.29076" + x="71.428574" + sodipodi:role="line"> (OWL ontology or</tspan><tspan + style="font-size:18px" + id="tspan2168" + y="248.79076" + x="71.428574" + sodipodi:role="line"> SPARQL endpoint)</tspan></text> + </g> + <rect + style="opacity:0.58500001;fill:#ffd42a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.07453477;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect3169" + width="248.92546" + height="88.925468" + x="400.53726" + y="369.87546" /> + <rect + style="opacity:0.58500001;fill:#ffd42a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.97974563;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect3171" + width="249.02025" + height="89.020256" + x="50.489872" + y="369.06635" /> + <rect + style="opacity:0.58500001;fill:#ffd42a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect3173" + width="304.28571" + height="97.14286" + x="205.71428" + y="556.64783" /> + <g + id="g2760" + transform="translate(0,29.442843)"> + <rect + y="176.24979" + x="400.53046" + height="88.939102" + width="248.9391" + id="rect3167" + style="opacity:0.58500001;fill:#ffd42a;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.06090128;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <text + id="text3175" + y="213.79076" + x="442.85712" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + xml:space="preserve"><tspan + id="tspan3179" + y="213.79076" + x="442.85712" + sodipodi:role="line">information about </tspan><tspan + id="tspan2721" + y="236.29076" + x="442.85712" + sodipodi:role="line">class to describe</tspan></text> + </g> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="77.14286" + y="395.21933" + id="text3181"><tspan + sodipodi:role="line" + id="tspan3183" + x="77.14286" + y="395.21933"> reasoner</tspan><tspan + sodipodi:role="line" + x="77.14286" + y="417.71933" + id="tspan3185">(Pellet, FaCT, KAON2,</tspan><tspan + sodipodi:role="line" + x="77.14286" + y="440.21933" + id="tspan3423">Racer Pro, HermiT)</tspan></text> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="430" + y="396.64789" + id="text3187"><tspan + sodipodi:role="line" + x="430" + y="396.64789" + id="tspan3191">measuring quality of</tspan><tspan + sodipodi:role="line" + x="430" + y="419.14789" + id="tspan2719"> class expression </tspan><tspan + sodipodi:role="line" + x="430" + y="441.64789" + id="tspan2727"> (heuristics)</tspan></text> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="214.28572" + y="596.64789" + id="text3193"><tspan + sodipodi:role="line" + x="214.28572" + y="596.64789" + id="tspan2709">generation of class expressions</tspan><tspan + sodipodi:role="line" + x="214.28572" + y="619.14789" + id="tspan2715">using a refinement operator</tspan></text> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-347.21228" + y="507.72968" + id="text3413" + transform="matrix(2.6333242e-3,-0.9999965,0.9999965,2.6333242e-3,0,0)"><tspan + sodipodi:role="line" + id="tspan3415" + x="-347.21228" + y="507.72968">use</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64779848;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:2.59119395, 2.59119395;stroke-dashoffset:0;stroke-opacity:1" + d="M 162.85714,361.27485 L 162.85714,309.28729" + id="path3419" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.97576565;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:3.90306258, 3.90306258;stroke-dashoffset:0;stroke-opacity:1" + d="M 395.95553,408.43421 C 365.52641,422.06523 335.22418,433.61629 307.34169,405.51055" + id="path3421" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-347.34915" + y="151.48549" + id="text3425" + transform="matrix(2.6333246e-3,-0.9999965,0.9999965,2.6333246e-3,0,0)"><tspan + sodipodi:role="line" + id="tspan3427" + x="-347.34915" + y="151.48549">use</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.90932429;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:2.7279727, 2.7279727;stroke-dashoffset:0;stroke-opacity:1" + d="M 544.48318,465.45996 C 504.89558,458.38783 475.6447,491.54308 451.56873,544.83742" + id="path3451" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.98453361;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:2.95360103, 2.95360103;stroke-dashoffset:0;stroke-opacity:1" + d="M 475.85156,549.83705 C 521.04331,557.09936 554.43503,523.05257 581.91927,468.32516" + id="path3453" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.64693761;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:2.58775042, 2.58775042;stroke-dashoffset:0;stroke-opacity:1" + d="M 518.57143,360.94183 L 518.57143,309.02341" + id="path3455" /> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="565.71429" + y="519.50507" + id="text3457"><tspan + sodipodi:role="line" + id="tspan3459" + x="565.71429" + y="519.50507">test</tspan><tspan + sodipodi:role="line" + x="565.71429" + y="542.00507" + id="tspan3461">expression</tspan></text> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="391.42859" + y="498.07648" + id="text3463"><tspan + sodipodi:role="line" + id="tspan3465" + x="391.42859" + y="498.07648">return</tspan><tspan + sodipodi:role="line" + x="391.42859" + y="520.57648" + id="tspan3467">quality</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.94272459;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:2.82817393, 2.82817393;stroke-dashoffset:0;stroke-opacity:1" + d="M 217.62905,548.94843 C 176.19401,556.21074 145.57809,522.16395 120.37857,467.43654" + id="path3469" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.91076428;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:2.73229266, 2.73229266;stroke-dashoffset:0;stroke-opacity:1" + d="M 154.30839,465.51986 C 194.02146,458.44773 223.36506,491.60298 247.51734,544.89732" + id="path3471" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="237.14285" + y="490.93359" + id="text3473"><tspan + sodipodi:role="line" + id="tspan3475" + x="237.14285" + y="490.93359">query</tspan><tspan + sodipodi:role="line" + x="237.14285" + y="513.43359" + id="tspan3477">results</tspan></text> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="88.571426" + y="535.21936" + id="text3479"><tspan + sodipodi:role="line" + id="tspan3481" + x="88.571426" + y="535.21936">query</tspan></text> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="314.28571" + y="439.50504" + id="text3485"><tspan + sodipodi:role="line" + id="tspan3487" + x="314.28571" + y="439.50504">instance</tspan><tspan + sodipodi:role="line" + x="314.28571" + y="462.00504" + id="tspan3489">checks</tspan></text> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.89501047;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-miterlimit:4;stroke-dasharray:3.5800417, 3.5800417;stroke-dashoffset:0;stroke-opacity:1" + d="M 305.42618,385.92792 C 334.98062,374.12036 364.41182,364.11452 391.49283,388.46048" + id="path3491" + sodipodi:nodetypes="cc" /> + <text + xml:space="preserve" + style="font-size:18px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="318.57144" + y="363.79077" + id="text3493"><tspan + sodipodi:role="line" + id="tspan3495" + x="318.57144" + y="363.79077">results</tspan></text> + </g> +</svg> Modified: trunk/src/php-examples/Suggestions.php =================================================================== --- trunk/src/php-examples/Suggestions.php 2009-06-11 14:57:29 UTC (rev 1794) +++ trunk/src/php-examples/Suggestions.php 2009-06-12 11:30:46 UTC (rev 1795) @@ -15,7 +15,7 @@ $id = $client->generateID(); $ksID=$client->addKnowledgeSource($id,"sparql","http://dbpedia.org/sparql"); -$client->applyConfigEntryInt($id, $ksID, "recursionDepth", 1); +$client->applyConfigEntryInt($id, $ksID, "recursionDepth", 2); $filterClasses=array("http://xmlns.com/foaf/","http://dbpedia.org/class/yago/","http://dbpedia.org/ontology/Resource"); // $relatedInstances = $client->getNegativeExamples($id,$ksID,$examples,count($examples),"http://dbpedia.org/resource/",$filterClasses); // $relatedInstances = $relatedInstances->item; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-11 14:57:35
|
Revision: 1794 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1794&view=rev Author: jenslehmann Date: 2009-06-11 14:57:29 +0000 (Thu, 11 Jun 2009) Log Message: ----------- small extension Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-11 14:55:10 UTC (rev 1793) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-11 14:57:29 UTC (rev 1794) @@ -225,8 +225,7 @@ // but there is one which was not found // - n ("none"): none of the axioms is appropriate and // there is probably no other appropriate axiom - System.out - .println("Type a number (\"0\"-\"" + System.out.println("Type a number (\"0\"-\"" + (suggestions.size() - 1) + "\") if any of the suggestions is appropriate (if several are possible choose the lowest number). Type \"n\" if there is no appropriate suggestion for this class in your opinion. Type \"m\" if there is an appropriate suggestion in your opinion, but the algorithm did not suggest it."); @@ -244,6 +243,8 @@ input = br.readLine(); } while (!allowedInputs.contains(input)); + userInputProtocol += input; + if (input.equals("m")) { if (i == 0) { missesCount++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-11 14:55:13
|
Revision: 1793 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1793&view=rev Author: jenslehmann Date: 2009-06-11 14:55:10 +0000 (Thu, 11 Jun 2009) Log Message: ----------- script for evaluating CELOE Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java trunk/src/dl-learner/org/dllearner/core/owl/Entity.java trunk/src/dl-learner/org/dllearner/core/owl/Individual.java trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java 2009-06-07 21:01:00 UTC (rev 1792) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java 2009-06-11 14:55:10 UTC (rev 1793) @@ -19,6 +19,7 @@ */ package org.dllearner.core.owl; +import java.net.URI; import java.util.Map; import org.dllearner.utilities.Helper; @@ -46,6 +47,10 @@ return name; } + public URI getURI() { + return URI.create(name); + } + @Override public String toString() { return toString(null, null); Modified: trunk/src/dl-learner/org/dllearner/core/owl/Entity.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Entity.java 2009-06-07 21:01:00 UTC (rev 1792) +++ trunk/src/dl-learner/org/dllearner/core/owl/Entity.java 2009-06-11 14:55:10 UTC (rev 1793) @@ -19,6 +19,8 @@ */ package org.dllearner.core.owl; +import java.net.URI; + /** * Marker interface for classes, properties, individuals. * @@ -27,4 +29,6 @@ */ public interface Entity extends NamedKBElement { + public URI getURI(); + } Modified: trunk/src/dl-learner/org/dllearner/core/owl/Individual.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Individual.java 2009-06-07 21:01:00 UTC (rev 1792) +++ trunk/src/dl-learner/org/dllearner/core/owl/Individual.java 2009-06-11 14:55:10 UTC (rev 1793) @@ -19,6 +19,7 @@ */ package org.dllearner.core.owl; +import java.net.URI; import java.util.Map; import org.dllearner.utilities.Helper; @@ -37,6 +38,10 @@ return name; } + public URI getURI() { + return URI.create(name); + } + public Individual(String name) { this.name = name; } Modified: trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java 2009-06-07 21:01:00 UTC (rev 1792) +++ trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java 2009-06-11 14:55:10 UTC (rev 1793) @@ -47,6 +47,10 @@ return name; } + public URI getURI() { + return URI.create(name); + } + public int getLength() { return 1; } Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java 2009-06-07 21:01:00 UTC (rev 1792) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java 2009-06-11 14:55:10 UTC (rev 1793) @@ -19,6 +19,7 @@ */ package org.dllearner.core.owl; +import java.net.URI; import java.util.Map; import org.dllearner.utilities.Helper; @@ -40,6 +41,10 @@ return 1; } + public URI getURI() { + return URI.create(name); + } + @Override public String toString() { return name; Added: trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/OntologyEngineering.java 2009-06-11 14:55:10 UTC (rev 1793) @@ -0,0 +1,363 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.scripts.evaluation; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.text.DecimalFormat; +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.dllearner.algorithms.celoe.CELOE; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.CELOEConfigurator; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.kb.OWLFile; +import org.dllearner.learningproblems.ClassLearningProblem; +import org.dllearner.learningproblems.EvaluatedDescriptionClass; +import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.utilities.statistics.Stat; + +/** + * The script loads an ontology, loops through all classes having at least a + * specified amount of instances, and evaluates a learning algorithm on those. + * It measures how many times the algorithm missed an appropriate solution of a + * problem, how often it found the correct solution (and the position of the + * solution in the suggestion list). It also tries to find consequences of + * adding an axiom (either it helped to detect an inconsistency or the class now + * has more inferred instances). + * + * @author Jens Lehmann + * + */ +public class OntologyEngineering { + + private static double minAccuracy = 0.85; + + private static int minInstanceCount = 3; + + private static int algorithmRuntimeInSeconds = 10; + + private static DecimalFormat df = new DecimalFormat(); + + @SuppressWarnings("unchecked") + public static void main(String[] args) throws ComponentInitException, + LearningProblemUnsupportedException, IOException { + + Logger.getRootLogger().setLevel(Level.WARN); + + // OWL file is the first argument of the script + if (args.length == 0) { + System.out.println("You need to give an OWL file as argument."); + System.exit(0); + } + File owlFile = new File(args[0]); + + ComponentManager cm = ComponentManager.getInstance(); + + // load OWL in reasoner + OWLFile ks = cm.knowledgeSource(OWLFile.class); + ks.getConfigurator().setUrl(owlFile.toURI().toURL()); + ks.init(); + ReasonerComponent reasoner = cm.reasoner(FastInstanceChecker.class, ks); + reasoner.init(); + System.out.println("Loaded ontology " + args[0] + "."); + + String baseURI = reasoner.getBaseURI(); + Map<String, String> prefixes = reasoner.getPrefixes(); + + // general statistical information + String userInputProtocol = ""; + int classCandidatesCount = 0; + Stat instanceCountStat = new Stat(); + + // equivalence classes + int candidatesAboveThresholdCount = 0; + int missesCount = 0; + int foundDescriptionCount = 0; + int noSensibleDescriptionCount = 0; + int inconsistencyDetected = 0; + int moreInstancesCount = 0; + Stat moreInstancesCountStat = new Stat(); + Stat accStat = new Stat(); + Stat accSelectedStat = new Stat(); + Stat accAboveThresholdStat = new Stat(); + Stat positionStat = new Stat(); + + // super classes + int candidatesAboveThresholdCountSC = 0; + int missesCountSC = 0; + int foundDescriptionCountSC = 0; + int noSensibleDescriptionCountSC = 0; + int inconsistencyDetectedSC = 0; + int moreInstancesCountSC = 0; + Stat moreInstancesCountStatSC = new Stat(); + Stat accStatSC = new Stat(); + Stat accSelectedStatSC = new Stat(); + Stat accAboveThresholdStatSC = new Stat(); + Stat positionStatSC = new Stat(); + + // loop through all classes + Set<NamedClass> classes = new TreeSet<NamedClass>(reasoner.getNamedClasses()); + classes.remove(new NamedClass("http://www.w3.org/2002/07/owl#Thing")); + // reduce number of classes for testing purposes +// shrinkSet(classes, 20); + for (NamedClass nc : classes) { + // check whether the class has sufficient instances + int instanceCount = reasoner.getIndividuals(nc).size(); + if (instanceCount < minInstanceCount) { + System.out.println("class " + nc.toManchesterSyntaxString(baseURI, prefixes) + + " has only " + instanceCount + " instances (minimum: " + minInstanceCount + + ") - skipping"); + } else { + System.out.println("\nlearning axioms for class " + + nc.toManchesterSyntaxString(baseURI, prefixes) + " with " + instanceCount + + " instances"); + classCandidatesCount++; + instanceCountStat.addNumber(instanceCount); + + TreeSet<EvaluatedDescriptionClass> suggestions; + // i=0 is equivalence and i=1 is super class + for (int i = 0; i <= 1; i++) { + // learn equivalence axiom + ClassLearningProblem lp = cm.learningProblem(ClassLearningProblem.class, + reasoner); + lp.getConfigurator().setClassToDescribe(nc.getURI().toURL()); + if (i == 0) { + System.out + .println("generating suggestions for equivalent class (please wait " + + algorithmRuntimeInSeconds + " seconds)"); + lp.getConfigurator().setType("equivalence"); + } else { + System.out.println("suggestions for super class (please wait " + + algorithmRuntimeInSeconds + " seconds)"); + lp.getConfigurator().setType("superClass"); + } + lp.init(); + + CELOE celoe = cm.learningAlgorithm(CELOE.class, lp, reasoner); + CELOEConfigurator cf = celoe.getConfigurator(); + cf.setUseNegation(false); + cf.setValueFrequencyThreshold(3); + cf.setMaxExecutionTimeInSeconds(algorithmRuntimeInSeconds); + cf.setNoisePercentage(0.05); + cf.setMaxNrOfResults(10); + celoe.init(); + + celoe.start(); + + // test whether a solution above the threshold was found + EvaluatedDescription best = celoe.getCurrentlyBestEvaluatedDescription(); + double bestAcc = best.getAccuracy(); + if (i == 0) { + accStat.addNumber(bestAcc); + } else { + accStatSC.addNumber(bestAcc); + } + if (bestAcc < minAccuracy) { + System.out + .println("The algorithm did not find a suggestion with an accuracy above the threshold of " + + (100 * minAccuracy) + + "%. (The best one was \"" + + best.getDescription().toManchesterSyntaxString(baseURI, + prefixes) + + "\" with an accuracy of " + + df.format(bestAcc) + ".) - skipping"); + } else { + + if (i == 0) { + accAboveThresholdStat.addNumber(bestAcc); + candidatesAboveThresholdCount++; + } else { + accAboveThresholdStatSC.addNumber(bestAcc); + candidatesAboveThresholdCountSC++; + } + + suggestions = (TreeSet<EvaluatedDescriptionClass>) celoe + .getCurrentlyBestEvaluatedDescriptions(); + List<EvaluatedDescriptionClass> suggestionsList = new LinkedList<EvaluatedDescriptionClass>( + suggestions.descendingSet()); + + int nr = 0; + for (EvaluatedDescription suggestion : suggestionsList) { + System.out.println(nr + + ": " + + suggestion.getDescription().toManchesterSyntaxString(baseURI, + prefixes) + " (accuracy: " + + df.format(suggestion.getAccuracy()) + ")"); + nr++; + } + + // knowledge engineer feedback: + // - number 0-9: one of axioms is appropriate + // - m ("missing"): none of the axioms is appropriate, + // but there is one which was not found + // - n ("none"): none of the axioms is appropriate and + // there is probably no other appropriate axiom + System.out + .println("Type a number (\"0\"-\"" + + (suggestions.size() - 1) + + "\") if any of the suggestions is appropriate (if several are possible choose the lowest number). Type \"n\" if there is no appropriate suggestion for this class in your opinion. Type \"m\" if there is an appropriate suggestion in your opinion, but the algorithm did not suggest it."); + + String[] inputs = new String[suggestions.size() + 2]; + inputs[0] = "m"; + inputs[1] = "n"; + for (int j = 0; j < suggestions.size(); j++) { + inputs[j + 2] = "" + j; + } + + List<String> allowedInputs = Arrays.asList(inputs); + String input; + do { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + input = br.readLine(); + } while (!allowedInputs.contains(input)); + + if (input.equals("m")) { + if (i == 0) { + missesCount++; + } else { + missesCountSC++; + } + System.out + .println("You said the algorithm missed a possible solution."); + } else if (input.equals("n")) { + if (i == 0) { + noSensibleDescriptionCount++; + } else { + noSensibleDescriptionCountSC++; + } + System.out + .println("You said that there is no reasonable class expression."); + } else { + int selectedNr = Integer.parseInt(input); + EvaluatedDescriptionClass selectedExpression = suggestionsList + .get(selectedNr); + System.out.println("You selected \"" + + selectedExpression.getDescription().toManchesterSyntaxString( + baseURI, prefixes) + "\"."); + boolean isConsistent = selectedExpression.isConsistent(); + if (!isConsistent) { + System.out + .println("Adding the expression leads to an inconsistency of the knowledge base (which is positive since it is a meaningful expression)."); + } + // selectedExpression.getAdditionalInstances(). + Set<Individual> addInst = selectedExpression.getAdditionalInstances(); + int additionalInstances = addInst.size(); + if (additionalInstances > 0) { + System.out.println("Adding the expression leads to " + + additionalInstances + + " new instances, e.g. \"" + + addInst.iterator().next().toManchesterSyntaxString( + baseURI, prefixes) + "\"."); + } + + if (i == 0) { + accSelectedStat.addNumber(bestAcc); + positionStat.addNumber(selectedNr); + foundDescriptionCount++; + if (!isConsistent) { + inconsistencyDetected++; + } + if (additionalInstances > 0) { + moreInstancesCount++; + moreInstancesCountStat.addNumber(additionalInstances); + } + } else { + accSelectedStatSC.addNumber(bestAcc); + positionStatSC.addNumber(selectedNr); + foundDescriptionCountSC++; + if (!isConsistent) { + inconsistencyDetectedSC++; + } + if (additionalInstances > 0) { + moreInstancesCountSC++; + moreInstancesCountStatSC.addNumber(additionalInstances); + } + } + } + } + } + } + } + + // print summary + System.out.println(); + System.out + .println("knowledge engineering process finished successfully - summary shown below"); + System.out.println(); + System.out.println("ontology: " + args[0]); + System.out.println("user input protocol: " + userInputProtocol); + System.out.println("classes in ontology: " + classes.size()); + System.out.println("classes with at least " + minInstanceCount + " instances: " + + classCandidatesCount); + System.out.println(); + + System.out.println("statistics for equivalence axioms:"); + System.out.println("classes above " + (minAccuracy * 100) + "% threshold: " + + candidatesAboveThresholdCount); + System.out.println("axioms learned succesfully: " + foundDescriptionCount); + System.out.println("axioms missed: " + missesCount); + System.out.println("axiom with no sensible axioms: " + noSensibleDescriptionCount); + System.out.println("average accuracy overall: " + accStat.prettyPrint("")); + System.out.println("average accuracy of selected expressions: " + + accSelectedStat.prettyPrint("")); + System.out.println("average accuracy of expressions above threshold " + + accAboveThresholdStat.prettyPrint("")); + System.out.println("average number typed by user " + positionStat.prettyPrint("")); + System.out.println(); + + System.out.println("statistics for super class axioms:"); + System.out.println("classes above " + (minAccuracy * 100) + "% threshold: " + + candidatesAboveThresholdCountSC); + System.out.println("axioms learned succesfully: " + foundDescriptionCountSC); + System.out.println("axioms missed: " + missesCountSC); + System.out.println("axiom with no sensible axioms: " + noSensibleDescriptionCountSC); + System.out.println("average accuracy overall: " + accStatSC.prettyPrint("")); + System.out.println("average accuracy of selected expressions: " + + accSelectedStatSC.prettyPrint("")); + System.out.println("average accuracy of expressions above threshold " + + accAboveThresholdStatSC.prettyPrint("")); + System.out.println("average number typed by user " + positionStatSC.prettyPrint("")); + } + + @SuppressWarnings("unused") + private static void shrinkSet(Set set, int nrOfElements) { + while (set.size() > nrOfElements) { + Iterator it = set.iterator(); + it.next(); + it.remove(); + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-07 21:01:09
|
Revision: 1792 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1792&view=rev Author: lorenz_b Date: 2009-06-07 21:01:00 +0000 (Sun, 07 Jun 2009) Log Message: ----------- integrated 'unsatisfiable_explanation'-step into wizard structure Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanelDescriptor.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-06-07 16:43:07 UTC (rev 1791) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-06-07 21:01:00 UTC (rev 1792) @@ -121,6 +121,17 @@ return explanations; } + public Set<Set<OWLAxiom>> getUnsatisfiableExplanations(OWLClass unsat, int count){ + Set<Set<OWLAxiom>> explanations = regularExplanationCache.get(unsat); + if(explanations == null){ + explanations = regularExpGen.getUnsatisfiableExplanations(unsat, count); + regularExplanationCache.put(unsat, explanations); + } + + return explanations; + } + + public Set<Set<OWLAxiom>> getLaconicUnsatisfiableExplanations(OWLClass unsat){ Set<Set<OWLAxiom>> explanations = laconicExplanationCache.get(unsat); OWLSubClassAxiom unsatAxiom; @@ -171,6 +182,13 @@ } + public Set<List<OWLAxiom>> getOrderedUnsatisfiableExplanations(OWLClass unsat, int count){ + + return getOrderedExplanations(dataFactory.getOWLSubClassAxiom(unsat, dataFactory.getOWLNothing()), + getUnsatisfiableExplanations(unsat, count)); + + } + public Set<List<OWLAxiom>> getOrderedLaconicUnsatisfiableExplanations(OWLClass unsat){ return getOrderedExplanations(dataFactory.getOWLSubClassAxiom(unsat, dataFactory.getOWLNothing()), Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-06-07 16:43:07 UTC (rev 1791) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-06-07 21:01:00 UTC (rev 1792) @@ -291,7 +291,7 @@ public static void main(String[] args) { try { - String file = "file:examples/ore/koala.owl"; + String file = "file:examples/ore/tambis.owl"; PelletOptions.USE_CLASSIFICATION_MONITOR = PelletOptions.MonitorType.SWING; OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.loadOntologyFromPhysicalURI(URI @@ -303,7 +303,7 @@ fr.setSize(new Dimension(400, 400)); fr.setLayout(new BorderLayout()); fr.add((JPanel)m); - fr.setVisible(true); +// fr.setVisible(true); PelletReasonerFactory reasonerFactory = new PelletReasonerFactory(); Reasoner reasoner = reasonerFactory.createReasoner(manager); reasoner.loadOntologies(Collections.singleton(ontology)); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java 2009-06-07 16:43:07 UTC (rev 1791) +++ trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java 2009-06-07 21:01:00 UTC (rev 1792) @@ -106,7 +106,7 @@ } - public void clearExplanationsPanel(){System.out.println("Clearing explanations"); + public void clearExplanationsPanel(){ explanationsPanel.removeAll(); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java 2009-06-07 16:43:07 UTC (rev 1791) +++ trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java 2009-06-07 21:01:00 UTC (rev 1792) @@ -116,7 +116,7 @@ @Override public void repairPlanExecuted() { - System.out.println("repair plan executed"); + showExplanations(); panel.repaint(); setNextButtonEnabled2ConsistentOntology(); Added: trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanel.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanel.java 2009-06-07 21:01:00 UTC (rev 1792) @@ -0,0 +1,172 @@ +package org.dllearner.tools.ore; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionListener; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.ButtonGroup; +import javax.swing.DefaultListModel; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JSplitPane; +import javax.swing.event.ListSelectionListener; + +import org.jdesktop.swingx.JXList; +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLClass; + +public class UnsatisfiableExplanationPanel extends JPanel{ + + private JXList unsatList; + private JSplitPane splitPane; + private JSplitPane statsSplitPane; + private JScrollPane listScrollPane; + private JScrollPane explanationsScrollPane; + private JComponent explanationsPanel; + private JPanel buttonExplanationsPanel; + private JPanel buttonPanel; + private ButtonGroup explanationType; + private JRadioButton regularButton; + private JRadioButton laconicButton; + + private UnsatClassesListCellRenderer listRenderer; + + private ExplanationManager expMan; + private ImpactManager impMan; + + + + private OWLClass unsatClass; + + public UnsatisfiableExplanationPanel(ExplanationManager expMan, ImpactManager impMan){ + this.expMan = expMan; + this.impMan = impMan; + + + setLayout(new BorderLayout()); + + Dimension minimumSize = new Dimension(400, 400); + + listRenderer = new UnsatClassesListCellRenderer(expMan); + unsatList = new JXList(); + + + unsatList.setCellRenderer(listRenderer); + listScrollPane = new JScrollPane(unsatList); + listScrollPane.setPreferredSize(minimumSize); + + explanationsPanel = new Box(1); + + JPanel pan = new JPanel(new BorderLayout()); + pan.add(explanationsPanel, BorderLayout.NORTH); + explanationsScrollPane = new JScrollPane(pan); + explanationsScrollPane.setPreferredSize(minimumSize); + explanationsScrollPane.setBorder(BorderFactory + .createLineBorder(Color.LIGHT_GRAY)); + explanationsScrollPane.getViewport().setOpaque(false); + explanationsScrollPane.getViewport().setBackground(null); + explanationsScrollPane.setOpaque(false); + + regularButton = new JRadioButton("regular", true); + regularButton.setActionCommand("regular"); + + laconicButton = new JRadioButton("laconic"); + laconicButton.setActionCommand("laconic"); + + explanationType = new ButtonGroup(); + explanationType.add(regularButton); + explanationType.add(laconicButton); + buttonPanel = new JPanel(); + buttonPanel.add(regularButton); + buttonPanel.add(laconicButton); + + buttonExplanationsPanel = new JPanel(); + buttonExplanationsPanel.setLayout(new BorderLayout()); + buttonExplanationsPanel + .add(explanationsScrollPane, BorderLayout.CENTER); + buttonExplanationsPanel.add(buttonPanel, BorderLayout.NORTH); + + statsSplitPane = new JSplitPane(0); + statsSplitPane.setResizeWeight(1.0D); + statsSplitPane.setTopComponent(buttonExplanationsPanel); + + //repair panel + JPanel impactRepairPanel = new JPanel(); + impactRepairPanel.setLayout(new BorderLayout()); + impactRepairPanel.add(new JLabel("Repair plan"), BorderLayout.NORTH); + JSplitPane impRepSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); + impRepSplit.setOneTouchExpandable(true); + impRepSplit.setDividerLocation(600); + impRepSplit.setBorder(null); + impactRepairPanel.add(impRepSplit); + + JPanel impactPanel = new JPanel(); + impactPanel.setLayout(new BorderLayout()); + impactPanel.add(new JLabel("Lost entailments"), BorderLayout.NORTH); + JScrollPane impScr = new JScrollPane(new ImpactTable(impMan)); + impactPanel.add(impScr); + impRepSplit.setRightComponent(impactPanel); + + RepairPlanPanel repairPanel = new RepairPlanPanel(impMan); + impRepSplit.setLeftComponent(repairPanel); + + + statsSplitPane.setBottomComponent(impactRepairPanel); + + statsSplitPane.setBorder(null); + statsSplitPane.setDividerLocation(500); + statsSplitPane.setOneTouchExpandable(true); + + splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, listScrollPane, + statsSplitPane); + splitPane.setOneTouchExpandable(true); + splitPane.setDividerLocation(150); + splitPane.setBorder(null); + + add(splitPane); + } + + public void fillUnsatClassesList(List<OWLClass> unsatClasses) { + DefaultListModel model = new DefaultListModel(); + for(OWLClass cl : unsatClasses){ + model.addElement(cl); + } + + unsatList.setModel(model); + } + + public void clearExplanationsPanel() { + + explanationsPanel.removeAll(); + } + + public void addExplanation(List<OWLAxiom> explanation, OWLClass unsat, int counter) { + ExplanationTable expTable = new ExplanationTable(explanation, impMan, + expMan, unsat); + explanationsPanel.add(new ExplanationTablePanel(expTable, counter)); + + explanationsPanel.add(Box.createVerticalStrut(10)); + explanationsPanel.add(new JSeparator()); + explanationsPanel.add(Box.createVerticalStrut(10)); + this.updateUI(); + } + + public void addActionListeners(ActionListener aL) { + regularButton.addActionListener(aL); + laconicButton.addActionListener(aL); + } + + public void addListSelectionListener(ListSelectionListener l){ + unsatList.addListSelectionListener(l); + } + + +} Added: trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanelDescriptor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/UnsatisfiableExplanationPanelDescriptor.java 2009-06-07 21:01:00 UTC (rev 1792) @@ -0,0 +1,147 @@ +package org.dllearner.tools.ore; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; + +import org.jdesktop.swingx.JXList; +import org.mindswap.pellet.owlapi.Reasoner; +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLClass; + +public class UnsatisfiableExplanationPanelDescriptor extends + WizardPanelDescriptor implements ActionListener, ImpactManagerListener, ListSelectionListener{ + + public static final String IDENTIFIER = "UNSATISFIABLE_PANEL"; + public static final String INFORMATION = ""; + + private UnsatisfiableExplanationPanel panel; + private ExplanationManager expMan; + private ImpactManager impMan; + private Reasoner reasoner; + private boolean laconicMode = false; + private OWLClass unsatClass; + + public UnsatisfiableExplanationPanelDescriptor(){ + setPanelDescriptorIdentifier(IDENTIFIER); + } + + public void init() { + reasoner = getWizardModel().getOre().getPelletReasoner() + .getReasoner(); + expMan = ExplanationManager.getExplanationManager(reasoner); + impMan = ImpactManager.getImpactManager(reasoner); + impMan.addListener(this); + panel = new UnsatisfiableExplanationPanel(expMan, impMan); + panel.addActionListeners(this); + panel.addListSelectionListener(this); + setPanelComponent(panel); + + + + } + + private void showLaconicExplanations() { + panel.clearExplanationsPanel(); + expMan.setLaconicMode(true); + int counter = 1; + for (List<OWLAxiom> explanation : expMan + .getOrderedLaconicUnsatisfiableExplanations(unsatClass)) { + panel.addExplanation(explanation, unsatClass, counter); + counter++; + } + + } + + private void showRegularExplanations() { + panel.clearExplanationsPanel(); + expMan.setLaconicMode(false); + int counter = 1; + for (List<OWLAxiom> explanation : expMan + .getOrderedUnsatisfiableExplanations(unsatClass)) { + panel.addExplanation(explanation, unsatClass, counter); + counter++; + } + } + + private void showExplanations(){ + if(laconicMode) { + showLaconicExplanations(); + } else { + showRegularExplanations(); + } + } + + @Override + public Object getNextPanelDescriptor() { + return ClassPanelOWLDescriptor.IDENTIFIER; + } + + @Override + public Object getBackPanelDescriptor() { + return KnowledgeSourcePanelDescriptor.IDENTIFIER; + } + + @Override + public void aboutToDisplayPanel() { + fillUnsatClassesList(); + getWizard().getInformationField().setText(INFORMATION); + + } + + @Override + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand().equals("regular")) { + laconicMode = false; + } else if (e.getActionCommand().equals("laconic")) { + laconicMode = true; + } + showExplanations(); + + } + + @Override + public void axiomForImpactChanged() { + // TODO Auto-generated method stub + + } + + @Override + public void repairPlanExecuted() { + panel.clearExplanationsPanel(); + + fillUnsatClassesList(); + panel.repaint(); + + } + + private void fillUnsatClassesList(){ + List<OWLClass> unsatClasses = new ArrayList<OWLClass>(); + Set<OWLClass> rootClasses = new TreeSet<OWLClass>(expMan + .getRootUnsatisfiableClasses()); + unsatClasses.addAll(rootClasses); + Set<OWLClass> derivedClasses = new TreeSet<OWLClass>(expMan + .getUnsatisfiableClasses()); + derivedClasses.removeAll(rootClasses); + + unsatClasses.addAll(derivedClasses); + panel.fillUnsatClassesList(unsatClasses); + } + + @Override + public void valueChanged(ListSelectionEvent e) { + JXList unsatList = (JXList) e.getSource(); + unsatClass = (OWLClass)unsatList.getSelectedValue(); + if (!unsatList.isSelectionEmpty()) { + showExplanations(); + } + + } + +} Modified: trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-06-07 16:43:07 UTC (rev 1791) +++ trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-06-07 21:01:00 UTC (rev 1792) @@ -21,17 +21,13 @@ package org.dllearner.tools.ore; -import java.awt.Dimension; import java.awt.event.ActionListener; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; import javax.swing.DefaultListModel; -import javax.swing.JDialog; import javax.swing.JOptionPane; -import javax.swing.JProgressBar; -import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import org.dllearner.core.owl.Description; @@ -85,18 +81,19 @@ private void nextButtonPressed() { WizardModel model = wizard.getModel(); - WizardPanelDescriptor descriptor = model.getCurrentPanelDescriptor(); + WizardPanelDescriptor currentPanelDescriptor = model.getCurrentPanelDescriptor(); ORE ore = model.getOre(); // If it is a finishable panel, close down the dialog. Otherwise, // get the ID that the current panel identifies as the next panel, // and display it. - Object nextPanelDescriptor = descriptor.getNextPanelDescriptor(); + Object nextPanelDescriptor = currentPanelDescriptor.getNextPanelDescriptor(); WizardPanelDescriptor nextDescriptor = model.getPanelHashMap().get(nextPanelDescriptor); - - if(nextPanelDescriptor.equals("CLASS_CHOOSE_OWL_PANEL")){ + + if(currentPanelDescriptor.getPanelDescriptorIdentifier().equals + (KnowledgeSourcePanelDescriptor.IDENTIFIER)){ ore.initPelletReasoner(); - + if(!ore.consistentOntology()){ @@ -115,11 +112,36 @@ } else { - ((ClassPanelOWLDescriptor) nextDescriptor).getOwlClassPanel().getModel().clear(); - new ConceptRetriever(nextPanelDescriptor).execute(); + ore.getPelletReasoner().classify(); + if(ore.getPelletReasoner().getInconsistentClasses().size() > 0 ){ + UnsatisfiableExplanationPanelDescriptor unsatDescriptor = new UnsatisfiableExplanationPanelDescriptor(); + wizard.registerWizardPanel(UnsatisfiableExplanationPanelDescriptor.IDENTIFIER, unsatDescriptor); + ((UnsatisfiableExplanationPanelDescriptor)model.getPanelHashMap().get(UnsatisfiableExplanationPanelDescriptor.IDENTIFIER)).init(); + wizard.registerWizardPanel(UnsatisfiableExplanationPanelDescriptor.IDENTIFIER, unsatDescriptor); + nextPanelDescriptor = UnsatisfiableExplanationPanelDescriptor.IDENTIFIER; + } else { + + nextPanelDescriptor = ClassPanelOWLDescriptor.IDENTIFIER; + ((ClassPanelOWLDescriptor) nextDescriptor).getOwlClassPanel().getModel().clear(); + new ConceptRetriever(nextPanelDescriptor).execute(); + } + } } + if(currentPanelDescriptor.equals(InconsistencyExplanationPanelDescriptor.IDENTIFIER)){ + ore.getPelletReasoner().classify(); + if(ore.getPelletReasoner().getInconsistentClasses().size() > 0 ){ + + } else { + nextPanelDescriptor = KnowledgeSourcePanelDescriptor.IDENTIFIER; + } + } + if(currentPanelDescriptor.getPanelDescriptorIdentifier().equals(UnsatisfiableExplanationPanelDescriptor.IDENTIFIER)){ + nextPanelDescriptor = ClassPanelOWLDescriptor.IDENTIFIER; + ((ClassPanelOWLDescriptor) nextDescriptor).getOwlClassPanel().getModel().clear(); + new ConceptRetriever(nextPanelDescriptor).execute(); + } if(nextPanelDescriptor.equals("LEARNING_PANEL")){ ore.init(); @@ -144,7 +166,7 @@ Description oldClass = model.getOre().getIgnoredConcept(); List<OWLOntologyChange> changes = ore.getModifier().rewriteClassDescription(newDesc, oldClass); - ((RepairPanelDescriptor) descriptor).getOntologyChanges().addAll(changes); + ((RepairPanelDescriptor) currentPanelDescriptor).getOntologyChanges().addAll(changes); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-07 16:43:48
|
Revision: 1791 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1791&view=rev Author: lorenz_b Date: 2009-06-07 16:43:07 +0000 (Sun, 07 Jun 2009) Log Message: ----------- small changes to work with the inconsistency panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/Main.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairPlanPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -13,7 +13,6 @@ import org.dllearner.tools.ore.explanation.RootFinder; import org.mindswap.pellet.owlapi.PelletReasonerFactory; import org.mindswap.pellet.owlapi.Reasoner; -import org.semanticweb.owl.apibinding.OWLManager; import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLClass; import org.semanticweb.owl.model.OWLDataFactory; @@ -47,6 +46,7 @@ private Set<OWLClass> unsatClasses; private Set<OWLClass> rootClasses; boolean ontologyChanged = true; + boolean isLaconicMode = false; @@ -59,17 +59,17 @@ this.ontology = reasoner.getLoadedOntologies().iterator().next(); manager.addOntologyChangeListener(this); - manager.addOntologyChangeListener(reasoner); +// manager.addOntologyChangeListener(reasoner); dataFactory = manager.getOWLDataFactory(); ImpactManager.getImpactManager(reasoner).addListener(this); reasonerFactory = new PelletReasonerFactory(); rootFinder = new RootFinder(manager, reasoner, reasonerFactory); - regularExpGen = new PelletExplanation(manager, Collections - .singleton(ontology)); + regularExpGen = new PelletExplanation(reasoner.getManager(), reasoner.getLoadedOntologies()); + laconicExpGen = new LaconicExplanationGenerator(manager, - reasonerFactory, Collections.singleton(ontology)); + reasonerFactory, manager.getOntologies()); rootClasses = new HashSet<OWLClass>(); unsatClasses = new HashSet<OWLClass>(); @@ -223,11 +223,18 @@ + + } public int getArity(OWLClass cl, OWLAxiom ax) { int arity = 0; - Set<Set<OWLAxiom>> explanations = regularExplanationCache.get(cl); + Set<Set<OWLAxiom>> explanations; + if(isLaconicMode){ + explanations = laconicExplanationCache.get(cl); + } else { + explanations = regularExplanationCache.get(cl); + } if(explanations != null){ @@ -239,6 +246,11 @@ } return arity; } + + public void setLaconicMode(boolean laconic){ + isLaconicMode = laconic; + + } @Override public void axiomForImpactChanged() { @@ -250,6 +262,9 @@ public void repairPlanExecuted() { reasoner.refresh(); ontologyChanged = true; + regularExpGen = new PelletExplanation(reasoner.getManager(), reasoner.getLoadedOntologies()); + laconicExpGen = new LaconicExplanationGenerator(manager, + reasonerFactory, reasoner.getLoadedOntologies()); regularExplanationCache.clear(); laconicExplanationCache.clear(); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -25,7 +25,6 @@ import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JSplitPane; -import javax.swing.ProgressMonitor; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.event.ListSelectionEvent; @@ -36,19 +35,13 @@ import org.mindswap.pellet.owlapi.PelletReasonerFactory; import org.mindswap.pellet.owlapi.Reasoner; import org.mindswap.pellet.utils.progress.SwingProgressMonitor; -import org.protege.editor.owl.ui.inference.ClassifyAction; import org.semanticweb.owl.apibinding.OWLManager; -import org.semanticweb.owl.inference.OWLReasonerException; import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLClass; import org.semanticweb.owl.model.OWLOntology; import org.semanticweb.owl.model.OWLOntologyCreationException; import org.semanticweb.owl.model.OWLOntologyManager; -import com.clarkparsia.modularity.AxiomBasedModuleExtractor; -import com.clarkparsia.modularity.IncrementalClassifier; -import com.clarkparsia.modularity.ModuleExtractor; - public class ExplanationPanel extends JPanel implements ListSelectionListener, ActionListener,ImpactManagerListener{ @@ -298,7 +291,7 @@ public static void main(String[] args) { try { - String file = "file:examples/ore/tambis.owl"; + String file = "file:examples/ore/koala.owl"; PelletOptions.USE_CLASSIFICATION_MONITOR = PelletOptions.MonitorType.SWING; OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.loadOntologyFromPhysicalURI(URI Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -26,8 +26,10 @@ private List<ImpactManagerListener> listeners; private OWLOntology ontology; private OWLOntologyManager manager; + private Reasoner reasoner; private ImpactManager(Reasoner reasoner) { + this.reasoner = reasoner; this.ontology = reasoner.getLoadedOntologies().iterator().next(); this.manager = reasoner.getManager(); impact = new HashMap<OWLAxiom, Set<OWLAxiom>>(); @@ -116,9 +118,10 @@ try { manager.applyChanges(changes); } catch (OWLOntologyChangeException e) { - // TODO Auto-generated catch block + System.out.println("Error in Impactmanager: Couldn't apply ontology changes"); e.printStackTrace(); } + impact.clear(); selectedAxioms.clear(); fireRepairPlanExecuted(); @@ -131,6 +134,7 @@ } private void fireRepairPlanExecuted(){ + for(ImpactManagerListener listener : listeners){ listener.repairPlanExecuted(); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -106,7 +106,7 @@ } - public void clearExplanationsPanel(){ + public void clearExplanationsPanel(){System.out.println("Clearing explanations"); explanationsPanel.removeAll(); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -7,13 +7,15 @@ import org.mindswap.pellet.owlapi.Reasoner; import org.semanticweb.owl.model.OWLAxiom; -public class InconsistencyExplanationPanelDescriptor extends WizardPanelDescriptor implements ActionListener{ +public class InconsistencyExplanationPanelDescriptor extends WizardPanelDescriptor implements ActionListener, ImpactManagerListener{ public static final String IDENTIFIER = "INCONSISTENCY_PANEL"; public static final String INFORMATION = ""; private InconsistencyExplanationPanel panel; private ExplanationManager expMan; private ImpactManager impMan; + private Reasoner reasoner; + private boolean laconicMode = false; public InconsistencyExplanationPanelDescriptor() { @@ -22,19 +24,22 @@ } public void init() { - Reasoner reasoner = getWizardModel().getOre().getPelletReasoner() + reasoner = getWizardModel().getOre().getPelletReasoner() .getReasoner(); expMan = ExplanationManager.getExplanationManager(reasoner); impMan = ImpactManager.getImpactManager(reasoner); + impMan.addListener(this); panel = new InconsistencyExplanationPanel(expMan, impMan); panel.addActionListeners(this); setPanelComponent(panel); + } private void showLaconicExplanations() { panel.clearExplanationsPanel(); + expMan.setLaconicMode(true); int counter = 1; for (List<OWLAxiom> explanation : expMan .getOrderedLaconicInconsistencyExplanations()) { @@ -46,6 +51,7 @@ private void showRegularExplanations() { panel.clearExplanationsPanel(); + expMan.setLaconicMode(false); int counter = 1; for (List<OWLAxiom> explanation : expMan .getOrderedInconsistencyExplanations()) { @@ -54,10 +60,25 @@ } } + private void showExplanations(){ + if(laconicMode) { + showLaconicExplanations(); + } else { + showRegularExplanations(); + } + } + private void setNextButtonEnabled2ConsistentOntology(){ + if(reasoner.isConsistent()){ + getWizard().setNextFinishButtonEnabled(true); + } else { + getWizard().setNextFinishButtonEnabled(false); + } + } + @Override public Object getNextPanelDescriptor() { return ClassPanelOWLDescriptor.IDENTIFIER; @@ -65,25 +86,44 @@ @Override public Object getBackPanelDescriptor() { - return null; + return KnowledgeSourcePanelDescriptor.IDENTIFIER; } @Override public void aboutToDisplayPanel() { showRegularExplanations(); getWizard().getInformationField().setText(INFORMATION); + getWizard().setNextFinishButtonEnabled(false); } @Override public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("regular")) { - showRegularExplanations(); + laconicMode = false; } else if (e.getActionCommand().equals("laconic")) { - showLaconicExplanations(); - + laconicMode = true; } + showExplanations(); } + + @Override + public void axiomForImpactChanged() { + // TODO Auto-generated method stub + + } + + @Override + public void repairPlanExecuted() { + + System.out.println("repair plan executed"); + showExplanations(); + panel.repaint(); + setNextButtonEnabled2ConsistentOntology(); + + } + + } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/Main.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/Main.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/Main.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -20,6 +20,7 @@ package org.dllearner.tools.ore; +import java.awt.Dimension; import java.util.Locale; import javax.swing.UIManager; @@ -57,7 +58,8 @@ Locale.setDefault(Locale.ENGLISH); Wizard wizard = new Wizard(); wizard.getDialog().setTitle("DL-Learner ORE-Tool"); - wizard.getDialog().setSize(1300, 600); + Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); + wizard.getDialog().setSize(dim); WizardPanelDescriptor descriptor1 = new IntroductionPanelDescriptor(); wizard.registerWizardPanel(IntroductionPanelDescriptor.IDENTIFIER, descriptor1); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/RepairPlanPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/RepairPlanPanel.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/RepairPlanPanel.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -34,6 +34,8 @@ })); JScrollPane repScr = new JScrollPane(new RepairTable(impMan)); + repScr.setBackground(null); + repScr.getViewport().setOpaque(false); add(repScr); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-06-03 16:05:00 UTC (rev 1790) +++ trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-06-07 16:43:07 UTC (rev 1791) @@ -108,7 +108,7 @@ InconsistencyExplanationPanelDescriptor incDescriptor = new InconsistencyExplanationPanelDescriptor(); wizard.registerWizardPanel(InconsistencyExplanationPanelDescriptor.IDENTIFIER, incDescriptor); ((InconsistencyExplanationPanelDescriptor)model.getPanelHashMap().get(InconsistencyExplanationPanelDescriptor.IDENTIFIER)).init(); - incDescriptor.init(); + wizard.registerWizardPanel(InconsistencyExplanationPanelDescriptor.IDENTIFIER, incDescriptor); nextPanelDescriptor = InconsistencyExplanationPanelDescriptor.IDENTIFIER; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-03 16:05:05
|
Revision: 1790 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1790&view=rev Author: lorenz_b Date: 2009-06-03 16:05:00 +0000 (Wed, 03 Jun 2009) Log Message: ----------- new reasoner only based on pellet Modified Paths: -------------- trunk/lib/components.ini Added Paths: ----------- trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-06-03 16:03:06 UTC (rev 1789) +++ trunk/lib/components.ini 2009-06-03 16:05:00 UTC (rev 1790) @@ -10,6 +10,7 @@ org.dllearner.reasoning.DIGReasoner org.dllearner.reasoning.FastRetrievalReasoner org.dllearner.reasoning.FastInstanceChecker +org.dllearner.reasoning.PelletReasoner # learning problems org.dllearner.learningproblems.PosNegLPStandard org.dllearner.learningproblems.PosNegLPStrict Added: trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/reasoning/PelletReasoner.java 2009-06-03 16:05:00 UTC (rev 1790) @@ -0,0 +1,858 @@ +package org.dllearner.reasoning; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.Map.Entry; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.Configurator; +import org.dllearner.core.owl.Axiom; +import org.dllearner.core.owl.Constant; +import org.dllearner.core.owl.Datatype; +import org.dllearner.core.owl.DatatypeProperty; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Entity; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.KB; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.TypedConstant; +import org.dllearner.core.owl.UntypedConstant; +import org.dllearner.kb.OWLAPIOntology; +import org.dllearner.kb.OWLFile; +import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.reasoning.ReasonerType; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.OWLAPIAxiomConvertVisitor; +import org.dllearner.utilities.owl.OWLAPIConverter; +import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; +import org.dllearner.utilities.owl.RoleComparator; +import org.mindswap.pellet.PelletOptions; +import org.mindswap.pellet.owlapi.Reasoner; +import org.mindswap.pellet.utils.SetUtils; +import org.mindswap.pellet.utils.progress.ProgressMonitor; +import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.inference.OWLReasonerException; +import org.semanticweb.owl.model.AddAxiom; +import org.semanticweb.owl.model.OWLAnnotation; +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLConstant; +import org.semanticweb.owl.model.OWLDataFactory; +import org.semanticweb.owl.model.OWLDataProperty; +import org.semanticweb.owl.model.OWLDataRange; +import org.semanticweb.owl.model.OWLDataType; +import org.semanticweb.owl.model.OWLDescription; +import org.semanticweb.owl.model.OWLEntity; +import org.semanticweb.owl.model.OWLIndividual; +import org.semanticweb.owl.model.OWLLabelAnnotation; +import org.semanticweb.owl.model.OWLNamedObject; +import org.semanticweb.owl.model.OWLObjectProperty; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLOntologyChangeException; +import org.semanticweb.owl.model.OWLOntologyCreationException; +import org.semanticweb.owl.model.OWLOntologyFormat; +import org.semanticweb.owl.model.OWLOntologyManager; +import org.semanticweb.owl.model.OWLOntologyStorageException; +import org.semanticweb.owl.model.OWLTypedConstant; +import org.semanticweb.owl.model.OWLUntypedConstant; +import org.semanticweb.owl.model.RemoveAxiom; +import org.semanticweb.owl.model.UnknownOWLOntologyException; +import org.semanticweb.owl.util.SimpleURIMapper; +import org.semanticweb.owl.vocab.NamespaceOWLOntologyFormat; + +import com.clarkparsia.explanation.PelletExplanation; + +public class PelletReasoner extends ReasonerComponent { + + private Reasoner reasoner; + private OWLOntologyManager manager; + private OWLOntology ontology; + // the data factory is used to generate OWL API objects + private OWLDataFactory factory; + + private ConceptComparator conceptComparator = new ConceptComparator(); + private RoleComparator roleComparator = new RoleComparator(); + + Set<NamedClass> atomicConcepts = new TreeSet<NamedClass>(conceptComparator); + Set<ObjectProperty> atomicRoles = new TreeSet<ObjectProperty>(roleComparator); + SortedSet<DatatypeProperty> datatypeProperties = new TreeSet<DatatypeProperty>(); + SortedSet<DatatypeProperty> booleanDatatypeProperties = new TreeSet<DatatypeProperty>(); + SortedSet<DatatypeProperty> doubleDatatypeProperties = new TreeSet<DatatypeProperty>(); + SortedSet<DatatypeProperty> intDatatypeProperties = new TreeSet<DatatypeProperty>(); + SortedSet<Individual> individuals = new TreeSet<Individual>(); + + // namespaces + private Map<String, String> prefixes = new TreeMap<String,String>(); + private String baseURI; + + // references to OWL API ontologies + private List<OWLOntology> owlAPIOntologies = new LinkedList<OWLOntology>(); + + public PelletReasoner(Set<KnowledgeSource> sources) { + super(sources); + // TODO Auto-generated constructor stub + } + + public void loadOntologies() { + Comparator<OWLNamedObject> namedObjectComparator = new Comparator<OWLNamedObject>() { + public int compare(OWLNamedObject o1, OWLNamedObject o2) { + return o1.getURI().compareTo(o2.getURI()); + } + }; + Set<OWLClass> classes = new TreeSet<OWLClass>(namedObjectComparator); + Set<OWLObjectProperty> owlObjectProperties = new TreeSet<OWLObjectProperty>( + namedObjectComparator); + Set<OWLDataProperty> owlDatatypeProperties = new TreeSet<OWLDataProperty>( + namedObjectComparator); + Set<OWLIndividual> owlIndividuals = new TreeSet<OWLIndividual>( + namedObjectComparator); + + Set<OWLOntology> allImports = new HashSet<OWLOntology>(); + prefixes = new TreeMap<String, String>(); + + for (KnowledgeSource source : sources) { + + if (source instanceof OWLFile + || source instanceof SparqlKnowledgeSource + || source instanceof OWLAPIOntology) { + URL url = null; + if (source instanceof OWLFile) { + url = ((OWLFile) source).getURL(); + } + + try { + + if (source instanceof OWLAPIOntology) { + ontology = ((OWLAPIOntology) source).getOWLOntolgy(); + } else if (source instanceof SparqlKnowledgeSource) { + ontology = ((SparqlKnowledgeSource) source) + .getOWLAPIOntology(); + } else { + ontology = manager.loadOntologyFromPhysicalURI(url + .toURI()); + } + + owlAPIOntologies.add(ontology); + // imports includes the ontology itself + Set<OWLOntology> imports = manager + .getImportsClosure(ontology); + allImports.addAll(imports); + // System.out.println(imports); + for (OWLOntology ont : imports) { + classes.addAll(ont.getReferencedClasses()); + owlObjectProperties.addAll(ont + .getReferencedObjectProperties()); + owlDatatypeProperties.addAll(ont + .getReferencedDataProperties()); + owlIndividuals.addAll(ont.getReferencedIndividuals()); + } + + // if several knowledge sources are included, then we can + // only + // guarantee that the base URI is from one of those sources + // (there + // can't be more than one); but we will take care that all + // prefixes are + // correctly imported + OWLOntologyFormat format = manager + .getOntologyFormat(ontology); + if (format instanceof NamespaceOWLOntologyFormat) { + prefixes.putAll(((NamespaceOWLOntologyFormat) format) + .getNamespacesByPrefixMap()); + baseURI = prefixes.get(""); + prefixes.remove(""); + } + + // read in primitives + for(OWLClass owlClass : classes) + atomicConcepts.add(new NamedClass(owlClass.getURI().toString())); + for(OWLObjectProperty owlProperty : owlObjectProperties) + atomicRoles.add(new ObjectProperty(owlProperty.getURI().toString())); + for(OWLDataProperty owlProperty : owlDatatypeProperties) { + DatatypeProperty dtp = new DatatypeProperty(owlProperty.getURI().toString()); + Set<OWLDataRange> ranges = owlProperty.getRanges(allImports); + Iterator<OWLDataRange> it = ranges.iterator(); + if(it.hasNext()) { + OWLDataRange range = it.next(); + if(range.isDataType()) { + URI uri = ((OWLDataType)range).getURI(); + if(uri.equals(Datatype.BOOLEAN.getURI())) + booleanDatatypeProperties.add(dtp); + else if(uri.equals(Datatype.DOUBLE.getURI())) + doubleDatatypeProperties.add(dtp); + else if(uri.equals(Datatype.INT.getURI())) + intDatatypeProperties.add(dtp); + } + } + datatypeProperties.add(dtp); + } + for(OWLIndividual owlIndividual : owlIndividuals) { + individuals.add(new Individual(owlIndividual.getURI().toString())); + } + + } catch (OWLOntologyCreationException e) { + e.printStackTrace(); + } catch (URISyntaxException e) { + e.printStackTrace(); + } + // all other sources are converted to KB and then to an + // OWL API ontology + } else { + KB kb = source.toKB(); + // System.out.println(kb.toString(null,null)); + + URI ontologyURI = URI.create("http://example.com"); + ontology = null; + try { + ontology = manager.createOntology(ontologyURI); + } catch (OWLOntologyCreationException e) { + e.printStackTrace(); + } + OWLAPIAxiomConvertVisitor + .fillOWLOntology(manager, ontology, kb); + owlAPIOntologies.add(ontology); + allImports.add(ontology); + atomicConcepts.addAll(kb.findAllAtomicConcepts()); + atomicRoles.addAll(kb.findAllAtomicRoles()); + individuals.addAll(kb.findAllIndividuals()); + // TODO: add method to find datatypes + } + } + reasoner.loadOntologies(allImports); + } + + public boolean isConsistent(){ + return reasoner.isConsistent(); + } + + public Set<Set<OWLAxiom>> getInconsistencyReasons(){ + PelletExplanation expGen = new PelletExplanation(manager, reasoner.getLoadedOntologies()); + + return expGen.getInconsistencyExplanations(); + } + + @Override + public ReasonerType getReasonerType() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void releaseKB() { + reasoner.clearOntologies(); + reasoner.dispose(); + + } + + @Override + public Configurator getConfigurator() { + // TODO Auto-generated method stub + return null; + } + + public OWLOntologyManager getOWLOntologyManager(){ + return manager; + } + + @Override + public void init() throws ComponentInitException { + // reset variables (otherwise subsequent initialisation with + // different knowledge sources will merge both) + atomicConcepts = new TreeSet<NamedClass>(conceptComparator); + atomicRoles = new TreeSet<ObjectProperty>(roleComparator); + datatypeProperties = new TreeSet<DatatypeProperty>(); + booleanDatatypeProperties = new TreeSet<DatatypeProperty>(); + doubleDatatypeProperties = new TreeSet<DatatypeProperty>(); + intDatatypeProperties = new TreeSet<DatatypeProperty>(); + individuals = new TreeSet<Individual>(); + + // create OWL API ontology manager + manager = OWLManager.createOWLOntologyManager(); + factory = manager.getOWLDataFactory(); + //set classification output to "none", while default is "console" + PelletOptions.USE_CLASSIFICATION_MONITOR = PelletOptions.MonitorType.NONE; + // change log level to WARN for Pellet, because otherwise log + // output will be very large + Logger pelletLogger = Logger.getLogger("org.mindswap.pellet"); + pelletLogger.setLevel(Level.WARN); + reasoner = new Reasoner(manager); + manager.addOntologyChangeListener(reasoner); + + } + + public void classify(){ + reasoner.classify(); + } + + public void addProgressMonitor(ProgressMonitor monitor){ + reasoner.getKB().getTaxonomyBuilder().setProgressMonitor(monitor); + } + + @Override + public String getBaseURI() { + return baseURI; + } + + @Override + public SortedSet<Individual> getIndividuals() { + return individuals; + } + + @Override + public Set<NamedClass> getNamedClasses() { + return Collections.unmodifiableSet(atomicConcepts); + } + + @Override + public Set<ObjectProperty> getObjectProperties() { + return Collections.unmodifiableSet(atomicRoles); + } + + @Override + public Map<String, String> getPrefixes() { + return prefixes; + } + + public Set<Description> getComplementClasses(Description desc){ + OWLDescription owlDesc = OWLAPIDescriptionConvertVisitor.getOWLDescription(desc); + Set<Description> complements = new HashSet<Description>(); + for(OWLClass comp : SetUtils.union(reasoner.getDisjointClasses(owlDesc))){ + complements.add(OWLAPIConverter.convertClass(comp)); + } + for(OWLClass comp : reasoner.getComplementClasses(owlDesc)){ + complements.add(OWLAPIConverter.convertClass(comp)); + } + return complements; + + } + + + + @Override + public SortedSet<DatatypeProperty> getDatatypePropertiesImpl() { + return datatypeProperties; + } + + + + + @Override + public boolean isSuperClassOfImpl(Description superConcept, Description subConcept) { + +// System.out.println("super: " + superConcept + "; sub: " + subConcept); + return reasoner.isSubClassOf(OWLAPIDescriptionConvertVisitor.getOWLDescription(subConcept), OWLAPIDescriptionConvertVisitor.getOWLDescription(superConcept)); + + } + + @Override + protected TreeSet<Description> getSuperClassesImpl(Description concept) { + Set<Set<OWLClass>> classes = null; + + classes = reasoner.getSuperClasses(OWLAPIDescriptionConvertVisitor.getOWLDescription(concept)); + + return getFirstClasses(classes); + } + + @Override + protected TreeSet<Description> getSubClassesImpl(Description concept) { + Set<Set<OWLClass>> classes = null; + + classes = reasoner.getSubClasses(OWLAPIDescriptionConvertVisitor.getOWLDescription(concept)); + + return getFirstClasses(classes); + } + + @Override + protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { + Set<Set<OWLObjectProperty>> properties; + + properties = reasoner.getSuperProperties(OWLAPIConverter.getOWLAPIObjectProperty(role)); + + return getFirstObjectProperties(properties); + } + + @Override + protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { + Set<Set<OWLObjectProperty>> properties; + + properties = reasoner.getSubProperties(OWLAPIConverter.getOWLAPIObjectProperty(role)); + + return getFirstObjectProperties(properties); + } + + @Override + protected TreeSet<DatatypeProperty> getSuperPropertiesImpl(DatatypeProperty role) { + Set<Set<OWLDataProperty>> properties; + + properties = reasoner.getSuperProperties(OWLAPIConverter.getOWLAPIDataProperty(role)); + + return getFirstDatatypeProperties(properties); + } + + @Override + protected TreeSet<DatatypeProperty> getSubPropertiesImpl(DatatypeProperty role) { + Set<Set<OWLDataProperty>> properties; + + properties = reasoner.getSubProperties(OWLAPIConverter.getOWLAPIDataProperty(role)); + + return getFirstDatatypeProperties(properties); + } + + @Override + public boolean hasTypeImpl(Description concept, Individual individual) { + OWLDescription d = OWLAPIDescriptionConvertVisitor.getOWLDescription(concept); + OWLIndividual i = factory.getOWLIndividual(URI.create(individual.getName())); + try { + return reasoner.hasType(i,d,false); + } catch (OWLReasonerException e) { + e.printStackTrace(); + throw new Error("Instance check error in OWL API."); + } + } + + @Override + public SortedSet<Individual> getIndividualsImpl(Description concept) { +// OWLDescription d = getOWLAPIDescription(concept); + OWLDescription d = OWLAPIDescriptionConvertVisitor.getOWLDescription(concept); + Set<OWLIndividual> individuals = null; + + individuals = reasoner.getIndividuals(d, false); + + SortedSet<Individual> inds = new TreeSet<Individual>(); + for(OWLIndividual ind : individuals) + inds.add(new Individual(ind.getURI().toString())); + return inds; + } + + @Override + public Set<NamedClass> getTypesImpl(Individual individual) { + Set<Set<OWLClass>> result = null; + + result = reasoner.getTypes(factory.getOWLIndividual(URI.create(individual.getName())),false); + + return getFirstClassesNoTopBottom(result); + } + + @Override + public boolean isSatisfiableImpl() { + + return reasoner.isSatisfiable(factory.getOWLThing()); + + } + + @Override + public Description getDomainImpl(ObjectProperty objectProperty) { + OWLObjectProperty prop = OWLAPIConverter.getOWLAPIObjectProperty(objectProperty); + + // Pellet returns a set of sets of named class, which are more + // general than the actual domain/range + Set<Set<OWLDescription>> set = reasoner.getDomains(prop); + return getDescriptionFromReturnedDomain(set); + + } + + @Override + public Description getDomainImpl(DatatypeProperty datatypeProperty) { + OWLDataProperty prop = OWLAPIConverter + .getOWLAPIDataProperty(datatypeProperty); + + Set<Set<OWLDescription>> set = reasoner.getDomains(prop); + return getDescriptionFromReturnedDomain(set); + + } + + @Override + public Description getRangeImpl(ObjectProperty objectProperty) { + OWLObjectProperty prop = OWLAPIConverter + .getOWLAPIObjectProperty(objectProperty); + + Set<OWLDescription> set = reasoner.getRanges(prop); + if (set.size() == 0) + return new Thing(); + OWLClass oc = (OWLClass) set.iterator().next(); + return new NamedClass(oc.getURI().toString()); + + } + + private Description getDescriptionFromReturnedDomain(Set<Set<OWLDescription>> set) { + if(set.size()==0) + return new Thing(); + + Set<OWLDescription> union = new HashSet<OWLDescription>(); + Set<OWLDescription> domains = new HashSet<OWLDescription>(); + + for(Set<OWLDescription> descs : set){ + for(OWLDescription desc : descs){ + union.add(desc); + } + } + for(OWLDescription desc : union){ + boolean isSuperClass = false; + for(Description d : getClassHierarchy().getSubClasses(OWLAPIConverter.convertClass(desc.asOWLClass()))){ + if(union.contains(OWLAPIConverter.getOWLAPIDescription(d))){ + isSuperClass = true; + break; + } + } + if(!isSuperClass){ + domains.add(desc); + } + } + + OWLClass oc = (OWLClass) domains.iterator().next(); + String str = oc.getURI().toString(); + if(str.equals("http://www.w3.org/2002/07/owl#Thing")) { + return new Thing(); + } else { + return new NamedClass(str); + } + } + + @Override + public Map<Individual, SortedSet<Individual>> getPropertyMembersImpl(ObjectProperty atomicRole) { + OWLObjectProperty prop = OWLAPIConverter.getOWLAPIObjectProperty(atomicRole); + Map<Individual, SortedSet<Individual>> map = new TreeMap<Individual, SortedSet<Individual>>(); + for(Individual i : individuals) { + OWLIndividual ind = factory.getOWLIndividual(URI.create(i.getName())); + + // get all related individuals via OWL API + Set<OWLIndividual> inds = null; + + inds = reasoner.getRelatedIndividuals(ind, prop); + + + // convert data back to DL-Learner structures + SortedSet<Individual> is = new TreeSet<Individual>(); + for(OWLIndividual oi : inds) + is.add(new Individual(oi.getURI().toString())); + map.put(i, is); + } + return map; + } + + @Override + protected Map<ObjectProperty,Set<Individual>> getObjectPropertyRelationshipsImpl(Individual individual) { + OWLIndividual ind = factory.getOWLIndividual(URI.create(individual.getName())); + Map<OWLObjectProperty,Set<OWLIndividual>> mapAPI = null; + + mapAPI = reasoner.getObjectPropertyRelationships(ind); + + Map<ObjectProperty,Set<Individual>> map = new TreeMap<ObjectProperty, Set<Individual>>(); + for(Entry<OWLObjectProperty,Set<OWLIndividual>> entry : mapAPI.entrySet()) { + ObjectProperty prop = OWLAPIConverter.convertObjectProperty(entry.getKey()); + Set<Individual> inds = OWLAPIConverter.convertIndividuals(entry.getValue()); + map.put(prop, inds); + } + return map; + } + + @Override + public Set<Individual> getRelatedIndividualsImpl(Individual individual, ObjectProperty objectProperty) { + OWLIndividual ind = factory.getOWLIndividual(URI.create(individual.getName())); + OWLObjectProperty prop = OWLAPIConverter.getOWLAPIObjectProperty(objectProperty); + Set<OWLIndividual> inds = null; + + inds = reasoner.getRelatedIndividuals(ind, prop); + + // convert data back to DL-Learner structures + SortedSet<Individual> is = new TreeSet<Individual>(); + for(OWLIndividual oi : inds) { + is.add(new Individual(oi.getURI().toString())); + } + return is; + } + + @Override + public Set<Constant> getRelatedValuesImpl(Individual individual, DatatypeProperty datatypeProperty) { + OWLIndividual ind = factory.getOWLIndividual(URI.create(individual.getName())); + OWLDataProperty prop = OWLAPIConverter.getOWLAPIDataProperty(datatypeProperty); + Set<OWLConstant> constants = null; + + constants = reasoner.getRelatedValues(ind, prop); + + return OWLAPIConverter.convertConstants(constants); + } + + public Map<Individual, SortedSet<Double>> getDoubleValues( + DatatypeProperty datatypeProperty) { + OWLDataProperty prop = OWLAPIConverter + .getOWLAPIDataProperty(datatypeProperty); + Map<Individual, SortedSet<Double>> map = new TreeMap<Individual, SortedSet<Double>>(); + for (Individual i : individuals) { + OWLIndividual ind = factory.getOWLIndividual(URI + .create(i.getName())); + + // get all related individuals via OWL API + Set<OWLConstant> inds = null; + + inds = reasoner.getRelatedValues(ind, prop); + + // convert data back to DL-Learner structures + SortedSet<Double> is = new TreeSet<Double>(); + for (OWLConstant oi : inds) { + Double d = Double.parseDouble(oi.getLiteral()); + is.add(d); + } + map.put(i, is); + } + return map; + } + + @Override + public Map<Individual, SortedSet<Constant>> getDatatypeMembersImpl(DatatypeProperty datatypeProperty) { + OWLDataProperty prop = OWLAPIConverter.getOWLAPIDataProperty(datatypeProperty); + Map<Individual, SortedSet<Constant>> map = new TreeMap<Individual, SortedSet<Constant>>(); + for(Individual i : individuals) { + OWLIndividual ind = factory.getOWLIndividual(URI.create(i.getName())); + + // get all related values via OWL API + Set<OWLConstant> constants = null; + + constants = reasoner.getRelatedValues(ind, prop); + + + // convert data back to DL-Learner structures + SortedSet<Constant> is = new TreeSet<Constant>(); + for(OWLConstant oi : constants) { + // for typed constants we have to figure out the correct + // data type and value + if(oi instanceof OWLTypedConstant) { + Datatype dt = OWLAPIConverter.convertDatatype(((OWLTypedConstant)oi).getDataType()); + is.add(new TypedConstant(oi.getLiteral(),dt)); + // for untyped constants we have to figure out the value + // and language tag (if any) + } else { + OWLUntypedConstant ouc = (OWLUntypedConstant) oi; + if(ouc.hasLang()) + is.add(new UntypedConstant(ouc.getLiteral(), ouc.getLang())); + else + is.add(new UntypedConstant(ouc.getLiteral())); + } + } + // only add individuals using the datatype property + if(is.size()>0) + map.put(i, is); + } + return map; + } + + // OWL API often returns a set of sets of classes, where each inner + // set consists of equivalent classes; this method picks one class + // from each inner set to flatten the set of sets + private TreeSet<Description> getFirstClasses(Set<Set<OWLClass>> setOfSets) { + TreeSet<Description> concepts = new TreeSet<Description>(conceptComparator); + for(Set<OWLClass> innerSet : setOfSets) { + // take one element from the set and ignore the rest + // (TODO: we need to make sure we always ignore the same concepts) + OWLClass concept = innerSet.iterator().next(); + if(concept.isOWLThing()) { + concepts.add(new Thing()); + } else if(concept.isOWLNothing()) { + concepts.add(new Nothing()); + } else { + concepts.add(new NamedClass(concept.getURI().toString())); + } + } + return concepts; + } + + private Set<NamedClass> getFirstClassesNoTopBottom(Set<Set<OWLClass>> setOfSets) { + Set<NamedClass> concepts = new HashSet<NamedClass>(); + for(Set<OWLClass> innerSet : setOfSets) { + // take one element from the set and ignore the rest + // (TODO: we need to make sure we always ignore the same concepts) + OWLClass concept = innerSet.iterator().next(); + if(!concept.isOWLThing() && !concept.isOWLNothing()) + concepts.add(new NamedClass(concept.getURI().toString())); + } + return concepts; + } + + private TreeSet<ObjectProperty> getFirstObjectProperties(Set<Set<OWLObjectProperty>> setOfSets) { + TreeSet<ObjectProperty> roles = new TreeSet<ObjectProperty>(roleComparator); + for(Set<OWLObjectProperty> innerSet : setOfSets) { + // take one element from the set and ignore the rest + // (TODO: we need to make sure we always ignore the same concepts) + OWLObjectProperty property = innerSet.iterator().next(); + roles.add(new ObjectProperty(property.getURI().toString())); + } + return roles; + } + + private TreeSet<DatatypeProperty> getFirstDatatypeProperties(Set<Set<OWLDataProperty>> setOfSets) { + TreeSet<DatatypeProperty> roles = new TreeSet<DatatypeProperty>(roleComparator); + for(Set<OWLDataProperty> innerSet : setOfSets) { + OWLDataProperty property = innerSet.iterator().next(); + roles.add(new DatatypeProperty(property.getURI().toString())); + } + return roles; + } + + @SuppressWarnings({"unused"}) + private Set<Description> owlClassesToAtomicConcepts(Set<OWLClass> owlClasses) { + Set<Description> concepts = new HashSet<Description>(); + for(OWLClass owlClass : owlClasses) + concepts.add(OWLAPIConverter.convertClass(owlClass)); + return concepts; + } + + public static void exportKBToOWL(File owlOutputFile, KB kb, URI ontologyURI) { + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + //URI ontologyURI = URI.create("http://example.com"); + URI physicalURI = owlOutputFile.toURI(); + SimpleURIMapper mapper = new SimpleURIMapper(ontologyURI, physicalURI); + manager.addURIMapper(mapper); + OWLOntology ontology; + try { + ontology = manager.createOntology(ontologyURI); + // OWLAPIReasoner.fillOWLAPIOntology(manager, ontology, kb); + OWLAPIAxiomConvertVisitor.fillOWLOntology(manager, ontology, kb); + manager.saveOntology(ontology); + } catch (OWLOntologyCreationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (UnknownOWLOntologyException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (OWLOntologyStorageException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + /** + * Test + * + * @param args + */ + public static void main(String[] args) { + String uri = "http://www.co-ode.org/ontologies/pizza/2007/02/12/pizza.owl"; + + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + try { + manager.loadOntologyFromPhysicalURI(URI.create(uri)); + new org.mindswap.pellet.owlapi.Reasoner(manager); + System.out.println("Reasoner loaded succesfully."); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * @return the booleanDatatypeProperties + */ + @Override + public SortedSet<DatatypeProperty> getBooleanDatatypePropertiesImpl() { + return booleanDatatypeProperties; + } + + /** + * @return the doubleDatatypeProperties + */ + @Override + public SortedSet<DatatypeProperty> getDoubleDatatypePropertiesImpl() { + return doubleDatatypeProperties; + } + + /** + * @return the intDatatypeProperties + */ + @Override + public SortedSet<DatatypeProperty> getIntDatatypePropertiesImpl() { + return intDatatypeProperties; + } + + + public OWLOntology getOWLAPIOntologies() { + return reasoner.getLoadedOntologies().iterator().next(); + } + + /*public void setReasonerType(String type){ + configurator.setReasonerType(type); + }*/ + +// @Override +// public boolean hasDatatypeSupport() { +// return true; +// } + + @Override + public Set<NamedClass> getInconsistentClassesImpl() { + Set<NamedClass> concepts = new HashSet<NamedClass>(); + + for (OWLClass concept : reasoner.getInconsistentClasses()){ + concepts.add(new NamedClass(concept.getURI().toString())); + } + + return concepts; + } + + + public Set<OWLClass> getInconsistentOWLClasses() { + return reasoner.getInconsistentClasses(); + } + + @Override + @SuppressWarnings("unchecked") + public Set<Constant> getLabelImpl(Entity entity) { + OWLEntity owlEntity = OWLAPIConverter.getOWLAPIEntity(entity); + Set<OWLAnnotation> labelAnnotations = owlEntity.getAnnotations(owlAPIOntologies.get(0), URI.create("http://www.w3.org/2000/01/rdf-schema#label")); + Set<Constant> annotations = new HashSet<Constant>(); + for(OWLAnnotation label : labelAnnotations) { + OWLConstant c = ((OWLLabelAnnotation)label).getAnnotationValue(); + annotations.add(OWLAPIConverter.convertConstant(c)); + } + return annotations; + } + + /* (non-Javadoc) + * @see org.dllearner.core.BaseReasoner#remainsSatisfiable(org.dllearner.core.owl.Axiom) + */ + @Override + public boolean remainsSatisfiableImpl(Axiom axiom) { + boolean consistent = true; + OWLAxiom axiomOWLAPI = OWLAPIAxiomConvertVisitor.convertAxiom(axiom); + + try { + manager.applyChange(new AddAxiom(ontology, axiomOWLAPI)); + } catch (OWLOntologyChangeException e1) { + e1.printStackTrace(); + } + + consistent = reasoner.isConsistent(ontology); + + + try { + manager.applyChange(new RemoveAxiom(ontology, axiomOWLAPI)); + } catch (OWLOntologyChangeException e) { + e.printStackTrace(); + } + + return consistent; + } + + public Reasoner getReasoner() { + return reasoner; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-06-03 16:03:12
|
Revision: 1789 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1789&view=rev Author: lorenz_b Date: 2009-06-03 16:03:06 +0000 (Wed, 03 Jun 2009) Log Message: ----------- added new step to wizard which shows explanations when ontology is inconsistent currently still for testing purpose Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java Added: trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassificationProgressMonitor.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -0,0 +1,117 @@ +package org.dllearner.tools.ore; + +import java.awt.Cursor; +import java.awt.Dimension; + +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.SwingUtilities; + +import org.mindswap.pellet.utils.progress.ProgressMonitor; + +public class ClassificationProgressMonitor extends JPanel implements ProgressMonitor{ + + /** + * + */ + private static final long serialVersionUID = -4913267621100462227L; + private javax.swing.ProgressMonitor monitor; + private JProgressBar progressBar; + private String progressMessage = ""; + private String progressTitle = ""; + private int progress = 0; + private int progressLength = 0; + private int progressPercent = -1; + private long startTime = -1; + private boolean canceled = false; + + + public ClassificationProgressMonitor(){ + super(); + monitor = new javax.swing.ProgressMonitor(this, progressTitle, progressMessage, 0 ,progressLength); + progressBar = new JProgressBar(0, progressLength); + progressBar.setValue(progress); + progressBar.setStringPainted(true); + add(progressBar); + setSize(new Dimension(200, 200)); + + } + + @Override + public int getProgress() { + return progress; + } + + @Override + public int getProgressPercent() { + return progressPercent; + } + + @Override + public void incrementProgress() { + setProgress(progress + 1); + + } + + @Override + public boolean isCanceled() { + return monitor.isCanceled(); + } + + @Override + public void setProgress(int progress) { + this.progress = progress; + updateProgress(); + + } + + @Override + public void setProgressLength(int length) { + progressLength = length; + monitor.setMaximum(length); + progressBar.setMaximum(length); + + } + + @Override + public void setProgressMessage(String message) { + progressMessage = message; + monitor.setNote(message); + + } + + @Override + public void setProgressTitle(String title) { + progressTitle = title; + + } + + @Override + public void taskFinished() { + monitor.close(); + setCursor(null); + + } + + @Override + public void taskStarted() { + setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + + } + + private void updateProgress(){ + SwingUtilities.invokeLater(new Runnable(){ + + @Override + public void run() { + monitor.setProgress(progress); + progressBar.setValue(progress); + + } + + }); + } + + + +} Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationManager.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -138,6 +138,32 @@ } + public Set<Set<OWLAxiom>> getInconsistencyExplanations(){ + Set<Set<OWLAxiom>> explanations = regularExplanationCache.get(dataFactory.getOWLThing()); + if(explanations == null){ + explanations = regularExpGen.getInconsistencyExplanations(); + regularExplanationCache.put(dataFactory.getOWLThing(), explanations); + } + return explanations; + } + + public Set<Set<OWLAxiom>> getLaconicInconsistencyExplanations(){ + OWLClass thing = dataFactory.getOWLThing(); + Set<Set<OWLAxiom>> explanations = laconicExplanationCache.get(thing); + OWLSubClassAxiom unsatAxiom; + if(explanations == null){ + unsatAxiom = dataFactory.getOWLSubClassAxiom(thing, dataFactory.getOWLNothing()); + try { + explanations = laconicExpGen.getExplanations(unsatAxiom); + } catch (ExplanationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + laconicExplanationCache.put(thing, explanations); + } + return explanations; + } + public Set<List<OWLAxiom>> getOrderedUnsatisfiableExplanations(OWLClass unsat){ return getOrderedExplanations(dataFactory.getOWLSubClassAxiom(unsat, dataFactory.getOWLNothing()), @@ -152,6 +178,18 @@ } + public Set<List<OWLAxiom>> getOrderedInconsistencyExplanations(){ + + return getOrderedExplanations(dataFactory.getOWLSubClassAxiom(dataFactory.getOWLThing(), dataFactory.getOWLNothing()), + getInconsistencyExplanations()); + + } + + public Set<List<OWLAxiom>> getOrderedLaconicInconsistencyExplanations(){ + return getOrderedExplanations(dataFactory.getOWLSubClassAxiom(dataFactory.getOWLThing(), dataFactory.getOWLNothing()), + getLaconicInconsistencyExplanations()); + } + public ArrayList<OWLAxiom> getTree2List(Tree<OWLAxiom> tree){ ArrayList<OWLAxiom> ordering = new ArrayList<OWLAxiom>(); ordering.add((OWLAxiom)tree.getUserObject()); @@ -180,7 +218,7 @@ @Override public void ontologiesChanged(List<? extends OWLOntologyChange> changes) - throws OWLException {System.out.println(changes); + throws OWLException { ontologyChanged = true; Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ExplanationPanel.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -25,6 +25,7 @@ import javax.swing.JScrollPane; import javax.swing.JSeparator; import javax.swing.JSplitPane; +import javax.swing.ProgressMonitor; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.event.ListSelectionEvent; @@ -35,16 +36,19 @@ import org.mindswap.pellet.owlapi.PelletReasonerFactory; import org.mindswap.pellet.owlapi.Reasoner; import org.mindswap.pellet.utils.progress.SwingProgressMonitor; +import org.protege.editor.owl.ui.inference.ClassifyAction; import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.inference.OWLReasonerException; import org.semanticweb.owl.model.OWLAxiom; import org.semanticweb.owl.model.OWLClass; -import org.semanticweb.owl.model.OWLException; import org.semanticweb.owl.model.OWLOntology; -import org.semanticweb.owl.model.OWLOntologyChange; -import org.semanticweb.owl.model.OWLOntologyChangeListener; import org.semanticweb.owl.model.OWLOntologyCreationException; import org.semanticweb.owl.model.OWLOntologyManager; +import com.clarkparsia.modularity.AxiomBasedModuleExtractor; +import com.clarkparsia.modularity.IncrementalClassifier; +import com.clarkparsia.modularity.ModuleExtractor; + public class ExplanationPanel extends JPanel implements ListSelectionListener, ActionListener,ImpactManagerListener{ @@ -294,23 +298,32 @@ public static void main(String[] args) { try { - String file = "file:examples/ore/miniEconomy.owl"; - PelletOptions.USE_CLASSIFICATION_MONITOR = PelletOptions.MonitorType.NONE; + String file = "file:examples/ore/tambis.owl"; + PelletOptions.USE_CLASSIFICATION_MONITOR = PelletOptions.MonitorType.SWING; OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.loadOntologyFromPhysicalURI(URI .create(file)); org.mindswap.pellet.utils.progress.ProgressMonitor mon = new SwingProgressMonitor(); + org.mindswap.pellet.utils.progress.ProgressMonitor m = new ClassificationProgressMonitor(); + JFrame fr = new JFrame(); + fr.setSize(new Dimension(400, 400)); + fr.setLayout(new BorderLayout()); + fr.add((JPanel)m); + fr.setVisible(true); PelletReasonerFactory reasonerFactory = new PelletReasonerFactory(); Reasoner reasoner = reasonerFactory.createReasoner(manager); reasoner.loadOntologies(Collections.singleton(ontology)); -// reasoner.getKB().getTaxonomyBuilder().setProgressMonitor(mon); + reasoner.getKB().getTaxonomyBuilder().setProgressMonitor(mon); // mon.taskStarted(); + + reasoner.classify(); -// mon.taskFinished(); + + // try { // String text = "Koala SubclassOf Class: Animal"; // OWLEntityChecker checker = new EntityChecker(manager); @@ -363,7 +376,7 @@ } catch (UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); - } + } } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ImpactManager.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -64,8 +64,8 @@ imp = new HashSet<OWLAxiom>(); impact.put(ax, imp); if(ax != null){ - imp.addAll(ranker.computeImpactOnRemoval(ax)); - imp.addAll(ranker.computeImpactSOS(ax));//computeImpactSOS(actual)); +// imp.addAll(ranker.computeImpactOnRemoval(ax)); + imp.addAll(ranker.computeImpactSOS(ax)); } } return imp; Added: trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanel.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -0,0 +1,132 @@ +package org.dllearner.tools.ore; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.ActionListener; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.ButtonGroup; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import javax.swing.JSplitPane; + +import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.model.OWLAxiom; + +public class InconsistencyExplanationPanel extends JPanel{ + + /** + * + */ + private static final long serialVersionUID = 9206626647697013786L; + + private JSplitPane statsSplitPane; + + private JScrollPane explanationsScrollPane; + private JComponent explanationsPanel; + private JPanel buttonExplanationsPanel; + private JPanel buttonPanel; + private ButtonGroup explanationType; + private JRadioButton regularButton; + private JRadioButton laconicButton; + + private ImpactManager impMan; + private ExplanationManager expMan; + + + public InconsistencyExplanationPanel(ExplanationManager expMan, ImpactManager impMan) { + + this.expMan = expMan; + this.impMan = impMan; + +// impManager.addListener(this); + setLayout(new BorderLayout()); + + Dimension minimumSize = new Dimension(400, 400); + + + explanationsPanel = new Box(1); + + JPanel pan = new JPanel(new BorderLayout()); + pan.add(explanationsPanel, BorderLayout.NORTH); + explanationsScrollPane = new JScrollPane(pan); + explanationsScrollPane.setPreferredSize(minimumSize); + explanationsScrollPane.setBorder(BorderFactory + .createLineBorder(Color.LIGHT_GRAY)); + explanationsScrollPane.getViewport().setOpaque(false); + explanationsScrollPane.getViewport().setBackground(null); + explanationsScrollPane.setOpaque(false); + + regularButton = new JRadioButton("regular", true); + regularButton.setActionCommand("regular"); +// regularButton.addActionListener(this); + laconicButton = new JRadioButton("laconic"); + laconicButton.setActionCommand("laconic"); +// laconicButton.addActionListener(this); + explanationType = new ButtonGroup(); + explanationType.add(regularButton); + explanationType.add(laconicButton); + buttonPanel = new JPanel(); + buttonPanel.add(regularButton); + buttonPanel.add(laconicButton); + + buttonExplanationsPanel = new JPanel(); + buttonExplanationsPanel.setLayout(new BorderLayout()); + buttonExplanationsPanel + .add(explanationsScrollPane, BorderLayout.CENTER); + buttonExplanationsPanel.add(buttonPanel, BorderLayout.NORTH); + + statsSplitPane = new JSplitPane(0); + statsSplitPane.setResizeWeight(1.0D); + statsSplitPane.setTopComponent(buttonExplanationsPanel); + + //repair panel + JPanel repairPanelHolder = new JPanel(); + repairPanelHolder.setOpaque(false); + repairPanelHolder.setLayout(new BorderLayout()); + repairPanelHolder.add(new JLabel("Repair plan"), BorderLayout.NORTH); + RepairPlanPanel repairPanel = new RepairPlanPanel(impMan); + repairPanelHolder.add(repairPanel); + + + statsSplitPane.setBottomComponent(repairPanelHolder); + + statsSplitPane.setBorder(null); + statsSplitPane.setDividerLocation(500); + statsSplitPane.setOneTouchExpandable(true); + + add(statsSplitPane); + + } + + public void clearExplanationsPanel(){ + explanationsPanel.removeAll(); + } + + public void addExplanation(List<OWLAxiom> explanation, int counter){ + ExplanationTable expTable = new ExplanationTable(explanation, impMan, expMan, OWLManager.createOWLOntologyManager().getOWLDataFactory().getOWLThing()); + explanationsPanel.add(new ExplanationTablePanel(expTable, counter)); + + explanationsPanel.add(Box.createVerticalStrut(10)); + explanationsPanel.add(new JSeparator()); + explanationsPanel.add(Box.createVerticalStrut(10)); + this.updateUI(); + } + + public void addActionListeners(ActionListener aL){ + regularButton.addActionListener(aL); + laconicButton.addActionListener(aL); + } + + + + + +} Added: trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/ore/InconsistencyExplanationPanelDescriptor.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -0,0 +1,90 @@ +package org.dllearner.tools.ore; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.List; + +import org.mindswap.pellet.owlapi.Reasoner; +import org.semanticweb.owl.model.OWLAxiom; + +public class InconsistencyExplanationPanelDescriptor extends WizardPanelDescriptor implements ActionListener{ + public static final String IDENTIFIER = "INCONSISTENCY_PANEL"; + public static final String INFORMATION = ""; + + private InconsistencyExplanationPanel panel; + private ExplanationManager expMan; + private ImpactManager impMan; + + public InconsistencyExplanationPanelDescriptor() { + + setPanelDescriptorIdentifier(IDENTIFIER); + + } + + public void init() { + Reasoner reasoner = getWizardModel().getOre().getPelletReasoner() + .getReasoner(); + expMan = ExplanationManager.getExplanationManager(reasoner); + impMan = ImpactManager.getImpactManager(reasoner); + panel = new InconsistencyExplanationPanel(expMan, impMan); + panel.addActionListeners(this); + setPanelComponent(panel); + + + } + + private void showLaconicExplanations() { + panel.clearExplanationsPanel(); + int counter = 1; + for (List<OWLAxiom> explanation : expMan + .getOrderedLaconicInconsistencyExplanations()) { + panel.addExplanation(explanation, counter); + counter++; + } + + } + + private void showRegularExplanations() { + panel.clearExplanationsPanel(); + int counter = 1; + for (List<OWLAxiom> explanation : expMan + .getOrderedInconsistencyExplanations()) { + panel.addExplanation(explanation, counter); + counter++; + } + } + + + + + + @Override + public Object getNextPanelDescriptor() { + return ClassPanelOWLDescriptor.IDENTIFIER; + } + + @Override + public Object getBackPanelDescriptor() { + return null; + } + + @Override + public void aboutToDisplayPanel() { + showRegularExplanations(); + getWizard().getInformationField().setText(INFORMATION); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand().equals("regular")) { + showRegularExplanations(); + } else if (e.getActionCommand().equals("laconic")) { + showLaconicExplanations(); + + } + + } + + +} + \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -21,7 +21,10 @@ package org.dllearner.tools.ore; import java.io.File; +import java.io.IOException; +import java.io.StringWriter; import java.net.MalformedURLException; +import java.net.URL; import java.util.Collection; import java.util.HashSet; import java.util.List; @@ -41,6 +44,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.ComponentFactory; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; @@ -53,14 +57,13 @@ import org.dllearner.learningproblems.EvaluatedDescriptionClass; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.OWLAPIReasoner; +import org.dllearner.reasoning.PelletReasoner; import org.mindswap.pellet.exceptions.InconsistentOntologyException; -import org.mindswap.pellet.owlapi.PelletReasonerFactory; -import org.mindswap.pellet.owlapi.Reasoner; -import org.semanticweb.owl.apibinding.OWLManager; -import org.semanticweb.owl.model.OWLOntology; -import org.semanticweb.owl.model.OWLOntologyCreationException; -import org.semanticweb.owl.model.OWLOntologyManager; +import org.semanticweb.owl.model.OWLAxiom; +import org.semanticweb.owl.model.OWLException; +import com.clarkparsia.explanation.io.manchester.ManchesterSyntaxExplanationRenderer; + /** * This class contains init methods, and is used as broker between wizard and OWL-API. * @author Lorenz Buehmann @@ -69,18 +72,17 @@ public class ORE { private LearningAlgorithm la; - private ReasonerComponent rs; + private KnowledgeSource ks; private LearningProblem lp; private ComponentManager cm; private ReasonerComponent fastReasoner; - private ReasonerComponent owlReasoner; - private SortedSet<Individual> posExamples; - private SortedSet<Individual> negExamples; + private PelletReasoner pelletReasoner; - private NamedClass classToLearn; + + private NamedClass class2Learn; private EvaluatedDescriptionClass newClassDescription; @@ -116,6 +118,7 @@ // TODO Auto-generated catch block e1.printStackTrace(); } + try { ks.init(); @@ -126,24 +129,26 @@ } - public boolean consistentOntology() throws InconsistentOntologyException{ - boolean consistent = true; + public void initPelletReasoner(){ + pelletReasoner = cm.reasoner(PelletReasoner.class, ks); try { - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLOntology ont = manager.loadOntology(owlFile.toURI()); - Reasoner reasoner = new PelletReasonerFactory().createReasoner(manager); - reasoner.loadOntology(ont); - - consistent = reasoner.isConsistent(); - } catch (OWLOntologyCreationException e) { + pelletReasoner.init(); + } catch (ComponentInitException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - return consistent; + pelletReasoner.loadOntologies(); } + public boolean consistentOntology() throws InconsistentOntologyException{ + return pelletReasoner.isConsistent(); + } + public PelletReasoner getPelletReasoner(){ + return pelletReasoner; + } + + /** * Initialize the reasoners. */ @@ -156,33 +161,36 @@ // TODO Auto-generated catch block e.printStackTrace(); } + pelletReasoner.loadOntologies(); + pelletReasoner.classify(); + modifier = new OntologyModifier(pelletReasoner); + baseURI = fastReasoner.getBaseURI(); + prefixes = fastReasoner.getPrefixes(); - - - owlReasoner = cm.reasoner(OWLAPIReasoner.class, ks); + } + + public String getInconsistencyExplanationsString(){ + ManchesterSyntaxExplanationRenderer renderer = new ManchesterSyntaxExplanationRenderer(); + StringWriter buffer = new StringWriter(); + renderer.startRendering(buffer); try { - owlReasoner.init(); - } catch (ComponentInitException e) { + renderer.render(getInconsistencyExplanations()); + } catch (UnsupportedOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); + } catch (OWLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); } - modifier = new OntologyModifier(owlReasoner, rs); - baseURI = fastReasoner.getBaseURI(); - prefixes = fastReasoner.getPrefixes(); - + renderer.endRendering(); + return buffer.toString(); } - - - - public void setPosNegExamples(){ - posExamples = owlReasoner.getIndividuals(classToLearn); - negExamples = owlReasoner.getIndividuals(); - - - for (Individual pos : posExamples){ - negExamples.remove(pos); - } + private Set<Set<OWLAxiom>> getInconsistencyExplanations(){ + return pelletReasoner.getInconsistencyReasons(); } @@ -204,17 +212,15 @@ return prefixes; } - public ReasonerComponent getOwlReasoner() { - return owlReasoner; - } public ReasonerComponent getFastReasoner() { return fastReasoner; } public void setLearningProblem(){ - lp = cm.learningProblem(ClassLearningProblem.class, fastReasoner); - cm.applyConfigEntry(lp, "classToDescribe", classToLearn.toString()); + + lp = ComponentFactory.getClassLearningProblem(fastReasoner, getClass2LearnAsURL()); + try { lp.init(); } catch (ComponentInitException e) { @@ -223,6 +229,18 @@ } } + private URL getClass2LearnAsURL(){ + URL classURL = null; + try { + classURL = new URL(class2Learn.toString()); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return classURL; + + } + public void setNoise(double noise){ System.out.println("setze noise auf" + noise); cm.applyConfigEntry(la, "noisePercentage", noise); @@ -236,20 +254,16 @@ } public void setLearningAlgorithm(){ + try { - la = cm.learningAlgorithm(CELOE.class, lp, fastReasoner); + la = ComponentFactory.getCELOE(lp, fastReasoner); cm.applyConfigEntry(la, "useNegation", false); } catch (LearningProblemUnsupportedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } - - Set<String> t = new TreeSet<String>(); - - - t.add(classToLearn.getName()); -// cm.applyConfigEntry(la, "ignoredConcepts", t); -// cm.applyConfigEntry(la, "guaranteeXgoodDescriptions", 10); + + try { la.init(); } catch (ComponentInitException e) { @@ -261,21 +275,14 @@ /** * Sets the class that has to be learned. - * @param oldClass class that is choosen to be (re)learned + * @param oldClass class that is chosen to be (re)learned */ - public void setClassToLearn(NamedClass oldClass){ - this.classToLearn = oldClass; + public void setClassToLearn(NamedClass class2Learn){ + this.class2Learn = class2Learn; } public void init(){ -// try { -// owlReasoner.init(); -// fastReasoner.init(); -// } catch (ComponentInitException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } - this.setPosNegExamples(); + this.setLearningProblem(); this.setLearningAlgorithm(); @@ -286,10 +293,7 @@ * */ public void start(){ - Set<String> t = new TreeSet<String>(); -// t.add(classToLearn.getName()); -// cm.applyConfigEntry(la, "ignoredConcepts", t); -// cm.applyConfigEntry(la, "noisePercentage", noise); + try { la.init(); } catch (ComponentInitException e) { @@ -310,7 +314,7 @@ } public NamedClass getIgnoredConcept() { - return classToLearn; + return class2Learn; } @@ -325,7 +329,7 @@ Set<Description> criticals = new HashSet<Description>(); List<Description> children = desc.getChildren(); - if(owlReasoner.hasType(desc, ind)){ + if(pelletReasoner.hasType(desc, ind)){ if(children.size() >= 2){ @@ -335,7 +339,7 @@ } } else if(desc instanceof Union){ for(Description d: children){ - if(owlReasoner.hasType(d, ind)){ + if(pelletReasoner.hasType(d, ind)){ criticals.addAll(getNegCriticalDescriptions(ind, d)); } } @@ -468,7 +472,7 @@ */ public Set<Individual> getIndividualsInPropertyRange(ObjectQuantorRestriction objRestr, Individual ind){ - Set<Individual> individuals = owlReasoner.getIndividuals(objRestr.getChild(0)); + Set<Individual> individuals = pelletReasoner.getIndividuals(objRestr.getChild(0)); individuals.remove(ind); return individuals; @@ -484,7 +488,7 @@ Set<Individual> allIndividuals = new HashSet<Individual>(); - for(Individual i : owlReasoner.getIndividuals()){ + for(Individual i : pelletReasoner.getIndividuals()){ // try { if(!fastReasoner.hasType(objRestr.getChild(0), i)){ @@ -507,12 +511,12 @@ */ public Set<NamedClass> getpossibleClassesMoveTo(Individual ind){ Set<NamedClass> moveClasses = new HashSet<NamedClass>(); - for(NamedClass nc : owlReasoner.getNamedClasses()){ - if(!owlReasoner.hasType(nc, ind)){ + for(NamedClass nc : pelletReasoner.getNamedClasses()){ + if(!pelletReasoner.hasType(nc, ind)){ moveClasses.add(nc); } } - moveClasses.remove(classToLearn); + moveClasses.remove(class2Learn); return moveClasses; } @@ -524,12 +528,12 @@ */ public Set<NamedClass> getpossibleClassesMoveFrom(Individual ind){ Set<NamedClass> moveClasses = new HashSet<NamedClass>(); - for(NamedClass nc : owlReasoner.getNamedClasses()){ - if(owlReasoner.hasType(nc, ind)){ + for(NamedClass nc : pelletReasoner.getNamedClasses()){ + if(pelletReasoner.hasType(nc, ind)){ moveClasses.add(nc); } } - moveClasses.remove(classToLearn); + moveClasses.remove(class2Learn); return moveClasses; } @@ -545,10 +549,10 @@ // TODO Auto-generated catch block e.printStackTrace(); } - owlReasoner = cm.reasoner(OWLAPIReasoner.class, new OWLAPIOntology(modifier.getOntology())); + try { - owlReasoner.init(); + pelletReasoner.init(); } catch (ComponentInitException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -563,19 +567,20 @@ * @param ind */ public Set<NamedClass> getComplements(Description desc, Individual ind){ -// System.out.println("----------------" + desc + "---------------"); + Set<NamedClass> complements = new HashSet<NamedClass>(); - for(NamedClass nc : owlReasoner.getNamedClasses()){ + System.out.println(pelletReasoner.getComplementClasses(desc)); + for(NamedClass nc : pelletReasoner.getNamedClasses()){ if(!(nc.toString().endsWith("Thing"))){ - if(owlReasoner.hasType(nc, ind)){ + if(pelletReasoner.hasType(nc, ind)){ if(modifier.isComplement(desc, nc)){ complements.add(nc); } } } } - System.out.println("Disjunkt sind: " + complements); + return complements; } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -28,7 +28,6 @@ import java.util.List; import java.util.Set; -import org.dllearner.core.ReasonerComponent; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; @@ -37,6 +36,7 @@ import org.dllearner.core.owl.ObjectPropertyAssertion; import org.dllearner.core.owl.ObjectQuantorRestriction; import org.dllearner.reasoning.OWLAPIReasoner; +import org.dllearner.reasoning.PelletReasoner; import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; import org.mindswap.pellet.owlapi.Reasoner; import org.semanticweb.owl.apibinding.OWLManager; @@ -75,18 +75,18 @@ public class OntologyModifier { private OWLOntology ontology; - private ReasonerComponent reasoner; + private PelletReasoner reasoner; private OWLDataFactory factory; private OWLOntologyManager manager; - private ReasonerComponent rs; - public OntologyModifier(ReasonerComponent reasoner, ReasonerComponent rs){ + + public OntologyModifier(PelletReasoner reasoner){ this.reasoner = reasoner; - this.manager = OWLManager.createOWLOntologyManager(); + this.manager = reasoner.getOWLOntologyManager(); this.factory = manager.getOWLDataFactory(); - this.ontology = ((OWLAPIReasoner)reasoner).getOWLAPIOntologies().get(0); - this.rs = rs; + this.ontology = (reasoner.getOWLAPIOntologies()); + } /** @@ -595,7 +595,7 @@ } OWLDebugger debugger = new BlackBoxOWLDebugger(manager, ontology, checker); - for(OWLClass owlClass : ((OWLAPIReasoner)reasoner).getInconsistentOWLClasses()){ + for(OWLClass owlClass : reasoner.getInconsistentOWLClasses()){ /* Find the sets of support and print them */ Set<Set<OWLAxiom>> allsos = null; try { Modified: trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -99,7 +99,7 @@ DefaultListModel posModel = repairPanel.getPosFailureModel(); posModel.clear();System.out.println(ore.getNewClassDescription().getCoveredInstances()); - Set<Individual> posNotCovered = ore.getOwlReasoner().getIndividuals(ore.getIgnoredConcept()); + Set<Individual> posNotCovered = ore.getPelletReasoner().getIndividuals(ore.getIgnoredConcept()); posNotCovered.removeAll(ore.getNewClassDescription().getCoveredInstances()); for(Individual ind : posNotCovered){ posModel.addElement(ind); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -100,7 +100,7 @@ classPane = new JXTaskPane(); classPane.setTitle("Classes"); - oldClasses = ore.getOwlReasoner().getTypes(ind); + oldClasses = ore.getPelletReasoner().getTypes(ind); for(NamedClass nc : oldClasses){ classPane.add(new JLabel(nc.toManchesterSyntaxString(baseURI, prefixes))); } @@ -154,7 +154,7 @@ classPane.removeAll(); Set<String> newClassesString = new HashSet<String>(); - for (NamedClass nc : ore.getOwlReasoner().getTypes(ind)){ + for (NamedClass nc : ore.getPelletReasoner().getTypes(ind)){ newClassesString.add(nc.toManchesterSyntaxString(baseURI, prefixes)); } Set<String> oldClassesString = new HashSet<String>(); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -21,22 +21,21 @@ package org.dllearner.tools.ore; +import java.awt.Dimension; import java.awt.event.ActionListener; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; -import java.util.logging.Level; import javax.swing.DefaultListModel; -import javax.swing.Icon; +import javax.swing.JDialog; import javax.swing.JOptionPane; +import javax.swing.JProgressBar; +import javax.swing.SwingUtilities; import javax.swing.SwingWorker; -import javax.swing.UIManager; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.NamedClass; -import org.jdesktop.swingx.JXErrorPane; -import org.jdesktop.swingx.error.ErrorInfo; import org.semanticweb.owl.model.OWLOntologyChange; /** @@ -96,20 +95,30 @@ WizardPanelDescriptor nextDescriptor = model.getPanelHashMap().get(nextPanelDescriptor); if(nextPanelDescriptor.equals("CLASS_CHOOSE_OWL_PANEL")){ -// model.getOre().getOwlReasoner().isSatisfiable() + ore.initPelletReasoner(); + if(!ore.consistentOntology()){ - Exception e = new Exception("ff"); - ErrorInfo info = new ErrorInfo("Inconsistent ontology", "2", "3", null, e, Level.ALL, null); - JXErrorPane error = new JXErrorPane(); - Icon icon = UIManager.getIcon("JOptionPane.errorIcon"); - error.setErrorInfo(info); - error.setIcon(icon);System.out.println(icon); - JXErrorPane.showDialog(wizard.getDialog(), error); + int n = showInconsistentOntologyWarning(); + + if(n == JOptionPane.NO_OPTION){ + nextPanelDescriptor = KnowledgeSourcePanelDescriptor.IDENTIFIER; + } else { + InconsistencyExplanationPanelDescriptor incDescriptor = new InconsistencyExplanationPanelDescriptor(); + wizard.registerWizardPanel(InconsistencyExplanationPanelDescriptor.IDENTIFIER, incDescriptor); + ((InconsistencyExplanationPanelDescriptor)model.getPanelHashMap().get(InconsistencyExplanationPanelDescriptor.IDENTIFIER)).init(); + incDescriptor.init(); + wizard.registerWizardPanel(InconsistencyExplanationPanelDescriptor.IDENTIFIER, incDescriptor); + nextPanelDescriptor = InconsistencyExplanationPanelDescriptor.IDENTIFIER; + } + + + } else { + ((ClassPanelOWLDescriptor) nextDescriptor).getOwlClassPanel().getModel().clear(); + new ConceptRetriever(nextPanelDescriptor).execute(); } - ((ClassPanelOWLDescriptor) nextDescriptor).getOwlClassPanel().getModel().clear(); - new ConceptRetriever(nextPanelDescriptor).execute(); + } if(nextPanelDescriptor.equals("LEARNING_PANEL")){ @@ -229,8 +238,41 @@ } + + private int showInconsistentOntologyWarning(){ +// Exception e = new Exception("ff"); + String infoString = "<html>Can not do reasoning with inconsistent ontologies, " + + "since everything is equivalent to owl:nothing\n" + + "<ul>" + + "<li>Press 'Yes' and try to repair the ontology</li>" + + "<li>Press 'No' and choose another ontology or exit</li>" + + "</ul></html>"; +// ErrorInfo info = new ErrorInfo("Warning: Inconsistent ontology.",infoString , wizard.getModel().getOre().getInconsistencyExplanationsString(), null, e, Level.ALL, null); +// JXErrorPane error = new JXErrorPane(); +// Icon icon = UIManager.getIcon("OptionPane.warningIcon"); +// error.setErrorInfo(info); +// error.setIcon(icon); +// JXErrorPane.showDialog(wizard.getDialog(), error); + + Object[] options = {"Yes", + "No"}; + int n = JOptionPane.showOptionDialog(wizard.getDialog(), + infoString, + "Inconsistent ontology loaded!", + JOptionPane.YES_NO_OPTION, + JOptionPane.WARNING_MESSAGE, + null, //do not use a custom Icon + options, //the titles of buttons + options[0]); //default button title + + return n; + + } + + + void resetButtonsToPanelRules() { // Reset the buttons to support the original panel rules, @@ -298,10 +340,10 @@ // owlClassPanel.getList().setCellRenderer(new ColorListCellRenderer(wizard.getModel().getOre())); wizard.getModel().getOre().initReasoners(); + + Set<NamedClass> classes = wizard.getModel().getOre().getPelletReasoner().getNamedClasses(); + - Set<NamedClass> classes = wizard.getModel().getOre().getOwlReasoner().getNamedClasses(); - unsatClasses = wizard.getModel().getOre().getOwlReasoner().getInconsistentClasses(); - return classes; } @@ -336,6 +378,13 @@ } } + + + + + + + Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java 2009-06-03 14:14:07 UTC (rev 1788) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/AxiomRanker.java 2009-06-03 16:03:06 UTC (rev 1789) @@ -212,6 +212,9 @@ } } } + for(OWLAxiom ax : result){ + System.out.println(reasoner.isEntailed(axiom)); + } return result; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-06-03 14:14:45
|
Revision: 1788 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1788&view=rev Author: kurzum Date: 2009-06-03 14:14:07 +0000 (Wed, 03 Jun 2009) Log Message: ----------- Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java Modified: trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2009-06-03 10:08:20 UTC (rev 1787) +++ trunk/src/dl-learner/org/dllearner/kb/extraction/ExtractionAlgorithm.java 2009-06-03 14:14:07 UTC (rev 1788) @@ -130,15 +130,17 @@ if(configuration.isGetPropertyInformation() ){ + collectNodes.add(seedNode); Monitor m = JamonMonitorLogger.getTimeMonitor(ExtractionAlgorithm.class, "TimeGetPropertyInformation").start(); List<ObjectPropertyNode> objectProperties = getObjectPropertyNodes(collectNodes); + logger.info("Get info for "+objectProperties.size() + " objectProperties"); for (ObjectPropertyNode node : objectProperties) { collectNodes.addAll(node.expandProperties(tupleAquisitor, configuration.getManipulator())); } List<DatatypePropertyNode> datatypeProperties = getDatatypeProperties(collectNodes); + logger.info("Get info for "+datatypeProperties.size() + " datatypeProperties"); for (DatatypePropertyNode node : datatypeProperties) { collectNodes.addAll(node.expandProperties(tupleAquisitor, configuration.getManipulator())); - //System.out.println(node+""+collectNodes.size()); } m.stop(); } @@ -282,7 +284,6 @@ for (Node node : l) { if (node instanceof InstanceNode) { properties.addAll(( (InstanceNode) node).getDatatypePropertyNode()); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-06-03 10:08:26
|
Revision: 1787 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1787&view=rev Author: kurzum Date: 2009-06-03 10:08:20 +0000 (Wed, 03 Jun 2009) Log Message: ----------- added useLiterals Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-03 09:45:55 UTC (rev 1786) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-03 10:08:20 UTC (rev 1787) @@ -58,6 +58,10 @@ private boolean literals = false; + public void setLiterals(boolean literals) { + this.literals = literals; + } + public SparqlQueryMaker(Set<String> objectFilterList, Set<String> predicateFilterList, boolean literals) { super(); @@ -190,6 +194,8 @@ terms = new ArrayList<String>(); terms.add(assembled); if (!isLiterals()) { + System.out.println(isLiterals()+"true"); + System.exit(0); terms.add("!isLiteral(" + objectVariable + ")"); } return assembleTerms(terms, "&&"); @@ -383,11 +389,13 @@ String dbont = "http://dbpedia.org/ontology/"; sqm.addPredicateFilter(dbont); + sqm.addPredicateFilter(OWLVocabulary.RDFS_range); + sqm.addPredicateFilter(OWLVocabulary.RDFS_domain); sqm.addPredicateObjectFilter(dbont, dbont); sqm.addPredicateObjectFilter(OWLVocabulary.RDF_TYPE, dbont); sqm.addPredicateObjectFilter(OWLVocabulary.RDFS_SUBCLASS_OF, dbont); + sqm.setLiterals(true); - // pred.add("http://dbpedia.org/property/wikipage"); // pred.add("http://dbpedia.org/property/wikiPageUsesTemplate"); // pred.add("http://dbpedia.org/property/relatedInstance"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-03 09:45:57
|
Revision: 1786 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1786&view=rev Author: jenslehmann Date: 2009-06-03 09:45:55 +0000 (Wed, 03 Jun 2009) Log Message: ----------- suggestion test Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java trunk/src/php-examples/Suggestions.php Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-02 17:12:23 UTC (rev 1785) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-03 09:45:55 UTC (rev 1786) @@ -373,7 +373,8 @@ } public static SparqlQueryMaker getDBpediaNavigatorFilter() { - SparqlQueryMaker sqm = new SparqlQueryMaker("allow", new TreeSet<String>(), new TreeSet<String>(), false); +// SparqlQueryMaker sqm = new SparqlQueryMaker("allow", new TreeSet<String>(), new TreeSet<String>(), false); + SparqlQueryMaker sqm = new SparqlQueryMaker("allow", new TreeSet<String>(), new TreeSet<String>(), true); // sqm.addPredicateFilter("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); // sqm.addPredicateFilter("http://www.w3.org/2000/01/rdf-schema#subClassOf"); // sqm.addPredicateFilter("http://www.w3.org/2003/01/geo/wgs84_pos#lat"); Modified: trunk/src/php-examples/Suggestions.php =================================================================== --- trunk/src/php-examples/Suggestions.php 2009-06-02 17:12:23 UTC (rev 1785) +++ trunk/src/php-examples/Suggestions.php 2009-06-03 09:45:55 UTC (rev 1786) @@ -24,8 +24,10 @@ $client->applyConfigEntryStringArray($id, $ksID, "instances", $instances); $client->applyConfigEntryString($id, $ksID, "predefinedFilter", "DBPEDIA-NAVIGATOR"); $client->applyConfigEntryString($id, $ksID, "predefinedEndpoint", "LOCALDBPEDIA"); -$client->applyConfigEntryString($id, $ksID, "predefinedManipulator", "DBPEDIA-NAVIGATOR"); +// $client->applyConfigEntryString($id, $ksID, "predefinedManipulator", "DBPEDIA-NAVIGATOR"); $client->applyConfigEntryBoolean($id, $ksID, "saveExtractedFragment", true); +// $client->applyConfigEntryBoolean($id, $ksID, "useLits", true); +$client->applyConfigEntryBoolean($id, $ksID, "getPropertyInformation", true); $rID = $client->setReasoner($id, "fastInstanceChecker"); @@ -33,6 +35,9 @@ $client->setPositiveExamples($id, $examples); $laID = $client->setLearningAlgorithm($id, "celoe"); +$client->applyConfigEntryInt($id, $laID, "maxExecutionTimeInSeconds", 1); +$client->applyConfigEntryBoolean($id, $laID, "useHasValueConstructor", true); +$client->applyConfigEntryInt($id, $laID, "valueFrequencyThreshold", 2); $client->initAll($id); @@ -43,19 +48,27 @@ echo '</p>'; echo '<p>Additional instances:<br />'; -foreach($relatedinstances as $related) { +foreach($relatedInstances as $related) { echo $related.'<br />'; } echo '</p>'; -echo 'start learning ... '; -$concepts = $client->learnDescriptionsEvaluated($id, 5); -echo 'OK <br />'; +echo '<p>start learning ... '; +$startTime = microtime(true); +$concepts = $client->learnDescriptionsEvaluated($id, 10); +$runTime = microtime(true) - $startTime; +echo 'OK ('.$runTime.' seconds)</p>'; $concepts = json_decode($concepts); +// var_dump($concepts); + +echo '<table border="1px"><tr><td><i>natural description</i></td><td><i>Manchester OWL Syntax</i></td><td><i>accuracy</i></td></tr>'; foreach($concepts as $concept) { - echo $concept; + $natural = $client->getNaturalDescription($id, $concept->descriptionKBSyntax); + // echo $natural . '(Manchester: ' . $concept->descriptionManchesterSyntax . ', acc. ' . $concept->scoreValue . ')<br />'; ; + echo '<tr><td>'.$natural.'</td><td>'.$concept->descriptionManchesterSyntax.'</td><td>'.$concept->scoreValue.'</td></tr>'; } +echo '</table>'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-06-02 17:12:25
|
Revision: 1785 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1785&view=rev Author: kurzum Date: 2009-06-02 17:12:23 +0000 (Tue, 02 Jun 2009) Log Message: ----------- new type of filter in SPARQL query maker fixes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-02 15:49:01 UTC (rev 1784) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQueryMaker.java 2009-06-02 17:12:23 UTC (rev 1785) @@ -24,6 +24,9 @@ import java.util.Set; import java.util.TreeSet; +import org.dllearner.utilities.datastructures.StringTuple; +import org.dllearner.utilities.owl.OWLVocabulary; + /** * Can assemble sparql queries. can make queries for subject, predicate, object * according to the filter settings object SparqlQueryType, which gives the @@ -50,6 +53,8 @@ private Set<String> objectFilterList; private Set<String> predicateFilterList; + + private Set<StringTuple> predicateobjectFilterList; private boolean literals = false; @@ -58,6 +63,7 @@ super(); this.objectFilterList = objectFilterList; this.predicateFilterList = predicateFilterList; + this.predicateobjectFilterList = new TreeSet<StringTuple>(); this.literals = literals; } @@ -158,10 +164,18 @@ : "?" + objectVariable; List<String> terms = new ArrayList<String>(); - if (!isLiterals()) { - terms.add("!isLiteral(" + objectVariable + ")"); + String not = (isAllowMode()) ? "" : "!"; + /*new filter type */ + + for (StringTuple tuple : getPredicateObjectFilterList()) { + List<String> tmpterms = new ArrayList<String>(); + tmpterms.add(not + "regex(str(" + predicateVariable + "), '" + tuple.a+ "')"); + tmpterms.add(not + "regex(str(" + objectVariable + "), '" + tuple.b+ "')"); + terms.add(assembleTerms(tmpterms, "&&")); } - String not = (isAllowMode()) ? "" : "!"; + + + for (String pred : getPredicateFilterList()) { terms.add(not + "regex(str(" + predicateVariable + "), '" + pred + "')"); @@ -171,19 +185,36 @@ .add(not + "regex(str(" + objectVariable + "), '" + obj + "')"); } + String assembled = assembleTerms(terms, getOperator()); + + terms = new ArrayList<String>(); + terms.add(assembled); + if (!isLiterals()) { + terms.add("!isLiteral(" + objectVariable + ")"); + } + return assembleTerms(terms, "&&"); + - return assembleTerms(terms); - } + + private String getOperator(){ + return (isAllowMode())?"||":"&&"; + + } - private String assembleTerms(List<String> terms) { + + private String assembleTerms(List<String> terms, String operator) { + if((!operator.equals("||")) && (!operator.equals("&&"))){ + System.out.println("in SparqlQuerymaker assembleTerms recieved wrong operator"); + System.exit(0); + } + if (terms.isEmpty()) return ""; else if (terms.size() == 1) return brackets(terms.get(0)); else { StringBuffer sbuf = new StringBuffer(1400); - String operator = (isAllowMode()) ? "||" : "&&"; String first = terms.remove(0); sbuf.append(brackets(first)); for (String term : terms) { @@ -214,6 +245,9 @@ public Set<String> getPredicateFilterList() { return predicateFilterList; } + public Set<StringTuple> getPredicateObjectFilterList() { + return predicateobjectFilterList; + } public void addPredicateFilter(String newFilter) { assembled = false; @@ -224,6 +258,10 @@ assembled = false; objectFilterList.add(newFilter); } + public void addPredicateObjectFilter(String pred, String object) { + assembled = false; + predicateobjectFilterList.add(new StringTuple(pred, object)); + } public void combineWith(SparqlQueryMaker sqm){ predicateFilterList.addAll(sqm.predicateFilterList); @@ -336,11 +374,19 @@ public static SparqlQueryMaker getDBpediaNavigatorFilter() { SparqlQueryMaker sqm = new SparqlQueryMaker("allow", new TreeSet<String>(), new TreeSet<String>(), false); - sqm.addPredicateFilter("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); - sqm.addPredicateFilter("http://www.w3.org/2000/01/rdf-schema#subClassOf"); - sqm.addPredicateFilter("http://www.w3.org/2003/01/geo/wgs84_pos#lat"); - sqm.addPredicateFilter("http://www.w3.org/2003/01/geo/wgs84_pos#long"); - sqm.addPredicateFilter("http://www.w3.org/2000/01/rdf-schema#label"); +// sqm.addPredicateFilter("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); +// sqm.addPredicateFilter("http://www.w3.org/2000/01/rdf-schema#subClassOf"); +// sqm.addPredicateFilter("http://www.w3.org/2003/01/geo/wgs84_pos#lat"); +// sqm.addPredicateFilter("http://www.w3.org/2003/01/geo/wgs84_pos#long"); +// sqm.addPredicateFilter("http://www.w3.org/2000/01/rdf-schema#label"); + + String dbont = "http://dbpedia.org/ontology/"; + sqm.addPredicateFilter(dbont); + sqm.addPredicateObjectFilter(dbont, dbont); + sqm.addPredicateObjectFilter(OWLVocabulary.RDF_TYPE, dbont); + sqm.addPredicateObjectFilter(OWLVocabulary.RDFS_SUBCLASS_OF, dbont); + + // pred.add("http://dbpedia.org/property/wikipage"); // pred.add("http://dbpedia.org/property/wikiPageUsesTemplate"); // pred.add("http://dbpedia.org/property/relatedInstance"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-06-02 15:49:07
|
Revision: 1784 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1784&view=rev Author: jenslehmann Date: 2009-06-02 15:49:01 +0000 (Tue, 02 Jun 2009) Log Message: ----------- WSDL files Modified Paths: -------------- trunk/src/php-examples/Suggestions.php Added Paths: ----------- trunk/src/php-examples/def0.xsd trunk/src/php-examples/def1.xsd trunk/src/php-examples/main.wsdl Property Changed: ---------------- trunk/src/php-examples/ Property changes on: trunk/src/php-examples ___________________________________________________________________ Modified: svn:ignore - *.xsd main.wsdl + Modified: trunk/src/php-examples/Suggestions.php =================================================================== --- trunk/src/php-examples/Suggestions.php 2009-06-02 14:27:09 UTC (rev 1783) +++ trunk/src/php-examples/Suggestions.php 2009-06-02 15:49:01 UTC (rev 1784) @@ -22,7 +22,7 @@ $relatedInstances = array('http://dbpedia.org/resource/Berlin','http://dbpedia.org/resource/London'); $instances = array_merge($examples, $relatedInstances); $client->applyConfigEntryStringArray($id, $ksID, "instances", $instances); -// $client->applyConfigEntryString($id, $ksID, "predefinedFilter", "DBPEDIA-NAVIGATOR"); +$client->applyConfigEntryString($id, $ksID, "predefinedFilter", "DBPEDIA-NAVIGATOR"); $client->applyConfigEntryString($id, $ksID, "predefinedEndpoint", "LOCALDBPEDIA"); $client->applyConfigEntryString($id, $ksID, "predefinedManipulator", "DBPEDIA-NAVIGATOR"); $client->applyConfigEntryBoolean($id, $ksID, "saveExtractedFragment", true); Added: trunk/src/php-examples/def0.xsd =================================================================== --- trunk/src/php-examples/def0.xsd (rev 0) +++ trunk/src/php-examples/def0.xsd 2009-06-02 15:49:01 UTC (rev 1784) @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. --><xs:schema xmlns:tns="http://server.dllearner.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://server.dllearner.org/"> + +<xs:element name="ClientNotKnownException" type="tns:ClientNotKnownException"></xs:element> + +<xs:element name="ComponentInitException" type="tns:ComponentInitException"></xs:element> + +<xs:element name="ConfigOptionTypeException" type="tns:ConfigOptionTypeException"></xs:element> + +<xs:element name="LearningProblemUnsupportedException" type="tns:LearningProblemUnsupportedException"></xs:element> + +<xs:element name="MalformedURLException" type="tns:MalformedURLException"></xs:element> + +<xs:element name="ParseException" type="tns:ParseException"></xs:element> + +<xs:element name="SparqlQueryException" type="tns:SparqlQueryException"></xs:element> + +<xs:element name="UnknownComponentException" type="tns:UnknownComponentException"></xs:element> + +<xs:complexType name="ParseException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="ClientNotKnownException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="SparqlQueryException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="UnknownComponentException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="ConfigOptionTypeException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="ComponentInitException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="LearningProblemUnsupportedException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="MalformedURLException"> +<xs:sequence> +<xs:element name="message" type="xs:string" minOccurs="0"></xs:element> +</xs:sequence> +</xs:complexType> +</xs:schema> \ No newline at end of file Added: trunk/src/php-examples/def1.xsd =================================================================== --- trunk/src/php-examples/def1.xsd (rev 0) +++ trunk/src/php-examples/def1.xsd 2009-06-02 15:49:01 UTC (rev 1784) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. --><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxb.dev.java.net/array"> + +<xs:complexType name="stringArray" final="#all"> +<xs:sequence> +<xs:element name="item" type="xs:string" minOccurs="0" maxOccurs="unbounded" nillable="true"></xs:element> +</xs:sequence> +</xs:complexType> + +<xs:complexType name="intArray" final="#all"> +<xs:sequence> +<xs:element name="item" type="xs:int" minOccurs="0" maxOccurs="unbounded" nillable="true"></xs:element> +</xs:sequence> +</xs:complexType> +</xs:schema> \ No newline at end of file Added: trunk/src/php-examples/main.wsdl =================================================================== --- trunk/src/php-examples/main.wsdl (rev 0) +++ trunk/src/php-examples/main.wsdl 2009-06-02 15:49:01 UTC (rev 1784) @@ -0,0 +1,1468 @@ +<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. --><definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://server.dllearner.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://server.dllearner.org/" name="DLLearnerWSService"> +<types> +<xsd:schema> +<xsd:import namespace="http://server.dllearner.org/" schemaLocation="def0.xsd"></xsd:import> +</xsd:schema> +<xsd:schema> +<xsd:import namespace="http://jaxb.dev.java.net/array" schemaLocation="def1.xsd"></xsd:import> +</xsd:schema> +</types> +<message name="init"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="initResponse"></message> +<message name="ClientNotKnownException"> +<part name="fault" element="tns:ClientNotKnownException"></part> +</message> +<message name="UnknownComponentException"> +<part name="fault" element="tns:UnknownComponentException"></part> +</message> +<message name="ComponentInitException"> +<part name="fault" element="tns:ComponentInitException"></part> +</message> +<message name="stop"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="stopResponse"></message> +<message name="getBuild"></message> +<message name="getBuildResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="ping"></message> +<message name="pingResponse"> +<part name="return" type="xsd:boolean"></part> +</message> +<message name="generateID"></message> +<message name="generateIDResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="getComponents"></message> +<message name="getComponentsResponse"> +<part xmlns:ns1="http://jaxb.dev.java.net/array" name="return" type="ns1:stringArray"></part> +</message> +<message name="getKnowledgeSources"></message> +<message name="getKnowledgeSourcesResponse"> +<part xmlns:ns2="http://jaxb.dev.java.net/array" name="return" type="ns2:stringArray"></part> +</message> +<message name="getReasoners"></message> +<message name="getReasonersResponse"> +<part xmlns:ns3="http://jaxb.dev.java.net/array" name="return" type="ns3:stringArray"></part> +</message> +<message name="getLearningProblems"></message> +<message name="getLearningProblemsResponse"> +<part xmlns:ns4="http://jaxb.dev.java.net/array" name="return" type="ns4:stringArray"></part> +</message> +<message name="getLearningAlgorithms"></message> +<message name="getLearningAlgorithmsResponse"> +<part xmlns:ns5="http://jaxb.dev.java.net/array" name="return" type="ns5:stringArray"></part> +</message> +<message name="getConfigOptions"> +<part name="arg0" type="xsd:string"></part> +<part name="arg1" type="xsd:boolean"></part> +</message> +<message name="getConfigOptionsResponse"> +<part xmlns:ns6="http://jaxb.dev.java.net/array" name="return" type="ns6:stringArray"></part> +</message> +<message name="addKnowledgeSource"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="addKnowledgeSourceResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="MalformedURLException"> +<part name="fault" element="tns:MalformedURLException"></part> +</message> +<message name="removeKnowledgeSource"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="removeKnowledgeSourceResponse"></message> +<message name="setReasoner"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +</message> +<message name="setReasonerResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="setLearningProblem"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +</message> +<message name="setLearningProblemResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="setLearningAlgorithm"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +</message> +<message name="setLearningAlgorithmResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="LearningProblemUnsupportedException"> +<part name="fault" element="tns:LearningProblemUnsupportedException"></part> +</message> +<message name="initAll"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="initAllResponse"></message> +<message name="learn"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +</message> +<message name="learnResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="learnDescriptionsEvaluated"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="learnDescriptionsEvaluatedResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="getCurrentlyBestEvaluatedDescriptions"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="getCurrentlyBestEvaluatedDescriptionsResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="learnThreaded"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="learnThreadedResponse"></message> +<message name="getCurrentlyBestConcept"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="getCurrentlyBestConceptResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="getCurrentlyBestConcepts"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getCurrentlyBestConceptsResponse"> +<part xmlns:ns7="http://jaxb.dev.java.net/array" name="return" type="ns7:stringArray"></part> +</message> +<message name="getCurrentlyBestEvaluatedDescriptionsFiltered"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:double"></part> +<part name="arg3" type="xsd:boolean"></part> +</message> +<message name="getCurrentlyBestEvaluatedDescriptionsFilteredResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="isAlgorithmRunning"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="isAlgorithmRunningResponse"> +<part name="return" type="xsd:boolean"></part> +</message> +<message name="setPositiveExamples"> +<part name="arg0" type="xsd:int"></part> +<part xmlns:ns8="http://jaxb.dev.java.net/array" name="arg1" type="ns8:stringArray"></part> +</message> +<message name="setPositiveExamplesResponse"></message> +<message name="setNegativeExamples"> +<part name="arg0" type="xsd:int"></part> +<part xmlns:ns9="http://jaxb.dev.java.net/array" name="arg1" type="ns9:stringArray"></part> +</message> +<message name="setNegativeExamplesResponse"></message> +<message name="applyConfigEntryInt"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +<part name="arg3" type="xsd:int"></part> +</message> +<message name="applyConfigEntryIntResponse"></message> +<message name="applyConfigEntryString"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +<part name="arg3" type="xsd:string"></part> +</message> +<message name="applyConfigEntryStringResponse"></message> +<message name="applyConfigEntryURL"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +<part name="arg3" type="xsd:string"></part> +</message> +<message name="applyConfigEntryURLResponse"></message> +<message name="applyConfigEntryStringArray"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +<part xmlns:ns10="http://jaxb.dev.java.net/array" name="arg3" type="ns10:stringArray"></part> +</message> +<message name="applyConfigEntryStringArrayResponse"></message> +<message name="applyConfigEntryBoolean"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +<part name="arg3" type="xsd:boolean"></part> +</message> +<message name="applyConfigEntryBooleanResponse"></message> +<message name="getConfigOptionValueStringArray"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueStringArrayResponse"> +<part xmlns:ns11="http://jaxb.dev.java.net/array" name="return" type="ns11:stringArray"></part> +</message> +<message name="ConfigOptionTypeException"> +<part name="fault" element="tns:ConfigOptionTypeException"></part> +</message> +<message name="getConfigOptionValueString"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueStringResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueURL"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueURLResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueDouble"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueDoubleResponse"> +<part name="return" type="xsd:double"></part> +</message> +<message name="getConfigOptionValueBoolean"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueBooleanResponse"> +<part name="return" type="xsd:boolean"></part> +</message> +<message name="getConfigOptionValueInt"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getConfigOptionValueIntResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="getAtomicConcepts"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="getAtomicConceptsResponse"> +<part xmlns:ns12="http://jaxb.dev.java.net/array" name="return" type="ns12:stringArray"></part> +</message> +<message name="getSubsumptionHierarchy"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="getSubsumptionHierarchyResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="retrieval"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +</message> +<message name="retrievalResponse"> +<part xmlns:ns13="http://jaxb.dev.java.net/array" name="return" type="ns13:stringArray"></part> +</message> +<message name="ParseException"> +<part name="fault" element="tns:ParseException"></part> +</message> +<message name="getConceptLength"> +<part name="arg0" type="xsd:string"></part> +</message> +<message name="getConceptLengthResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="getAtomicRoles"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="getAtomicRolesResponse"> +<part xmlns:ns14="http://jaxb.dev.java.net/array" name="return" type="ns14:stringArray"></part> +</message> +<message name="getInstances"> +<part name="arg0" type="xsd:int"></part> +</message> +<message name="getInstancesResponse"> +<part xmlns:ns15="http://jaxb.dev.java.net/array" name="return" type="ns15:stringArray"></part> +</message> +<message name="getIndividualsForARole"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +</message> +<message name="getIndividualsForARoleResponse"> +<part xmlns:ns16="http://jaxb.dev.java.net/array" name="return" type="ns16:stringArray"></part> +</message> +<message name="getAsJSON"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="getAsJSONResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="SparqlQueryException"> +<part name="fault" element="tns:SparqlQueryException"></part> +</message> +<message name="getAsXMLString"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="getAsXMLStringResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="sparqlQueryThreaded"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="sparqlQueryThreadedResponse"> +<part name="return" type="xsd:int"></part> +</message> +<message name="sparqlQuery"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="sparqlQueryResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="sparqlQueryPredefinedEndpoint"> +<part name="arg0" type="xsd:string"></part> +<part name="arg1" type="xsd:string"></part> +<part name="arg2" type="xsd:boolean"></part> +</message> +<message name="sparqlQueryPredefinedEndpointResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="isSparqlQueryRunning"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="isSparqlQueryRunningResponse"> +<part name="return" type="xsd:boolean"></part> +</message> +<message name="stopSparqlThread"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="stopSparqlThreadResponse"></message> +<message name="getConceptDepth"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="getConceptDepthResponse"> +<part xmlns:ns17="http://jaxb.dev.java.net/array" name="return" type="ns17:intArray"></part> +</message> +<message name="getConceptArity"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="getConceptArityResponse"> +<part xmlns:ns18="http://jaxb.dev.java.net/array" name="return" type="ns18:intArray"></part> +</message> +<message name="SparqlRetrieval"> +<part name="arg0" type="xsd:string"></part> +<part name="arg1" type="xsd:int"></part> +</message> +<message name="SparqlRetrievalResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="getNaturalDescription"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:string"></part> +<part name="arg2" type="xsd:string"></part> +</message> +<message name="getNaturalDescriptionResponse"> +<part name="return" type="xsd:string"></part> +</message> +<message name="getNegativeExamples"> +<part name="arg0" type="xsd:int"></part> +<part name="arg1" type="xsd:int"></part> +<part xmlns:ns19="http://jaxb.dev.java.net/array" name="arg2" type="ns19:stringArray"></part> +<part name="arg3" type="xsd:int"></part> +<part name="arg4" type="xsd:string"></part> +<part xmlns:ns20="http://jaxb.dev.java.net/array" name="arg5" type="ns20:stringArray"></part> +</message> +<message name="getNegativeExamplesResponse"> +<part xmlns:ns21="http://jaxb.dev.java.net/array" name="return" type="ns21:stringArray"></part> +</message> +<portType name="DLLearnerWebService"> +<operation name="init" parameterOrder="arg0 arg1"> +<input message="tns:init"></input> +<output message="tns:initResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:ComponentInitException" name="ComponentInitException"></fault> +</operation> +<operation name="stop"> +<input message="tns:stop"></input> +<output message="tns:stopResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getBuild"> +<input message="tns:getBuild"></input> +<output message="tns:getBuildResponse"></output> +</operation> +<operation name="ping"> +<input message="tns:ping"></input> +<output message="tns:pingResponse"></output> +</operation> +<operation name="generateID"> +<input message="tns:generateID"></input> +<output message="tns:generateIDResponse"></output> +</operation> +<operation name="getComponents"> +<input message="tns:getComponents"></input> +<output message="tns:getComponentsResponse"></output> +</operation> +<operation name="getKnowledgeSources"> +<input message="tns:getKnowledgeSources"></input> +<output message="tns:getKnowledgeSourcesResponse"></output> +</operation> +<operation name="getReasoners"> +<input message="tns:getReasoners"></input> +<output message="tns:getReasonersResponse"></output> +</operation> +<operation name="getLearningProblems"> +<input message="tns:getLearningProblems"></input> +<output message="tns:getLearningProblemsResponse"></output> +</operation> +<operation name="getLearningAlgorithms"> +<input message="tns:getLearningAlgorithms"></input> +<output message="tns:getLearningAlgorithmsResponse"></output> +</operation> +<operation name="getConfigOptions" parameterOrder="arg0 arg1"> +<input message="tns:getConfigOptions"></input> +<output message="tns:getConfigOptionsResponse"></output> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +</operation> +<operation name="addKnowledgeSource" parameterOrder="arg0 arg1 arg2"> +<input message="tns:addKnowledgeSource"></input> +<output message="tns:addKnowledgeSourceResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:MalformedURLException" name="MalformedURLException"></fault> +</operation> +<operation name="removeKnowledgeSource" parameterOrder="arg0 arg1"> +<input message="tns:removeKnowledgeSource"></input> +<output message="tns:removeKnowledgeSourceResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="setReasoner" parameterOrder="arg0 arg1"> +<input message="tns:setReasoner"></input> +<output message="tns:setReasonerResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +</operation> +<operation name="setLearningProblem" parameterOrder="arg0 arg1"> +<input message="tns:setLearningProblem"></input> +<output message="tns:setLearningProblemResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +</operation> +<operation name="setLearningAlgorithm" parameterOrder="arg0 arg1"> +<input message="tns:setLearningAlgorithm"></input> +<output message="tns:setLearningAlgorithmResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:LearningProblemUnsupportedException" name="LearningProblemUnsupportedException"></fault> +</operation> +<operation name="initAll"> +<input message="tns:initAll"></input> +<output message="tns:initAllResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:ComponentInitException" name="ComponentInitException"></fault> +</operation> +<operation name="learn" parameterOrder="arg0 arg1"> +<input message="tns:learn"></input> +<output message="tns:learnResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="learnDescriptionsEvaluated" parameterOrder="arg0 arg1"> +<input message="tns:learnDescriptionsEvaluated"></input> +<output message="tns:learnDescriptionsEvaluatedResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getCurrentlyBestEvaluatedDescriptions" parameterOrder="arg0 arg1"> +<input message="tns:getCurrentlyBestEvaluatedDescriptions"></input> +<output message="tns:getCurrentlyBestEvaluatedDescriptionsResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="learnThreaded"> +<input message="tns:learnThreaded"></input> +<output message="tns:learnThreadedResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getCurrentlyBestConcept"> +<input message="tns:getCurrentlyBestConcept"></input> +<output message="tns:getCurrentlyBestConceptResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getCurrentlyBestConcepts" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getCurrentlyBestConcepts"></input> +<output message="tns:getCurrentlyBestConceptsResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getCurrentlyBestEvaluatedDescriptionsFiltered" parameterOrder="arg0 arg1 arg2 arg3"> +<input message="tns:getCurrentlyBestEvaluatedDescriptionsFiltered"></input> +<output message="tns:getCurrentlyBestEvaluatedDescriptionsFilteredResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="isAlgorithmRunning"> +<input message="tns:isAlgorithmRunning"></input> +<output message="tns:isAlgorithmRunningResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="setPositiveExamples" parameterOrder="arg0 arg1"> +<input message="tns:setPositiveExamples"></input> +<output message="tns:setPositiveExamplesResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="setNegativeExamples" parameterOrder="arg0 arg1"> +<input message="tns:setNegativeExamples"></input> +<output message="tns:setNegativeExamplesResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="applyConfigEntryInt" parameterOrder="arg0 arg1 arg2 arg3"> +<input message="tns:applyConfigEntryInt"></input> +<output message="tns:applyConfigEntryIntResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +</operation> +<operation name="applyConfigEntryString" parameterOrder="arg0 arg1 arg2 arg3"> +<input message="tns:applyConfigEntryString"></input> +<output message="tns:applyConfigEntryStringResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +</operation> +<operation name="applyConfigEntryURL" parameterOrder="arg0 arg1 arg2 arg3"> +<input message="tns:applyConfigEntryURL"></input> +<output message="tns:applyConfigEntryURLResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:MalformedURLException" name="MalformedURLException"></fault> +</operation> +<operation name="applyConfigEntryStringArray" parameterOrder="arg0 arg1 arg2 arg3"> +<input message="tns:applyConfigEntryStringArray"></input> +<output message="tns:applyConfigEntryStringArrayResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +</operation> +<operation name="applyConfigEntryBoolean" parameterOrder="arg0 arg1 arg2 arg3"> +<input message="tns:applyConfigEntryBoolean"></input> +<output message="tns:applyConfigEntryBooleanResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +</operation> +<operation name="getConfigOptionValueStringArray" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getConfigOptionValueStringArray"></input> +<output message="tns:getConfigOptionValueStringArrayResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:ConfigOptionTypeException" name="ConfigOptionTypeException"></fault> +</operation> +<operation name="getConfigOptionValueString" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getConfigOptionValueString"></input> +<output message="tns:getConfigOptionValueStringResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:ConfigOptionTypeException" name="ConfigOptionTypeException"></fault> +</operation> +<operation name="getConfigOptionValueURL" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getConfigOptionValueURL"></input> +<output message="tns:getConfigOptionValueURLResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:ConfigOptionTypeException" name="ConfigOptionTypeException"></fault> +</operation> +<operation name="getConfigOptionValueDouble" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getConfigOptionValueDouble"></input> +<output message="tns:getConfigOptionValueDoubleResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:ConfigOptionTypeException" name="ConfigOptionTypeException"></fault> +</operation> +<operation name="getConfigOptionValueBoolean" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getConfigOptionValueBoolean"></input> +<output message="tns:getConfigOptionValueBooleanResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:ConfigOptionTypeException" name="ConfigOptionTypeException"></fault> +</operation> +<operation name="getConfigOptionValueInt" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getConfigOptionValueInt"></input> +<output message="tns:getConfigOptionValueIntResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:UnknownComponentException" name="UnknownComponentException"></fault> +<fault message="tns:ConfigOptionTypeException" name="ConfigOptionTypeException"></fault> +</operation> +<operation name="getAtomicConcepts"> +<input message="tns:getAtomicConcepts"></input> +<output message="tns:getAtomicConceptsResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getSubsumptionHierarchy"> +<input message="tns:getSubsumptionHierarchy"></input> +<output message="tns:getSubsumptionHierarchyResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="retrieval" parameterOrder="arg0 arg1"> +<input message="tns:retrieval"></input> +<output message="tns:retrievalResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:ParseException" name="ParseException"></fault> +</operation> +<operation name="getConceptLength"> +<input message="tns:getConceptLength"></input> +<output message="tns:getConceptLengthResponse"></output> +<fault message="tns:ParseException" name="ParseException"></fault> +</operation> +<operation name="getAtomicRoles"> +<input message="tns:getAtomicRoles"></input> +<output message="tns:getAtomicRolesResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getInstances"> +<input message="tns:getInstances"></input> +<output message="tns:getInstancesResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getIndividualsForARole" parameterOrder="arg0 arg1"> +<input message="tns:getIndividualsForARole"></input> +<output message="tns:getIndividualsForARoleResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getAsJSON" parameterOrder="arg0 arg1"> +<input message="tns:getAsJSON"></input> +<output message="tns:getAsJSONResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:SparqlQueryException" name="SparqlQueryException"></fault> +</operation> +<operation name="getAsXMLString" parameterOrder="arg0 arg1"> +<input message="tns:getAsXMLString"></input> +<output message="tns:getAsXMLStringResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +<fault message="tns:SparqlQueryException" name="SparqlQueryException"></fault> +</operation> +<operation name="sparqlQueryThreaded" parameterOrder="arg0 arg1 arg2"> +<input message="tns:sparqlQueryThreaded"></input> +<output message="tns:sparqlQueryThreadedResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="sparqlQuery" parameterOrder="arg0 arg1 arg2"> +<input message="tns:sparqlQuery"></input> +<output message="tns:sparqlQueryResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="sparqlQueryPredefinedEndpoint" parameterOrder="arg0 arg1 arg2"> +<input message="tns:sparqlQueryPredefinedEndpoint"></input> +<output message="tns:sparqlQueryPredefinedEndpointResponse"></output> +</operation> +<operation name="isSparqlQueryRunning" parameterOrder="arg0 arg1"> +<input message="tns:isSparqlQueryRunning"></input> +<output message="tns:isSparqlQueryRunningResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="stopSparqlThread" parameterOrder="arg0 arg1"> +<input message="tns:stopSparqlThread"></input> +<output message="tns:stopSparqlThreadResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getConceptDepth" parameterOrder="arg0 arg1"> +<input message="tns:getConceptDepth"></input> +<output message="tns:getConceptDepthResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getConceptArity" parameterOrder="arg0 arg1"> +<input message="tns:getConceptArity"></input> +<output message="tns:getConceptArityResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="SparqlRetrieval" parameterOrder="arg0 arg1"> +<input message="tns:SparqlRetrieval"></input> +<output message="tns:SparqlRetrievalResponse"></output> +<fault message="tns:ParseException" name="ParseException"></fault> +</operation> +<operation name="getNaturalDescription" parameterOrder="arg0 arg1 arg2"> +<input message="tns:getNaturalDescription"></input> +<output message="tns:getNaturalDescriptionResponse"></output> +<fault message="tns:ParseException" name="ParseException"></fault> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +<operation name="getNegativeExamples" parameterOrder="arg0 arg1 arg2 arg3 arg4 arg5"> +<input message="tns:getNegativeExamples"></input> +<output message="tns:getNegativeExamplesResponse"></output> +<fault message="tns:ClientNotKnownException" name="ClientNotKnownException"></fault> +</operation> +</portType> +<binding name="DLLearnerWebServicePortBinding" type="tns:DLLearnerWebService"> +<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"></soap:binding> +<operation name="init"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="ComponentInitException"> +<soap:fault name="ComponentInitException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="stop"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getBuild"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="ping"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="generateID"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="getComponents"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="getKnowledgeSources"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="getReasoners"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="getLearningProblems"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="getLearningAlgorithms"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +</operation> +<operation name="getConfigOptions"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="addKnowledgeSource"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="MalformedURLException"> +<soap:fault name="MalformedURLException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="removeKnowledgeSource"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="setReasoner"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="setLearningProblem"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="setLearningAlgorithm"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="LearningProblemUnsupportedException"> +<soap:fault name="LearningProblemUnsupportedException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="initAll"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="ComponentInitException"> +<soap:fault name="ComponentInitException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="learn"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="learnDescriptionsEvaluated"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getCurrentlyBestEvaluatedDescriptions"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="learnThreaded"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getCurrentlyBestConcept"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getCurrentlyBestConcepts"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getCurrentlyBestEvaluatedDescriptionsFiltered"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="isAlgorithmRunning"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="setPositiveExamples"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="setNegativeExamples"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="applyConfigEntryInt"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="applyConfigEntryString"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="applyConfigEntryURL"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="MalformedURLException"> +<soap:fault name="MalformedURLException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="applyConfigEntryStringArray"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="applyConfigEntryBoolean"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getConfigOptionValueStringArray"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="ConfigOptionTypeException"> +<soap:fault name="ConfigOptionTypeException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getConfigOptionValueString"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="ConfigOptionTypeException"> +<soap:fault name="ConfigOptionTypeException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getConfigOptionValueURL"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="ConfigOptionTypeException"> +<soap:fault name="ConfigOptionTypeException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getConfigOptionValueDouble"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="ConfigOptionTypeException"> +<soap:fault name="ConfigOptionTypeException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getConfigOptionValueBoolean"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="ConfigOptionTypeException"> +<soap:fault name="ConfigOptionTypeException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getConfigOptionValueInt"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="UnknownComponentException"> +<soap:fault name="UnknownComponentException" use="literal"></soap:fault> +</fault> +<fault name="ConfigOptionTypeException"> +<soap:fault name="ConfigOptionTypeException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getAtomicConcepts"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getSubsumptionHierarchy"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="retrieval"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +<fault name="ParseException"> +<soap:fault name="ParseException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getConceptLength"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ParseException"> +<soap:fault name="ParseException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getAtomicRoles"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getInstances"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getIndividualsForARole"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</input> +<output> +<soap:body use="literal" namespace="http://server.dllearner.org/"></soap:body> +</output> +<fault name="ClientNotKnownException"> +<soap:fault name="ClientNotKnownException" use="literal"></soap:fault> +</fault> +</operation> +<operation name="getAsJSON"> +<soap:operation soapAction=""></soap:operation> +<input> +<soap:body use... [truncated message content] |