From: <jen...@us...> - 2011-03-17 11:25:05
|
Revision: 2725 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2725&view=rev Author: jenslehmann Date: 2011-03-17 11:24:56 +0000 (Thu, 17 Mar 2011) Log Message: ----------- refactored learning algorithm class to (officially) allow algorithms learning SPARQL queries and fuzzy expressions Modified Paths: -------------- trunk/autosparql/src/main/resources/log4j.properties trunk/components-core/src/main/java/org/dllearner/algorithms/BruteForceLearner.java trunk/components-core/src/main/java/org/dllearner/algorithms/RandomGuesser.java trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java trunk/components-core/src/main/java/org/dllearner/algorithms/gp/GP.java trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java trunk/components-core/src/main/java/org/dllearner/algorithms/refinement/ROLearner.java trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java trunk/components-core/src/main/java/org/dllearner/core/LearningAlgorithm.java trunk/components-core/src/main/java/org/dllearner/core/LearningProblemUnsupportedException.java trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnConfiguration.java trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java trunk/components-core/src/test/java/org/dllearner/test/ClassCastExceptionTest.java trunk/components-core/src/test/java/org/dllearner/test/ComponentTest.java trunk/components-core/src/test/java/org/dllearner/test/SworeTest.java trunk/interfaces/src/main/java/org/dllearner/cli/ConfMapper.java trunk/interfaces/src/main/java/org/dllearner/cli/DocumentationGenerator.java trunk/interfaces/src/main/java/org/dllearner/cli/Start.java trunk/interfaces/src/main/java/org/dllearner/gui/ComponentPanel.java trunk/interfaces/src/main/java/org/dllearner/gui/Config.java trunk/interfaces/src/main/java/org/dllearner/gui/ConfigSave.java trunk/interfaces/src/main/java/org/dllearner/gui/MiniGUI.java trunk/interfaces/src/main/java/org/dllearner/gui/StartGUI.java trunk/interfaces/src/main/java/org/dllearner/server/ClientState.java trunk/interfaces/src/main/java/org/dllearner/server/DLLearnerWS.java trunk/interfaces/src/test/java/org/dllearner/test/junit/ReasonerTests.java trunk/protege/src/main/java/org/dllearner/tools/protege/Manager.java trunk/scripts/src/main/java/org/dllearner/examples/KRKModular.java trunk/scripts/src/main/java/org/dllearner/scripts/ConfigJavaGenerator.java trunk/scripts/src/main/java/org/dllearner/scripts/CrossValidation.java trunk/scripts/src/main/java/org/dllearner/scripts/NestedCrossValidation.java trunk/scripts/src/main/java/org/dllearner/scripts/Sample.java trunk/scripts/src/main/java/org/dllearner/scripts/SemanticBibleComparison.java trunk/scripts/src/main/java/org/dllearner/scripts/tiger/TestIterativeLearning.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java trunk/components-core/src/main/java/org/dllearner/core/ClassExpressionLearningAlgorithm.java trunk/components-core/src/main/java/org/dllearner/core/FuzzyClassExpressionLearningAlgorithm.java trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java Modified: trunk/autosparql/src/main/resources/log4j.properties =================================================================== --- trunk/autosparql/src/main/resources/log4j.properties 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/autosparql/src/main/resources/log4j.properties 2011-03-17 11:24:56 UTC (rev 2725) @@ -25,7 +25,7 @@ # appenders are the output-targets defined above # loglevels: trace, debug, info, warn, error, fatal # -log4j.rootLogger=debug, stdout, file +log4j.rootLogger=debug, stdout ### set log levels - for more verbose logging change 'info' to 'debug' ### @@ -34,6 +34,6 @@ log4j.category.org.dllearner.autosparql.server=INFO ####SparqlQueryGenerator -log4j.category.org.dllearner.sparqlquerygenerator=DEBUG +log4j.category.org.dllearner.sparqlquerygenerator=INFO Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/BruteForceLearner.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/BruteForceLearner.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -26,7 +26,7 @@ import java.util.List; import java.util.Map; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.BruteForceLearnerConfigurator; @@ -57,7 +57,7 @@ * @author Jens Lehmann * */ -public class BruteForceLearner extends LearningAlgorithm { +public class BruteForceLearner extends AbstractCELA { private BruteForceLearnerConfigurator configurator; @Override Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/RandomGuesser.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/RandomGuesser.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/RandomGuesser.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -25,7 +25,7 @@ import org.apache.log4j.Logger; import org.dllearner.algorithms.gp.GPUtilities; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; @@ -48,7 +48,7 @@ * @author Jens Lehmann * */ -public class RandomGuesser extends LearningAlgorithm { +public class RandomGuesser extends AbstractCELA { private RandomGuesserConfigurator configurator; @Override Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -33,7 +33,7 @@ import org.apache.log4j.Logger; import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.CELOEConfigurator; @@ -75,7 +75,7 @@ * @author Jens Lehmann * */ -public class CELOE extends LearningAlgorithm { +public class CELOE extends AbstractCELA { private static Logger logger = Logger.getLogger(CELOE.class); private CELOEConfigurator configurator; Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -27,7 +27,7 @@ import org.apache.log4j.Logger; import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.Configurator; @@ -51,7 +51,7 @@ * @author Jens Lehmann * */ -public class ELLearningAlgorithm extends LearningAlgorithm { +public class ELLearningAlgorithm extends AbstractCELA { private static Logger logger = Logger.getLogger(ELLearningAlgorithm.class); private ELLearningAlgorithmConfigurator configurator; @@ -65,7 +65,7 @@ private long treeStartTime; // a set with limited size (currently the ordering is defined in the class itself) - private EvaluatedDescriptionSet bestEvaluatedDescriptions = new EvaluatedDescriptionSet(LearningAlgorithm.MAX_NR_OF_RESULTS); + private EvaluatedDescriptionSet bestEvaluatedDescriptions = new EvaluatedDescriptionSet(AbstractCELA.MAX_NR_OF_RESULTS); private SearchTreeNode startNode; private ELHeuristic heuristic; Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithmDisjunctive.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -30,7 +30,7 @@ import org.apache.log4j.Logger; import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.Configurator; @@ -83,7 +83,7 @@ * @author Jens Lehmann * */ -public class ELLearningAlgorithmDisjunctive extends LearningAlgorithm { +public class ELLearningAlgorithmDisjunctive extends AbstractCELA { private static Logger logger = Logger.getLogger(ELLearningAlgorithmDisjunctive.class); private ELLearningAlgorithmDisjunctiveConfigurator configurator; Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/gp/GP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/gp/GP.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/gp/GP.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -30,7 +30,7 @@ import java.util.Map.Entry; import org.dllearner.algorithms.hybridgp.Psi; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.GPConfigurator; @@ -55,7 +55,7 @@ * @author Jens Lehmann * */ -public class GP extends LearningAlgorithm { +public class GP extends AbstractCELA { private GPConfigurator configurator; @Override Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -34,7 +34,7 @@ import org.dllearner.algorithms.celoe.OENode; import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ISLEConfigurator; @@ -71,7 +71,7 @@ * @author Jens Lehmann * */ -public class ISLE extends LearningAlgorithm { +public class ISLE extends AbstractCELA { private static Logger logger = Logger.getLogger(CELOE.class); private ISLEConfigurator configurator; Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -30,7 +30,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.OCELConfigurator; @@ -81,7 +81,7 @@ * @author Jens Lehmann * */ -public class OCEL extends LearningAlgorithm { +public class OCEL extends AbstractCELA { private OCELConfigurator configurator; @Override Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/refinement/ROLearner.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/refinement/ROLearner.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -14,7 +14,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ROLearnerConfigurator; @@ -42,7 +42,7 @@ import org.dllearner.utilities.owl.ConceptTransformation; import org.dllearner.utilities.owl.EvaluatedDescriptionPosNegComparator; -public class ROLearner extends LearningAlgorithm { +public class ROLearner extends AbstractCELA { private ROLearnerConfigurator configurator; @Override @@ -51,7 +51,7 @@ } private static Logger logger = Logger - .getLogger(LearningAlgorithm.class); + .getLogger(AbstractCELA.class); private String logLevel = CommonConfigOptions.logLevelDefault; Copied: trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java (from rev 2724, trunk/components-core/src/main/java/org/dllearner/core/LearningAlgorithm.java) =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -0,0 +1,305 @@ +/** + * Copyright (C) 2007-2011, 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; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.TreeSet; + +import org.dllearner.core.owl.Description; +import org.dllearner.utilities.datastructures.DescriptionSubsumptionTree; +import org.dllearner.utilities.owl.ConceptTransformation; + +/** + * Abstract superclass of all class expression learning algorithm implementations. + * Includes support for anytime learning algorithms and resumable + * learning algorithms. Provides methods for filtering the best + * descriptions found by the algorithm. As results of the algorithm, + * you can either get only descriptions or evaluated descriptions. + * Evaluated descriptions have information about accuracy and + * example coverage associated with them. However, retrieving those + * may require addition reasoner queries, because the learning + * algorithms usually use but do not necessarily store this information. + * + * @author Jens Lehmann + * + */ +public abstract class AbstractCELA extends Component { + + /** + * The learning problem variable, which must be used by + * all learning algorithm implementations. + */ + protected LearningProblem learningProblem; + + /** + * The reasoning service variable, which must be used by + * all learning algorithm implementations. + */ + protected ReasonerComponent reasoner; + + /** + * Each learning algorithm gets a learning problem and + * a reasoner as input. + * @param learningProblem The learning problem to solve. + * @param reasoningService The reasoner connecting to the + * underlying knowledge base. + */ + public AbstractCELA(LearningProblem learningProblem, ReasonerComponent reasoningService) { + this.learningProblem = learningProblem; + this.reasoner = reasoningService; + } + + /** + * Call this when you want to change the learning problem, but + * leave everything else as is. Method can be used to apply + * a configured algorithm to different learning problems. + * Implementations, which do not only use the provided learning + * algorithm variable, must make sure that a call to this method + * indeed changes the learning problem. + * @param learningProblem The new learning problem. + */ + public void changeLearningProblem(LearningProblem learningProblem) { + this.learningProblem = learningProblem; + } + + /** + * Call this when you want to change the reasoning service, but + * leave everything else as is. Method can be used to use + * a configured algorithm with different reasoners. + * Implementations, which do not only use the provided reasoning + * service class variable, must make sure that a call to this method + * indeed changes the reasoning service. + * @param reasoningService The new reasoning service. + */ + public void changeReasonerComponent(ReasonerComponent reasoningService) { + this.reasoner = reasoningService; + } + + /** + * This is the maximum number of results, which the learning + * algorithms are asked to store. (Note, that algorithms are not + * required to store any results except the best one, so this limit + * is used to limit the performance cost for those which + * choose to store results.) + */ + public static final int MAX_NR_OF_RESULTS = 100; + + /** + * Starts the algorithm. It runs until paused, stopped, or + * a termination criterion has been reached. + */ + public abstract void start(); + + /** + * Pauses the algorithm (not all algorithms need to implement + * this operation). + */ + public void pause() { }; + + /** + * Resumes the algorithm (not all algorithms need to implement + * this operation). You can use this method to continue + * an algorithm run even after a termination criterion has been + * reached. It will run until paused, stopped, or terminated + * again. + */ + public void resume() { }; + + /** + * Stops the algorithm gracefully. A stopped algorithm cannot be resumed anymore. + * Use this method for cleanup and freeing memory. + */ + public abstract void stop(); + + /** + * Returns whether the learning algorithm is running. Implementation + * should use a boolean status variable in their implementations of + * the start and resume methods. + * @return True if the algorithm is running, false otherwise. + */ + public abstract boolean isRunning(); + + /** + * Every algorithm must be able to return the score of the + * best solution found. + * + * @return Best score. + */ +// @Deprecated +// public abstract Score getSolutionScore(); + + /** + * @see #getCurrentlyBestEvaluatedDescription() + * @return The best class description found by the learning algorithm so far. + */ + public abstract Description getCurrentlyBestDescription(); + + /** + * @see #getCurrentlyBestEvaluatedDescriptions() + * @return The best class descriptions found by the learning algorithm so far. + */ + public List<Description> getCurrentlyBestDescriptions() { + List<Description> ds = new LinkedList<Description>(); + ds.add(getCurrentlyBestDescription()); + return ds; + } + + /** + * @see #getCurrentlyBestEvaluatedDescriptions(int) + * @param nrOfDescriptions Limit for the number or returned descriptions. + * @return The best class descriptions found by the learning algorithm so far. + */ + public synchronized List<Description> getCurrentlyBestDescriptions(int nrOfDescriptions) { + return getCurrentlyBestDescriptions(nrOfDescriptions, false); + } + + /** + * @see #getCurrentlyBestEvaluatedDescriptions(int,double,boolean) + * @param nrOfDescriptions Limit for the number or returned descriptions. + * @param filterNonMinimalDescriptions Remove non-minimal descriptions (e.g. those which can be shortened + * to an equivalent concept) from the returned set. + * @return The best class descriptions found by the learning algorithm so far. + */ + public synchronized List<Description> getCurrentlyBestDescriptions(int nrOfDescriptions, boolean filterNonMinimalDescriptions) { + List<Description> currentlyBest = getCurrentlyBestDescriptions(); + List<Description> returnList = new LinkedList<Description>(); + for(Description ed : currentlyBest) { + if(returnList.size() >= nrOfDescriptions) { + return returnList; + } + + if(!filterNonMinimalDescriptions || ConceptTransformation.isDescriptionMinimal(ed)) { + returnList.add(ed); + } + + } + return returnList; + } + + /** + * Returns the best descriptions obtained so far. + * @return Best class description found so far. + */ + public abstract EvaluatedDescription getCurrentlyBestEvaluatedDescription(); + + /** + * Returns a sorted set of the best descriptions found so far. We + * assume that they are ordered such that the best ones come in + * last. (In Java, iterators traverse a SortedSet in ascending order.) + * @return Best class descriptions found so far. + */ + public TreeSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + TreeSet<EvaluatedDescription> ds = new TreeSet<EvaluatedDescription>(); + ds.add(getCurrentlyBestEvaluatedDescription()); + return ds; + } + + /** + * Returns a filtered list of currently best class descriptions. + * + * @param nrOfDescriptions Maximum number of restrictions. Use Integer.MAX_VALUE + * if you do not want this filter to be active. + * + * @param accuracyThreshold Minimum accuracy. All class descriptions with lower + * accuracy are disregarded. Specify a value between 0.0 and 1.0. Use 0.0 if + * you do not want this filter to be active. + * + * @param filterNonMinimalDescriptions If true, non-minimal descriptions are + * filtered, e.g. ALL r.TOP (being equivalent to TOP), male AND male (can be + * shortened to male). Currently, non-minimal descriptions are just skipped, + * i.e. they are completely omitted from the return list. Later, implementation + * might be changed to return shortened versions of those descriptions. + * + * @return A list of currently best class descriptions. + */ + public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions) { + TreeSet<? extends EvaluatedDescription> currentlyBest = getCurrentlyBestEvaluatedDescriptions(); + List<EvaluatedDescription> returnList = new LinkedList<EvaluatedDescription>(); + for(EvaluatedDescription ed : currentlyBest.descendingSet()) { + // once we hit a description with a below threshold accuracy, we simply return + // because learning algorithms are advised to order descriptions by accuracy, + // so we won't find any concept with higher accuracy in the remaining list +// if(ed.getAccuracy() < accuracyThreshold) { + if(ed.getAccuracy() < accuracyThreshold) { + return returnList; + } + + // return if we have sufficiently many descriptions + if(returnList.size() >= nrOfDescriptions) { + return returnList; + } + + if(!filterNonMinimalDescriptions || ConceptTransformation.isDescriptionMinimal(ed.getDescription())) { + // before we add the description we replace EXISTS r.TOP with + // EXISTS r.range(r) if range(r) is atomic + // (we need to clone, otherwise we change descriptions which could + // be in the search of the learning algorith, which leads to + // unpredictable behaviour) + Description d = ed.getDescription().clone(); + + //commented out because reasoner is called. leads in swing applications sometimes to exceptions +// ConceptTransformation.replaceRange(d, reasoner); + ed.setDescription(d); + + returnList.add(ed); + } + + } + return returnList; + } + + /** + * Return the best currently found concepts up to some maximum + * count (no minimality filter used). + * @param nrOfDescriptions Maximum number of descriptions returned. + * @return Return value is getCurrentlyBestDescriptions(nrOfDescriptions, 0.0, false). + */ + public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions) { + return getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, 0.0, false); + } + + /** + * Returns a fraction of class descriptions with sufficiently high accuracy. + * @param accuracyThreshold Only return solutions with this accuracy or higher. + * @return Return value is getCurrentlyBestDescriptions(Integer.MAX_VALUE, accuracyThreshold, false). + */ + public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(double accuracyThreshold) { + return getCurrentlyBestEvaluatedDescriptions(Integer.MAX_VALUE, accuracyThreshold, false); + } + + public synchronized List<? extends EvaluatedDescription> getCurrentlyBestMostGeneralEvaluatedDescriptions() { + List<? extends EvaluatedDescription> l = getCurrentlyBestEvaluatedDescriptions(getCurrentlyBestEvaluatedDescriptions().last().getAccuracy()); + DescriptionSubsumptionTree t = new DescriptionSubsumptionTree(reasoner); + t.insert(l); + return t.getMostGeneralDescriptions(true); + } + + /** + * Returns all learning problems supported by this component. This can be used to indicate that, e.g. + * an algorithm is only suitable for positive only learning. + * @return All classes implementing learning problems, which are supported by this learning algorithm. + */ + public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { + return new LinkedList<Class<? extends LearningProblem>>(); + } + +} Added: trunk/components-core/src/main/java/org/dllearner/core/ClassExpressionLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ClassExpressionLearningAlgorithm.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/ClassExpressionLearningAlgorithm.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2007-2011, 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; + +/** + * Basic interface for algorithms learning OWL/DL class expressions. + * + * @author Jens Lehmann + * + */ +public interface ClassExpressionLearningAlgorithm extends LearningAlgorithm { + +} Modified: trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -72,7 +72,7 @@ private static Collection<Class<? extends KnowledgeSource>> knowledgeSources; private static Collection<Class<? extends ReasonerComponent>> reasonerComponents; private static Collection<Class<? extends LearningProblem>> learningProblems; - private static Collection<Class<? extends LearningAlgorithm>> learningAlgorithms; + private static Collection<Class<? extends AbstractCELA>> learningAlgorithms; // you can either use the components.ini file or directly specify the classes to use @Deprecated private static String componentsFile = "org/dllearner/components.ini"; @@ -111,8 +111,8 @@ private static Map<Class<? extends Component>, String> componentNames; private static Map<Class<? extends Component>, List<ConfigOption<?>>> componentOptions; private static Map<Class<? extends Component>, Map<String, ConfigOption<?>>> componentOptionsByName; - private static Map<Class<? extends LearningAlgorithm>, Collection<Class<? extends LearningProblem>>> algorithmProblemsMapping; - private static Map<Class<? extends LearningProblem>, Collection<Class<? extends LearningAlgorithm>>> problemAlgorithmsMapping; + private static Map<Class<? extends AbstractCELA>, Collection<Class<? extends LearningProblem>>> algorithmProblemsMapping; + private static Map<Class<? extends LearningProblem>, Collection<Class<? extends AbstractCELA>>> problemAlgorithmsMapping; // list of default values of config options // private static Map<ConfigOption<?>,Object> configOptionDefaults; @@ -143,8 +143,8 @@ knowledgeSources = new TreeSet<Class<? extends KnowledgeSource>>(classComparator); reasonerComponents = new TreeSet<Class<? extends ReasonerComponent>>(classComparator); learningProblems = new TreeSet<Class<? extends LearningProblem>>(classComparator); - learningAlgorithms = new TreeSet<Class<? extends LearningAlgorithm>>(classComparator); - algorithmProblemsMapping = new TreeMap<Class<? extends LearningAlgorithm>, Collection<Class<? extends LearningProblem>>>( + learningAlgorithms = new TreeSet<Class<? extends AbstractCELA>>(classComparator); + algorithmProblemsMapping = new TreeMap<Class<? extends AbstractCELA>, Collection<Class<? extends LearningProblem>>>( classComparator); // create classes from strings @@ -160,8 +160,8 @@ reasonerComponents.add((Class<? extends ReasonerComponent>) component); } else if (LearningProblem.class.isAssignableFrom(component)) { learningProblems.add((Class<? extends LearningProblem>) component); - } else if (LearningAlgorithm.class.isAssignableFrom(component)) { - Class<? extends LearningAlgorithm> learningAlgorithmClass = (Class<? extends LearningAlgorithm>) component; + } else if (AbstractCELA.class.isAssignableFrom(component)) { + Class<? extends AbstractCELA> learningAlgorithmClass = (Class<? extends AbstractCELA>) component; learningAlgorithms.add(learningAlgorithmClass); Collection<Class<? extends LearningProblem>> problems = (Collection<Class<? extends LearningProblem>>) invokeStaticMethod( learningAlgorithmClass, "supportedLearningProblems"); @@ -447,7 +447,7 @@ * @throws LearningProblemUnsupportedException Thrown when the learning problem and * the learning algorithm are not compatible. */ - public <T extends LearningAlgorithm> T learningAlgorithm(Class<T> laClass, LearningProblem lp, ReasonerComponent rs) throws LearningProblemUnsupportedException { + public <T extends AbstractCELA> T learningAlgorithm(Class<T> laClass, LearningProblem lp, ReasonerComponent rs) throws LearningProblemUnsupportedException { if (!learningAlgorithms.contains(laClass)) { System.err.println("Warning: learning algorithm " + laClass + " is not a registered learning algorithm component."); @@ -661,9 +661,9 @@ * @param learningProblem A learning problem type. * @return The set of learning algorithms applicable for this learning problem. */ - public List<Class<? extends LearningAlgorithm>> getApplicableLearningAlgorithms(Class<? extends LearningProblem> learningProblem) { - List<Class<? extends LearningAlgorithm>> algorithms = new LinkedList<Class<? extends LearningAlgorithm>>(); - for(Entry<Class<? extends LearningProblem>,Collection<Class<? extends LearningAlgorithm>>> entry : problemAlgorithmsMapping.entrySet()) { + public List<Class<? extends AbstractCELA>> getApplicableLearningAlgorithms(Class<? extends LearningProblem> learningProblem) { + List<Class<? extends AbstractCELA>> algorithms = new LinkedList<Class<? extends AbstractCELA>>(); + for(Entry<Class<? extends LearningProblem>,Collection<Class<? extends AbstractCELA>>> entry : problemAlgorithmsMapping.entrySet()) { Class<? extends LearningProblem> prob = entry.getKey(); if(prob.isAssignableFrom(learningProblem)) { algorithms.addAll(entry.getValue()); @@ -679,8 +679,8 @@ * @return the components A list of learning algorithm classes available in this * instance of <code>ComponentManager</code>. */ - public List<Class<? extends LearningAlgorithm>> getLearningAlgorithms() { - return new LinkedList<Class<? extends LearningAlgorithm>>(learningAlgorithms); + public List<Class<? extends AbstractCELA>> getLearningAlgorithms() { + return new LinkedList<Class<? extends AbstractCELA>>(learningAlgorithms); } @@ -696,11 +696,11 @@ * Retuns a list of all instanciated and registered LearningAlgorithm * @return Currently active learning algorithms. */ - public List<LearningAlgorithm> getLiveLearningAlgorithms(){ - List<LearningAlgorithm> list = new ArrayList<LearningAlgorithm>(); + public List<AbstractCELA> getLiveLearningAlgorithms(){ + List<AbstractCELA> list = new ArrayList<AbstractCELA>(); for (Component component : cm.getLiveComponents()) { - if(component instanceof LearningAlgorithm){ - list.add((LearningAlgorithm) component); + if(component instanceof AbstractCELA){ + list.add((AbstractCELA) component); } } Added: trunk/components-core/src/main/java/org/dllearner/core/FuzzyClassExpressionLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/FuzzyClassExpressionLearningAlgorithm.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/FuzzyClassExpressionLearningAlgorithm.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2007-2011, 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; + +/** + * Basic interface for algorithms learning fuzzy OWL/DL class expressions. + * + * @author Jens Lehmann + * + */ +public interface FuzzyClassExpressionLearningAlgorithm extends LearningAlgorithm { + +} Modified: trunk/components-core/src/main/java/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/LearningAlgorithm.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/core/LearningAlgorithm.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007-2008, Jens Lehmann + * Copyright (C) 2007-2011, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,287 +19,12 @@ */ package org.dllearner.core; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.TreeSet; - -import org.dllearner.core.owl.Description; -import org.dllearner.utilities.datastructures.DescriptionSubsumptionTree; -import org.dllearner.utilities.owl.ConceptTransformation; - /** - * Abstract superclass of all learning algorithm implementations. - * Includes support for anytime learning algorithms and resumable - * learning algorithms. Provides methods for filtering the best - * descriptions found by the algorithm. As results of the algorithm, - * you can either get only descriptions or evaluated descriptions. - * Evaluated descriptions have information about accuracy and - * example coverage associated with them. However, retrieving those - * may require addition reasoner queries, because the learning - * algorithms usually use but do not necessarily store this information. + * Basic interface for all DL-Learner learning algorithms. * * @author Jens Lehmann * */ -public abstract class LearningAlgorithm extends Component { +public interface LearningAlgorithm { - /** - * The learning problem variable, which must be used by - * all learning algorithm implementations. - */ - protected LearningProblem learningProblem; - - /** - * The reasoning service variable, which must be used by - * all learning algorithm implementations. - */ - protected ReasonerComponent reasoner; - - /** - * Each learning algorithm gets a learning problem and - * a reasoner as input. - * @param learningProblem The learning problem to solve. - * @param reasoningService The reasoner connecting to the - * underlying knowledge base. - */ - public LearningAlgorithm(LearningProblem learningProblem, ReasonerComponent reasoningService) { - this.learningProblem = learningProblem; - this.reasoner = reasoningService; - } - - /** - * Call this when you want to change the learning problem, but - * leave everything else as is. Method can be used to apply - * a configured algorithm to different learning problems. - * Implementations, which do not only use the provided learning - * algorithm variable, must make sure that a call to this method - * indeed changes the learning problem. - * @param learningProblem The new learning problem. - */ - public void changeLearningProblem(LearningProblem learningProblem) { - this.learningProblem = learningProblem; - } - - /** - * Call this when you want to change the reasoning service, but - * leave everything else as is. Method can be used to use - * a configured algorithm with different reasoners. - * Implementations, which do not only use the provided reasoning - * service class variable, must make sure that a call to this method - * indeed changes the reasoning service. - * @param reasoningService The new reasoning service. - */ - public void changeReasonerComponent(ReasonerComponent reasoningService) { - this.reasoner = reasoningService; - } - - /** - * This is the maximum number of results, which the learning - * algorithms are asked to store. (Note, that algorithms are not - * required to store any results except the best one, so this limit - * is used to limit the performance cost for those which - * choose to store results.) - */ - public static final int MAX_NR_OF_RESULTS = 100; - - /** - * Starts the algorithm. It runs until paused, stopped, or - * a termination criterion has been reached. - */ - public abstract void start(); - - /** - * Pauses the algorithm (not all algorithms need to implement - * this operation). - */ - public void pause() { }; - - /** - * Resumes the algorithm (not all algorithms need to implement - * this operation). You can use this method to continue - * an algorithm run even after a termination criterion has been - * reached. It will run until paused, stopped, or terminated - * again. - */ - public void resume() { }; - - /** - * Stops the algorithm gracefully. A stopped algorithm cannot be resumed anymore. - * Use this method for cleanup and freeing memory. - */ - public abstract void stop(); - - /** - * Returns whether the learning algorithm is running. Implementation - * should use a boolean status variable in their implementations of - * the start and resume methods. - * @return True if the algorithm is running, false otherwise. - */ - public abstract boolean isRunning(); - - /** - * Every algorithm must be able to return the score of the - * best solution found. - * - * @return Best score. - */ -// @Deprecated -// public abstract Score getSolutionScore(); - - /** - * @see #getCurrentlyBestEvaluatedDescription() - * @return The best class description found by the learning algorithm so far. - */ - public abstract Description getCurrentlyBestDescription(); - - /** - * @see #getCurrentlyBestEvaluatedDescriptions() - * @return The best class descriptions found by the learning algorithm so far. - */ - public List<Description> getCurrentlyBestDescriptions() { - List<Description> ds = new LinkedList<Description>(); - ds.add(getCurrentlyBestDescription()); - return ds; - } - - /** - * @see #getCurrentlyBestEvaluatedDescriptions(int) - * @param nrOfDescriptions Limit for the number or returned descriptions. - * @return The best class descriptions found by the learning algorithm so far. - */ - public synchronized List<Description> getCurrentlyBestDescriptions(int nrOfDescriptions) { - return getCurrentlyBestDescriptions(nrOfDescriptions, false); - } - - /** - * @see #getCurrentlyBestEvaluatedDescriptions(int,double,boolean) - * @param nrOfDescriptions Limit for the number or returned descriptions. - * @param filterNonMinimalDescriptions Remove non-minimal descriptions (e.g. those which can be shortened - * to an equivalent concept) from the returned set. - * @return The best class descriptions found by the learning algorithm so far. - */ - public synchronized List<Description> getCurrentlyBestDescriptions(int nrOfDescriptions, boolean filterNonMinimalDescriptions) { - List<Description> currentlyBest = getCurrentlyBestDescriptions(); - List<Description> returnList = new LinkedList<Description>(); - for(Description ed : currentlyBest) { - if(returnList.size() >= nrOfDescriptions) { - return returnList; - } - - if(!filterNonMinimalDescriptions || ConceptTransformation.isDescriptionMinimal(ed)) { - returnList.add(ed); - } - - } - return returnList; - } - - /** - * Returns the best descriptions obtained so far. - * @return Best class description found so far. - */ - public abstract EvaluatedDescription getCurrentlyBestEvaluatedDescription(); - - /** - * Returns a sorted set of the best descriptions found so far. We - * assume that they are ordered such that the best ones come in - * last. (In Java, iterators traverse a SortedSet in ascending order.) - * @return Best class descriptions found so far. - */ - public TreeSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { - TreeSet<EvaluatedDescription> ds = new TreeSet<EvaluatedDescription>(); - ds.add(getCurrentlyBestEvaluatedDescription()); - return ds; - } - - /** - * Returns a filtered list of currently best class descriptions. - * - * @param nrOfDescriptions Maximum number of restrictions. Use Integer.MAX_VALUE - * if you do not want this filter to be active. - * - * @param accuracyThreshold Minimum accuracy. All class descriptions with lower - * accuracy are disregarded. Specify a value between 0.0 and 1.0. Use 0.0 if - * you do not want this filter to be active. - * - * @param filterNonMinimalDescriptions If true, non-minimal descriptions are - * filtered, e.g. ALL r.TOP (being equivalent to TOP), male AND male (can be - * shortened to male). Currently, non-minimal descriptions are just skipped, - * i.e. they are completely omitted from the return list. Later, implementation - * might be changed to return shortened versions of those descriptions. - * - * @return A list of currently best class descriptions. - */ - public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions) { - TreeSet<? extends EvaluatedDescription> currentlyBest = getCurrentlyBestEvaluatedDescriptions(); - List<EvaluatedDescription> returnList = new LinkedList<EvaluatedDescription>(); - for(EvaluatedDescription ed : currentlyBest.descendingSet()) { - // once we hit a description with a below threshold accuracy, we simply return - // because learning algorithms are advised to order descriptions by accuracy, - // so we won't find any concept with higher accuracy in the remaining list -// if(ed.getAccuracy() < accuracyThreshold) { - if(ed.getAccuracy() < accuracyThreshold) { - return returnList; - } - - // return if we have sufficiently many descriptions - if(returnList.size() >= nrOfDescriptions) { - return returnList; - } - - if(!filterNonMinimalDescriptions || ConceptTransformation.isDescriptionMinimal(ed.getDescription())) { - // before we add the description we replace EXISTS r.TOP with - // EXISTS r.range(r) if range(r) is atomic - // (we need to clone, otherwise we change descriptions which could - // be in the search of the learning algorith, which leads to - // unpredictable behaviour) - Description d = ed.getDescription().clone(); - - //commented out because reasoner is called. leads in swing applications sometimes to exceptions -// ConceptTransformation.replaceRange(d, reasoner); - ed.setDescription(d); - - returnList.add(ed); - } - - } - return returnList; - } - - /** - * Return the best currently found concepts up to some maximum - * count (no minimality filter used). - * @param nrOfDescriptions Maximum number of descriptions returned. - * @return Return value is getCurrentlyBestDescriptions(nrOfDescriptions, 0.0, false). - */ - public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions) { - return getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, 0.0, false); - } - - /** - * Returns a fraction of class descriptions with sufficiently high accuracy. - * @param accuracyThreshold Only return solutions with this accuracy or higher. - * @return Return value is getCurrentlyBestDescriptions(Integer.MAX_VALUE, accuracyThreshold, false). - */ - public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(double accuracyThreshold) { - return getCurrentlyBestEvaluatedDescriptions(Integer.MAX_VALUE, accuracyThreshold, false); - } - - public synchronized List<? extends EvaluatedDescription> getCurrentlyBestMostGeneralEvaluatedDescriptions() { - List<? extends EvaluatedDescription> l = getCurrentlyBestEvaluatedDescriptions(getCurrentlyBestEvaluatedDescriptions().last().getAccuracy()); - DescriptionSubsumptionTree t = new DescriptionSubsumptionTree(reasoner); - t.insert(l); - return t.getMostGeneralDescriptions(true); - } - - /** - * Returns all learning problems supported by this component. This can be used to indicate that, e.g. - * an algorithm is only suitable for positive only learning. - * @return All classes implementing learning problems, which are supported by this learning algorithm. - */ - public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { - return new LinkedList<Class<? extends LearningProblem>>(); - } - } Modified: trunk/components-core/src/main/java/org/dllearner/core/LearningProblemUnsupportedException.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/LearningProblemUnsupportedException.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/core/LearningProblemUnsupportedException.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -33,12 +33,12 @@ private static final long serialVersionUID = 177919265073997460L; - public LearningProblemUnsupportedException(Class<? extends LearningProblem> problemClass, Class<? extends LearningAlgorithm> algorithmClass) { + public LearningProblemUnsupportedException(Class<? extends LearningProblem> problemClass, Class<? extends AbstractCELA> algorithmClass) { super("Warning: No suitable constructor registered for algorithm " + algorithmClass.getName() + " and problem " + problemClass.getClass().getName() + "."); } - public LearningProblemUnsupportedException(Class<? extends LearningProblem> problemClass, Class<? extends LearningAlgorithm> algorithmClass, Collection<Class<? extends LearningProblem>> supportedProblems) { + public LearningProblemUnsupportedException(Class<? extends LearningProblem> problemClass, Class<? extends AbstractCELA> algorithmClass, Collection<Class<? extends LearningProblem>> supportedProblems) { super("Warning: No suitable constructor registered for algorithm " + algorithmClass.getName() + " and problem " + problemClass.getClass().getName() + ". Registered constructors for " + algorithmClass.getName() + ": " Added: trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -0,0 +1,30 @@ +/** + * Copyright (C) 2007-2011, 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; + +/** + * Basic interface for algorithms learning SPARQL queries. + * + * @author Jens Lehmann + * + */ +public interface SparqlQueryLearningAlgorithm extends LearningAlgorithm { + +} Modified: trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -19,7 +19,7 @@ */ package org.dllearner.core.options; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; @@ -193,7 +193,7 @@ public static IntegerConfigOption maxNrOfResults(int defaultValue) { IntegerConfigOption opt = new IntegerConfigOption("maxNrOfResults", "Sets the maximum number of results one is interested in. (Setting this to a lower value may increase performance as the learning algorithm has to store/evaluate/beautify less descriptions).", defaultValue); opt.setLowerLimit(1); - opt.setUpperLimit(LearningAlgorithm.MAX_NR_OF_RESULTS); + opt.setUpperLimit(AbstractCELA.MAX_NR_OF_RESULTS); return opt; } Modified: trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/utilities/components/ComponentCombo.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -27,7 +27,7 @@ import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; @@ -50,7 +50,7 @@ private Set<KnowledgeSource> sources; private ReasonerComponent reasoner; private LearningProblem problem; - private LearningAlgorithm algorithm; + private AbstractCELA algorithm; /** * Builds a component combination object from the specified components. @@ -59,7 +59,7 @@ * @param problem A learning problem. * @param algorithm A learning algorithm. */ - public ComponentCombo(KnowledgeSource source, ReasonerComponent reasoner, LearningProblem problem, LearningAlgorithm algorithm) { + public ComponentCombo(KnowledgeSource source, ReasonerComponent reasoner, LearningProblem problem, AbstractCELA algorithm) { this(getSourceSet(source), reasoner, problem, algorithm); } @@ -70,7 +70,7 @@ * @param problem A learning problem. * @param algorithm A learning algorithm. */ - public ComponentCombo(Set<KnowledgeSource> sources, ReasonerComponent reasoner, LearningProblem problem, LearningAlgorithm algorithm) { + public ComponentCombo(Set<KnowledgeSource> sources, ReasonerComponent reasoner, LearningProblem problem, AbstractCELA algorithm) { this.sources = sources; this.reasoner = reasoner; this.problem = problem; @@ -144,7 +144,7 @@ /** * @return the algorithm */ - public LearningAlgorithm getAlgorithm() { + public AbstractCELA getAlgorithm() { return algorithm; } Modified: trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnConfiguration.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnConfiguration.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnConfiguration.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -5,7 +5,7 @@ import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; @@ -28,7 +28,7 @@ public boolean replaceSearchTree = true; - public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasonerComponent rs, LearningAlgorithm la) { + public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasonerComponent rs, AbstractCELA la) { try { // LEARNINGALGORITHM Modified: trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -4,7 +4,7 @@ import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; @@ -22,7 +22,7 @@ } @Override - public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasonerComponent rs, LearningAlgorithm la) { + public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasonerComponent rs, AbstractCELA la) { try { super.applyConfigEntries(cm, ks, lp, rs, la); // KNOWLEDGESOURCE Modified: trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/main/java/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -2,7 +2,7 @@ import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.kb.sparql.Cache; @@ -24,7 +24,7 @@ @Override - public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasonerComponent rs, LearningAlgorithm la) { + public void applyConfigEntries(ComponentManager cm, KnowledgeSource ks, LearningProblem lp, ReasonerComponent rs, AbstractCELA la) { try { super.applyConfigEntries(cm, ks, lp, rs, la); // KNOWLEDGESOURCE Modified: trunk/components-core/src/test/java/org/dllearner/test/ClassCastExceptionTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/ClassCastExceptionTest.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/test/java/org/dllearner/test/ClassCastExceptionTest.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -8,7 +8,7 @@ import org.dllearner.core.ComponentManager; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; @@ -47,7 +47,7 @@ lp.init(); // create the learning algorithm - LearningAlgorithm la = null; + AbstractCELA la = null; try { la = cm.learningAlgorithm(CELOE.class, lp, reasoner); cm.applyConfigEntry(la, "maxExecutionTimeInSeconds", 2); Modified: trunk/components-core/src/test/java/org/dllearner/test/ComponentTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/ComponentTest.java 2011-03-16 21:14:14 UTC (rev 2724) +++ trunk/components-core/src/test/java/org/dllearner/test/ComponentTest.java 2011-03-17 11:24:56 UTC (rev 2725) @@ -28,7 +28,7 @@ import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.AbstractCELA; import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; @@ -78,7 +78,7 @@ lp.init(); // create the learning algorithm - LearningAlgorithm la = null; + AbstractCELA la = null; try { la = cm.learningAlgorithm(OCEL.class, lp, reasoner); la.init(); Modified: trunk/components-core/src/test/java/org/dllearner/test/SworeTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test... [truncated message content] |
From: <hee...@us...> - 2011-03-22 20:45:29
|
Revision: 2730 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2730&view=rev Author: heeroyuy Date: 2011-03-22 20:45:22 +0000 (Tue, 22 Mar 2011) Log Message: ----------- -added the jdeb plugin for components core and interfaces Modified Paths: -------------- trunk/components-core/pom.xml trunk/interfaces/pom.xml Added Paths: ----------- trunk/components-core/src/deb/ trunk/components-core/src/deb/control/ trunk/components-core/src/deb/control/control trunk/interfaces/src/deb/ trunk/interfaces/src/deb/control/ trunk/interfaces/src/deb/control/control Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2011-03-20 16:40:28 UTC (rev 2729) +++ trunk/components-core/pom.xml 2011-03-22 20:45:22 UTC (rev 2730) @@ -45,6 +45,31 @@ </execution> </executions> </plugin> + <plugin> + <artifactId>jdeb</artifactId> + <groupId>org.vafer</groupId> + <version>0.8</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>jdeb</goal> + </goals> + <configuration> + <dataSet> + <data> + <src>${project.build.directory}/${project.build.finalName}.jar</src> + <type>file</type> + <mapper> + <type>perm</type> + <prefix>/usr/share/dllearner</prefix> + </mapper> + </data> + </dataSet> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> Added: trunk/components-core/src/deb/control/control =================================================================== --- trunk/components-core/src/deb/control/control (rev 0) +++ trunk/components-core/src/deb/control/control 2011-03-22 20:45:22 UTC (rev 2730) @@ -0,0 +1,9 @@ +Package: dl-learner-components-core +Version: 1.0.0 +Section: misc +Priority: optional +Architecture: all +Depends: openjdk-6-jre | sun-java6-jre +Maintainer: Jens Lehmann <le...@in...> +Description: This is a package that contains the core components of the dl-learner. +Distribution: development \ No newline at end of file Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2011-03-20 16:40:28 UTC (rev 2729) +++ trunk/interfaces/pom.xml 2011-03-22 20:45:22 UTC (rev 2730) @@ -1,61 +1,88 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>org.dllearner</groupId> - <artifactId>interfaces</artifactId> - <packaging>jar</packaging> - <name>Interfaces: GUI, CLI, Web Service </name> - <url>http://aksw.org/Projects/DLLearner</url> - - <parent> - <groupId>org.dllearner</groupId> - <artifactId>dllearner-parent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> - - <build> - <plugins> - <!--Surefire - for JUnits--> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <excludes> - <exclude>org/dllearner/test/junit/OWLlinkTest.java</exclude> - </excludes> - </configuration> - </plugin> - </plugins> - </build> + <groupId>org.dllearner</groupId> + <artifactId>interfaces</artifactId> + <packaging>jar</packaging> + <name>Interfaces: GUI, CLI, Web Service </name> + <url>http://aksw.org/Projects/DLLearner</url> - <dependencies> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - </dependency> + <parent> + <groupId>org.dllearner</groupId> + <artifactId>dllearner-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> - <!--Added the dependency of the core tests so that they will be accessible from the tests in this component--> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - <classifier>tests</classifier> - <scope>test</scope> - </dependency> + <build> + <plugins> + <!--Surefire - for JUnits --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/dllearner/test/junit/OWLlinkTest.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <artifactId>jdeb</artifactId> + <groupId>org.vafer</groupId> + <version>0.8</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>jdeb</goal> + </goals> + <configuration> + <dataSet> + <data> + <src>${project.build.directory}/${project.build.finalName}.jar</src> + <type>file</type> + <mapper> + <type>perm</type> + <prefix>/usr/share/dllearner</prefix> + </mapper> + </data> + </dataSet> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-ext</artifactId> - </dependency> - <dependency> - <groupId>com.jamonapi</groupId> - <artifactId>jamon</artifactId> - </dependency> + <dependencies> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> + <!--Added the dependency of the core tests so that they will be accessible + from the tests in this component --> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + <classifier>tests</classifier> + <scope>test</scope> + </dependency> - </dependencies> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-ext</artifactId> + </dependency> + <dependency> + <groupId>com.jamonapi</groupId> + <artifactId>jamon</artifactId> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + + </dependencies> </project> Added: trunk/interfaces/src/deb/control/control =================================================================== --- trunk/interfaces/src/deb/control/control (rev 0) +++ trunk/interfaces/src/deb/control/control 2011-03-22 20:45:22 UTC (rev 2730) @@ -0,0 +1,9 @@ +Package: dl-learner-interfaces +Version: 1.0.0 +Section: misc +Priority: optional +Architecture: all +Depends: openjdk-6-jre | sun-java6-jre +Maintainer: Jens Lehmann <le...@in...> +Description: This is a package that contains the cli and gui components of the dl-learner. +Distribution: development \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2011-03-24 11:34:14
|
Revision: 2736 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2736&view=rev Author: heeroyuy Date: 2011-03-24 11:34:07 +0000 (Thu, 24 Mar 2011) Log Message: ----------- -added changes file for debian packages Added Paths: ----------- trunk/components-core/src/deb/control/changes trunk/interfaces/src/deb/control/changes Added: trunk/components-core/src/deb/control/changes =================================================================== --- trunk/components-core/src/deb/control/changes (rev 0) +++ trunk/components-core/src/deb/control/changes 2011-03-24 11:34:07 UTC (rev 2736) @@ -0,0 +1,10 @@ + * support for OWL API 3, ORE tool based on DL-Learner algorithms (soon to be migrated to an own project), implemented several new heuristics, e.g. generalised F-Measure, stochastic approximation of computing F-Measure, learning algorithms for the EL description logic, support for hasValue construct in combination with string datatype, support for refining existing definitions (instead of learning from scratch) for CELOE ontology engineering algorithm, increased number of unit tests (now 40), support for direct Pellet 2 integration and reasoners connected via OWLLink, 24 bugs fixed and 12 feature requests implemented at sourceforge.net bug tracker +release distribution=staging, date=20:13 07.08.2010,version=1.0,urgency=low,by=Jens Lehmann <le...@in...> + * new algorithm: CELOE (class expression learning for ontology engineering), an efficient refinement operator for the EL description logic, fast stochastic class expression coverage estimation included, reasoner component design and learning problem structure improved, more learning examples provided and unit tests for ensuring code quality extended, 6 bugs and feature requests reported at the sourceforge.net tracker fixed +release distribution=staging, date=20:13 06.05.2009,version=0.9,urgency=low,by=Jens Lehmann <le...@in...> + * improved refinement operator based learning approach taking domain/range of properties, property hierarchies, disjoint classes into account to structure search space more efficiently, fast instance checking algorithm reduces the time to test example coverage of class descriptions significantly, more learning examples provided in release, 12 bugs and 10 feature requests reported at the sourceforge.net tracker fixed +release distribution=staging, date=20:13 13.10.2008,version=0.8,urgency=low,by=Jens Lehmann <le...@in...> + * Flexible new component based structure: 4 types of components: knowledge sources, reasoners, learning problems, learning algorithms, easily extensible: to implement a new component of one of the above types you only have to extend the corresponding class in org.dllearner.core and add the name of your class to the components.ini file, each component can maintain and easily extend its own configuration options, Support for using SPARQL endpoints as background knowledge, including mechanisms for knowledge fragment selection. This feature enables DL-Learner to use DBpedia as background knowledge,Preliminary support for learning from only positive examples and learning of inclusion axioms instead of definitions, Support for N-Triple files, Support for using role hierarchies in the refinement operator based algorithm, Much more powerful web service interface allowing to access and modify all DL-Learner components, Reasoners:preliminary OWL API reasoner interface support: Pellet, FaCT++, KAON2 dropped, such that DL-Learner now depends solely on open source libraries, A Prolog parser, which can help in converting Prolog files to OWL (thereby transfering ILP problems into OWL learning problems), +release distribution=staging, date=20:13 18.02.2008,version=0.7,urgency=low,by=Jens Lehmann <le...@in...> + * initial release +release distribution=staging, date=20:13 31.08.2007,version=0.6,urgency=low,by=Jens Lehmann <le...@in...> Added: trunk/interfaces/src/deb/control/changes =================================================================== --- trunk/interfaces/src/deb/control/changes (rev 0) +++ trunk/interfaces/src/deb/control/changes 2011-03-24 11:34:07 UTC (rev 2736) @@ -0,0 +1,4 @@ + * DL-Learner GUI for loading, saving, and modifying configuration files +release distribution=staging, date=20:13 13.10.2008,version=0.7,urgency=low,by=Jens Lehmann <le...@in...> + * initial release +release distribution=staging, date=20:13 31.08.2007,version=0.6,urgency=low,by=Jens Lehmann <le...@in...> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-03-29 16:10:06
|
Revision: 2740 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2740&view=rev Author: jenslehmann Date: 2011-03-29 16:09:59 +0000 (Tue, 29 Mar 2011) Log Message: ----------- added script template for learning DBpedia ontology classes Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/SortedSetTuple.java Added Paths: ----------- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java Modified: trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/SortedSetTuple.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/SortedSetTuple.java 2011-03-29 15:41:28 UTC (rev 2739) +++ trunk/components-core/src/main/java/org/dllearner/utilities/datastructures/SortedSetTuple.java 2011-03-29 16:09:59 UTC (rev 2740) @@ -1,3 +1,22 @@ +/** + * Copyright (C) 2007-2011, 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.utilities.datastructures; import java.util.SortedSet; @@ -3,4 +22,14 @@ import java.util.TreeSet; +import org.dllearner.utilities.Helper; + +/** + * + * Convenience data structure for keeping positive and negative examples in a single structure. + * + * @author Jens Lehmann + * + * @param <T> The datatype (usually Individual or String). + */ public class SortedSetTuple<T> { @@ -26,4 +55,8 @@ return negSet; } + public SortedSet<T> getCompleteSet() { + return Helper.union(posSet, negSet); + } + } Added: trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java (rev 0) +++ trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java 2011-03-29 16:09:59 UTC (rev 2740) @@ -0,0 +1,108 @@ +/** + * Copyright (C) 2007-2011, 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.improveWikipedia; + +import java.io.File; +import java.io.IOException; +import java.util.Set; +import java.util.SortedSet; + +import org.dllearner.algorithms.celoe.CELOE; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.OntologyFormat; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.CELOEConfigurator; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.EquivalentClassesAxiom; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.KB; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.gui.Config; +import org.dllearner.gui.ConfigSave; +import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.utilities.datastructures.Datastructures; +import org.dllearner.utilities.datastructures.SortedSetTuple; + +/** + * A script, which learns definitions / super classes of classes in the DBpedia ontology. + * + * @author Jens Lehmann + * + */ +public class DBpediaClassLearnerCELOE { + + public DBpediaClassLearnerCELOE() { + // OPTIONAL: if you want to do some case distinctions in the learnClass method, you could add + // parameters to the constructure e.g. YAGO_ + } + + public KB learnAllClasses(Set<String> classesToLearn) throws LearningProblemUnsupportedException, IOException { + KB kb = new KB(); + for(String classToLearn : classesToLearn) { + kb.addAxiom(new EquivalentClassesAxiom(new NamedClass(classToLearn), learnClass(classToLearn))); + } + return kb; + } + + public Description learnClass(String classToLearn) throws LearningProblemUnsupportedException, IOException { + + // TODO: code for getting postive and negative examples for class to learn + SortedSet<Individual> posExamples = null; + SortedSet<Individual> negExamples = null; + SortedSetTuple<Individual> examples = new SortedSetTuple<Individual>(posExamples, negExamples); + + ComponentManager cm = ComponentManager.getInstance(); + + SparqlKnowledgeSource ks = cm.knowledgeSource(SparqlKnowledgeSource.class); + ks.getConfigurator().setInstances(Datastructures.individualSetToStringSet(examples.getCompleteSet())); + ks.getConfigurator().setPredefinedEndpoint("DBPEDIA"); // TODO: probably the official endpoint is too slow? + + ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, ks); + + PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); + lp.getConfigurator().setAccuracyMethod("fMeasure"); + lp.getConfigurator().setUseApproximations(false); + + CELOE la = cm.learningAlgorithm(CELOE.class, lp, rc); + CELOEConfigurator cc = la.getConfigurator(); + cc.setMaxExecutionTimeInSeconds(100); + cc.setNoisePercentage(20); + // TODO: set more options as needed + + // to write the above configuration in a conf file (optional) + Config cf = new Config(cm, ks, rc, lp, la); + new ConfigSave(cf).saveFile(new File("/dev/null")); + + la.start(); + + return la.getCurrentlyBestDescription(); + } + + public static void main(String args[]) throws LearningProblemUnsupportedException, IOException { + DBpediaClassLearnerCELOE dcl = new DBpediaClassLearnerCELOE(); + Set<String> classesToLearn = null; + KB kb = dcl.learnAllClasses(classesToLearn); + kb.export(new File("/dev/null"), OntologyFormat.RDF_XML); // TODO: pick appropriate place to save ontology + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2011-04-03 20:25:41
|
Revision: 2744 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2744&view=rev Author: kurzum Date: 2011-04-03 20:25:35 +0000 (Sun, 03 Apr 2011) Log Message: ----------- updated dependencies to aksw commons\n fix for concurrency in ExtractionDBCache Modified Paths: -------------- trunk/autosparql/pom.xml trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java trunk/pom.xml trunk/scripts/pom.xml trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java Added Paths: ----------- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java Modified: trunk/autosparql/pom.xml =================================================================== --- trunk/autosparql/pom.xml 2011-04-01 09:38:11 UTC (rev 2743) +++ trunk/autosparql/pom.xml 2011-04-03 20:25:35 UTC (rev 2744) @@ -99,10 +99,6 @@ <artifactId>log4j</artifactId> </dependency> - <dependency> - <groupId>org.aksw.commons</groupId> - <artifactId>commons</artifactId> - </dependency> <dependency> Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2011-04-01 09:38:11 UTC (rev 2743) +++ trunk/components-core/pom.xml 2011-04-03 20:25:35 UTC (rev 2744) @@ -190,10 +190,7 @@ <artifactId>h2</artifactId> </dependency> - <dependency> - <groupId>org.aksw.commons</groupId> - <artifactId>commons</artifactId> - </dependency> + </dependencies> </project> Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2011-04-01 09:38:11 UTC (rev 2743) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2011-04-03 20:25:35 UTC (rev 2744) @@ -236,7 +236,7 @@ conn.close(); } - private byte[] md5(String string) { + private synchronized byte[] md5(String string) { md5.reset(); md5.update(string.getBytes()); return md5.digest(); Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-04-01 09:38:11 UTC (rev 2743) +++ trunk/pom.xml 2011-04-03 20:25:35 UTC (rev 2744) @@ -271,7 +271,7 @@ <dependency> <groupId>org.aksw.commons</groupId> - <artifactId>commons</artifactId> + <artifactId>sparql</artifactId> <version>${aksw.version}</version> </dependency> Modified: trunk/scripts/pom.xml =================================================================== --- trunk/scripts/pom.xml 2011-04-01 09:38:11 UTC (rev 2743) +++ trunk/scripts/pom.xml 2011-04-03 20:25:35 UTC (rev 2744) @@ -1,13 +1,14 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.dllearner</groupId> <artifactId>scripts</artifactId> <packaging>jar</packaging> - <name>Executable scripts </name> + <name>Executable scripts</name> <url>http://aksw.org/Projects/DLLearner</url> - + <parent> <groupId>org.dllearner</groupId> <artifactId>dllearner-parent</artifactId> @@ -33,17 +34,20 @@ <artifactId>secondstring</artifactId> </dependency> <dependency> - <groupId>postgresql</groupId> - <artifactId>postgresql</artifactId> + <groupId>postgresql</groupId> + <artifactId>postgresql</artifactId> </dependency> - <dependency> - <groupId>com.dumontierlab</groupId> - <artifactId>pdb2rdf-parser</artifactId> + <dependency> + <groupId>com.dumontierlab</groupId> + <artifactId>pdb2rdf-parser</artifactId> </dependency> - <dependency> - <groupId>com.dumontierlab</groupId> - <artifactId>pdb2rdf-cli</artifactId> + <dependency> + <groupId>com.dumontierlab</groupId> + <artifactId>pdb2rdf-cli</artifactId> </dependency> - + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>sparql</artifactId> + </dependency> </dependencies> </project> Modified: trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java 2011-04-01 09:38:11 UTC (rev 2743) +++ trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java 2011-04-03 20:25:35 UTC (rev 2744) @@ -50,6 +50,7 @@ * */ public class DBpediaClassLearnerCELOE { + //SparqlEndpoint se ; public DBpediaClassLearnerCELOE() { // OPTIONAL: if you want to do some case distinctions in the learnClass method, you could add @@ -104,5 +105,10 @@ KB kb = dcl.learnAllClasses(classesToLearn); kb.export(new File("/dev/null"), OntologyFormat.RDF_XML); // TODO: pick appropriate place to save ontology } + + + public Set<String> getInstances(){ + return null; + } } Copied: trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java (from rev 2743, trunk/components-core/src/main/java/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderSPARQL.java) =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java (rev 0) +++ trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java 2011-04-03 20:25:35 UTC (rev 2744) @@ -0,0 +1,341 @@ +/** + * Copyright (C) 2007, 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.improveWikipedia; + +import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.vocabulary.OWL; +import com.hp.hpl.jena.vocabulary.RDF; +import org.aksw.commons.sparql.core.SparqlEndpoint; +import org.apache.log4j.Logger; +import org.dllearner.kb.sparql.SPARQLTasks; +import org.dllearner.utilities.datastructures.SetManipulation; +import org.dllearner.utilities.owl.OWLVocabulary; + +import java.util.Iterator; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +public class InstanceFinderSPARQL { + + // LOGGER: ComponentManager + private static Logger logger = Logger.getLogger(InstanceFinderSPARQL.class); + + + public static void randomInstances(Set<String> blacklist, SparqlEndpoint se) { + logger.debug("retrieving random instances "); + String query = "SELECT ?subject { ?subject <" + RDF.type + "> <" + OWL.Thing + "> } "; + + ResultSet r = se.executeSelect(query); + + + //fromRandom = sparqltasks.queryAsSet(sparqlQueryString, variable); + //fromRandom.removeAll(fullPositiveSet); + //logger.debug("|-negExample size from random: " + fromRandom.size()); + } + + + private SPARQLTasks sparqltasks; + + private SortedSet<String> filterClasses; + + private SortedSet<String> fullPositiveSet; + + private SortedSet<String> fromRelated = new TreeSet<String>(); + private SortedSet<String> fromNearbyClasses = new TreeSet<String>(); + private SortedSet<String> fromSuperclasses = new TreeSet<String>(); + ; + private SortedSet<String> fromParallelClasses = new TreeSet<String>(); + ; + private SortedSet<String> fromRandom = new TreeSet<String>(); + ; + private SortedSet<String> fromDomain = new TreeSet<String>(); + ; + private SortedSet<String> fromRange = new TreeSet<String>(); + ; + + static int poslimit = 10; + static int neglimit = 20; + + + /** + * takes as input a full positive set to make sure no negatives are added as positives + * + * @param fullPositiveSet + * @param st + */ + public InstanceFinderSPARQL( + SortedSet<String> fullPositiveSet, + SPARQLTasks st, SortedSet<String> filterClasses) { + super(); + this.fullPositiveSet = new TreeSet<String>(); + this.fullPositiveSet.addAll(fullPositiveSet); + this.sparqltasks = st; + this.filterClasses = filterClasses; + } + + + /** + * see <code> getNegativeExamples(int neglimit, boolean stable )</code> + * + * @param neglimit + */ + public SortedSet<String> getNegativeExamples(int neglimit) { + return getNegativeExamples(neglimit, false); + } + + /** + * aggregates all collected neg examples + * CAVE: it is necessary to call one of the make functions before calling this + * OTHERWISE it will choose random examples + * + * @param neglimit size of negative Example set, 0 means all, which can be quite large several thousands + * @param stable decides whether neg Examples are randomly picked, default false, faster for developing, since the cache can be used + */ + public SortedSet<String> getNegativeExamples(int neglimit, boolean stable) { + SortedSet<String> negatives = new TreeSet<String>(); + negatives.addAll(fromNearbyClasses); + negatives.addAll(fromParallelClasses); + negatives.addAll(fromRelated); + negatives.addAll(fromSuperclasses); + if (negatives.isEmpty()) { + negatives.addAll(fromRandom); + } + if (neglimit <= 0) { + logger.debug("neg Example size NO shrinking: " + negatives.size()); + return negatives; + } + + logger.debug("neg Example size before shrinking: " + negatives.size()); + if (stable) { + negatives = SetManipulation.stableShrink(negatives, neglimit); + } else { + negatives = SetManipulation.fuzzyShrink(negatives, neglimit); + } + logger.debug("neg Example size after shrinking: " + negatives.size()); + return negatives; + } + + + public void makeNegativeExamplesFromRandomInstances() { + logger.debug("making random examples "); + String variable = "subject"; + String sparqlQueryString = "SELECT ?" + variable + " WHERE {" + + "?" + variable + " <" + OWLVocabulary.RDF_TYPE + ">" + " ?o" + + "}"; + + fromRandom = sparqltasks.queryAsSet(sparqlQueryString, variable); + fromRandom.removeAll(fullPositiveSet); + logger.debug("|-negExample size from random: " + fromRandom.size()); + } + + /** + * makes neg ex from related instances, that take part in a role R(pos,neg) + * filters all objects, that don't use the given namespace + * + * @param instances + * @param objectNamespace + */ + public void makeNegativeExamplesFromRelatedInstances(SortedSet<String> instances, + String objectNamespace) { + logger.debug("making examples from related instances"); + for (String oneInstance : instances) { + makeNegativeExamplesFromRelatedInstances(oneInstance, objectNamespace); + } + logger.debug("|-negExample size from related: " + fromRelated.size()); + } + + private void makeNegativeExamplesFromRelatedInstances(String oneInstance, String objectnamespace) { + // SortedSet<String> result = new TreeSet<String>(); + + String SPARQLquery = "SELECT * WHERE { \n" + "<" + oneInstance + "> " + "?p ?object. \n" + + "FILTER (REGEX(str(?object), '" + objectnamespace + "')).\n" + "}"; + + fromRelated.addAll(sparqltasks.queryAsSet(SPARQLquery, "object")); + fromRelated.removeAll(fullPositiveSet); + + } + + // keep a while may still be needed + /*public void dbpediaMakeNegativeExamplesFromRelatedInstances(String subject) { + // SortedSet<String> result = new TreeSet<String>(); + + String SPARQLquery = "SELECT * WHERE { \n" + "<" + subject + "> " + "?p ?o. \n" + + "FILTER (REGEX(str(?o), 'http://dbpedia.org/resource/')).\n" + + "FILTER (!REGEX(str(?p), 'http://www.w3.org/2004/02/skos'))\n" + "}"; + + this.fromRelated.addAll(sparqltasks.queryAsSet(SPARQLquery, "o")); + + }*/ + + public void makeNegativeExamplesFromNearbyClasses(SortedSet<String> positiveSet, int sparqlResultLimit) { + SortedSet<String> classes = new TreeSet<String>(); + Iterator<String> instanceIter = positiveSet.iterator(); + while (classes.isEmpty() && instanceIter.hasNext()) { + classes.addAll(sparqltasks.getClassesForInstance(instanceIter.next(), 100)); + } + String concept = classes.first(); + if (filterClasses != null && filterClasses.size() > 0) { + boolean br = false; + for (String oneClass : classes) { + Iterator<String> iter = filterClasses.iterator(); + while (iter.hasNext()) { + if (oneClass.startsWith(iter.next())) { + break; + } else { + concept = oneClass; + br = true; + break; + } + } + if (br) break; + } + } + concept = concept.replaceAll("\"", ""); + SortedSet<String> superClasses = sparqltasks.getSuperClasses(concept, 1); + + classes = new TreeSet<String>(); + for (String oneSuperClass : superClasses) { + classes.addAll(sparqltasks.getSubClasses(oneSuperClass, 1)); + } + classes.remove(concept); + for (String oneClass : classes) { + try { + fromNearbyClasses.addAll(sparqltasks.retrieveInstancesForClassDescription("\"" + + oneClass + "\"", sparqlResultLimit)); + } catch (Exception e) { + } + } + + this.fromNearbyClasses.removeAll(fullPositiveSet); + } + + /** + * makes negEx from classes, the posEx belong to. + * Gets all Classes from PosEx, gets Instances from these Classes, returns all + * + * @param positiveSet + * @param sparqlResultLimit + */ + public void makeNegativeExamplesFromParallelClasses(SortedSet<String> positiveSet, int sparqlResultLimit) { + makeNegativeExamplesFromClassesOfInstances(positiveSet, sparqlResultLimit); + } + + private void makeNegativeExamplesFromClassesOfInstances(SortedSet<String> positiveSet, + int sparqlResultLimit) { + logger.debug("making neg Examples from parallel classes"); + SortedSet<String> classes = new TreeSet<String>(); + // superClasses.add(concept.replace("\"", "")); + // logger.debug("before"+superClasses); + // superClasses = dbpediaGetSuperClasses( superClasses, 4); + // logger.debug("getting negExamples from "+superClasses.size()+" + // superclasses"); + + for (String instance : positiveSet) { + try { + classes.addAll(sparqltasks.getClassesForInstance(instance, sparqlResultLimit)); + } catch (Exception e) { + e.printStackTrace(); + logger.warn("ignoring SPARQLQuery failure, see log/sparql.txt"); + } + } + logger.debug("getting negExamples from " + classes.size() + " parallel classes"); + for (String oneClass : classes) { + logger.debug(oneClass); + // rsc = new + // JenaResultSetConvenience(queryConcept("\""+oneClass+"\"",limit)); + try { + this.fromParallelClasses.addAll(sparqltasks.retrieveInstancesForClassDescription("\"" + oneClass + + "\"", sparqlResultLimit)); + } catch (Exception e) { + logger.warn("ignoring SPARQLQuery failure, see log/sparql.txt"); + } + } + + fromParallelClasses.removeAll(fullPositiveSet); + logger.debug("|-neg Example size from parallelclass: " + fromParallelClasses.size()); + + } + + + /** + * it gets the first class of an arbitrary instance and queries the superclasses of it, + * could be more elaborate. + * It is better to use makeNegativeExamplesFromSuperClasses + * + * @param positiveSet + * @param sparqlResultSetLimit + */ + public void makeNegativeExamplesFromSuperClassesOfInstances(SortedSet<String> positiveSet, + int sparqlResultSetLimit) { + SortedSet<String> classes = new TreeSet<String>(); + Iterator<String> instanceIter = positiveSet.iterator(); + while (classes.isEmpty() && instanceIter.hasNext()) { + classes.addAll(sparqltasks.getClassesForInstance(instanceIter.next(), sparqlResultSetLimit)); + + } + makeNegativeExamplesFromSuperClasses(classes.first(), sparqlResultSetLimit); + } + + + public void makeNegativeExamplesFromSuperClasses(String concept, int sparqlResultSetLimit) { + makeNegativeExamplesFromSuperClasses(concept, sparqlResultSetLimit, 2); + } + + /** + * if pos ex derive from one class, then neg ex are taken from a superclass + * + * @param concept + * @param sparqlResultSetLimit + */ + public void makeNegativeExamplesFromSuperClasses(String concept, int sparqlResultSetLimit, int depth) { + + concept = concept.replaceAll("\"", ""); + // superClasses.add(concept.replace("\"", "")); + // logger.debug("before"+superClasses); + SortedSet<String> superClasses = sparqltasks.getSuperClasses(concept, depth); + logger.debug("making neg Examples from " + superClasses.size() + " superclasses"); + + for (String oneSuperClass : superClasses) { + logger.debug(oneSuperClass); + fromSuperclasses.addAll(sparqltasks.retrieveInstancesForClassDescription("\"" + + oneSuperClass + "\"", sparqlResultSetLimit)); + + } + this.fromSuperclasses.removeAll(fullPositiveSet); + logger.debug("|-neg Example from superclass: " + fromSuperclasses.size()); + } + + @SuppressWarnings("unused") + private void makeNegativeExamplesFromDomain(String role, int sparqlResultSetLimit) { + logger.debug("making Negative Examples from Domain of : " + role); + fromDomain.addAll(sparqltasks.getDomainInstances(role, sparqlResultSetLimit)); + fromDomain.removeAll(fullPositiveSet); + logger.debug("|-neg Example size from Domain: " + this.fromDomain.size()); + } + + @SuppressWarnings("unused") + private void makeNegativeExamplesFromRange(String role, int sparqlResultSetLimit) { + logger.debug("making Negative Examples from Range of : " + role); + fromRange.addAll(sparqltasks.getRangeInstances(role, sparqlResultSetLimit)); + fromRange.removeAll(fullPositiveSet); + logger.debug("|-neg Example size from Range: " + fromRange.size()); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2011-04-04 06:45:35
|
Revision: 2745 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2745&view=rev Author: kurzum Date: 2011-04-04 06:45:24 +0000 (Mon, 04 Apr 2011) Log Message: ----------- fixed hudson error Modified Paths: -------------- trunk/autosparql/pom.xml trunk/autosparql/src/main/java/org/dllearner/autosparql/server/SPARQLSearch.java trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java trunk/pom.xml trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java Modified: trunk/autosparql/pom.xml =================================================================== --- trunk/autosparql/pom.xml 2011-04-03 20:25:35 UTC (rev 2744) +++ trunk/autosparql/pom.xml 2011-04-04 06:45:24 UTC (rev 2745) @@ -1,428 +1,432 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <!-- POM generated by gwt-maven-plugin archetype --> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>dllearner-parent</artifactId> - <groupId>org.dllearner</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <groupId>org.dllearner</groupId> - <artifactId>autosparql</artifactId> - <packaging>war</packaging> - <name>AutoSPARQL</name> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <!-- POM generated by gwt-maven-plugin archetype --> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>dllearner-parent</artifactId> + <groupId>org.dllearner</groupId> + <version>1.0-SNAPSHOT</version> + </parent> + <groupId>org.dllearner</groupId> + <artifactId>autosparql</artifactId> + <packaging>war</packaging> + <name>AutoSPARQL</name> - <properties> - <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding> - </properties> + <properties> + <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding> + </properties> - <repositories> - <repository> - <id>Simmetrics</id> - <url>http://maven.mse.jhu.edu/m2repository/</url> - </repository> - <repository> - <id>opennlp.sf.net</id> - <url>http://opennlp.sourceforge.net/maven2</url> - </repository> - <repository> - <id>Sesame</id> - <url>http://repo.aduna-software.org/maven2/releases/</url> - </repository> - <repository> - <id>info-bliki-repository</id> - <url>http://gwtwiki.googlecode.com/svn/maven-repository/</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> + <repositories> + <repository> + <id>Simmetrics</id> + <url>http://maven.mse.jhu.edu/m2repository/</url> + </repository> + <repository> + <id>opennlp.sf.net</id> + <url>http://opennlp.sourceforge.net/maven2</url> + </repository> + <repository> + <id>Sesame</id> + <url>http://repo.aduna-software.org/maven2/releases/</url> + </repository> + <repository> + <id>info-bliki-repository</id> + <url>http://gwtwiki.googlecode.com/svn/maven-repository/</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> - </repositories> - <dependencies> - <dependency> - <groupId>info.bliki.wiki</groupId> - <artifactId>bliki-core</artifactId> - <version>3.0.16</version> - </dependency> - <dependency> - <groupId>opennlp</groupId> - <artifactId>tools</artifactId> - <version>1.5.0</version> - </dependency> + </repositories> + <dependencies> + <dependency> + <groupId>info.bliki.wiki</groupId> + <artifactId>bliki-core</artifactId> + <version>3.0.16</version> + </dependency> + <dependency> + <groupId>opennlp</groupId> + <artifactId>tools</artifactId> + <version>1.5.0</version> + </dependency> - <!-- GWT dependencies (from central repo) --> - <dependency> - <groupId>com.google.gwt</groupId> - <artifactId>gwt-servlet</artifactId> - <scope>compile</scope> - </dependency> + <!-- GWT dependencies (from central repo) --> + <dependency> + <groupId>com.google.gwt</groupId> + <artifactId>gwt-servlet</artifactId> + <scope>compile</scope> + </dependency> - <dependency> - <groupId>com.google.gwt</groupId> - <artifactId>gwt-user</artifactId> - <scope>provided</scope> - </dependency> + <dependency> + <groupId>com.google.gwt</groupId> + <artifactId>gwt-user</artifactId> + <scope>provided</scope> + </dependency> - <!-- test --> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> + <!-- test --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> - <dependency> - <groupId>com.extjs</groupId> - <artifactId>gxt</artifactId> - </dependency> + <dependency> + <groupId>com.extjs</groupId> + <artifactId>gxt</artifactId> + </dependency> - <dependency> - <groupId>com.hp.hpl.jena</groupId> - <artifactId>arq</artifactId> - </dependency> + <dependency> + <groupId>com.hp.hpl.jena</groupId> + <artifactId>arq</artifactId> + </dependency> - <dependency> - <groupId>com.hp.hpl.jena</groupId> - <artifactId>jena</artifactId> - </dependency> + <dependency> + <groupId>com.hp.hpl.jena</groupId> + <artifactId>jena</artifactId> + </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - </dependency> + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + </dependency> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </dependency> + <dependency> + <groupId>mysql</groupId> + <artifactId>mysql-connector-java</artifactId> + </dependency> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - </dependency> + <dependency> + <groupId>commons-configuration</groupId> + <artifactId>commons-configuration</artifactId> + </dependency> + <dependency> + <groupId>org.ini4j</groupId> + <artifactId>ini4j</artifactId> + </dependency> - <dependency> - <groupId>commons-configuration</groupId> - <artifactId>commons-configuration</artifactId> - </dependency> - <dependency> - <groupId>org.ini4j</groupId> - <artifactId>ini4j</artifactId> - </dependency> + <!-- Jars for SIMBA stuff from Axel --> - <!-- Jars for SIMBA stuff from Axel --> + <dependency> + <groupId>uk.ac.shef.wit</groupId> + <artifactId>simmetrics</artifactId> + <version>1.6.2</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>stax</groupId> + <artifactId>stax-api</artifactId> + <version>1.0.1</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>woodstox</groupId> + <artifactId>wstx-api</artifactId> + <version>3.2.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>edu.stanford</groupId> + <artifactId>postagger</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>lbj</groupId> + <artifactId>library</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>lbj</groupId> + <artifactId>core</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>lbj</groupId> + <artifactId>ner</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>jaws</groupId> + <artifactId>core</artifactId> + <version>1.0</version> + </dependency> + <dependency> + <groupId>org.openrdf.sesame</groupId> + <artifactId>sesame-rio-api</artifactId> + <version>2.3.2</version> + </dependency> + <dependency> + <groupId>org.openrdf.sesame</groupId> + <artifactId>sesame-rio-ntriples</artifactId> + <version>2.3.2</version> + </dependency> - <dependency> - <groupId>uk.ac.shef.wit</groupId> - <artifactId>simmetrics</artifactId> - <version>1.6.2</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>stax</groupId> - <artifactId>stax-api</artifactId> - <version>1.0.1</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>woodstox</groupId> - <artifactId>wstx-api</artifactId> - <version>3.2.0</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>edu.stanford</groupId> - <artifactId>postagger</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>lbj</groupId> - <artifactId>library</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>lbj</groupId> - <artifactId>core</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>lbj</groupId> - <artifactId>ner</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>jaws</groupId> - <artifactId>core</artifactId> - <version>1.0</version> - </dependency> - <dependency> - <groupId>org.openrdf.sesame</groupId> - <artifactId>sesame-rio-api</artifactId> - <version>2.3.2</version> - </dependency> - <dependency> - <groupId>org.openrdf.sesame</groupId> - <artifactId>sesame-rio-ntriples</artifactId> - <version>2.3.2</version> - </dependency> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-lucene-core</artifactId> + <version>1.3.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-core</artifactId> + <version>1.4.1</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.openrdf.sesame</groupId> + <artifactId>sesame-model</artifactId> + <version>2.3.2</version> + <type>pom</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-wordnet</artifactId> + <version>3.0.3</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.openrdf</groupId> + <artifactId>sesame</artifactId> + <version>1.2.7</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-lucene-analyzers</artifactId> + <version>1.3.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-common</artifactId> + <version>1.3.0</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.solr.solr</groupId> + <artifactId>solr-parent</artifactId> + <version>1.4.1</version> + <type>pom</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-core</artifactId> + <version>2.9.4</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-ext</artifactId> + <version>1.0-SNAPSHOT</version> + <type>jar</type> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>util</artifactId> + </dependency> - <dependency> - <groupId>org.apache.solr</groupId> - <artifactId>solr-lucene-core</artifactId> - <version>1.3.0</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.solr</groupId> - <artifactId>solr-core</artifactId> - <version>1.4.1</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.openrdf.sesame</groupId> - <artifactId>sesame-model</artifactId> - <version>2.3.2</version> - <type>pom</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-wordnet</artifactId> - <version>3.0.3</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.openrdf</groupId> - <artifactId>sesame</artifactId> - <version>1.2.7</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.solr</groupId> - <artifactId>solr-lucene-analyzers</artifactId> - <version>1.3.0</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.solr</groupId> - <artifactId>solr-common</artifactId> - <version>1.3.0</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.solr.solr</groupId> - <artifactId>solr-parent</artifactId> - <version>1.4.1</version> - <type>pom</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-core</artifactId> - <version>2.9.4</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-ext</artifactId> - <version>1.0-SNAPSHOT</version> - <type>jar</type> - <scope>compile</scope> - </dependency> - </dependencies> + </dependencies> - <build> - <outputDirectory>war/WEB-INF/classes</outputDirectory> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>gwt-maven-plugin</artifactId> - <executions> - <execution> - <configuration> - <module>org.dllearner.autosparql.Application</module> - </configuration> - <goals> - <goal>compile</goal> - <!-- <goal>generateAsync</goal> --> - <!--<goal>test</goal> --> - </goals> - </execution> - </executions> - <configuration> - <hostedWebapp>war</hostedWebapp> - <runTarget>org.dllearner.autosparql.Application/index.html</runTarget> - <modules> - <module>org.dllearner.autosparql.Application</module> - </modules> - <localWorkers>6</localWorkers> - </configuration> + <build> + <outputDirectory>war/WEB-INF/classes</outputDirectory> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>gwt-maven-plugin</artifactId> + <executions> + <execution> + <configuration> + <module>org.dllearner.autosparql.Application</module> + </configuration> + <goals> + <goal>compile</goal> + <!-- <goal>generateAsync</goal> --> + <!--<goal>test</goal> --> + </goals> + </execution> + </executions> + <configuration> + <hostedWebapp>war</hostedWebapp> + <runTarget>org.dllearner.autosparql.Application/index.html</runTarget> + <modules> + <module>org.dllearner.autosparql.Application</module> + </modules> + <localWorkers>6</localWorkers> + </configuration> - </plugin> - <!-- If you want to use the target/web.xml file mergewebxml produces, - tell the war plugin to use it. Also, exclude what you want from the final - artifact here. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> - <configuration> <webXml>target/web.xml</webXml> <warSourceExcludes>.gwt-tmp/**</warSourceExcludes> - </configuration> </plugin> --> + </plugin> + <!-- If you want to use the target/web.xml file mergewebxml produces, + tell the war plugin to use it. Also, exclude what you want from the final + artifact here. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> + <configuration> <webXml>target/web.xml</webXml> <warSourceExcludes>.gwt-tmp/**</warSourceExcludes> + </configuration> </plugin> --> - <!--Surefire - for JUnits --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <excludes> - <exclude>org/dllearner/autosparql/server/*</exclude> - </excludes> - </configuration> - </plugin> + <!--Surefire - for JUnits --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/dllearner/autosparql/server/*</exclude> + </excludes> + </configuration> + </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <executions> - <execution> - <id>install-stanford-postagger</id> - <phase>validate</phase> - <goals> - <goal>install-file</goal> - </goals> - <configuration> - <file>${project.basedir}/lib/stanford-postagger-2010-05-21.jar</file> - <groupId>edu.stanford</groupId> - <artifactId>postagger</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - <createChecksum>true</createChecksum> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-LBJ2Library</id> - <phase>validate</phase> - <goals> - <goal>install-file</goal> - </goals> - <configuration> - <file>${project.basedir}/lib/LBJ2Library.jar</file> - <groupId>lbj</groupId> - <artifactId>library</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - <createChecksum>true</createChecksum> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-LBJ2</id> - <phase>validate</phase> - <goals> - <goal>install-file</goal> - </goals> - <configuration> - <file>${project.basedir}/lib/LBJ2.jar</file> - <groupId>lbj</groupId> - <artifactId>core</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - <createChecksum>true</createChecksum> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-LBJ2Ner</id> - <phase>validate</phase> - <goals> - <goal>install-file</goal> - </goals> - <configuration> - <file>${project.basedir}/lib/LbjNerTagger.jar</file> - <groupId>lbj</groupId> - <artifactId>ner</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - <createChecksum>true</createChecksum> - <generatePom>true</generatePom> - </configuration> - </execution> - <execution> - <id>install-jaws</id> - <phase>validate</phase> - <goals> - <goal>install-file</goal> - </goals> - <configuration> - <file>${project.basedir}/lib/jaws-bin.jar</file> - <groupId>jaws</groupId> - <artifactId>core</artifactId> - <version>1.0</version> - <packaging>jar</packaging> - <createChecksum>true</createChecksum> - <generatePom>true</generatePom> - </configuration> - </execution> - </executions> - </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <executions> + <execution> + <id>install-stanford-postagger</id> + <phase>validate</phase> + <goals> + <goal>install-file</goal> + </goals> + <configuration> + <file>${project.basedir}/lib/stanford-postagger-2010-05-21.jar</file> + <groupId>edu.stanford</groupId> + <artifactId>postagger</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + <createChecksum>true</createChecksum> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-LBJ2Library</id> + <phase>validate</phase> + <goals> + <goal>install-file</goal> + </goals> + <configuration> + <file>${project.basedir}/lib/LBJ2Library.jar</file> + <groupId>lbj</groupId> + <artifactId>library</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + <createChecksum>true</createChecksum> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-LBJ2</id> + <phase>validate</phase> + <goals> + <goal>install-file</goal> + </goals> + <configuration> + <file>${project.basedir}/lib/LBJ2.jar</file> + <groupId>lbj</groupId> + <artifactId>core</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + <createChecksum>true</createChecksum> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-LBJ2Ner</id> + <phase>validate</phase> + <goals> + <goal>install-file</goal> + </goals> + <configuration> + <file>${project.basedir}/lib/LbjNerTagger.jar</file> + <groupId>lbj</groupId> + <artifactId>ner</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + <createChecksum>true</createChecksum> + <generatePom>true</generatePom> + </configuration> + </execution> + <execution> + <id>install-jaws</id> + <phase>validate</phase> + <goals> + <goal>install-file</goal> + </goals> + <configuration> + <file>${project.basedir}/lib/jaws-bin.jar</file> + <groupId>jaws</groupId> + <artifactId>core</artifactId> + <version>1.0</version> + <packaging>jar</packaging> + <createChecksum>true</createChecksum> + <generatePom>true</generatePom> + </configuration> + </execution> + </executions> + </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>tomcat-maven-plugin</artifactId> - <version>1.0-beta-1</version> - <configuration> - <server>local</server> - <url>http://127.0.0.1:8080/manager</url> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>tomcat-maven-plugin</artifactId> + <version>1.0-beta-1</version> + <configuration> + <server>local</server> + <url>http://127.0.0.1:8080/manager</url> - </configuration> - </plugin> + </configuration> + </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.2</version> - <executions> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.2</version> + <executions> - <execution> - <goals> - <goal>exec</goal> - </goals> - </execution> - </executions> - <configuration> - <executable>java</executable> - <arguments> - <argument>-Xms512m</argument> - <argument>-Xmx6000m</argument> - </arguments> - </configuration> - </plugin> - </plugins> - </build> + <execution> + <goals> + <goal>exec</goal> + </goals> + </execution> + </executions> + <configuration> + <executable>java</executable> + <arguments> + <argument>-Xms512m</argument> + <argument>-Xmx6000m</argument> + </arguments> + </configuration> + </plugin> + </plugins> + </build> </project> Modified: trunk/autosparql/src/main/java/org/dllearner/autosparql/server/SPARQLSearch.java =================================================================== --- trunk/autosparql/src/main/java/org/dllearner/autosparql/server/SPARQLSearch.java 2011-04-03 20:25:35 UTC (rev 2744) +++ trunk/autosparql/src/main/java/org/dllearner/autosparql/server/SPARQLSearch.java 2011-04-04 06:45:24 UTC (rev 2745) @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import org.aksw.commons.util.strings.BifContains; import org.apache.log4j.Logger; Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2011-04-03 20:25:35 UTC (rev 2744) +++ trunk/components-core/pom.xml 2011-04-04 06:45:24 UTC (rev 2745) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.dllearner</groupId> @@ -23,7 +24,7 @@ <configuration> <!--Uncomment this when the junits are independent of a runtime directory--> <!--<includes>--> - <!--<include>org/dllearner/test/junit/*</include>--> + <!--<include>org/dllearner/test/junit/*</include>--> <!--</includes>--> <excludes> <exclude>org/dllearner/test/*</exclude> @@ -46,35 +47,40 @@ </executions> </plugin> <plugin> - <artifactId>jdeb</artifactId> - <groupId>org.vafer</groupId> - <version>0.8</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>jdeb</goal> - </goals> - <configuration> - <dataSet> - <data> - <src>${project.build.directory}/${project.build.finalName}.jar</src> - <type>file</type> - <mapper> - <type>perm</type> - <prefix>/usr/share/dllearner</prefix> - </mapper> - </data> - </dataSet> - </configuration> - </execution> - </executions> - </plugin> + <artifactId>jdeb</artifactId> + <groupId>org.vafer</groupId> + <version>0.8</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>jdeb</goal> + </goals> + <configuration> + <dataSet> + <data> + <src>${project.build.directory}/${project.build.finalName}.jar</src> + <type>file</type> + <mapper> + <type>perm</type> + <prefix>/usr/share/dllearner</prefix> + </mapper> + </data> + </dataSet> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build> <dependencies> + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>sparql</artifactId> + </dependency> + <!-- THIS IS FROM THE UNIBAS REPO--> <dependency> <groupId>net.sourceforge.owlapi</groupId> @@ -86,11 +92,11 @@ <groupId>com.owldl</groupId> <artifactId>pellet</artifactId> <exclusions> - <exclusion> <!-- declare the exclusion here --> - <groupId>org.mortbay.jetty</groupId> - <artifactId>org.mortbay.jetty</artifactId> - </exclusion> - </exclusions> + <exclusion> <!-- declare the exclusion here --> + <groupId>org.mortbay.jetty</groupId> + <artifactId>org.mortbay.jetty</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> @@ -98,7 +104,7 @@ <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> - + <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> @@ -124,14 +130,13 @@ </dependency> - - <dependency> + <dependency> <groupId>net.sf.jopt-simple</groupId> <artifactId>jopt-simple</artifactId> </dependency> - <!--Lucene is in Central--> + <!--Lucene is in Central--> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> @@ -184,12 +189,11 @@ <groupId>net.sourceforge.dig</groupId> <artifactId>dig-xmlbeans</artifactId> </dependency> - + <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </dependency> - </dependencies> Modified: trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2011-04-03 20:25:35 UTC (rev 2744) +++ trunk/components-core/src/main/java/org/dllearner/kb/sparql/ExtractionDBCache.java 2011-04-04 06:45:24 UTC (rev 2745) @@ -19,29 +19,22 @@ */ package org.dllearner.kb.sparql; -import java.io.ByteArrayOutputStream; -import java.io.StringReader; -import java.io.UnsupportedEncodingException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.sql.Clob; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; - -import org.aksw.commons.jena.ExtendedQueryEngineHTTP; -import org.dllearner.utilities.Helper; - import com.hp.hpl.jena.query.ResultSetFactory; import com.hp.hpl.jena.query.ResultSetRewindable; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; +import org.aksw.commons.jena.ExtendedQueryEngineHTTP; +import org.dllearner.utilities.Helper; +import java.io.ByteArrayOutputStream; +import java.io.StringReader; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.sql.*; + /** * The class is used to cache information about resources to a database. * Provides the connection to an H2 database in a light weight, configuration free Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-04-03 20:25:35 UTC (rev 2744) +++ trunk/pom.xml 2011-04-04 06:45:24 UTC (rev 2745) @@ -275,7 +275,13 @@ <version>${aksw.version}</version> </dependency> + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>util</artifactId> + <version>${aksw.version}</version> + </dependency> + <dependency> <groupId>net.sourceforge.secondstring</groupId> <artifactId>secondstring</artifactId> Modified: trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java 2011-04-03 20:25:35 UTC (rev 2744) +++ trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/InstanceFinderSPARQL.java 2011-04-04 06:45:24 UTC (rev 2745) @@ -43,15 +43,14 @@ logger.debug("retrieving random instances "); String query = "SELECT ?subject { ?subject <" + RDF.type + "> <" + OWL.Thing + "> } "; - ResultSet r = se.executeSelect(query); + //ResultSet r = se.executeSelect(query); //fromRandom = sparqltasks.queryAsSet(sparqlQueryString, variable); //fromRandom.removeAll(fullPositiveSet); //logger.debug("|-negExample size from random: " + fromRandom.size()); - } - + } private SPARQLTasks sparqltasks; private SortedSet<String> filterClasses; @@ -61,16 +60,10 @@ private SortedSet<String> fromRelated = new TreeSet<String>(); private SortedSet<String> fromNearbyClasses = new TreeSet<String>(); private SortedSet<String> fromSuperclasses = new TreeSet<String>(); - ; private SortedSet<String> fromParallelClasses = new TreeSet<String>(); - ; private SortedSet<String> fromRandom = new TreeSet<String>(); - ; private SortedSet<String> fromDomain = new TreeSet<String>(); - ; private SortedSet<String> fromRange = new TreeSet<String>(); - ; - static int poslimit = 10; static int neglimit = 20; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-04-04 07:21:37
|
Revision: 2746 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2746&view=rev Author: jenslehmann Date: 2011-04-04 07:21:31 +0000 (Mon, 04 Apr 2011) Log Message: ----------- removed Scala imports Modified Paths: -------------- trunk/components-core/src/test/java/org/dllearner/test/junit/HeuristicTests.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/WordNet.java Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/HeuristicTests.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/HeuristicTests.java 2011-04-04 06:45:24 UTC (rev 2745) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/HeuristicTests.java 2011-04-04 07:21:31 UTC (rev 2746) @@ -23,6 +23,7 @@ import java.net.MalformedURLException; import java.net.URL; +import java.util.Arrays; import java.util.Set; import java.util.TreeSet; @@ -44,8 +45,6 @@ import org.dllearner.utilities.Helper; import org.junit.Test; -import scala.actors.threadpool.Arrays; - /** * Tests for various heuristics employed in learning problems. * @@ -295,7 +294,7 @@ problem.init(); } - @SuppressWarnings("unchecked") +// @SuppressWarnings("unchecked") private static void configurePosNegStandardLP(PosNegLPStandard problem, Individual[] positiveExamples, Individual[] negativeExamples, String accuracyMethod, boolean useApproximations) throws ComponentInitException { Set<Individual> s1 = new TreeSet<Individual>(Arrays.asList(positiveExamples)); Set<Individual> s2 = new TreeSet<Individual>(Arrays.asList(negativeExamples)); Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/WordNet.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/WordNet.java 2011-04-04 06:45:24 UTC (rev 2745) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/templator/WordNet.java 2011-04-04 07:21:31 UTC (rev 2746) @@ -1,10 +1,9 @@ package org.dllearner.algorithm.tbsl.templator; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import scala.actors.threadpool.Arrays; - import edu.smu.tspell.wordnet.*; public class WordNet { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-04-04 18:17:06
|
Revision: 2749 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2749&view=rev Author: jenslehmann Date: 2011-04-04 18:17:00 +0000 (Mon, 04 Apr 2011) Log Message: ----------- added init methods in DBpedia ontology learning script Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java Modified: trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java 2011-04-04 16:28:53 UTC (rev 2748) +++ trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigOptions.java 2011-04-04 18:17:00 UTC (rev 2749) @@ -167,7 +167,7 @@ } public static BooleanConfigOption useDoubleDatatypes() { - return new BooleanConfigOption("useDoubleDatatypes", "specifies whether boolean datatypes are used in the learning algorothm",useDoubleDatatypesDefault); + return new BooleanConfigOption("useDoubleDatatypes", "specifies whether double datatypes are used in the learning algorothm",useDoubleDatatypesDefault); } public static BooleanConfigOption useStringDatatypes() { Modified: trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java 2011-04-04 16:28:53 UTC (rev 2748) +++ trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java 2011-04-04 18:17:00 UTC (rev 2749) @@ -115,19 +115,23 @@ SparqlKnowledgeSource ks = cm.knowledgeSource(SparqlKnowledgeSource.class); ks.getConfigurator().setInstances(Datastructures.individualSetToStringSet(examples.getCompleteSet())); ks.getConfigurator().setPredefinedEndpoint("DBPEDIA"); // TODO: probably the official endpoint is too slow? - + ks.init(); + ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, ks); - + rc.init(); + PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); lp.getConfigurator().setAccuracyMethod("fMeasure"); lp.getConfigurator().setUseApproximations(false); - + lp.init(); + CELOE la = cm.learningAlgorithm(CELOE.class, lp, rc); CELOEConfigurator cc = la.getConfigurator(); cc.setMaxExecutionTimeInSeconds(100); cc.setNoisePercentage(20); // TODO: set more options as needed - + la.init(); + // to write the above configuration in a conf file (optional) Config cf = new Config(cm, ks, rc, lp, la); new ConfigSave(cf).saveFile(new File("/dev/null")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-04-05 09:53:41
|
Revision: 2754 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2754&view=rev Author: lorenz_b Date: 2011-04-05 09:53:35 +0000 (Tue, 05 Apr 2011) Log Message: ----------- Removed module from parent pom.xml. Modified Paths: -------------- trunk/pom.xml Removed Paths: ------------- trunk/sparql-query-generator/ Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-04-05 09:48:46 UTC (rev 2753) +++ trunk/pom.xml 2011-04-05 09:53:35 UTC (rev 2754) @@ -26,7 +26,6 @@ <module>scripts</module> <module>protege</module> <module>evalplugin</module> - <module>sparql-query-generator</module> <module>autosparql</module> </modules> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-04-07 11:46:29
|
Revision: 2762 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2762&view=rev Author: lorenz_b Date: 2011-04-07 11:46:23 +0000 (Thu, 07 Apr 2011) Log Message: ----------- Extended interface. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java Modified: trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java 2011-04-07 08:51:26 UTC (rev 2761) +++ trunk/components-core/src/main/java/org/dllearner/core/SparqlQueryLearningAlgorithm.java 2011-04-07 11:46:23 UTC (rev 2762) @@ -33,10 +33,13 @@ public interface SparqlQueryLearningAlgorithm extends LearningAlgorithm { /** - * @see #getCurrentlyBestEvaluatedDescriptions(int) - * @param nrOfDescriptions Limit for the number or returned descriptions. + * @param nrOfSPARQLQueries Limit for the number or returned SPARQL queries. * @return The best SPARQL queries found by the learning algorithm so far. */ - public List<String> getCurrentlyBestDescriptions(int nrOfDescriptions); + public List<String> getCurrentlyBestSPARQLQueries(int nrOfSPARQLQueries); + public String getBestSPARQLQuery(); + + + } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-04-07 08:51:26 UTC (rev 2761) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner.java 2011-04-07 11:46:23 UTC (rev 2762) @@ -411,6 +411,11 @@ this.oracle = oracle; } + @Override + public String getBestSPARQLQuery() { + return null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ji...@us...> - 2011-04-13 08:54:41
|
Revision: 2765 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2765&view=rev Author: jialva Date: 2011-04-13 08:54:28 +0000 (Wed, 13 Apr 2011) Log Message: ----------- New classes and some little changes regarding DL-Learner fuzzy extensions (I) Modified Paths: -------------- trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java trunk/components-core/src/main/java/org/dllearner/core/Reasoner.java trunk/components-core/src/main/java/org/dllearner/core/ReasonerComponent.java trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java trunk/components-core/src/main/java/org/dllearner/core/configurators/package.html trunk/components-core/src/main/java/org/dllearner/core/options/CommonConfigMappings.java trunk/components-core/src/main/java/org/dllearner/reasoning/ReasonerType.java trunk/components-core/src/main/resources/components.ini trunk/interfaces/src/main/java/org/dllearner/cli/ConfMapper.java trunk/interfaces/src/main/java/org/dllearner/cli/Start.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOEHeuristicRuntime.java trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOENode.java trunk/components-core/src/main/java/org/dllearner/core/configurators/FuzzyCELOEConfigurator.java trunk/components-core/src/main/java/org/dllearner/core/configurators/FuzzyOWLAPIReasonerConfigurator.java trunk/components-core/src/main/java/org/dllearner/core/configurators/FuzzyPosNegLPStandardConfigurator.java trunk/components-core/src/main/java/org/dllearner/core/fuzzydll/ trunk/components-core/src/main/java/org/dllearner/core/fuzzydll/FuzzyIndividualReasoner.java trunk/components-core/src/main/java/org/dllearner/core/fuzzydll/FuzzyUnsupportedCodeException.java trunk/components-core/src/main/java/org/dllearner/core/options/fuzzydll/ trunk/components-core/src/main/java/org/dllearner/core/options/fuzzydll/FuzzyExample.java trunk/components-core/src/main/java/org/dllearner/core/options/fuzzydll/ObjectSetConfigOption.java trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/ trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest.java Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2011-04-12 11:24:02 UTC (rev 2764) +++ trunk/components-core/pom.xml 2011-04-13 08:54:28 UTC (rev 2765) @@ -71,8 +71,8 @@ </execution> </executions> </plugin> - </plugins> - </build> + </plugins> + </build> <dependencies> @@ -195,6 +195,17 @@ <artifactId>h2</artifactId> </dependency> + <dependency> + <groupId>fuzzydll</groupId> + <artifactId>fuzzydl</artifactId> + <version>1.0</version> + </dependency> + + <dependency> + <groupId>fuzzydll</groupId> + <artifactId>fuzzyowl2fuzzydlparser</artifactId> + <version>1.0</version> + </dependency> </dependencies> </project> Added: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -0,0 +1,814 @@ +/** + * 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.fuzzydll; + +import java.io.File; +import java.text.DecimalFormat; +import java.util.Collection; +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.TreeSet; + +import org.apache.log4j.Logger; +import org.dllearner.core.AbstractCELA; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.FuzzyClassExpressionLearningAlgorithm; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.FuzzyCELOEConfigurator; +import org.dllearner.core.options.BooleanConfigOption; +import org.dllearner.core.options.CommonConfigOptions; +import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.DoubleConfigOption; +import org.dllearner.core.options.StringConfigOption; +import org.dllearner.core.owl.ClassHierarchy; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Restriction; +import org.dllearner.core.owl.Thing; +import org.dllearner.learningproblems.ClassLearningProblem; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.learningproblems.PosOnlyLP; +import org.dllearner.learningproblems.fuzzydll.FuzzyPosNegLPStandard; +import org.dllearner.refinementoperators.OperatorInverter; +import org.dllearner.refinementoperators.RefinementOperator; +import org.dllearner.refinementoperators.RhoDRDown; +import org.dllearner.utilities.Files; +import org.dllearner.utilities.Helper; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.ConceptTransformation; +import org.dllearner.utilities.owl.DescriptionMinimizer; +import org.dllearner.utilities.owl.EvaluatedDescriptionSet; +import org.dllearner.utilities.owl.PropertyContext; + +import com.jamonapi.Monitor; +import com.jamonapi.MonitorFactory; + +/** + * The CELOE (Class Expression Learner for Ontology Engineering) algorithm. + * It adapts and extends the standard supervised learning algorithm for the + * ontology engineering use case. + * + * @author Jens Lehmann + * + */ +public class FuzzyCELOE extends AbstractCELA implements FuzzyClassExpressionLearningAlgorithm { + + private static Logger logger = Logger.getLogger(FuzzyCELOE.class); + private FuzzyCELOEConfigurator configurator; + + private boolean isRunning = false; + private boolean stop = false; + +// private OEHeuristicStable heuristicStable = new OEHeuristicStable(); +// private OEHeuristicRuntime heuristicRuntime = new OEHeuristicRuntime(); + + private RefinementOperator operator; + private DescriptionMinimizer minimizer; + + // all nodes in the search tree (used for selecting most promising node) + private TreeSet<FuzzyOENode> nodes; + private FuzzyOEHeuristicRuntime heuristic; // = new OEHeuristicRuntime(); + // root of search tree + private FuzzyOENode startNode; + // the class with which we start the refinement process + private Description startClass; + + // all descriptions in the search tree plus those which were too weak (for fast redundancy check) + private TreeSet<Description> descriptions; + + private EvaluatedDescriptionSet bestEvaluatedDescriptions; + + // if true, then each solution is evaluated exactly instead of approximately + // private boolean exactBestDescriptionEvaluation = false; + private boolean singleSuggestionMode; + private Description bestDescription; + private double bestAccuracy = Double.MIN_VALUE; + + private NamedClass classToDescribe; + // examples are either 1.) instances of the class to describe 2.) positive examples + // 3.) union of pos.+neg. examples depending on the learning problem at hand + private Set<Individual> examples; + + // CELOE was originally created for learning classes in ontologies, but also + // works for other learning problem types + private boolean isClassLearningProblem; + private boolean isEquivalenceProblem; + + private long nanoStartTime; + + // important parameters + private double noise; + private double maxDepth; + private boolean filterFollowsFromKB; + + // less important parameters + // forces that one solution cannot be subexpression of another expression; this option is useful to get diversity + // but it can also suppress quite useful expressions + private boolean forceMutualDifference = false; + + // utility variables + private String baseURI; + private Map<String, String> prefixes; + private DecimalFormat dfPercent = new DecimalFormat("0.00%"); + private ConceptComparator descriptionComparator = new ConceptComparator(); + + // statistical variables + private int expressionTests = 0; + private int minHorizExp = 0; + private int maxHorizExp = 0; + + @Override + public FuzzyCELOEConfigurator getConfigurator() { + return configurator; + } + + public FuzzyCELOE(LearningProblem problem, ReasonerComponent reasoner) { + super(problem, reasoner); + configurator = new FuzzyCELOEConfigurator(this); + } + + public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { + Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); + problems.add(LearningProblem.class); + return problems; + } + + public static Collection<ConfigOption<?>> createConfigOptions() { + Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); + options.add(CommonConfigOptions.useAllConstructor()); + options.add(CommonConfigOptions.useExistsConstructor()); + options.add(CommonConfigOptions.useHasValueConstructor()); + options.add(CommonConfigOptions.useDataHasValueConstructor()); + options.add(CommonConfigOptions.valueFreqencyThreshold()); + options.add(CommonConfigOptions.useCardinalityRestrictions()); + options.add(CommonConfigOptions.cardinalityLimit()); + // by default, we do not use negation (should be configurable in GUI) + options.add(CommonConfigOptions.useNegation(false)); + options.add(CommonConfigOptions.useBooleanDatatypes()); + options.add(CommonConfigOptions.useDoubleDatatypes()); + options.add(CommonConfigOptions.maxExecutionTimeInSeconds(10)); + options.add(CommonConfigOptions.getNoisePercentage()); + options.add(CommonConfigOptions.getTerminateOnNoiseReached(false)); + options.add(CommonConfigOptions.getMaxDepth(7)); + options.add(CommonConfigOptions.maxNrOfResults(10)); + options.add(CommonConfigOptions.maxClassDescriptionTests()); + options.add(new BooleanConfigOption("singleSuggestionMode", "Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples.", false)); + options.add(CommonConfigOptions.getInstanceBasedDisjoints()); + options.add(new BooleanConfigOption("filterDescriptionsFollowingFromKB", "If true, then the results will not contain suggestions, which already follow logically from the knowledge base. Be careful, since this requires a potentially expensive consistency check for candidate solutions.", false)); + options.add(new BooleanConfigOption("reuseExistingDescription", "If true, the algorithm tries to find a good starting point close to an existing definition/super class of the given class in the knowledge base.", false)); + options.add(new BooleanConfigOption("writeSearchTree", "specifies whether to write a search tree", false)); + options.add(new StringConfigOption("searchTreeFile","file to use for the search tree", "log/searchTree.txt")); + options.add(new BooleanConfigOption("replaceSearchTree","specifies whether to replace the search tree in the log file after each run or append the new search tree", false)); + options.add(new DoubleConfigOption("expansionPenaltyFactor","heuristic penalty per syntactic construct used (lower = finds more complex expression, but might miss simple ones)", 0.1)); + return options; + } + + public static String getName() { + return "fuzzy CELOE"; + } + + @Override + public void init() throws ComponentInitException { + // copy class hierarchy and modify it such that each class is only + // reachable via a single path + ClassHierarchy classHierarchy = reasoner.getClassHierarchy().clone(); + classHierarchy.thinOutSubsumptionHierarchy(); + + heuristic = new FuzzyOEHeuristicRuntime(configurator); + + minimizer = new DescriptionMinimizer(reasoner); + + startClass = Thing.instance; + + singleSuggestionMode = configurator.getSingleSuggestionMode(); + + // create refinement operator + operator = new RhoDRDown(reasoner, classHierarchy, startClass, configurator); + baseURI = reasoner.getBaseURI(); + prefixes = reasoner.getPrefixes(); + if(configurator.getWriteSearchTree()) { + Files.clearFile(new File(configurator.getSearchTreeFile())); + } + + bestEvaluatedDescriptions = new EvaluatedDescriptionSet(configurator.getMaxNrOfResults()); + + isClassLearningProblem = (learningProblem instanceof ClassLearningProblem); + + // we put important parameters in class variables + noise = configurator.getNoisePercentage()/100d; +// System.out.println("noise " + noise); + maxDepth = configurator.getMaxDepth(); + // (filterFollowsFromKB is automatically set to false if the problem + // is not a class learning problem + filterFollowsFromKB = configurator.getFilterDescriptionsFollowingFromKB() + && isClassLearningProblem; + + // actions specific to ontology engineering + if(isClassLearningProblem) { + ClassLearningProblem problem = (ClassLearningProblem) learningProblem; + classToDescribe = problem.getClassToDescribe(); + isEquivalenceProblem = problem.isEquivalenceProblem(); + + examples = reasoner.getIndividuals(classToDescribe); + + // start class: intersection of super classes for definitions (since it needs to + // capture all instances), but owl:Thing for learning subclasses (since it is + // superfluous to add super classes in this case) + if(isEquivalenceProblem) { + Set<Description> existingDefinitions = reasoner.getAssertedDefinitions(classToDescribe); + if(configurator.getReuseExistingDescription() && (existingDefinitions.size() > 0)) { + // the existing definition is reused, which in the simplest case means to + // use it as a start class or, if it is already too specific, generalise it + + // pick the longest existing definition as candidate + Description existingDefinition = null; + int highestLength = 0; + for(Description exDef : existingDefinitions) { + if(exDef.getLength() > highestLength) { + existingDefinition = exDef; + highestLength = exDef.getLength(); + } + } + + LinkedList<Description> startClassCandidates = new LinkedList<Description>(); + startClassCandidates.add(existingDefinition); + ((RhoDRDown)operator).setDropDisjuncts(true); + RefinementOperator upwardOperator = new OperatorInverter(operator); + + // use upward refinement until we find an appropriate start class + boolean startClassFound = false; + Description candidate; + do { + candidate = startClassCandidates.pollFirst(); + if(((ClassLearningProblem)learningProblem).getRecall(candidate)<1.0) { + // add upward refinements to list + Set<Description> refinements = upwardOperator.refine(candidate, candidate.getLength()); +// System.out.println("ref: " + refinements); + LinkedList<Description> refinementList = new LinkedList<Description>(refinements); +// Collections.reverse(refinementList); +// System.out.println("list: " + refinementList); + startClassCandidates.addAll(refinementList); +// System.out.println("candidates: " + startClassCandidates); + } else { + startClassFound = true; + } + } while(!startClassFound); + startClass = candidate; + + if(startClass.equals(existingDefinition)) { + logger.info("Reusing existing description " + startClass.toManchesterSyntaxString(baseURI, prefixes) + " as start class for learning algorithm."); + } else { + logger.info("Generalised existing description " + existingDefinition.toManchesterSyntaxString(baseURI, prefixes) + " to " + startClass.toManchesterSyntaxString(baseURI, prefixes) + ", which is used as start class for the learning algorithm."); + } + +// System.out.println("start class: " + startClass); +// System.out.println("existing def: " + existingDefinition); +// System.out.println(reasoner.getIndividuals(existingDefinition)); + + ((RhoDRDown)operator).setDropDisjuncts(false); + + } else { + Set<Description> superClasses = reasoner.getClassHierarchy().getSuperClasses(classToDescribe); + if(superClasses.size() > 1) { + startClass = new Intersection(new LinkedList<Description>(superClasses)); + } else if(superClasses.size() == 1){ + startClass = (Description) superClasses.toArray()[0]; + } else { + startClass = Thing.instance; + logger.warn(classToDescribe + " is equivalent to owl:Thing. Usually, it is not " + + "sensible to learn a description in this case."); + } + } + } + } else if(learningProblem instanceof PosOnlyLP) { + examples = ((PosOnlyLP)learningProblem).getPositiveExamples(); + } else if(learningProblem instanceof PosNegLP) { + examples = Helper.union(((PosNegLP)learningProblem).getPositiveExamples(),((PosNegLP)learningProblem).getNegativeExamples()); + } + } + + @Override + public Description getCurrentlyBestDescription() { + EvaluatedDescription ed = getCurrentlyBestEvaluatedDescription(); + return ed == null ? null : ed.getDescription(); + } + + @Override + public List<Description> getCurrentlyBestDescriptions() { + return bestEvaluatedDescriptions.toDescriptionList(); + } + + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + return bestEvaluatedDescriptions.getBest(); + } + + @Override + public TreeSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + return bestEvaluatedDescriptions.getSet(); + } + + public double getCurrentlyBestAccuracy() { + return bestEvaluatedDescriptions.getBest().getAccuracy(); + } + + @Override + public void start() { +// System.out.println(configurator.getMaxExecutionTimeInSeconds()); + + stop = false; + isRunning = true; + reset(); + nanoStartTime = System.nanoTime(); + + // highest accuracy so far + double highestAccuracy = 0.0; + FuzzyOENode nextNode; + + addNode(startClass, null); + + int loop = 0; + while (!terminationCriteriaSatisfied()) { +// System.out.println("loop " + loop); + + if(!singleSuggestionMode && bestEvaluatedDescriptions.getBestAccuracy() > highestAccuracy) { + highestAccuracy = bestEvaluatedDescriptions.getBestAccuracy(); + logger.info("more accurate (" + dfPercent.format(highestAccuracy) + ") class expression found: " + descriptionToString(bestEvaluatedDescriptions.getBest().getDescription())); + } + + // chose best node according to heuristics + nextNode = getNextNodeToExpand(); + int horizExp = nextNode.getHorizontalExpansion(); + + // apply operator + Monitor mon = MonitorFactory.start("refineNode"); + TreeSet<Description> refinements = refineNode(nextNode); + mon.stop(); + +// System.out.println("next node: " + nextNode); +// for(Description refinement : refinements) { +// System.out.println("refinement: " + refinement); +// } + + while(refinements.size() != 0) { + // pick element from set + Description refinement = refinements.pollFirst(); + int length = refinement.getLength(); + + // we ignore all refinements with lower length and too high depth + // (this also avoids duplicate node children) + if(length > horizExp && refinement.getDepth() <= maxDepth) { + +// System.out.println("potentially adding " + refinement + " to search tree as child of " + nextNode + " " + new Date()); + Monitor mon2 = MonitorFactory.start("addNode"); + addNode(refinement, nextNode); + mon2.stop(); + // adding nodes is potentially computationally expensive, so we have + // to check whether max time is exceeded + if(terminationCriteriaSatisfied()) { + break; + } +// System.out.println("addNode finished" + " " + new Date()); + } + +// System.out.println(" refinement queue length: " + refinements.size()); + } + + updateMinMaxHorizExp(nextNode); + + // writing the search tree (if configured) + if (configurator.getWriteSearchTree()) { + String treeString = "best node: " + bestEvaluatedDescriptions.getBest() + "\n"; + if (refinements.size() > 1) { + treeString += "all expanded nodes:\n"; + for (Description n : refinements) { + treeString += " " + n + "\n"; + } + } + treeString += startNode.toTreeString(baseURI); + treeString += "\n"; + + if (configurator.getReplaceSearchTree()) + Files.createFile(new File(configurator.getSearchTreeFile()), treeString); + else + Files.appendFile(new File(configurator.getSearchTreeFile()), treeString); + } + +// System.out.println(loop); + loop++; + } + + if (stop) { + logger.info("Algorithm stopped ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); + } else { + logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); + } + + if(singleSuggestionMode) { + bestEvaluatedDescriptions.add(bestDescription, bestAccuracy, learningProblem); + } + + // print solution(s) + logger.info("solutions:\n" + getSolutionString()); + +// System.out.println(startNode.toTreeString(baseURI)); + + isRunning = false; +// System.out.println("isRunning: " + isRunning); + } + + private FuzzyOENode getNextNodeToExpand() { + // we expand the best node of those, which have not achieved 100% accuracy + // already and have a horizontal expansion equal to their length + // (rationale: further extension is likely to add irrelevant syntactical constructs) + Iterator<FuzzyOENode> it = nodes.descendingIterator(); + while(it.hasNext()) { + FuzzyOENode node = it.next(); + if(node.getAccuracy() < 1.0 || node.getHorizontalExpansion() < node.getDescription().getLength()) { + return node; + } + } + + // this should practically never be called, since for any reasonable learning + // task, we will always have at least one node with less than 100% accuracy + return nodes.last(); + } + + // expand node horizontically + private TreeSet<Description> refineNode(FuzzyOENode node) { + // we have to remove and add the node since its heuristic evaluation changes through the expansion + // (you *must not* include any criteria in the heuristic which are modified outside of this method, + // otherwise you may see rarely occurring but critical false ordering in the nodes set) + nodes.remove(node); +// System.out.println("refining: " + node); + int horizExp = node.getHorizontalExpansion(); + TreeSet<Description> refinements = (TreeSet<Description>) operator.refine(node.getDescription(), horizExp+1); + node.incHorizontalExpansion(); + node.setRefinementCount(refinements.size()); + nodes.add(node); + return refinements; + } + + // add node to search tree if it is not too weak + // returns true if node was added and false otherwise + private boolean addNode(Description description, FuzzyOENode parentNode) { + +// System.out.println(description); + + // redundancy check (return if redundant) + boolean nonRedundant = descriptions.add(description); + if(!nonRedundant) { + return false; + } + + // check whether the description is allowed + if(!isDescriptionAllowed(description, parentNode)) { + return false; + } + +// System.out.println("Test " + new Date()); + // quality of description (return if too weak) + double accuracy = learningProblem.getAccuracyOrTooWeak(description, noise); + // issue a warning if accuracy is not between 0 and 1 or -1 (too weak) + if(accuracy > 1.0 || (accuracy < 0.0 && accuracy != -1)) { + logger.warn("Invalid accuracy value " + accuracy + " for description " + description + ". This could be caused by a bug in the heuristic measure and should be reported to the DL-Learner bug tracker."); + System.exit(0); + } + +// System.out.println("Test2 " + new Date()); + expressionTests++; +// System.out.println("acc: " + accuracy); +// System.out.println(description + " " + accuracy); + if(accuracy == -1) { + return false; + } + + FuzzyOENode node = new FuzzyOENode(parentNode, description, accuracy); + + // link to parent (unless start node) + if(parentNode == null) { + startNode = node; + } else { + parentNode.addChild(node); + } + + nodes.add(node); +// System.out.println("Test3 " + new Date()); + + // in some cases (e.g. mutation) fully evaluating even a single description is too expensive + // due to the high number of examples -- so we just stick to the approximate accuracy + if(singleSuggestionMode) { + if(accuracy > bestAccuracy) { + bestAccuracy = accuracy; + bestDescription = description; + logger.info("more accurate (" + dfPercent.format(bestAccuracy) + ") class expression found: " + descriptionToString(bestDescription)); // + getTemporaryString(bestDescription)); + } + return true; + } + +// System.out.println("description " + description + " accuracy " + accuracy); + + // maybe add to best descriptions (method keeps set size fixed); + // we need to make sure that this does not get called more often than + // necessary since rewriting is expensive + boolean isCandidate = !bestEvaluatedDescriptions.isFull(); + if(!isCandidate) { + EvaluatedDescription worst = bestEvaluatedDescriptions.getWorst(); + double accThreshold = worst.getAccuracy(); + isCandidate = + (accuracy > accThreshold || + (accuracy >= accThreshold && description.getLength() < worst.getDescriptionLength())); + } + +// System.out.println(isCandidate); + +// System.out.println("Test4 " + new Date()); + if(isCandidate) { + + Description niceDescription = rewriteNode(node); + ConceptTransformation.transformToOrderedForm(niceDescription, descriptionComparator); +// Description niceDescription = node.getDescription(); + + // another test: none of the other suggested descriptions should be + // a subdescription of this one unless accuracy is different + // => comment: on the one hand, this appears to be too strict, because once A is a solution then everything containing + // A is not a candidate; on the other hand this suppresses many meaningless extensions of A + boolean shorterDescriptionExists = false; + if(forceMutualDifference) { + for(EvaluatedDescription ed : bestEvaluatedDescriptions.getSet()) { + if(Math.abs(ed.getAccuracy()-accuracy) <= 0.00001 && ConceptTransformation.isSubdescription(niceDescription, ed.getDescription())) { +// System.out.println("shorter: " + ed.getDescription()); + shorterDescriptionExists = true; + break; + } + } + } + +// System.out.println("shorter description? " + shorterDescriptionExists + " nice: " + niceDescription); + + if(!shorterDescriptionExists) { + if(!filterFollowsFromKB || !((ClassLearningProblem)learningProblem).followsFromKB(niceDescription)) { +// System.out.println("Test2"); + bestEvaluatedDescriptions.add(niceDescription, accuracy, learningProblem); +// System.out.println("acc: " + accuracy); +// System.out.println(bestEvaluatedDescriptions); + } + } + +// System.out.println(bestEvaluatedDescriptions.getSet().size()); + } + +// System.out.println("Test5 " + new Date()); +// System.out.println("best evaluated descriptions size: " + bestEvaluatedDescriptions.size() + " worst: " + bestEvaluatedDescriptions.getWorst()); + return true; + } + + // checks whether the description is allowed + private boolean isDescriptionAllowed(Description description, FuzzyOENode parentNode) { + if(isClassLearningProblem) { + if(isEquivalenceProblem) { + // the class to learn must not appear on the outermost property level + if(occursOnFirstLevel(description, classToDescribe)) { + return false; + } + } else { + // none of the superclasses of the class to learn must appear on the + // outermost property level + TreeSet<Description> toTest = new TreeSet<Description>(descriptionComparator); + toTest.add(classToDescribe); + while(!toTest.isEmpty()) { + Description d = toTest.pollFirst(); + if(occursOnFirstLevel(description, d)) { + return false; + } + toTest.addAll(reasoner.getClassHierarchy().getSuperClasses(d)); + } + } + } + + // perform forall sanity tests + if(parentNode != null && ConceptTransformation.getForallOccurences(description) > ConceptTransformation.getForallOccurences(parentNode.getDescription())) { + // we have an additional \forall construct, so we now fetch the contexts + // in which it occurs + SortedSet<PropertyContext> contexts = ConceptTransformation.getForallContexts(description); + SortedSet<PropertyContext> parentContexts = ConceptTransformation.getForallContexts(parentNode.getDescription()); + contexts.removeAll(parentContexts); +// System.out.println("parent description: " + parentNode.getDescription()); +// System.out.println("description: " + description); +// System.out.println("contexts: " + contexts); + // we now have to perform sanity checks: if \forall is used, then there + // should be at least on class instance which has a filler at the given context + for(PropertyContext context : contexts) { + // transform [r,s] to \exists r.\exists s.\top + Description existentialContext = context.toExistentialContext(); + boolean fillerFound = false; + for(Individual instance : examples) { + if(reasoner.hasType(existentialContext, instance)) { +// System.out.println(instance + " " + existentialContext); + fillerFound = true; + break; + } + } + // if we do not find a filler, this means that putting \forall at + // that position is not meaningful + if(!fillerFound) { + return false; + } + } + } + + // we do not want to have negations of sibling classes on the outermost level + // (they are expressed more naturally by saying that the siblings are disjoint, + // so it is reasonable not to include them in solutions) +// Set<Description> siblingClasses = reasoner.getClassHierarchy().getSiblingClasses(classToDescribe); +// for now, we just disable negation + + return true; + } + + // determine whether a named class occurs on the outermost level, i.e. property depth 0 + // (it can still be at higher depth, e.g. if intersections are nested in unions) + private boolean occursOnFirstLevel(Description description, Description clazz) { + if(description instanceof NamedClass) { + if(description.equals(clazz)) { + return true; + } + } + + if(description instanceof Restriction) { + return false; + } + + for(Description child : description.getChildren()) { + if(occursOnFirstLevel(child, clazz)) { + return true; + } + } + + return false; + } + + // check whether the node is a potential solution candidate + private Description rewriteNode(FuzzyOENode node) { + Description description = node.getDescription(); + // minimize description (expensive!) - also performes some human friendly rewrites + Description niceDescription = minimizer.minimizeClone(description); + // replace \exists r.\top with \exists r.range(r) which is easier to read for humans + ConceptTransformation.replaceRange(niceDescription, reasoner); + return niceDescription; + } + + private boolean terminationCriteriaSatisfied() { + return + stop || + (configurator.getMaxClassDescriptionTests() != 0 && (expressionTests >= configurator.getMaxClassDescriptionTests())) || + (configurator.getMaxExecutionTimeInSeconds() != 0 && ((System.nanoTime() - nanoStartTime) >= (configurator.getMaxExecutionTimeInSeconds()*1000000000l))) || + (configurator.getTerminateOnNoiseReached() && (100*getCurrentlyBestAccuracy()>100-configurator.getNoisePercentage())); + } + + private void reset() { + // set all values back to their default values (used for running + // the algorithm more than once) + nodes = new TreeSet<FuzzyOENode>(heuristic); + descriptions = new TreeSet<Description>(new ConceptComparator()); + bestEvaluatedDescriptions.getSet().clear(); + expressionTests = 0; + } + + @Override + public boolean isRunning() { + return isRunning; + } + + @Override + public void stop() { + stop = true; + } + + public FuzzyOENode getSearchTreeRoot() { + return startNode; + } + + // central function for printing description + private String descriptionToString(Description description) { + return description.toManchesterSyntaxString(baseURI, prefixes); + } + + @SuppressWarnings("unused") + private String bestDescriptionToString() { + EvaluatedDescription best = bestEvaluatedDescriptions.getBest(); + return best.getDescription().toManchesterSyntaxString(baseURI, prefixes) + " (accuracy: " + dfPercent.format(best.getAccuracy()) + ")"; + } + + private String getSolutionString() { + int current = 1; + String str = ""; + for(EvaluatedDescription ed : bestEvaluatedDescriptions.getSet().descendingSet()) { + // temporary code + // changed by Josue + if(learningProblem instanceof PosNegLPStandard) { + str += current + ": " + descriptionToString(ed.getDescription()) + " (pred. acc.: " + dfPercent.format(((PosNegLPStandard)learningProblem).getPredAccuracyOrTooWeakExact(ed.getDescription(),1)) + ", F-measure: "+ dfPercent.format(((PosNegLPStandard)learningProblem).getFMeasureOrTooWeakExact(ed.getDescription(),1)) + ")\n"; + } else if (learningProblem instanceof FuzzyPosNegLPStandard) { + str += current + ": " + descriptionToString(ed.getDescription()) + " (pred. acc.: " + dfPercent.format(((FuzzyPosNegLPStandard)learningProblem).getPredAccuracyOrTooWeakExact(ed.getDescription(),1)) + ", F-measure: "+ dfPercent.format(((FuzzyPosNegLPStandard)learningProblem).getFMeasureOrTooWeakExact(ed.getDescription(),1)) + ")\n"; + } else { + str += current + ": " + descriptionToString(ed.getDescription()) + " " + dfPercent.format(ed.getAccuracy()) + "\n"; +// System.out.println(ed); + } + current++; + } + return str; + } + +// private String getTemporaryString(Description description) { +// return descriptionToString(description) + " (pred. acc.: " + dfPercent.format(((PosNegLPStandard)learningProblem).getPredAccuracyOrTooWeakExact(description,1)) + ", F-measure: "+ dfPercent.format(((PosNegLPStandard)learningProblem).getFMeasureOrTooWeakExact(description,1)) + ")"; +// } + + private void updateMinMaxHorizExp(FuzzyOENode node) { + int newHorizExp = node.getHorizontalExpansion(); + + // update maximum value + maxHorizExp = Math.max(maxHorizExp, newHorizExp); + + // we just expanded a node with minimum horizontal expansion; + // we need to check whether it was the last one + if(minHorizExp == newHorizExp - 1) { + + // the best accuracy that a node can achieve + double scoreThreshold = heuristic.getNodeScore(node) + 1 - node.getAccuracy(); + + for(FuzzyOENode n : nodes.descendingSet()) { + if(n != node) { + if(n.getHorizontalExpansion() == minHorizExp) { + // we can stop instantly when another node with min. + return; + } + if(heuristic.getNodeScore(n) < scoreThreshold) { + // we can stop traversing nodes when their score is too low + break; + } + } + } + + // inc. minimum since we found no other node which also has min. horiz. exp. + minHorizExp++; + +// System.out.println("minimum horizontal expansion is now " + minHorizExp); + } + } + + public int getMaximumHorizontalExpansion() { + return maxHorizExp; + } + + public int getMinimumHorizontalExpansion() { + return minHorizExp; + } + + /** + * @return the expressionTests + */ + public int getClassExpressionTests() { + return expressionTests; + } + + // added by Josue (when implementing FuzzyClassExpressionLearningAlgorithm) + + @Override + public List<Description> getCurrentlyBestDescriptions(int nrOfDescriptions) { + // TODO Auto-generated method stub + return null; + } + + @Override + public List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions( + int nrOfDescriptions) { + // TODO Auto-generated method stub + return null; + } +} Added: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOEHeuristicRuntime.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOEHeuristicRuntime.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOEHeuristicRuntime.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -0,0 +1,87 @@ +/** + * 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.fuzzydll; + +import java.util.Comparator; + +import org.dllearner.core.configurators.FuzzyCELOEConfigurator; +import org.dllearner.utilities.owl.ConceptComparator; + +/** + * Search algorithm heuristic for the ontology engineering algorithm. The heuristic + * has a strong bias towards short descriptions (i.e. the algorithm is likely to be + * less suitable for learning complex descriptions). + * + * @author Jens Lehmann + * + */ +public class FuzzyOEHeuristicRuntime implements Comparator<FuzzyOENode>{ + + // strong penalty for long descriptions + private double expansionPenaltyFactor = 0.1; + // bonus for being better than parent node + private double gainBonusFactor = 0.3; + // penalty if a node description has very many refinements since exploring + // such a node is computationally very expensive + private double nodeRefinementPenalty = 0.0001; + // syntactic comparison as final comparison criterion + private ConceptComparator conceptComparator = new ConceptComparator(); + + public FuzzyOEHeuristicRuntime(FuzzyCELOEConfigurator configurator) { + expansionPenaltyFactor = configurator.getExpansionPenaltyFactor(); + } + + @Override + public int compare(FuzzyOENode node1, FuzzyOENode node2) { +// System.out.println("node1 " + node1); +// System.out.println("score: " + getNodeScore(node1)); +// System.out.println("node2 " + node2); +// System.out.println("score: " + getNodeScore(node2)); + + double diff = getNodeScore(node1) - getNodeScore(node2); + + if(diff>0) { + return 1; + } else if(diff<0) { + return -1; + } else { + return conceptComparator.compare(node1.getDescription(), node2.getDescription()); + } + } + + public double getNodeScore(FuzzyOENode node) { + // accuracy as baseline + double score = node.getAccuracy(); + // being better than the parent gives a bonus; + if(!node.isRoot()) { + double parentAccuracy = node.getParent().getAccuracy(); + score += (parentAccuracy - score) * gainBonusFactor; + } + // penalty for horizontal expansion + score -= node.getHorizontalExpansion() * expansionPenaltyFactor; + // penalty for having many child nodes (stuck prevention) + score -= node.getRefinementCount() * nodeRefinementPenalty; + return score; + } + + public double getExpansionPenaltyFactor() { + return expansionPenaltyFactor; + } +} Added: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOENode.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOENode.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyOENode.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -0,0 +1,168 @@ +/** + * 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.fuzzydll; + +import java.text.DecimalFormat; +import java.util.LinkedList; +import java.util.List; + +import org.dllearner.algorithms.SearchTreeNode; +import org.dllearner.core.owl.Description; + +/** + * A node in the search tree of the ontology engineering algorithm. + * + * Differences to the node structures in other algorithms (this may change): + * - covered examples are not stored in node (i.e. coverage needs to be recomputed + * for child nodes, which costs time but saves memory) + * - only evaluated nodes are stored + * - too weak nodes are not stored + * - redundant nodes are not stored (?) + * - only accuracy is stored to make the node structure reusable for different + * learning problems and -algorithms + * + * @author Jens Lehmann + * + */ +public class FuzzyOENode implements SearchTreeNode { + + private Description description; + + private double accuracy; + + private int horizontalExpansion; + + private FuzzyOENode parent; + private List<FuzzyOENode> children = new LinkedList<FuzzyOENode>(); + + // the refinement count corresponds to the number of refinements of the + // description in this node - it is a better heuristic indicator than child count + // (and avoids the problem that adding children changes the heuristic value) + private int refinementCount = 0; + + private static DecimalFormat dfPercent = new DecimalFormat("0.00%"); + + public FuzzyOENode(FuzzyOENode parentNode, Description description, double accuracy) { + this.parent = parentNode; + this.description = description; + this.accuracy = accuracy; + horizontalExpansion = description.getLength()-1; + } + + public void addChild(FuzzyOENode node) { + children.add(node); + } + + public void incHorizontalExpansion() { + horizontalExpansion++; + } + + public boolean isRoot() { + return (parent == null); + } + + /** + * @return the description + */ + public Description getDescription() { + return description; + } + + public Description getExpression() { + return getDescription(); + } + + /** + * @return the accuracy + */ + public double getAccuracy() { + return accuracy; + } + + /** + * @return the parent + */ + public FuzzyOENode getParent() { + return parent; + } + + /** + * @return the children + */ + public List<FuzzyOENode> getChildren() { + return children; + } + + /** + * @return the horizontalExpansion + */ + public int getHorizontalExpansion() { + return horizontalExpansion; + } + + public String getShortDescription(String baseURI) { + String ret = description.toString(baseURI,null) + " ["; + ret += "acc:" + dfPercent.format(accuracy) + ", "; + ret += "he:" + horizontalExpansion + ", "; + ret += "c:" + children.size() + ", "; + ret += "ref:" + refinementCount + "]"; + return ret; + } + + @Override + public String toString() { + return getShortDescription(null); + } + + public String toTreeString() { + return toTreeString(0, null).toString(); + } + + public String toTreeString(String baseURI) { + return toTreeString(0, baseURI).toString(); + } + + private StringBuilder toTreeString(int depth, String baseURI) { + StringBuilder treeString = new StringBuilder(); + for(int i=0; i<depth-1; i++) + treeString.append(" "); + if(depth!=0) + treeString.append("|--> "); + treeString.append(getShortDescription(baseURI)+"\n"); + for(FuzzyOENode child : children) { + treeString.append(child.toTreeString(depth+1,baseURI)); + } + return treeString; + } + + /** + * @return the refinementCount + */ + public int getRefinementCount() { + return refinementCount; + } + + /** + * @param refinementCount the refinementCount to set + */ + public void setRefinementCount(int refinementCount) { + this.refinementCount = refinementCount; + } +} Modified: trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-04-12 11:24:02 UTC (rev 2764) +++ trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -83,6 +83,7 @@ "org.dllearner.kb.OWLAPIOntology", //reasoners "org.dllearner.reasoning.OWLAPIReasoner", + "org.dllearner.reasoning.fuzzydll.FuzzyOWLAPIReasoner", // added by Josue "org.dllearner.reasoning.DIGReasoner", "org.dllearner.reasoning.FastRetrievalReasoner", "org.dllearner.reasoning.FastInstanceChecker", @@ -90,6 +91,7 @@ "org.dllearner.reasoning.PelletReasoner", //learning problems "org.dllearner.learningproblems.PosNegLPStandard", + "org.dllearner.learningproblems.fuzzydll.FuzzyPosNegLPStandard", // added by Josue "org.dllearner.learningproblems.PosNegLPStrict", "org.dllearner.learningproblems.PosOnlyLP", "org.dllearner.learningproblems.ClassLearningProblem", @@ -102,6 +104,7 @@ "org.dllearner.algorithms.el.ELLearningAlgorithm", "org.dllearner.algorithms.el.ELLearningAlgorithmDisjunctive", "org.dllearner.algorithms.celoe.CELOE", + "org.dllearner.algorithms.fuzzydll.FuzzyCELOE", //added by Josue "org.dllearner.algorithms.isle.ISLE" } )); Modified: trunk/components-core/src/main/java/org/dllearner/core/Reasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/Reasoner.java 2011-04-12 11:24:02 UTC (rev 2764) +++ trunk/components-core/src/main/java/org/dllearner/core/Reasoner.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -19,12 +19,14 @@ */ package org.dllearner.core; +import org.dllearner.core.fuzzydll.FuzzyIndividualReasoner; + /** * List of available reasoning/query methods. * * @author Jens Lehmann * */ -public interface Reasoner extends BaseReasoner, SchemaReasoner, IndividualReasoner { +public interface Reasoner extends BaseReasoner, SchemaReasoner, IndividualReasoner, FuzzyIndividualReasoner { } Modified: trunk/components-core/src/main/java/org/dllearner/core/ReasonerComponent.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ReasonerComponent.java 2011-04-12 11:24:02 UTC (rev 2764) +++ trunk/components-core/src/main/java/org/dllearner/core/ReasonerComponent.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -39,6 +39,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Entity; import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.fuzzydll.FuzzyIndividual; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Nothing; import org.dllearner.core.owl.ObjectProperty; @@ -1213,4 +1214,28 @@ return str; } + /************************************************************** + * FUZZY EXTENSIONS + **************************************************************/ + + @Override + public double hasTypeFuzzyMembership(Description description, FuzzyIndividual individual) { + reasoningStartTimeTmp = System.nanoTime(); + double result = -1; + try { + result = hasTypeFuzzyMembershipImpl(description, individual); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + } + nrOfInstanceChecks++; + reasoningDurationTmp = System.nanoTime() - reasoningStartTimeTmp; + instanceCheckReasoningTimeNs += reasoningDurationTmp; + overallReasoningTimeNs += reasoningDurationTmp; + return result; + } + + protected double hasTypeFuzzyMembershipImpl(Description concept, FuzzyIndividual individual) + throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); + } } Modified: trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java 2011-04-12 11:24:02 UTC (rev 2764) +++ trunk/components-core/src/main/java/org/dllearner/core/configurators/ComponentFactory.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -27,6 +27,7 @@ import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.el.ELLearningAlgorithmDisjunctive; +import org.dllearner.algorithms.fuzzydll.FuzzyCELOE; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.isle.ISLE; import org.dllearner.algorithms.ocel.OCEL; @@ -43,12 +44,14 @@ import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.PosOnlyLP; +import org.dllearner.learningproblems.fuzzydll.FuzzyPosNegLPStandard; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; import org.dllearner.reasoning.OWLAPIReasoner; import org.dllearner.reasoning.PelletReasoner; import org.dllearner.reasoning.ProtegeReasoner; +import org.dllearner.reasoning.fuzzydll.FuzzyOWLAPIReasoner; /** * automatically generated, do not edit manually. @@ -138,6 +141,14 @@ } /** +* @param knowledgeSource see KnowledgeSource +* @return a component ready for initialization FuzzyOWLAPIReasoner +**/ +public static FuzzyOWLAPIReasoner getFuzzyOWLAPIReasoner(Set<KnowledgeSource> knowledgeSource) { +return FuzzyOWLAPIReasonerConfigurator.getFuzzyOWLAPIReasoner(knowledgeSource); +} + +/** * @param classToDescribe class of which a description should be learned * @param reasoningService see ReasoningService * @return a component ready for initialization ClassLearningProblem @@ -176,6 +187,17 @@ } /** +* @param fuzzyExamples fuzzy examples +* @param positiveExamples positive examples +* @param negativeExamples negative examples +* @param reasoningService see ReasoningService +* @return a component ready for initialization FuzzyPosNegLPStandard +**/ +public static FuzzyPosNegLPStandard getFuzzyPosNegLPStandard(ReasonerComponent reasoningService, Set<Object> fuzzyExamples, Set<String> positiveExamples, Set<String> negativeExamples) { +return FuzzyPosNegLPStandardConfigurator.getFuzzyPosNegLPStandard(reasoningService, fuzzyExamples, positiveExamples, negativeExamples); +} + +/** * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see @@ -229,6 +251,16 @@ * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see +* @return a component ready for initialization FuzzyCELOE +**/ +public static FuzzyCELOE getFuzzyCELOE(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { +return FuzzyCELOEConfigurator.getFuzzyCELOE(learningProblem, reasoningService); +} + +/** +* @param learningProblem see LearningProblem +* @param reasoningService see ReasoningService +* @throws LearningProblemUnsupportedException see * @return a component ready for initialization GP **/ public static GP getGP(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { Added: trunk/components-core/src/main/java/org/dllearner/core/configurators/FuzzyCELOEConfigurator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/configurators/FuzzyCELOEConfigurator.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/configurators/FuzzyCELOEConfigurator.java 2011-04-13 08:54:28 UTC (rev 2765) @@ -0,0 +1,499 @@ +/** + * 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 org.dllearner.algorithms.fuzzydll.FuzzyCELOE; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasonerComponent; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class FuzzyCELOEConfigurator extends RefinementOperatorConfigurator implements Configurator { + +private boolean reinitNecessary = false; +private FuzzyCELOE fuzzyCELOE; + +/** +* @param fuzzyCELOE see FuzzyCELOE +**/ +public FuzzyCELOEConfigurator(FuzzyCELOE fuzzyCELOE){ +this.fuzzyCELOE = fuzzyCELOE; +} + +/** +* @param reasoningService see reasoningService +* @param learningProblem see learningProblem +* @throws LearningProblemUnsupportedException see +* @return FuzzyCELOE +**/ +public static FuzzyCELOE getFuzzyCELOE(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException{ +FuzzyCELOE component = ComponentManager.getInstance().learningAlgorithm(FuzzyCELOE.class, learningProblem, reasoningService); +return component; +} + +/** +* useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getUseAllConstructor() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useAllConstructor") ; +} +/** +* useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getUseExistsConstructor() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useExistsConstructor") ; +} +/** +* useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: false +* @return boolean +**/ +public boolean getUseHasValueConstructor() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useHasValueConstructor") ; +} +/** +* useDataHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm in combination with data properties. +* mandatory: false| reinit necessary: true +* default value: false +* @return boolean +**/ +public boolean getUseDataHasValueConstructor() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useDataHasValueConstructor") ; +} +/** +* valueFrequencyThreshold specifies how often an object must occur as value in order to be considered for hasValue restrictions. +* mandatory: false| reinit necessary: true +* default value: 3 +* @return int +**/ +public int getValueFrequencyThreshold() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "valueFrequencyThreshold") ; +} +/** +* useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getUseCardinalityRestrictions() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useCardinalityRestrictions") ; +} +/** +* cardinalityLimit Gives the maximum number used in cardinality restrictions.. +* mandatory: false| reinit necessary: true +* default value: 5 +* @return int +**/ +public int getCardinalityLimit() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "cardinalityLimit") ; +} +/** +* useNegation specifies whether negation is used in the learning algorothm. +* mandatory: false| reinit necessary: true +* default value: false +* @return boolean +**/ +public boolean getUseNegation() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useNegation") ; +} +/** +* useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getUseBooleanDatatypes() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useBooleanDatatypes") ; +} +/** +* useDoubleDatatypes specifies whether double datatypes are used in the learning algorothm. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getUseDoubleDatatypes() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "useDoubleDatatypes") ; +} +/** +* maxExecutionTimeInSeconds algorithm will stop after specified seconds. +* mandatory: false| reinit necessary: true +* default value: 10 +* @return int +**/ +public int getMaxExecutionTimeInSeconds() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "maxExecutionTimeInSeconds") ; +} +/** +* noisePercentage the (approximated) percentage of noise within the examples. +* mandatory: false| reinit necessary: true +* default value: 0.0 +* @return double +**/ +public double getNoisePercentage() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(fuzzyCELOE, "noisePercentage") ; +} +/** +* terminateOnNoiseReached specifies whether to terminate when noise criterion is met. +* mandatory: false| reinit necessary: true +* defau... [truncated message content] |
From: <km...@us...> - 2011-05-13 07:51:18
|
Revision: 2801 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2801&view=rev Author: kmpf Date: 2011-05-13 07:51:11 +0000 (Fri, 13 May 2011) Log Message: ----------- Modified Paths: -------------- trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java trunk/test/pdb/bt426.list trunk/test/pdb/plp273.list trunk/test/pdb/plp364.list trunk/test/pdb/plp399.list Modified: trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java 2011-05-12 17:05:26 UTC (rev 2800) +++ trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java 2011-05-13 07:51:11 UTC (rev 2801) @@ -31,6 +31,8 @@ import com.hp.hpl.jena.query.QueryExecution; import com.hp.hpl.jena.query.QueryExecutionFactory; import com.hp.hpl.jena.query.QueryFactory; +import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.query.ResultSetFormatter; import com.hp.hpl.jena.rdf.model.NodeIterator; import com.hp.hpl.jena.rdf.model.Property; import com.hp.hpl.jena.rdf.model.ResIterator; @@ -38,6 +40,7 @@ import com.hp.hpl.jena.rdf.model.ResourceFactory; import com.hp.hpl.jena.rdf.model.Statement; import com.hp.hpl.jena.rdf.model.StmtIterator; +import com.hp.hpl.jena.vocabulary.RDFS; import com.dumontierlab.pdb2rdf.model.PdbRdfModel; import com.dumontierlab.pdb2rdf.parser.PdbXmlParser; @@ -178,7 +181,9 @@ trainmodel.removeAll(); trainmodel.add(getRdfModelForIds(trainSet.getTrainset()[i].getPdbID(), trainSet.getTrainset()[i].getChainID())); + System.out.println(getSpecies(trainmodel, trainSet.getTrainset()[i].getPdbID())); + /* * as we have sometimes to handle several amino acid chains we need the first @@ -464,6 +469,28 @@ qe.close(); return construct; } + + private static String getSpecies( PdbRdfModel model, String pdbID) { + String queryString ; + queryString = + "PREFIX pdb: <http://bio2rdf.org/pdb:> " + + "PREFIX dcterms: <http://purl.org/dc/terms/> " + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> " + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> " + + "PREFIX fn: <http://www.w3.org/2005/xpath-functions#> " + + "SELECT * " + + "WHERE { ?s ?p ?o .}"; //FILTER (str(?xxx) = fn:concat(str(?x4), '/extraction/source/gene/organism')) . }"; + + System.out.println(queryString); + Query query = QueryFactory.create(queryString); + QueryExecution qe = QueryExecutionFactory.create(query, model); + ResultSet results = qe.execSelect(); + qe.close(); + ResultSetFormatter.out (System.out, results, query); + return ResultSetFormatter.asText(results); + } + + private static ResIterator getFirstAA( PdbRdfModel model) { PdbRdfModel construct = new PdbRdfModel(); Modified: trunk/test/pdb/bt426.list =================================================================== --- trunk/test/pdb/bt426.list 2011-05-12 17:05:26 UTC (rev 2800) +++ trunk/test/pdb/bt426.list 2011-05-13 07:51:11 UTC (rev 2801) @@ -1,426 +1,426 @@ -1LMB.3 -8ABP -1MRP -1G3P -1GVP -1AT0 -1AOP -1AMP -1AK0 -1BGP -2CYP -1LAT.B -1LUC.B -1MTY.B -1NBA.B -1NCI.B -1KVE.B -1KWA.B -1EDM.B -1FMT.B -1GOT.B -1ATZ.B -1APY.B -1AQZ.B -1A28.B -1BDM.B -1BEN.B -1BTK.B -1CPC.B -1VWL.B -1WPO.B -1PNK.B -1RYP.2 -5P21 -1HA1 -1ECA -1FUA -1FNA -1GSA -1A6Q -1AK1 -1ABA -1BV1 -1BA1 -1TCA -1WBA -1POA -1QBA -2BAA -3CLA -2KIN.B -5HPG.A -1LKK.A -1LTS.A -1MLD.A -1MOL.A -1MKA.A -1MUG.A -1MUC.A -1MPG.A -1NBC.A -1NP1.A -1ONR.A -1HGX.A -1HAV.A -1HCR.A -1HSB.A -1IIB.A -1IDA.A -1IAK.A -1ISU.A -1JET.A -1JFR.A -1KVE.A -1KPT.A -1DOR.A -1DOS.A -1DOK.A -1DKZ.A -1DUP.A -1ECP.A -1FUR.A -1FVK.A -1FWC.A -1GIF.A -1GDO.A -1GAR.A -1GUQ.A -1ALV.A -1ALI.A -1AMU.A -1AOZ.A -1AOQ.A -1AOH.A -1AOC.A -1AJS.A -1ADO.A -1AFW.A -1AGJ.A -1AT1.A -1AVM.A -1AWS.A -1AQ6.A -1AQ0.A -1A7T.A -1A2Z.A -1A2Y.A -1A2P.A -1A34.A -1BKR.A -1BEB.A -1BFT.A -1BBP.A -1CHM.A -1CKA.A -1CYD.A -1XIK.A -1XGS.A -1YTB.A -1TVX.A -1VCA.A -1PHN.A -1RGE.A -1SLT.A -1SLU.A -1SPU.A -5ICB -1NAR -1JER -1KNB -1FDR -1A62 -1ARB -1AQB -1AJ2 -1AD2 -1BYB -1C52 -1CFB -1YER -1WAB -2POR -3CYR -3SEB -3SDH.A -2HMZ.A -2ARC.A -2PSP.A -8RXN.A -1HTR.P -1LIS -1MSC -1NLS -1ORC -1HFC -1IFC -1JPC -1FUS -1FDS -1A9S -1AL3 -1AAC -1BGC -1C1C -1YCC -1TYS -1VCC -1POC -1PGS -1RHS -2CTC -2PLC -2SNS -2SN3 -3TSS -1MTY.G -1GOT.G -1LIT -1MBD -1OPD -1IGD -1KID -1DAD -1EDT -1FIT -1GND -1AWD -1BRT -1BFD -1CHD -1VSD -1VID -1PUD -1POT -1SMD -2LBD -2HFT -2END -1RYP.F -1LBU -1MWE -1NEU -1HOE -1KVU -1EDE -1A8E -1ALU -1TFE -1UAE -1PHE -1RIE -1CSE.E -1NIF -1KPF -1ERV -1ARV -1ANF -1BKF -1CNV -1THV -1QNF -1LT5.D -1MTY.D -1AGQ.D -1JDW -1EDG -1AH7 -1AF7 -1BFG -1RMG -2HBG -1NOX -1IXH -1KUH -1A68 -1A1X -1AMX -1CSH -1CEX -1THX -1VHH -2AYH -3COX -1RYP.J -1LKI -1MSI -1MAI -1OPY -1DXY -1GKY -1GAI -1A8I -1ALY -1UBI -1R69 -2DRI -1FLE.I -1CEW.I -1CSE.I -1YVE.I -1RYP.I -1MRJ -1AJJ -1AKZ -1CTJ -8RUC.I -1MSK -1NPK -1IDK -2BBK.H -1GD1.O -1LML -1LCL -1MML -1ECL -1AYL -1AOL -153L -119L -2SIL -1LAM -1MZM -1EZM -1AMM -1CEM -2MCM -2GDM -1NFN -1HXN -1DUN -1AXN -1BTN -1CSN -1CBN -1ISO -1IDO -1AZO -1ALO -1AKO -1AHO -1BDO -1CPO -1CEO -1XJO -1PDO -1YAI.C -1TAD.C -1TSP -1WHT.B -7RSA -1PTQ -1PDA -2FHA -2CBA -2WEA -2PIA -5CSM.A -4PGA.A -7AHL.A -6GSV.A -1XYZ.A -1YAS.A -1TRK.A -1URN.A -1VPS.A -1PCF.A -1RYP.1 -1RVA.A -1SVP.A -2I1B -2A0B -2KIN.A -2FIV.A -2CHS.A -2CCY.A -2SCP.A -4XIS -1ONC -1OIS -1VLS -1VJS -3B5C -1PNE -3PTE -1REQ.D -1UXY -1V39 -1WHI -1PTY -1PMI -2ACY -2PHY -2PII -3CHY -1REG.Y -1SGP.I -1SKZ -2SIC.I -2ILK -2ABK -2SAK -1TML -3NUL -2FDN -3PCG.M -1WHO -5PTP -1PHP -1SFP -1SBP -1NUL.B -1PRX.B -1SFT.B -1SRA -2MSB.B -2VHB.B -2RSP.B -1NWP.A -1OVA.A -1XSO.A -1UNK.A -1WDC.A -1STM.A -4MT2 -1NXB -1XNB -1TIB -1WER -1SVB -2RN2 -3VUB -3DAA.A -2NAC.A -2HPD.A -2BOP.A -2TYS.A -256B.A -1OYC -1PLC -1RSS -1REC -2HTS -3GRS -1PPT -2PGD -3LZT -1TIF -1VIF -1RCF -2ENG -1UCH -2PTH -5PTI -1PII -1RSY -1RA9 -2TGI -1OSP.O -4BCL -6CEL -2ERL -1ZIN -1VIN -1PPN -1RRO +1LMB.3. +8ABP. +1MRP. +1G3P. +1GVP. +1AT0. +1AOP. +1AMP. +1AK0. +1BGP. +2CYP. +1LAT.B. +1LUC.B. +1MTY.B. +1NBA.B. +1NCI.B. +1KVE.B. +1KWA.B. +1EDM.B. +1FMT.B. +1GOT.B. +1ATZ.B. +1APY.B. +1AQZ.B. +1A28.B. +1BDM.B. +1BEN.B. +1BTK.B. +1CPC.B. +1VWL.B. +1WPO.B. +1PNK.B. +1RYP.2. +5P21. +1HA1. +1ECA. +1FUA. +1FNA. +1GSA. +1A6Q. +1AK1. +1ABA. +1BV1. +1BA1. +1TCA. +1WBA. +1POA. +1QBA. +2BAA. +3CLA. +2KIN.B. +5HPG.A. +1LKK.A. +1LTS.A. +1MLD.A. +1MOL.A. +1MKA.A. +1MUG.A. +1MUC.A. +1MPG.A. +1NBC.A. +1NP1.A. +1ONR.A. +1HGX.A. +1HAV.A. +1HCR.A. +1HSB.A. +1IIB.A. +1IDA.A. +1IAK.A. +1ISU.A. +1JET.A. +1JFR.A. +1KVE.A. +1KPT.A. +1DOR.A. +1DOS.A. +1DOK.A. +1DKZ.A. +1DUP.A. +1ECP.A. +1FUR.A. +1FVK.A. +1FWC.A. +1GIF.A. +1GDO.A. +1GAR.A. +1GUQ.A. +1ALV.A. +1ALI.A. +1AMU.A. +1AOZ.A. +1AOQ.A. +1AOH.A. +1AOC.A. +1AJS.A. +1ADO.A. +1AFW.A. +1AGJ.A. +1AT1.A. +1AVM.A. +1AWS.A. +1AQ6.A. +1AQ0.A. +1A7T.A. +1A2Z.A. +1A2Y.A. +1A2P.A. +1A34.A. +1BKR.A. +1BEB.A. +1BFT.A. +1BBP.A. +1CHM.A. +1CKA.A. +1CYD.A. +1XIK.A. +1XGS.A. +1YTB.A. +1TVX.A. +1VCA.A. +1PHN.A. +1RGE.A. +1SLT.A. +1SLU.A. +1SPU.A. +5ICB. +1NAR. +1JER. +1KNB. +1FDR. +1A62. +1ARB. +1AQB. +1AJ2. +1AD2. +1BYB. +1C52. +1CFB. +1YER. +1WAB. +2POR. +3CYR. +3SEB. +3SDH.A. +2HMZ.A. +2ARC.A. +2PSP.A. +8RXN.A. +1HTR.P. +1LIS. +1MSC. +1NLS. +1ORC. +1HFC. +1IFC. +1JPC. +1FUS. +1FDS. +1A9S. +1AL3. +1AAC. +1BGC. +1C1C. +1YCC. +1TYS. +1VCC. +1POC. +1PGS. +1RHS. +2CTC. +2PLC. +2SNS. +2SN3. +3TSS. +1MTY.G. +1GOT.G. +1LIT. +1MBD. +1OPD. +1IGD. +1KID. +1DAD. +1EDT. +1FIT. +1GND. +1AWD. +1BRT. +1BFD. +1CHD. +1VSD. +1VID. +1PUD. +1POT. +1SMD. +2LBD. +2HFT. +2END. +1RYP.F. +1LBU. +1MWE. +1NEU. +1HOE. +1KVU. +1EDE. +1A8E. +1ALU. +1TFE. +1UAE. +1PHE. +1RIE. +1CSE.E. +1NIF. +1KPF. +1ERV. +1ARV. +1ANF. +1BKF. +1CNV. +1THV. +1QNF. +1LT5.D. +1MTY.D. +1AGQ.D. +1JDW. +1EDG. +1AH7. +1AF7. +1BFG. +1RMG. +2HBG. +1NOX. +1IXH. +1KUH. +1A68. +1A1X. +1AMX. +1CSH. +1CEX. +1THX. +1VHH. +2AYH. +3COX. +1RYP.J. +1LKI. +1MSI. +1MAI. +1OPY. +1DXY. +1GKY. +1GAI. +1A8I. +1ALY. +1UBI. +1R69. +2DRI. +1FLE.I. +1CEW.I. +1CSE.I. +1YVE.I. +1RYP.I. +1MRJ. +1AJJ. +1AKZ. +1CTJ. +8RUC.I. +1MSK. +1NPK. +1IDK. +2BBK.H. +1GD1.O. +1LML. +1LCL. +1MML. +1ECL. +1AYL. +1AOL. +153L. +119L. +2SIL. +1LAM. +1MZM. +1EZM. +1AMM. +1CEM. +2MCM. +2GDM. +1NFN. +1HXN. +1DUN. +1AXN. +1BTN. +1CSN. +1CBN. +1ISO. +1IDO. +1AZO. +1ALO. +1AKO. +1AHO. +1BDO. +1CPO. +1CEO. +1XJO. +1PDO. +1YAI.C. +1TAD.C. +1TSP. +1WHT.B. +7RSA. +1PTQ. +1PDA. +2FHA. +2CBA. +2WEA. +2PIA. +5CSM.A. +4PGA.A. +7AHL.A. +6GSV.A. +1XYZ.A. +1YAS.A. +1TRK.A. +1URN.A. +1VPS.A. +1PCF.A. +1RYP.1. +1RVA.A. +1SVP.A. +2I1B. +2A0B. +2KIN.A. +2FIV.A. +2CHS.A. +2CCY.A. +2SCP.A. +4XIS. +1ONC. +1OIS. +1VLS. +1VJS. +3B5C. +1PNE. +3PTE. +1REQ.D. +1UXY. +1V39. +1WHI. +1PTY. +1PMI. +2ACY. +2PHY. +2PII. +3CHY. +1REG.Y. +1SGP.I. +1SKZ. +2SIC.I. +2ILK. +2ABK. +2SAK. +1TML. +3NUL. +2FDN. +3PCG.M. +1WHO. +5PTP. +1PHP. +1SFP. +1SBP. +1NUL.B. +1PRX.B. +1SFT.B. +1SRA. +2MSB.B. +2VHB.B. +2RSP.B. +1NWP.A. +1OVA.A. +1XSO.A. +1UNK.A. +1WDC.A. +1STM.A. +4MT2. +1NXB. +1XNB. +1TIB. +1WER. +1SVB. +2RN2. +3VUB. +3DAA.A. +2NAC.A. +2HPD.A. +2BOP.A. +2TYS.A. +256B.A. +1OYC. +1PLC. +1RSS. +1REC. +2HTS. +3GRS. +1PPT. +2PGD. +3LZT. +1TIF. +1VIF. +1RCF. +2ENG. +1UCH. +2PTH. +5PTI. +1PII. +1RSY. +1RA9. +2TGI. +1OSP.O. +4BCL. +6CEL. +2ERL. +1ZIN. +1VIN. +1PPN. +1RRO. 2BBK.L Modified: trunk/test/pdb/plp273.list =================================================================== --- trunk/test/pdb/plp273.list 2011-05-12 17:05:26 UTC (rev 2800) +++ trunk/test/pdb/plp273.list 2011-05-13 07:51:11 UTC (rev 2801) @@ -1,273 +1,273 @@ -2W8X.A -2W9Y.A -2WCJ.A -2WCR.A -2WFB.A -2WFO.A -2WJ5.A -2WJ9.A -2WJR.A -2WL1.A -2WNF.A -2WPV.B -2WQF.A -2WTP.A -2WUJ.A -2WUU.A -2WUX.A -2WVX.A -2WY3.B -2WZO.A -2ZXY.A -3A0Z.A -3A4R.A -3A57.A -3A5P.A -3AAP.A -3FOT.A -3FOV.A -3FQG.A -3FRR.A -3FSO.A -3FSS.A -3FWK.A -3FWZ.A -3FX7.A -3FYB.A -3FYM.A -3G02.A -3G0M.A -3G1J.A -3G21.A -3G2B.A -3G2S.A -3G36.A -3G3T.A -3G5B.A -3G7G.A -3GA3.A -3GA4.A -3GAE.A -3GBW.A -3GBY.A -3GDW.A -3GE3.E -3GFP.A -3GI7.A -3GIX.A -3GKJ.A -3GMG.A -3GN6.A -3GNE.A -3GNZ.P -3GOE.A -3GP4.A -3GP6.A -3GQQ.A -3GWH.A -3GWN.A -3GXW.A -3GY9.A -3GZB.A -3H05.A -3H0W.A -3H20.A -3H3L.A -3H51.A -3H5J.A -3H6P.C -3H6R.A -3H7H.B -3H8T.A -3H96.A -3H9W.A -3HA2.A -3HE5.B -3HFO.A -3HH1.A -3HL1.A -3HN0.A -3HN5.A -3HO6.A -3HOI.A -3HPC.X -3HR0.A -3HRL.A -3HRR.A -3HSH.A -3HTV.A -3HVS.A -3HWP.A -3HWU.A -3HX8.A -3HXL.A -3HYN.A -3HZP.A -3I0W.A -3I1A.A -3I2V.A -3I4O.A -3I7M.A -3I84.A -3IBM.A -3IC3.A -3ID1.A -3IDF.A -3IDU.A -3IE4.A -3IEE.A -3IG9.A -3IHT.A -3IJM.A -3IKB.A -3IKW.A -3ILW.A -3IM3.A -3IMK.A -3IP4.C -3IPF.A -3IPJ.A -3IR4.A -3IT5.A -3IU6.A -3IUF.A -3IUO.A -3IUW.A -3IVV.A -3IWF.A -3IX3.A -3JQY.A -3JRN.A -3JSZ.A -3JTW.A -3JU0.A -3JUD.A -3JXO.A -3JYG.A -3JYZ.A -3JZ9.A -3K0X.A -3K0Z.A -3K2O.A -3K5J.A -3K69.A -3K6O.A -3K7X.A -3KD3.A -3KDE.C -3KDF.A -3KDF.B -3KDG.A -3KE7.A -3KG9.A -3KGK.A -3KK4.A -3KKF.A -3KKG.A -3KLQ.A -3KMI.A -3KOG.A -3KOS.A -3KPE.A -3KUC.B -3KWS.A -3KXT.A -3KYZ.A -3KZ5.A -3KZD.A -3KZP.A -3L0Q.B -3L15.A -3L23.A -3L29.A -3L3E.A -3L4H.A -3L51.B -3L6T.A -3L7H.A -2X2S.A -2X2U.A -2X32.A -2X3G.A -2X4J.A -2X4K.A -2X4W.A -2X55.A -2X5N.A -2XCJ.A -2XDG.A -2XDH.A -2XF7.A -2XFV.A -2XG5.B -2XLG.A -2XMJ.A -3AG3.D -3L9A.X -3LAX.A -3LDC.A -3LDU.A -3LE4.A -3LFR.A -3LGB.A -3LHE.A -3LHO.A -3LHR.A -3LLO.A -3LM3.A -3LQ9.A -3LR2.A -3LR4.A -3LS0.A -3LUC.A -3LUM.A -3LUR.A -3LUU.A -3LWC.A -3LWG.A -3LXR.F -3LYD.A -3LYG.A -3LYH.A -3LYY.A -3M1T.A -3M66.A -3M6J.A -3M7K.A -3M7O.A -3M8J.A -3M9Q.A -3MAB.A -3MAL.A -3MCB.A -3MCB.B -3MCQ.A -3MDP.A -3MG1.A -3MHS.B -3MR0.A -3MSW.A -3MT0.A -3MW8.A -3MWZ.A -3MZO.A -3N0R.A -3N1E.A -3N6Y.A -3N9B.A -3NE8.A -3NFT.A -3NKE.A -3NKG.A -3NKL.A -3NO2.A -3NOH.A -3NPD.A -3NQI.A -3NRF.A -3NRW.A -3NS2.A -3NY3.A -3NZN.A -3O6C.A +2W8X.A. +2W9Y.A. +2WCJ.A. +2WCR.A. +2WFB.A. +2WFO.A. +2WJ5.A. +2WJ9.A. +2WJR.A. +2WL1.A. +2WNF.A. +2WPV.B. +2WQF.A. +2WTP.A. +2WUJ.A. +2WUU.A. +2WUX.A. +2WVX.A. +2WY3.B. +2WZO.A. +2ZXY.A. +3A0Z.A. +3A4R.A. +3A57.A. +3A5P.A. +3AAP.A. +3FOT.A. +3FOV.A. +3FQG.A. +3FRR.A. +3FSO.A. +3FSS.A. +3FWK.A. +3FWZ.A. +3FX7.A. +3FYB.A. +3FYM.A. +3G02.A. +3G0M.A. +3G1J.A. +3G21.A. +3G2B.A. +3G2S.A. +3G36.A. +3G3T.A. +3G5B.A. +3G7G.A. +3GA3.A. +3GA4.A. +3GAE.A. +3GBW.A. +3GBY.A. +3GDW.A. +3GE3.E. +3GFP.A. +3GI7.A. +3GIX.A. +3GKJ.A. +3GMG.A. +3GN6.A. +3GNE.A. +3GNZ.P. +3GOE.A. +3GP4.A. +3GP6.A. +3GQQ.A. +3GWH.A. +3GWN.A. +3GXW.A. +3GY9.A. +3GZB.A. +3H05.A. +3H0W.A. +3H20.A. +3H3L.A. +3H51.A. +3H5J.A. +3H6P.C. +3H6R.A. +3H7H.B. +3H8T.A. +3H96.A. +3H9W.A. +3HA2.A. +3HE5.B. +3HFO.A. +3HH1.A. +3HL1.A. +3HN0.A. +3HN5.A. +3HO6.A. +3HOI.A. +3HPC.X. +3HR0.A. +3HRL.A. +3HRR.A. +3HSH.A. +3HTV.A. +3HVS.A. +3HWP.A. +3HWU.A. +3HX8.A. +3HXL.A. +3HYN.A. +3HZP.A. +3I0W.A. +3I1A.A. +3I2V.A. +3I4O.A. +3I7M.A. +3I84.A. +3IBM.A. +3IC3.A. +3ID1.A. +3IDF.A. +3IDU.A. +3IE4.A. +3IEE.A. +3IG9.A. +3IHT.A. +3IJM.A. +3IKB.A. +3IKW.A. +3ILW.A. +3IM3.A. +3IMK.A. +3IP4.C. +3IPF.A. +3IPJ.A. +3IR4.A. +3IT5.A. +3IU6.A. +3IUF.A. +3IUO.A. +3IUW.A. +3IVV.A. +3IWF.A. +3IX3.A. +3JQY.A. +3JRN.A. +3JSZ.A. +3JTW.A. +3JU0.A. +3JUD.A. +3JXO.A. +3JYG.A. +3JYZ.A. +3JZ9.A. +3K0X.A. +3K0Z.A. +3K2O.A. +3K5J.A. +3K69.A. +3K6O.A. +3K7X.A. +3KD3.A. +3KDE.C. +3KDF.A. +3KDF.B. +3KDG.A. +3KE7.A. +3KG9.A. +3KGK.A. +3KK4.A. +3KKF.A. +3KKG.A. +3KLQ.A. +3KMI.A. +3KOG.A. +3KOS.A. +3KPE.A. +3KUC.B. +3KWS.A. +3KXT.A. +3KYZ.A. +3KZ5.A. +3KZD.A. +3KZP.A. +3L0Q.B. +3L15.A. +3L23.A. +3L29.A. +3L3E.A. +3L4H.A. +3L51.B. +3L6T.A. +3L7H.A. +2X2S.A. +2X2U.A. +2X32.A. +2X3G.A. +2X4J.A. +2X4K.A. +2X4W.A. +2X55.A. +2X5N.A. +2XCJ.A. +2XDG.A. +2XDH.A. +2XF7.A. +2XFV.A. +2XG5.B. +2XLG.A. +2XMJ.A. +3AG3.D. +3L9A.X. +3LAX.A. +3LDC.A. +3LDU.A. +3LE4.A. +3LFR.A. +3LGB.A. +3LHE.A. +3LHO.A. +3LHR.A. +3LLO.A. +3LM3.A. +3LQ9.A. +3LR2.A. +3LR4.A. +3LS0.A. +3LUC.A. +3LUM.A. +3LUR.A. +3LUU.A. +3LWC.A. +3LWG.A. +3LXR.F. +3LYD.A. +3LYG.A. +3LYH.A. +3LYY.A. +3M1T.A. +3M66.A. +3M6J.A. +3M7K.A. +3M7O.A. +3M8J.A. +3M9Q.A. +3MAB.A. +3MAL.A. +3MCB.A. +3MCB.B. +3MCQ.A. +3MDP.A. +3MG1.A. +3MHS.B. +3MR0.A. +3MSW.A. +3MT0.A. +3MW8.A. +3MWZ.A. +3MZO.A. +3N0R.A. +3N1E.A. +3N6Y.A. +3N9B.A. +3NE8.A. +3NFT.A. +3NKE.A. +3NKG.A. +3NKL.A. +3NO2.A. +3NOH.A. +3NPD.A. +3NQI.A. +3NRF.A. +3NRW.A. +3NS2.A. +3NY3.A. +3NZN.A. +3O6C.A. 3OAJ.A Modified: trunk/test/pdb/plp364.list =================================================================== --- trunk/test/pdb/plp364.list 2011-05-12 17:05:26 UTC (rev 2800) +++ trunk/test/pdb/plp364.list 2011-05-13 07:51:11 UTC (rev 2801) @@ -1,364 +1,364 @@ -2JK9.A -2V4X.A -2VQ4.A -2VTC.A -2VV6.A -2VXT.I -2VXZ.A -2VZC.A -2W2R.A -2W61.A -2W6A.A -2W7A.A -2W7N.A -2ZK9.X -2ZNR.A -2ZQ5.A -2ZQE.A -2ZSI.B -2ZX0.A -3BYP.A -3BYQ.A -3C1Q.A -3C7T.A -3C8L.A -3C8W.A -3CHM.A -3CKK.A -3CNY.A -3CP7.A -3CT6.A -3CZ6.A -3D1R.A -3D2Q.A -3D34.A -3D3B.J -3D59.A -3D85.C -3DAN.A -3DD7.A -3DS2.A -3DSB.A -3E7H.A -3E7U.X -3E8O.A -3E8T.A -3EBT.A -3ECF.A -3ECH.A -3EDO.A -3EEH.A -3EER.A -3EF8.A -3EHG.A -3EHM.A -3EKI.A -3EMF.A -3EMI.A -3ENU.A -3EO6.A -3ER7.A -3ES4.A -3EYT.A -3EZI.A -3F0P.A -3F2E.A -3F40.A -3F4M.A -3F62.A -3F7E.A -3F7Q.A -3F8X.A -3F95.A -3F9S.A -3FAU.A -3FB9.A -3FBL.A -3FCN.A -3FF2.A -3FF5.A -3FFV.A -3FG9.A -3FGR.B -3FGV.A -3FH1.A -3FIA.A -3FID.A -3FJU.B -3FK8.A -3FKA.A -3FM2.A -3FMY.A -2W8X.A -2W9Y.A -2WCJ.A -2WCR.A -2WFB.A -2WFO.A -2WJ5.A -2WJ9.A -2WJR.A -2WL1.A -2WNF.A -2WPV.B -2WQF.A -2WTP.A -2WUJ.A -2WUU.A -2WUX.A -2WVX.A -2WY3.B -2WZO.A -2ZXY.A -3A0Z.A -3A4R.A -3A57.A -3A5P.A -3AAP.A -3FOT.A -3FOV.A -3FQG.A -3FRR.A -3FSO.A -3FSS.A -3FWK.A -3FWZ.A -3FX7.A -3FYB.A -3FYM.A -3G02.A -3G0M.A -3G1J.A -3G21.A -3G2B.A -3G2S.A -3G36.A -3G3T.A -3G5B.A -3G7G.A -3GA3.A -3GA4.A -3GAE.A -3GBW.A -3GBY.A -3GDW.A -3GE3.E -3GFP.A -3GI7.A -3GIX.A -3GKJ.A -3GMG.A -3GN6.A -3GNE.A -3GNZ.P -3GOE.A -3GP4.A -3GP6.A -3GQQ.A -3GWH.A -3GWN.A -3GXW.A -3GY9.A -3GZB.A -3H05.A -3H0W.A -3H20.A -3H3L.A -3H51.A -3H5J.A -3H6P.C -3H6R.A -3H7H.B -3H8T.A -3H96.A -3H9W.A -3HA2.A -3HE5.B -3HFO.A -3HH1.A -3HL1.A -3HN0.A -3HN5.A -3HO6.A -3HOI.A -3HPC.X -3HR0.A -3HRL.A -3HRR.A -3HSH.A -3HTV.A -3HVS.A -3HWP.A -3HWU.A -3HX8.A -3HXL.A -3HYN.A -3HZP.A -3I0W.A -3I1A.A -3I2V.A -3I4O.A -3I7M.A -3I84.A -3IBM.A -3IC3.A -3ID1.A -3IDF.A -3IDU.A -3IE4.A -3IEE.A -3IG9.A -3IHT.A -3IJM.A -3IKB.A -3IKW.A -3ILW.A -3IM3.A -3IMK.A -3IP4.C -3IPF.A -3IPJ.A -3IR4.A -3IT5.A -3IU6.A -3IUF.A -3IUO.A -3IUW.A -3IVV.A -3IWF.A -3IX3.A -3JQY.A -3JRN.A -3JSZ.A -3JTW.A -3JU0.A -3JUD.A -3JXO.A -3JYG.A -3JYZ.A -3JZ9.A -3K0X.A -3K0Z.A -3K2O.A -3K5J.A -3K69.A -3K6O.A -3K7X.A -3KD3.A -3KDE.C -3KDF.A -3KDF.B -3KDG.A -3KE7.A -3KG9.A -3KGK.A -3KK4.A -3KKF.A -3KKG.A -3KLQ.A -3KMI.A -3KOG.A -3KOS.A -3KPE.A -3KUC.B -3KWS.A -3KXT.A -3KYZ.A -3KZ5.A -3KZD.A -3KZP.A -3L0Q.B -3L15.A -3L23.A -3L29.A -3L3E.A -3L4H.A -3L51.B -3L6T.A -3L7H.A -2X2S.A -2X2U.A -2X32.A -2X3G.A -2X4J.A -2X4K.A -2X4W.A -2X55.A -2X5N.A -2XCJ.A -2XDG.A -2XDH.A -2XF7.A -2XFV.A -2XG5.B -2XLG.A -2XMJ.A -3AG3.D -3L9A.X -3LAX.A -3LDC.A -3LDU.A -3LE4.A -3LFR.A -3LGB.A -3LHE.A -3LHO.A -3LHR.A -3LLO.A -3LM3.A -3LQ9.A -3LR2.A -3LR4.A -3LS0.A -3LUC.A -3LUM.A -3LUR.A -3LUU.A -3LWC.A -3LWG.A -3LXR.F -3LYD.A -3LYG.A -3LYH.A -3LYY.A -3M1T.A -3M66.A -3M6J.A -3M7K.A -3M7O.A -3M8J.A -3M9Q.A -3MAB.A -3MAL.A -3MCB.A -3MCB.B -3MCQ.A -3MDP.A -3MG1.A -3MHS.B -3MR0.A -3MSW.A -3MT0.A -3MW8.A -3MWZ.A -3MZO.A -3N0R.A -3N1E.A -3N6Y.A -3N9B.A -3NE8.A -3NFT.A -3NKE.A -3NKG.A -3NKL.A -3NO2.A -3NOH.A -3NPD.A -3NQI.A -3NRF.A -3NRW.A -3NS2.A -3NY3.A -3NZN.A -3O6C.A +2JK9.A. +2V4X.A. +2VQ4.A. +2VTC.A. +2VV6.A. +2VXT.I. +2VXZ.A. +2VZC.A. +2W2R.A. +2W61.A. +2W6A.A. +2W7A.A. +2W7N.A. +2ZK9.X. +2ZNR.A. +2ZQ5.A. +2ZQE.A. +2ZSI.B. +2ZX0.A. +3BYP.A. +3BYQ.A. +3C1Q.A. +3C7T.A. +3C8L.A. +3C8W.A. +3CHM.A. +3CKK.A. +3CNY.A. +3CP7.A. +3CT6.A. +3CZ6.A. +3D1R.A. +3D2Q.A. +3D34.A. +3D3B.J. +3D59.A. +3D85.C. +3DAN.A. +3DD7.A. +3DS2.A. +3DSB.A. +3E7H.A. +3E7U.X. +3E8O.A. +3E8T.A. +3EBT.A. +3ECF.A. +3ECH.A. +3EDO.A. +3EEH.A. +3EER.A. +3EF8.A. +3EHG.A. +3EHM.A. +3EKI.A. +3EMF.A. +3EMI.A. +3ENU.A. +3EO6.A. +3ER7.A. +3ES4.A. +3EYT.A. +3EZI.A. +3F0P.A. +3F2E.A. +3F40.A. +3F4M.A. +3F62.A. +3F7E.A. +3F7Q.A. +3F8X.A. +3F95.A. +3F9S.A. +3FAU.A. +3FB9.A. +3FBL.A. +3FCN.A. +3FF2.A. +3FF5.A. +3FFV.A. +3FG9.A. +3FGR.B. +3FGV.A. +3FH1.A. +3FIA.A. +3FID.A. +3FJU.B. +3FK8.A. +3FKA.A. +3FM2.A. +3FMY.A. +2W8X.A. +2W9Y.A. +2WCJ.A. +2WCR.A. +2WFB.A. +2WFO.A. +2WJ5.A. +2WJ9.A. +2WJR.A. +2WL1.A. +2WNF.A. +2WPV.B. +2WQF.A. +2WTP.A. +2WUJ.A. +2WUU.A. +2WUX.A. +2WVX.A. +2WY3.B. +2WZO.A. +2ZXY.A. +3A0Z.A. +3A4R.A. +3A57.A. +3A5P.A. +3AAP.A. +3FOT.A. +3FOV.A. +3FQG.A. +3FRR.A. +3FSO.A. +3FSS.A. +3FWK.A. +3FWZ.A. +3FX7.A. +3FYB.A. +3FYM.A. +3G02.A. +3G0M.A. +3G1J.A. +3G21.A. +3G2B.A. +3G2S.A. +3G36.A. +3G3T.A. +3G5B.A. +3G7G.A. +3GA3.A. +3GA4.A. +3GAE.A. +3GBW.A. +3GBY.A. +3GDW.A. +3GE3.E. +3GFP.A. +3GI7.A. +3GIX.A. +3GKJ.A. +3GMG.A. +3GN6.A. +3GNE.A. +3GNZ.P. +3GOE.A. +3GP4.A. +3GP6.A. +3GQQ.A. +3GWH.A. +3GWN.A. +3GXW.A. +3GY9.A. +3GZB.A. +3H05.A. +3H0W.A. +3H20.A. +3H3L.A. +3H51.A. +3H5J.A. +3H6P.C. +3H6R.A. +3H7H.B. +3H8T.A. +3H96.A. +3H9W.A. +3HA2.A. +3HE5.B. +3HFO.A. +3HH1.A. +3HL1.A. +3HN0.A. +3HN5.A. +3HO6.A. +3HOI.A. +3HPC.X. +3HR0.A. +3HRL.A. +3HRR.A. +3HSH.A. +3HTV.A. +3HVS.A. +3HWP.A. +3HWU.A. +3HX8.A. +3HXL.A. +3HYN.A. +3HZP.A. +3I0W.A. +3I1A.A. +3I2V.A. +3I4O.A. +3I7M.A. +3I84.A. +3IBM.A. +3IC3.A. +3ID1.A. +3IDF.A. +3IDU.A. +3IE4.A. +3IEE.A. +3IG9.A. +3IHT.A. +3IJM.A. +3IKB.A. +3IKW.A. +3ILW.A. +3IM3.A. +3IMK.A. +3IP4.C. +3IPF.A. +3IPJ.A. +3IR4.A. +3IT5.A. +3IU6.A. +3IUF.A. +3IUO.A. +3IUW.A. +3IVV.A. +3IWF.A. +3IX3.A. +3JQY.A. +3JRN.A. +3JSZ.A. +3JTW.A. +3JU0.A. +3JUD.A. +3JXO.A. +3JYG.A. +3JYZ.A. +3JZ9.A. +3K0X.A. +3K0Z.A. +3K2O.A. +3K5J.A. +3K69.A. +3K6O.A. +3K7X.A. +3KD3.A. +3KDE.C. +3KDF.A. +3KDF.B. +3KDG.A. +3KE7.A. +3KG9.A. +3KGK.A. +3KK4.A. +3KKF.A. +3KKG.A. +3KLQ.A. +3KMI.A. +3KOG.A. +3KOS.A. +3KPE.A. +3KUC.B. +3KWS.A. +3KXT.A. +3KYZ.A. +3KZ5.A. +3KZD.A. +3KZP.A. +3L0Q.B. +3L15.A. +3L23.A. +3L29.A. +3L3E.A. +3L4H.A. +3L51.B. +3L6T.A. +3L7H.A. +2X2S.A. +2X2U.A. +2X32.A. +2X3G.A. +2X4J.A. +2X4K.A. +2X4W.A. +2X55.A. +2X5N.A. +2XCJ.A. +2XDG.A. +2XDH.A. +2XF7.A. +2XFV.A. +2XG5.B. +2XLG.A. +2XMJ.A. +3AG3.D. +3L9A.X. +3LAX.A. +3LDC.A. +3LDU.A. +3LE4.A. +3LFR.A. +3LGB.A. +3LHE.A. +3LHO.A. +3LHR.A. +3LLO.A. +3LM3.A. +3LQ9.A. +3LR2.A. +3LR4.A. +3LS0.A. +3LUC.A. +3LUM.A. +3LUR.A. +3LUU.A. +3LWC.A. +3LWG.A. +3LXR.F. +3LYD.A. +3LYG.A. +3LYH.A. +3LYY.A. +3M1T.A. +3M66.A. +3M6J.A. +3M7K.A. +3M7O.A. +3M8J.A. +3M9Q.A. +3MAB.A. +3MAL.A. +3MCB.A. +3MCB.B. +3MCQ.A. +3MDP.A. +3MG1.A. +3MHS.B. +3MR0.A. +3MSW.A. +3MT0.A. +3MW8.A. +3MWZ.A. +3MZO.A. +3N0R.A. +3N1E.A. +3N6Y.A. +3N9B.A. +3NE8.A. +3NFT.A. +3NKE.A. +3NKG.A. +3NKL.A. +3NO2.A. +3NOH.A. +3NPD.A. +3NQI.A. +3NRF.A. +3NRW.A. +3NS2.A. +3NY3.A. +3NZN.A. +3O6C.A. 3OAJ.A Modified: trunk/test/pdb/plp399.list =================================================================== --- trunk/test/pdb/plp399.list 2011-05-12 17:05:26 UTC (rev 2800) +++ trunk/test/pdb/plp399.list 2011-05-13 07:51:11 UTC (rev 2801) @@ -1,399 +1,399 @@ -3JU0.A -3JUD.A -2WQF.A -3F8X.A -2X4W.A -2X4J.A -2X4K.A -3LM3.A -3FQG.A -3A57.A -3A5P.A -3FJU.B -2ZQ5.A -2ZQE.A -2ZNR.A -2G1P.A -3G1J.A -3K7X.A -3LLO.A -3IVV.A -3ES4.A -3K0X.A -3K0Z.A -3IWF.A -3MW8.A -3MWZ.A -3FKA.A -3FK8.A -3GMG.A -3I1A.A -3FBL.A -3FB9.A -2WY3.B -3MG1.A -3HA2.A -3H20.A -3LFR.A -2RIV.B -3H5J.A -3H51.A -2VXZ.A -2VXT.I -1US5.A -2WCJ.A -2WCR.A -1EG3.A -3G02.A -3G0M.A -3HOI.A -3HO6.A -3KMI.A -3HRR.A -3HR0.A -3HRL.A -3G21.A -3G2B.A -3G2S.A -3KOS.A -3KOG.A -3C7T.A -2RH3.A -3F62.A -3H0W.A -3H05.A -1DC1.A -3NE8.A -3GDW.A -3L4H.A -3GY9.A -2XMJ.A -2XCJ.A -3IM3.A -3IMK.A -3I2V.A -2WJ5.A -2WJR.A -2WJ9.A -3JSZ.A -3JTW.A -3D59.A -3H9W.A -3H96.A -3FH1.A -3CP7.A -3LYD.A -3LYY.A -3LYG.A -3LYH.A -3I7M.A -3F2E.A -3HZP.A -2XF7.A -2XFV.A -3KZP.A -3KZ5.A -3KZD.A -2WL1.A -3MT0.A -3GFP.A -3KYZ.A -3N0R.A -3EO6.A -3HWU.A -3HWP.A -2WNF.A -3GWH.A -3GWN.A -3K2O.A -2R16.A -3DAN.A -3GNE.A -3GN6.A -3GNZ.P -3OAJ.A -3I0W.A -3C1Q.A -2QL8.A -3CHM.A -3CZ6.A -3EYT.A -2WZO.A -2VZC.A -3FF2.A -3FFV.A -3FF5.A -3NQI.A -2XG5.B -3HH1.A -2VE8.A -3D2Q.A -3NS2.A -3E7U.X -3E7H.A -2P4F.A -3IKB.A -3IKW.A -3NZN.A -3GI7.A -3GIX.A -3KWS.A -3IP4.C -3IPJ.A -3IPF.A -3KUC.B -3ENU.A -2AQ6.A -3KLQ.A -3L15.A -3N9B.A -3NO2.A -3NOH.A -3KDF.A -3KDF.B -3KDE.C -3KDG.A -3KD3.A -3CT6.A -3IG9.A -3L9A.X -3LDC.A -3LDU.A -3FWK.A -3FWZ.A -3A4R.A -3BFQ.G -3GE3.E -3LUM.A -3LUU.A -3LUC.A -3LUR.A -3IU6.A -3IUO.A -3IUW.A -3IUF.A -2OX7.A -3LHR.A -3LHE.A -3LHO.A -3ER7.A -2QZQ.A -3N1E.A -3LQ9.A -2WTP.A -3IC3.A -3M8J.A -2ZCA.A -3F7Q.A -3F7E.A -3MHS.C -3HSH.A -3KKG.A -3KK4.A -3KKF.A -3NRF.A -3NRW.A -3HYN.A -3EMF.A -3EMI.A -3C8L.A -3C8W.A -3IR4.A -3L23.A -3L29.A -3BO6.A -2P1M.A -2ZF9.A -2X32.A -2X3G.A -2QPX.A -3G5B.A -2ZK9.X -3M66.A -3M6J.A -3E8O.A -3E8T.A -3ILW.A -2ILR.A -3BCY.A -3LWG.A -3LWC.A -3H7H.B -2W9Y.A -2JK9.A -3NPD.A -3H8T.A -3M7K.A -3M7O.A -3L6T.A -3JXO.A -2WUU.A -2WUJ.A -2WUX.A -3L51.B -3FAU.A -3L0Q.B -3D85.C -3MCQ.A -3MCB.A -3MCB.B -2R2A.A -3DD7.A -3L3E.A -3N6Y.A -3GZB.A -3FM2.A -3FMY.A -3I84.A -2F1N.A -3LAX.A -3IX3.A -3KE7.A -2XLG.A -3IDU.A -3IDF.A -3ID1.A -3FOV.A -3FOT.A -3FCN.A -3D1R.A -3IBM.A -3EZI.A -3AG3.D -3H6P.C -3H6R.A -3NFT.A -2VQ4.A -3L7H.A -3GXW.A -2VTC.A -3IJM.A -3GOE.A -3EDO.A -3FGR.B -3FG9.A -3FGV.A -3JQY.A -3K69.A -3K6O.A -3BMZ.A -3BM3.A -2WVX.A -3ECH.A -3ECF.A -3O6C.A -3GQQ.A -3LGB.A -3MSW.A -3KXT.A -3BIY.A -3BP6.A -3GBY.A -3GBW.A -3FIA.A -3FID.A -3FX7.A -2ZSI.B -3EHM.A -3EHG.A -3EEH.A -3EER.A -3NKG.A -3NKL.A -3NKE.A -3F4M.A -3F40.A -1T07.A -3JYZ.A -3JYG.A -2W8X.A -3F9S.A -3F95.A -3IT5.A -1PBY.A -2W2R.A -2WPV.B -3F0P.A -3HL1.A -2HLQ.A -3A0Z.A -3NY3.A -3GAE.A -3GA4.A -3GA3.A -2V89.A -3IE4.A -3IEE.A -2TPS.A -3K5J.A -3G7G.A -3JZ9.A -3CNY.A -3KGK.A -3KG9.A -3DSB.A -3DS2.A -3HPC.X -3LS0.A -3GP4.A -3GP6.A -2XDH.A -2XDG.A -2ZX0.A -2ZXY.A -3I4O.A -3IHT.A -2VV6.A -3D3B.J -3D34.A -3LR4.A -3LR2.A -2QEE.A -2QEU.A -3HXL.A -3HX8.A -3M9Q.A -2X2U.A -2X2S.A -2V4X.A -3HFO.A -3G3T.A -3G36.A -3LE4.A -2QJV.A -3MAB.A -3MAL.A -3HVS.A -3HN0.A -3HN5.A -3HTV.A -3EBT.A -3AAP.A -3JRN.A -3MR0.A -2W61.A -2W6A.A -3FRR.A -3EKI.A -2WFO.A -2WFB.A -3MZO.A -3FSS.A -3FSO.A -3GKJ.A -3LXR.F -3M1T.A -3EF8.A -3FYM.A -3FYB.A -2W7N.A -2W7A.A -2X5N.A -2X55.A -3BYQ.A -3BYP.A -3MDP.A -3H3L.A -2RBG.A -3HE5.B +3JU0.A. +3JUD.A. +2WQF.A. +3F8X.A. +2X4W.A. +2X4J.A. +2X4K.A. +3LM3.A. +3FQG.A. +3A57.A. +3A5P.A. +3FJU.B. +2ZQ5.A. +2ZQE.A. +2ZNR.A. +2G1P.A. +3G1J.A. +3K7X.A. +3LLO.A. +3IVV.A. +3ES4.A. +3K0X.A. +3K0Z.A. +3IWF.A. +3MW8.A. +3MWZ.A. +3FKA.A. +3FK8.A. +3GMG.A. +3I1A.A. +3FBL.A. +3FB9.A. +2WY3.B. +3MG1.A. +3HA2.A. +3H20.A. +3LFR.A. +2RIV.B. +3H5J.A. +3H51.A. +2VXZ.A. +2VXT.I. +1US5.A. +2WCJ.A. +2WCR.A. +1EG3.A. +3G02.A. +3G0M.A. +3HOI.A. +3HO6.A. +3KMI.A. +3HRR.A. +3HR0.A. +3HRL.A. +3G21.A. +3G2B.A. +3G2S.A. +3KOS.A. +3KOG.A. +3C7T.A. +2RH3.A. +3F62.A. +3H0W.A. +3H05.A. +1DC1.A. +3NE8.A. +3GDW.A. +3L4H.A. +3GY9.A. +2XMJ.A. +2XCJ.A. +3IM3.A. +3IMK.A. +3I2V.A. +2WJ5.A. +2WJR.A. +2WJ9.A. +3JSZ.A. +3JTW.A. +3D59.A. +3H9W.A. +3H96.A. +3FH1.A. +3CP7.A. +3LYD.A. +3LYY.A. +3LYG.A. +3LYH.A. +3I7M.A. +3F2E.A. +3HZP.A. +2XF7.A. +2XFV.A. +3KZP.A. +3KZ5.A. +3KZD.A. +2WL1.A. +3MT0.A. +3GFP.A. +3KYZ.A. +3N0R.A. +3EO6.A. +3HWU.A. +3HWP.A. +2WNF.A. +3GWH.A. +3GWN.A. +3K2O.A. +2R16.A. +3DAN.A. +3GNE.A. +3GN6.A. +3GNZ.P. +3OAJ.A. +3I0W.A. +3C1Q.A. +2QL8.A. +3CHM.A. +3CZ6.A. +3EYT.A. +2WZO.A. +2VZC.A. +3FF2.A. +3FFV.A. +3FF5.A. +3NQI.A. +2XG5.B. +3HH1.A. +2VE8.A. +3D2Q.A. +3NS2.A. +3E7U.X. +3E7H.A. +2P4F.A. +3IKB.A. +3IKW.A. +3NZN.A. +3GI7.A. +3GIX.A. +3KWS.A. +3IP4.C. +3IPJ.A. +3IPF.A. +3KUC.B. +3ENU.A. +2AQ6.A. +3KLQ.A. +3L15.A. +3N9B.A. +3NO2.A. +3NOH.A. +3KDF.A. +3KDF.B. +3KDE.C. +3KDG.A. +3KD3.A. +3CT6.A. +3IG9.A. +3L9A.X. +3LDC.A. +3LDU.A. +3FWK.A. +3FWZ.A. +3A4R.A. +3BFQ.G. +3GE3.E. +3LUM.A. +3LUU.A. +3LUC.A. +3LUR.A. +3IU6.A. +3IUO.A. +3IUW.A. +3IUF.A. +2OX7.A. +3LHR.A. +3LHE.A. +3LHO.A. +3ER7.A. +2QZQ.A. +3N1E.A. +3LQ9.A. +2WTP.A. +3IC3.A. +3M8J.A. +2ZCA.A. +3F7Q.A. +3F7E.A. +3MHS.C. +3HSH.A. +3KKG.A. +3KK4.A. +3KKF.A. +3NRF.A. +3NRW.A. +3HYN.A. +3EMF.A. +3EMI.A. +3C8L.A. +3C8W.A. +3IR4.A. +3L23.A. +3L29.A. +3BO6.A. +2P1M.A. +2ZF9.A. +2X32.A. +2X3G.A. +2QPX.A. +3G5B.A. +2ZK9.X. +3M66.A. +3M6J.A. +3E8O.A. +3E8T.A. +3ILW.A. +2ILR.A. +3BCY.A. +3LWG.A. +3LWC.A. +3H7H.B. +2W9Y.A. +2JK9.A. +3NPD.A. +3H8T.A. +3M7K.A. +3M7O.A. +3L6T.A. +3JXO.A. +2WUU.A. +2WUJ.A. +2WUX.A. +3L51.B. +3FAU.A. +3L0Q.B. +3D85.C. +3MCQ.A. +3MCB.A. +3MCB.B. +2R2A.A. +3DD7.A. +3L3E.A. +3N6Y.A. +3GZB.A. +3FM2.A. +3FMY.A. +3I84.A. +2F1N.A. +3LAX.A. +3IX3.A. +3KE7.A. +2XLG.A. +3IDU.A. +3IDF.A. +3ID1.A. +3FOV.A. +3FOT.A. +3FCN.A. +3D1R.A. +3IBM.A. +3EZI.A. +3AG3.D. +3H6P.C. +3H6R.A. +3NFT.A. +2VQ4.A. +3L7H.A. +3GXW.A. +2VTC.A. +3IJM.A. +3GOE.A. +3EDO.A. +3FGR.B. +3FG9.A. +3FGV.A. +3JQY.A. +3K69.A. +3K6O.A. +3BMZ.A. +3BM3.A. +2WVX.A. +3ECH.A. +3ECF.A. +3O6C.A. +3GQQ.A. +3LGB.A. +3MSW.A. +3KXT.A. +3BIY.A. +3BP6.A. +3GBY.A. +3GBW.A. +3FIA.A. +3FID.A. +3FX7.A. +2ZSI.B. +3EHM.A. +3EHG.A. +3EEH.A. +3EER.A. +3NKG.A. +3NKL.A. +3NKE.A. +3F4M.A. +3F40.A. +1T07.A. +3JYZ.A. +3JYG.A. +2W8X.A. +3F9S.A. +3F95.A. +3IT5.A. +1PBY.A. +2W2R.A. +2WPV.B. +3F0P.A. +3HL1.A. +2HLQ.A. +3A0Z.A. +3NY3.A. +3GAE.A. +3GA4.A. +3GA3.A. +2V89.A. +3IE4.A. +3IEE.A. +2TPS.A. +3K5J.A. +3G7G.A. +3JZ9.A. +3CNY.A. +3KGK.A. +3KG9.A. +3DSB.A. +3DS2.A. +3HPC.X. +3LS0.A. +3GP4.A. +3GP6.A. +2XDH.A. +2XDG.A. +2ZX0.A. +2ZXY.A. +3I4O.A. +3IHT.A. +2VV6.A. +3D3B.J. +3D34.A. +3LR4.A. +3LR2.A. +2QEE.A. +2QEU.A. +3HXL.A. +3HX8.A. +3M9Q.A. +2X2U.A. +2X2S.A. +2V4X.A. +3HFO.A. +3G3T.A. +3G36.A. +3LE4.A. +2QJV.A. +3MAB.A. +3MAL.A. +3HVS.A. +3HN0.A. +3HN5.A. +3HTV.A. +3EBT.A. +3AAP.A. +3JRN.A. +3MR0.A. +2W61.A. +2W6A.A. +3FRR.A. +3EKI.A. +2WFO.A. +2WFB.A. +3MZO.A. +3FSS.A. +3FSO.A. +3GKJ.A. +3LXR.F. +3M1T.A. +3EF8.A. +3FYM.A. +3FYB.A. +2W7N.A. +2W7A.A. +2X5N.A. +2X55.A. +3BYQ.A. +3BYP.A. +3MDP.A. +3H3L.A. +2RBG.A. +3HE5.B. 3CKK.A This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ji...@us...> - 2011-05-13 10:33:09
|
Revision: 2807 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2807&view=rev Author: jialva Date: 2011-05-13 10:33:02 +0000 (Fri, 13 May 2011) Log Message: ----------- New update of fuzzyDL-Learner Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt Added Paths: ----------- trunk/examples/fuzzydll/noFuzzyTrains_v1.3.owl Modified: trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java 2011-05-13 09:59:27 UTC (rev 2806) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java 2011-05-13 10:33:02 UTC (rev 2807) @@ -18,4 +18,20 @@ public void setBeliefDegree(double beliefDegree) { this.beliefDegree = beliefDegree; } + + public int compareTo(FuzzyIndividual o) { + int d = Double.compare(beliefDegree, o.getBeliefDegree()); + if (d == 0) + return super.compareTo(o); + else + return d; + } + + @Override + public boolean equals(Object o) { + if(o==null) { + return false; + } + return (compareTo((FuzzyIndividual)o)==0); + } } Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-05-13 09:59:27 UTC (rev 2806) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-05-13 10:33:02 UTC (rev 2807) @@ -527,6 +527,7 @@ // System.out.println("noise = " + noise); + // TODO in order the noise check to work ... is it necessary to have the examples ordered by its truthBelief? // int individualCounter = fuzzyExamples.size(); double individualCounter = totalTruth; for (FuzzyIndividual fuzzyExample : fuzzyExamples) { Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-13 09:59:27 UTC (rev 2806) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-13 10:33:02 UTC (rev 2807) @@ -80,7 +80,7 @@ ComponentManager cm = ComponentManager.getInstance(); OWLFile ks = cm.knowledgeSource(OWLFile.class); - ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/fuzzyTrains_v1.3.owl")); + ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/noFuzzyTrains_v1.3.owl")); ks.init(); //ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-05-13 09:59:27 UTC (rev 2806) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-05-13 10:33:02 UTC (rev 2807) @@ -85,7 +85,7 @@ OWLFile ks = cm.knowledgeSource(OWLFile.class); // ks.getConfigurator().setUrl(new URL("file:///Users/josue/Documents/PhD/AKSW/ontologies/fuzzyTrains/fuzzyTrains_v1.0.owl")); - ks.getConfigurator().setUrl(new URL("file:///Users/josue/Documents/PhD/AKSW/ontologies/fuzzyTrains/noFuzzyTrains_v1.3.owl")); + ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/noFuzzyTrains_v1.3.owl")); ks.init(); ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); Modified: trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt =================================================================== --- trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt 2011-05-13 09:59:27 UTC (rev 2806) +++ trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt 2011-05-13 10:33:02 UTC (rev 2807) @@ -1,6 +1,3 @@ -(define-fuzzy-concept fuzzyLongCar right-shoulder(5.0, 50.0, 40.0, 40.0) ) -(define-fuzzy-concept fuzzyShortCar left-shoulder(5.0, 50.0, 15.0, 15.0) ) -(define-fuzzy-concept fuzzyMediumLengthCar trapezoidal(5.0, 50.0, 15.0, 15.0, 40.0, 40.0) ) (functional isInFrontOf) (functional hasCarLength) (domain hasLoad Car ) @@ -85,9 +82,11 @@ (instance car63 (= hasCarLength 25) 1.0 ) (instance car12 (= hasCarLength 25) 1.0 ) (instance car72 (= hasCarLength 6) 1.0 ) +(disjoint Rectangle Triangle ) +(disjoint LongCar MediumLenghtCar ShortCar ) (disjoint Car Load ) (disjoint Car Train ) (disjoint Load Train ) -(define-concept LongCar (and Car (some hasCarLength fuzzyLongCar))) -(define-concept ShortCar (and Car (some hasCarLength fuzzyShortCar))) -(define-concept MediumLenghtCar (and Car (some hasCarLength fuzzyMediumLengthCar))) +(define-concept ShortCar (and Car null)) +(define-concept MediumLenghtCar (and Car null)) +(define-concept LongCar (and Car null)) Added: trunk/examples/fuzzydll/noFuzzyTrains_v1.3.owl =================================================================== --- trunk/examples/fuzzydll/noFuzzyTrains_v1.3.owl (rev 0) +++ trunk/examples/fuzzydll/noFuzzyTrains_v1.3.owl 2011-05-13 10:33:02 UTC (rev 2807) @@ -0,0 +1,638 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<rdf:RDF xmlns="http://www.example.com/fuzzyTrains.owl#" + xml:base="http://www.example.com/fuzzyTrains.owl" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <owl:Ontology rdf:about="http://www.example.com/fuzzyTrains.owl"> + <rdfs:comment xml:lang="en">Fuzzy adaptation of Michalsky's trains problem [1] +Original idea from [2] + +Developed by Josue Iglesias (josue at grpss.ssr.upm.es) + +[1] http://www.mli.gmu.edu/papers/79-80/80-05.pdf +[2] http://users.iit.demokritos.gr/~konstant/dload/Pubs/fuzz10.pdf</rdfs:comment> + </owl:Ontology> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Annotation properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + <owl:AnnotationProperty rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLabel"/> + <owl:AnnotationProperty rdf:about="&rdfs;comment"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Datatypes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#noFuzzyLongCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#noFuzzyLongCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">40.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#noFuzzyMediumLengthCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#noFuzzyMediumLengthCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">15.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxExclusive rdf:datatype="&xsd;double">40.0</xsd:maxExclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#noFuzzyShortCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#noFuzzyShortCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxExclusive rdf:datatype="&xsd;double">15.0</xsd:maxExclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + </rdfs:Datatype> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCar --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCar"> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasLoad --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasLoad"> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#isInFrontOf --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#isInFrontOf"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:ObjectProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Data properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCarLength --> + + <owl:DatatypeProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCarLength"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </rdfs:range> + </owl:DatatypeProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#Car --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Car"> + <rdfs:subClassOf rdf:resource="&owl;Thing"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Load --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Load"> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#LongCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#noFuzzyLongCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#MediumLenghtCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#noFuzzyMediumLengthCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Rectangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Rectangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#ShortCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#noFuzzyShortCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Train --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Triangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Triangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:Class> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#car11 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car11"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">49</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car12 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car12"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car13 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car13"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">13</hasCarLength> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car21 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car21"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">47</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load21a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car22 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car22"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">7</hasCarLength> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car61 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car61"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">45</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car62 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car62"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">8</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car63 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car63"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car71 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car71"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">7</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car72 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car72"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">6</hasCarLength> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east1 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east1"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east2 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east2"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load12a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load12a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load21a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load21b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load62a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load62b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west6 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west6"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west7 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west7"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + </owl:NamedIndividual> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // General axioms + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + <rdf:Description> + <rdf:type rdf:resource="&owl;AllDisjointClasses"/> + <owl:members rdf:parseType="Collection"> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"/> + </owl:members> + </rdf:Description> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 3.1.0.20069) http://owlapi.sourceforge.net --> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ji...@us...> - 2011-05-17 08:56:39
|
Revision: 2810 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2810&view=rev Author: jialva Date: 2011-05-17 08:56:32 +0000 (Tue, 17 May 2011) Log Message: ----------- New update of fuzzyDL-Learner Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt Modified: trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java 2011-05-16 10:29:40 UTC (rev 2809) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/fuzzydll/FuzzyIndividual.java 2011-05-17 08:56:32 UTC (rev 2810) @@ -4,23 +4,23 @@ public class FuzzyIndividual extends Individual{ - private double beliefDegree; + private double truthDegree; public FuzzyIndividual(String name, double fuzzyDegree) { super(name); - this.beliefDegree = fuzzyDegree; + this.truthDegree = fuzzyDegree; } - public double getBeliefDegree() { - return beliefDegree; + public double getTruthDegree() { + return truthDegree; } - public void setBeliefDegree(double beliefDegree) { - this.beliefDegree = beliefDegree; + public void setTruthDegree(double beliefDegree) { + this.truthDegree = beliefDegree; } public int compareTo(FuzzyIndividual o) { - int d = Double.compare(beliefDegree, o.getBeliefDegree()); + int d = Double.compare(truthDegree, o.getTruthDegree()); if (d == 0) return super.compareTo(o); else Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java 2011-05-16 10:29:40 UTC (rev 2809) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLP.java 2011-05-17 08:56:32 UTC (rev 2810) @@ -121,7 +121,7 @@ if (name.equals("fuzzyExamples")){ fuzzyExamples = CommonConfigMappings.getFuzzyIndividualSet((Set<FuzzyExample>) entry.getValue()); for (FuzzyIndividual fuzzyExample : fuzzyExamples) { - totalTruth += fuzzyExample.getBeliefDegree(); + totalTruth += fuzzyExample.getTruthDegree(); } } // TODO delete positiveExamples & negativeExamples Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-05-16 10:29:40 UTC (rev 2809) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-05-17 08:56:32 UTC (rev 2810) @@ -593,9 +593,9 @@ // TODO to optimize for (FuzzyIndividual ind: fuzzyExamples) { - coveredMembershipDegree += reasoner.hasTypeFuzzyMembership(description, ind) * ind.getBeliefDegree(); - totalMembershipDegree += ind.getBeliefDegree(); - invertedCoveredMembershipDegree += (1 - ind.getBeliefDegree()) * (1 - reasoner.hasTypeFuzzyMembership(description, ind)); + coveredMembershipDegree += reasoner.hasTypeFuzzyMembership(description, ind) * ind.getTruthDegree(); + totalMembershipDegree += ind.getTruthDegree(); + invertedCoveredMembershipDegree += (1 - ind.getTruthDegree()) * (1 - reasoner.hasTypeFuzzyMembership(description, ind)); } double fuzzyRecall = totalMembershipDegree == 0 ? 0 :coveredMembershipDegree/totalMembershipDegree; // TODO this is like this??? not sure Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-05-16 10:29:40 UTC (rev 2809) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-05-17 08:56:32 UTC (rev 2810) @@ -1137,7 +1137,7 @@ OWLClassExpression desc = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(description); OWLIndividual ind = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - double fuzzyReasonerOutput = fuzzyReasoner.getFuzzyMembership(desc, ind, individual.getBeliefDegree()); + double fuzzyReasonerOutput = fuzzyReasoner.getFuzzyMembership(desc, ind, individual.getTruthDegree()); // System.out.println("- d: " + d); // System.out.println("- i: " + i); Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-16 10:29:40 UTC (rev 2809) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-17 08:56:32 UTC (rev 2810) @@ -80,7 +80,7 @@ ComponentManager cm = ComponentManager.getInstance(); OWLFile ks = cm.knowledgeSource(OWLFile.class); - ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/noFuzzyTrains_v1.3.owl")); + ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/fuzzyTrains_v1.3.owl")); ks.init(); //ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); Modified: trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt =================================================================== --- trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt 2011-05-16 10:29:40 UTC (rev 2809) +++ trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt 2011-05-17 08:56:32 UTC (rev 2810) @@ -1,3 +1,6 @@ +(define-fuzzy-concept fuzzyLongCar right-shoulder(5.0, 50.0, 40.0, 40.0) ) +(define-fuzzy-concept fuzzyShortCar left-shoulder(5.0, 50.0, 15.0, 15.0) ) +(define-fuzzy-concept fuzzyMediumLengthCar trapezoidal(5.0, 50.0, 15.0, 15.0, 40.0, 40.0) ) (functional isInFrontOf) (functional hasCarLength) (domain hasLoad Car ) @@ -82,11 +85,9 @@ (instance car63 (= hasCarLength 25) 1.0 ) (instance car12 (= hasCarLength 25) 1.0 ) (instance car72 (= hasCarLength 6) 1.0 ) -(disjoint Rectangle Triangle ) -(disjoint LongCar MediumLenghtCar ShortCar ) (disjoint Car Load ) (disjoint Car Train ) (disjoint Load Train ) -(define-concept ShortCar (and Car null)) -(define-concept MediumLenghtCar (and Car null)) -(define-concept LongCar (and Car null)) +(define-concept LongCar (and Car (some hasCarLength fuzzyLongCar))) +(define-concept ShortCar (and Car (some hasCarLength fuzzyShortCar))) +(define-concept MediumLenghtCar (and Car (some hasCarLength fuzzyMediumLengthCar))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ji...@us...> - 2011-05-19 16:05:20
|
Revision: 2814 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2814&view=rev Author: jialva Date: 2011-05-19 16:05:12 +0000 (Thu, 19 May 2011) Log Message: ----------- New update of fuzzyDL-Learner Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java Added Paths: ----------- trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-05-19 10:36:18 UTC (rev 2813) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-05-19 16:05:12 UTC (rev 2814) @@ -8,18 +8,53 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.util.Iterator; +import java.util.List; import java.util.Scanner; +import java.util.Set; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.semanticweb.owlapi.model.AxiomType; +import org.semanticweb.owlapi.model.OWLAxiom; +import org.semanticweb.owlapi.model.OWLClass; import org.semanticweb.owlapi.model.OWLClassExpression; +import org.semanticweb.owlapi.model.OWLDataProperty; +import org.semanticweb.owlapi.model.OWLDataPropertyExpression; import org.semanticweb.owlapi.model.OWLEntity; import org.semanticweb.owlapi.model.OWLIndividual; +import org.semanticweb.owlapi.model.OWLLiteral; +import org.semanticweb.owlapi.model.OWLNamedIndividual; +import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; +import org.semanticweb.owlapi.model.OWLOntology; +import org.semanticweb.owlapi.model.OWLOntologyChange; +import org.semanticweb.owlapi.reasoner.AxiomNotInProfileException; +import org.semanticweb.owlapi.reasoner.BufferingMode; +import org.semanticweb.owlapi.reasoner.ClassExpressionNotInProfileException; +import org.semanticweb.owlapi.reasoner.FreshEntitiesException; +import org.semanticweb.owlapi.reasoner.FreshEntityPolicy; +import org.semanticweb.owlapi.reasoner.InconsistentOntologyException; +import org.semanticweb.owlapi.reasoner.IndividualNodeSetPolicy; +import org.semanticweb.owlapi.reasoner.InferenceType; +import org.semanticweb.owlapi.reasoner.Node; +import org.semanticweb.owlapi.reasoner.NodeSet; +import org.semanticweb.owlapi.reasoner.OWLReasoner; +import org.semanticweb.owlapi.reasoner.OWLReasonerConfiguration; +import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; +import org.semanticweb.owlapi.reasoner.TimeOutException; +import org.semanticweb.owlapi.reasoner.UnsupportedEntailmentTypeException; import org.semanticweb.owlapi.util.SimpleShortFormProvider; +import org.semanticweb.owlapi.util.Version; + +import com.clarkparsia.pellet.owlapiv3.PelletReasoner; +import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; + import fuzzydl.*; import fuzzydl.exception.FuzzyOntologyException; import fuzzydl.milp.Solution; import fuzzydl.parser.*; import fuzzydll.fuzzyowl2fuzzydlparser.*; -public class FuzzyDLReasonerManager { +public class FuzzyDLReasonerManager implements OWLReasoner { // private static final String CHANGING_JUST_HIERARCHI_PROBLEM = "../examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput_manual.fuzzyDL.txt"; private static final String FUZZYOWL2FUZZYDLPARSEROUTPUT = "../examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt"; @@ -32,9 +67,13 @@ private FuzzyOwl2toFuzzyDL fuzzyFileParser; private int auxCounter = 0; + private PelletReasoner crispReasoner; // private FileOutputStream errorFile; - public FuzzyDLReasonerManager(String ontologyFile) throws Exception { + public FuzzyDLReasonerManager(String ontologyFile, OWLOntology ontology, OWLReasonerConfiguration conf) throws Exception { + + startPellet(ontology, conf); + queryResult = null; parser = null; @@ -51,6 +90,15 @@ // errorFile = new FileOutputStream("errorFile.txt"); } + private void startPellet(OWLOntology ontology, OWLReasonerConfiguration conf) { + // instantiate Pellet reasoner + crispReasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology, conf); + // 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); + } + private void solveKB() { try { fuzzyKB.solveKB(); @@ -125,4 +173,402 @@ sw.flush(); return sw.toString(); } + + @Override + public void dispose() { + // TODO Auto-generated method stub + crispReasoner.dispose(); + } + + @Override + public void flush() { + + crispReasoner.flush(); + } + + @Override + public Node<OWLClass> getBottomClassNode() { + + return crispReasoner.getBottomClassNode(); + } + + @Override + public Node<OWLDataProperty> getBottomDataPropertyNode() { + + return crispReasoner.getBottomDataPropertyNode(); + } + + @Override + public Node<OWLObjectPropertyExpression> getBottomObjectPropertyNode() { + + return crispReasoner.getBottomObjectPropertyNode(); + } + + @Override + public BufferingMode getBufferingMode() { + + return crispReasoner.getBufferingMode(); + } + + @Override + public NodeSet<OWLClass> getDataPropertyDomains(OWLDataProperty arg0, + boolean arg1) throws InconsistentOntologyException, + FreshEntitiesException, ReasonerInterruptedException, + TimeOutException { + + return crispReasoner.getDataPropertyDomains(arg0, arg1); + } + + @Override + public Set<OWLLiteral> getDataPropertyValues(OWLNamedIndividual arg0, + OWLDataProperty arg1) throws InconsistentOntologyException, + FreshEntitiesException, ReasonerInterruptedException, + TimeOutException { + + return crispReasoner.getDataPropertyValues(arg0, arg1); + } + + @Override + public NodeSet<OWLNamedIndividual> getDifferentIndividuals( + OWLNamedIndividual arg0) throws InconsistentOntologyException, + FreshEntitiesException, ReasonerInterruptedException, + TimeOutException { + + return crispReasoner.getDifferentIndividuals(arg0); + } + + @Override + public NodeSet<OWLClass> getDisjointClasses(OWLClassExpression arg0) + throws ReasonerInterruptedException, TimeOutException, + FreshEntitiesException, InconsistentOntologyException { + + return crispReasoner.getDisjointClasses(arg0); + } + + @Override + public NodeSet<OWLDataProperty> getDisjointDataProperties( + OWLDataPropertyExpression arg0) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getDisjointDataProperties(arg0); + } + + @Override + public NodeSet<OWLObjectPropertyExpression> getDisjointObjectProperties( + OWLObjectPropertyExpression arg0) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getDisjointObjectProperties(arg0); + } + + @Override + public Node<OWLClass> getEquivalentClasses(OWLClassExpression arg0) + throws InconsistentOntologyException, + ClassExpressionNotInProfileException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getEquivalentClasses(arg0); + } + + @Override + public Node<OWLDataProperty> getEquivalentDataProperties( + OWLDataProperty arg0) throws InconsistentOntologyException, + FreshEntitiesException, ReasonerInterruptedException, + TimeOutException { + + return crispReasoner.getEquivalentDataProperties(arg0); + } + + @Override + public Node<OWLObjectPropertyExpression> getEquivalentObjectProperties( + OWLObjectPropertyExpression arg0) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getEquivalentObjectProperties(arg0); + } + + @Override + public FreshEntityPolicy getFreshEntityPolicy() { + + return crispReasoner.getFreshEntityPolicy(); + } + + @Override + public IndividualNodeSetPolicy getIndividualNodeSetPolicy() { + + return crispReasoner.getIndividualNodeSetPolicy(); + } + + @Override + public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression arg0, + boolean arg1) throws InconsistentOntologyException, + ClassExpressionNotInProfileException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getInstances(arg0, arg1); + } + + @Override + public Node<OWLObjectPropertyExpression> getInverseObjectProperties( + OWLObjectPropertyExpression arg0) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getInverseObjectProperties(arg0); + } + + @Override + public NodeSet<OWLClass> getObjectPropertyDomains( + OWLObjectPropertyExpression arg0, boolean arg1) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getObjectPropertyDomains(arg0, arg1); + } + + @Override + public NodeSet<OWLClass> getObjectPropertyRanges( + OWLObjectPropertyExpression arg0, boolean arg1) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getObjectPropertyRanges(arg0, arg1); + } + + @Override + public NodeSet<OWLNamedIndividual> getObjectPropertyValues( + OWLNamedIndividual arg0, OWLObjectPropertyExpression arg1) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getObjectPropertyValues(arg0, arg1); + } + + @Override + public Set<OWLAxiom> getPendingAxiomAdditions() { + + return crispReasoner.getPendingAxiomAdditions(); + } + + @Override + public Set<OWLAxiom> getPendingAxiomRemovals() { + + return crispReasoner.getPendingAxiomRemovals(); + } + + @Override + public List<OWLOntologyChange> getPendingChanges() { + + return crispReasoner.getPendingChanges(); + } + + @Override + public Set<InferenceType> getPrecomputableInferenceTypes() { + + return crispReasoner.getPrecomputableInferenceTypes(); + } + + @Override + public String getReasonerName() { + + return crispReasoner.getReasonerName(); + } + + @Override + public Version getReasonerVersion() { + + return crispReasoner.getReasonerVersion(); + } + + @Override + public OWLOntology getRootOntology() { + + return crispReasoner.getRootOntology(); + } + + @Override + public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual arg0) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getSameIndividuals(arg0); + } + + @Override + public NodeSet<OWLClass> getSubClasses(OWLClassExpression arg0, boolean arg1) + throws ReasonerInterruptedException, TimeOutException, + FreshEntitiesException, InconsistentOntologyException, + ClassExpressionNotInProfileException { + + return crispReasoner.getSubClasses(arg0, arg1); + } + + @Override + public NodeSet<OWLDataProperty> getSubDataProperties(OWLDataProperty arg0, + boolean arg1) throws InconsistentOntologyException, + FreshEntitiesException, ReasonerInterruptedException, + TimeOutException { + + return crispReasoner.getSubDataProperties(arg0, arg1); + } + + @Override + public NodeSet<OWLObjectPropertyExpression> getSubObjectProperties( + OWLObjectPropertyExpression arg0, boolean arg1) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getSubObjectProperties(arg0, arg1); + } + + @Override + public NodeSet<OWLClass> getSuperClasses(OWLClassExpression arg0, + boolean arg1) throws InconsistentOntologyException, + ClassExpressionNotInProfileException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + +// System.out.println(arg0); +// +// Query q1, q2; +// for(Concept concept : fuzzyKB.atomicConcepts.values()) { +// System.out.print(" - " + concept + " "); +// q1 = new MinSubsumesQuery(concept, OWLAPI_fuzzyDLObjectParser.getFuzzyDLExpresion(arg0), MinSubsumesQuery.LUKASIEWICZ); +// q2 = new MaxSubsumesQuery(concept, OWLAPI_fuzzyDLObjectParser.getFuzzyDLExpresion(arg0), MaxSubsumesQuery.LUKASIEWICZ); +// KnowledgeBase clonedFuzzyKB = fuzzyKB.clone(); +// try { +// Solution queryResult1 = q1.solve(clonedFuzzyKB); +// Solution queryResult2 = q2.solve(clonedFuzzyKB); +// System.out.print(queryResult1 + " " + queryResult2); +// System.out.println(); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } + + + + return crispReasoner.getSuperClasses(arg0, arg1); + } + + @Override + public NodeSet<OWLDataProperty> getSuperDataProperties( + OWLDataProperty arg0, boolean arg1) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getSuperDataProperties(arg0, arg1); + } + + @Override + public NodeSet<OWLObjectPropertyExpression> getSuperObjectProperties( + OWLObjectPropertyExpression arg0, boolean arg1) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getSuperObjectProperties(arg0, arg1); + } + + @Override + public long getTimeOut() { + + return crispReasoner.getTimeOut(); + } + + @Override + public Node<OWLClass> getTopClassNode() { + + return crispReasoner.getTopClassNode(); + } + + @Override + public Node<OWLDataProperty> getTopDataPropertyNode() { + + return crispReasoner.getTopDataPropertyNode(); + } + + @Override + public Node<OWLObjectPropertyExpression> getTopObjectPropertyNode() { + + return crispReasoner.getTopObjectPropertyNode(); + } + + @Override + public NodeSet<OWLClass> getTypes(OWLNamedIndividual arg0, boolean arg1) + throws InconsistentOntologyException, FreshEntitiesException, + ReasonerInterruptedException, TimeOutException { + + return crispReasoner.getTypes(arg0, arg1); + } + + @Override + public Node<OWLClass> getUnsatisfiableClasses() + throws ReasonerInterruptedException, TimeOutException, + InconsistentOntologyException { + + return crispReasoner.getUnsatisfiableClasses(); + } + + @Override + public void interrupt() { + + crispReasoner.interrupt(); + } + + @Override + public boolean isConsistent() throws ReasonerInterruptedException, + TimeOutException { + + return crispReasoner.isConsistent(); + } + + @Override + public boolean isEntailed(OWLAxiom arg0) + throws ReasonerInterruptedException, + UnsupportedEntailmentTypeException, TimeOutException, + AxiomNotInProfileException, FreshEntitiesException, + InconsistentOntologyException { + + return crispReasoner.isEntailed(arg0); + } + + @Override + public boolean isEntailed(Set<? extends OWLAxiom> arg0) + throws ReasonerInterruptedException, + UnsupportedEntailmentTypeException, TimeOutException, + AxiomNotInProfileException, FreshEntitiesException, + InconsistentOntologyException { + + return crispReasoner.isEntailed(arg0); + } + + @Override + public boolean isEntailmentCheckingSupported(AxiomType<?> arg0) { + + return crispReasoner.isEntailmentCheckingSupported(arg0); + } + + @Override + public boolean isPrecomputed(InferenceType arg0) { + + return crispReasoner.isPrecomputed(arg0); + } + + @Override + public boolean isSatisfiable(OWLClassExpression arg0) + throws ReasonerInterruptedException, TimeOutException, + ClassExpressionNotInProfileException, FreshEntitiesException, + InconsistentOntologyException { + + return crispReasoner.isSatisfiable(arg0); + } + + @Override + public void precomputeInferences(InferenceType... arg0) + throws ReasonerInterruptedException, TimeOutException, + InconsistentOntologyException { + crispReasoner.precomputeInferences(arg0); + } } Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-05-19 10:36:18 UTC (rev 2813) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-05-19 16:05:12 UTC (rev 2814) @@ -135,7 +135,7 @@ // private static Logger logger = Logger // .getLogger(OWLAPIReasoner.class); - //private String reasonerType = "pellet"; + // private String reasonerType = "pellet"; private FuzzyOWLAPIReasonerConfigurator configurator; @Override public FuzzyOWLAPIReasonerConfigurator getConfigurator(){ @@ -174,7 +174,7 @@ // references to OWL API ontologies private List<OWLOntology> owlAPIOntologies = new LinkedList<OWLOntology>(); - private FuzzyDLReasonerManager fuzzyReasoner; + // private FuzzyDLReasonerManager fuzzyReasoner; private int reasonersComparationCounter = 0; private int reasonersComparationDisparityCounter = 0; @@ -191,7 +191,7 @@ public static Collection<ConfigOption<?>> createConfigOptions() { Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); StringConfigOption type = new StringConfigOption("reasonerType", "FaCT++, HermiT, OWLlink or Pellet, which means \"fact\", \"hermit\", \"owllink\" or \"pellet\"", "pellet", false, true); - type.setAllowedValues(new String[] {"fact", "hermit", "owllink", "pellet" }); + type.setAllowedValues(new String[] {"fact", "hermit", "owllink", "pellet", "fuzzydl" }); // closure option? see: // http://owlapi.svn.sourceforge.net/viewvc/owlapi/owl1_1/trunk/tutorial/src/main/java/uk/ac/manchester/owl/tutorial/examples/ClosureAxiomsExample.java?view=markup @@ -339,14 +339,18 @@ } else if(configurator.getReasonerType().equals("hermit")){ // instantiate HermiT reasoner reasoner = new ReasonerFactory().createNonBufferingReasoner(ontology, conf); - } else if(configurator.getReasonerType().equals("pellet")){ - // instantiate Pellet reasoner - reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology, conf); + } else if(configurator.getReasonerType().equals("pellet")){ - // 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); + } else if(configurator.getReasonerType().equals("fuzzydl")){ + // added by Josue + // create actual fuzzy reasoner and computes initial fuzzy memberships + // ontology and conf are passed so FuzzyDLReasonerManager can instanciate also a Pellet reasoner + try { + reasoner = new FuzzyDLReasonerManager(((OWLFile)sources.iterator().next()).getURL().toString(), ontology, conf); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } else { try { OWLlinkHTTPXMLReasonerFactory factory = new OWLlinkHTTPXMLReasonerFactory(); @@ -374,14 +378,7 @@ // System.out.println(properties); // System.out.println(individuals); - // added by Josue - // create actual fuzzy reasoner and computes initial fuzzy memberships - try { - fuzzyReasoner = new FuzzyDLReasonerManager(((OWLFile)sources.iterator().next()).getURL().toString()); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + // compute class hierarchy and types of individuals // (done here to speed up later reasoner calls) @@ -621,11 +618,8 @@ OWLClassExpression d = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept); OWLIndividual i = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - boolean crispReasonerOutput = reasoner.isEntailed(factory.getOWLClassAssertionAxiom(d, i)); - - // System.out.println("ccccc->: " + crispReasonerOutput); - - return crispReasonerOutput; + boolean crispReasonerOutput = reasoner.isEntailed(factory.getOWLClassAssertionAxiom(d, i)); + return crispReasonerOutput; } @Override @@ -1137,7 +1131,7 @@ OWLClassExpression desc = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(description); OWLIndividual ind = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - double fuzzyReasonerOutput = fuzzyReasoner.getFuzzyMembership(desc, ind, individual.getTruthDegree()); + double fuzzyReasonerOutput = ((FuzzyDLReasonerManager) reasoner).getFuzzyMembership(desc, ind, individual.getTruthDegree()); // System.out.println("- d: " + d); // System.out.println("- i: " + i); Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-19 10:36:18 UTC (rev 2813) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-05-19 16:05:12 UTC (rev 2814) @@ -80,13 +80,14 @@ ComponentManager cm = ComponentManager.getInstance(); OWLFile ks = cm.knowledgeSource(OWLFile.class); - ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/fuzzyTrains_v1.3.owl")); + ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/fuzzyTrains_v1.4.owl")); ks.init(); // ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); - ReasonerComponent rc = cm.reasoner(FuzzyOWLAPIReasoner.class, ks); + FuzzyOWLAPIReasoner rc = cm.reasoner(FuzzyOWLAPIReasoner.class, ks); + rc.getConfigurator().setReasonerType("fuzzydl"); rc.init(); -// System.out.println(rc.getClassHierarchy()); + System.out.println(rc.getClassHierarchy()); FuzzyPosNegLPStandard lp = cm.learningProblem(FuzzyPosNegLPStandard.class, rc); //PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-05-19 10:36:18 UTC (rev 2813) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-05-19 16:05:12 UTC (rev 2814) @@ -91,7 +91,7 @@ ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); //ReasonerComponent rc = cm.reasoner(FuzzyOWLAPIReasoner.class, ks); rc.init(); -// System.out.println(rc.getClassHierarchy()); + System.out.println(rc.getClassHierarchy()); //FuzzyPosNegLPStandard lp = cm.learningProblem(FuzzyPosNegLPStandard.class, rc); PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); Added: trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl =================================================================== --- trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl (rev 0) +++ trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl 2011-05-19 16:05:12 UTC (rev 2814) @@ -0,0 +1,641 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > + <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > +]> + + +<rdf:RDF xmlns="http://www.example.com/fuzzyTrains.owl#" + xml:base="http://www.example.com/fuzzyTrains.owl" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <owl:Ontology rdf:about="http://www.example.com/fuzzyTrains.owl"> + <rdfs:comment xml:lang="en">Fuzzy adaptation of Michalsky's trains problem [1] +Original idea from [2] + +Developed by Josue Iglesias (josue at grpss.ssr.upm.es) + +[1] http://www.mli.gmu.edu/papers/79-80/80-05.pdf +[2] http://users.iit.demokritos.gr/~konstant/dload/Pubs/fuzz10.pdf</rdfs:comment> + <rdfs:comment xml:lang="en">v1.0: Cars can be (fuzzy) classified as being short, medium or long depending on their length (double)</rdfs:comment> + <rdfs:comment xml:lang="en">v1.1: Car's load can be more or less similar to a triangle and/or a rectangle</rdfs:comment> + <rdfs:comment xml:lang="en">v1.2: Change properties (Train) hasFirstCar (Car) + (Car) isInFrontOf (Car) for just (Train) hasCar (Car) in order to make the example easier</rdfs:comment> + <rdfs:comment xml:lang="en">v1.3: +Some concepts of v1.1 and v1.2 are merged: +- (Train) hasCar (Train) +- (Train) or (Car) isInFrontOf (Car)</rdfs:comment> + <rdfs:comment xml:lang="en">v1.4: Instead of defining fuzzy data types as (double[>= 5.0] and double[<= 15.0]), this is change to + +- fuzzyShortCar (double[>= 5.0] and double[<= 15.0]) +- fuzzyMediumLengthCar (double[>= 15.0] and double[<= 40.0]) +- fuzzyLongCar (double[>= 40.0] and double[<= 50.0]) + +in order crisp reasoners not to infer that ShortCar, MediumLengthCar and LongCar to be equivalent clases</rdfs:comment> + </owl:Ontology> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Annotation properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + <owl:AnnotationProperty rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLabel"/> + <owl:AnnotationProperty rdf:about="&rdfs;comment"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Datatypes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#fuzzyLongCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">40.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> +<Datatype type="rightshoulder" a="40" b="40" /> +</fuzzyOwl2></fuzzyLabel> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">15.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">40.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> +<Datatype type="trapezoidal" a="15" b="15" c="40" d="40" /> +</fuzzyOwl2></fuzzyLabel> + </rdfs:Datatype> + + + + <!-- http://www.example.com/fuzzyTrains.owl#fuzzyShortCar --> + + <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"> + <owl:equivalentClass> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">15.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </owl:equivalentClass> + <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> +<Datatype type="leftshoulder" a="15" b="15" /> +</fuzzyOwl2></fuzzyLabel> + </rdfs:Datatype> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCar --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCar"> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasLoad --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasLoad"> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:ObjectProperty> + + + + <!-- http://www.example.com/fuzzyTrains.owl#isInFrontOf --> + + <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#isInFrontOf"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:domain> + <owl:Class> + <owl:unionOf rdf:parseType="Collection"> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:unionOf> + </owl:Class> + </rdfs:domain> + </owl:ObjectProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Data properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#hasCarLength --> + + <owl:DatatypeProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCarLength"> + <rdf:type rdf:resource="&owl;FunctionalProperty"/> + <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <rdfs:range> + <rdfs:Datatype> + <owl:intersectionOf rdf:parseType="Collection"> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + <rdfs:Datatype> + <owl:onDatatype rdf:resource="&xsd;double"/> + <owl:withRestrictions rdf:parseType="Collection"> + <rdf:Description> + <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + </rdf:Description> + </owl:withRestrictions> + </rdfs:Datatype> + </owl:intersectionOf> + </rdfs:Datatype> + </rdfs:range> + </owl:DatatypeProperty> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#Car --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Car"> + <rdfs:subClassOf rdf:resource="&owl;Thing"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Load --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Load"> + <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#LongCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#MediumLenghtCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Rectangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Rectangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#ShortCar --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"> + <owl:equivalentClass> + <owl:Restriction> + <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> + <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"/> + </owl:Restriction> + </owl:equivalentClass> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + </owl:Class> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Train --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> + + + + <!-- http://www.example.com/fuzzyTrains.owl#Triangle --> + + <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Triangle"> + <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> + </owl:Class> + + + + <!-- http://www.w3.org/2002/07/owl#Thing --> + + <owl:Class rdf:about="&owl;Thing"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://www.example.com/fuzzyTrains.owl#car11 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car11"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">49</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car12 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car12"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car13 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car13"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">13</hasCarLength> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car21 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car21"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">47</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load21a"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car22 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car22"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">7</hasCarLength> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car61 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car61"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">45</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car62 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car62"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">8</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car63 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car63"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car71 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car71"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">7</hasCarLength> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71b"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#car72 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car72"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> + <hasCarLength rdf:datatype="&xsd;double">6</hasCarLength> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72a"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72b"/> + <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72c"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east1 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east1"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#east2 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east2"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load11c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load12a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load12a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load21a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load21b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load62a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load62b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load63b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load71b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72a --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72a"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72b --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72b"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#load72c --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72c"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west6 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west6"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> + </owl:NamedIndividual> + + + + <!-- http://www.example.com/fuzzyTrains.owl#west7 --> + + <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west7"> + <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> + <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> + </owl:NamedIndividual> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 3.1.0.20069) http://owlapi.sourceforge.net --> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ji...@us...> - 2011-06-03 14:57:25
|
Revision: 2848 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2848&view=rev Author: jialva Date: 2011-06-03 14:57:18 +0000 (Fri, 03 Jun 2011) Log Message: ----------- New update of fuzzyDL-Learner Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-06-03 10:24:46 UTC (rev 2847) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-06-03 14:57:18 UTC (rev 2848) @@ -533,7 +533,7 @@ for (FuzzyIndividual fuzzyExample : fuzzyExamples) { descriptionMembership += reasoner.hasTypeFuzzyMembership(description, fuzzyExample); // individualCounter--; - if (individualCounter != 0) individualCounter--; + if (individualCounter >= 1) individualCounter -= fuzzyExample.getTruthDegree(); // before it was individual--; // before // if ((descriptionMembership + individualCounter) / fuzzyExamples.size() < noise) // return -1; Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-06-03 10:24:46 UTC (rev 2847) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-06-03 14:57:18 UTC (rev 2848) @@ -7,17 +7,22 @@ import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; +import java.util.Collection; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Scanner; import java.util.Set; +import java.util.TreeSet; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.semanticweb.owlapi.model.AxiomType; +import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLClass; import org.semanticweb.owlapi.model.OWLClassExpression; +import org.semanticweb.owlapi.model.OWLDataFactory; import org.semanticweb.owlapi.model.OWLDataProperty; import org.semanticweb.owlapi.model.OWLDataPropertyExpression; import org.semanticweb.owlapi.model.OWLEntity; @@ -42,9 +47,17 @@ import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; import org.semanticweb.owlapi.reasoner.TimeOutException; import org.semanticweb.owlapi.reasoner.UnsupportedEntailmentTypeException; +import org.semanticweb.owlapi.reasoner.impl.DefaultNode; +import org.semanticweb.owlapi.reasoner.impl.NodeFactory; +import org.semanticweb.owlapi.reasoner.impl.OWLClassNode; +import org.semanticweb.owlapi.reasoner.impl.OWLClassNodeSet; +import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNode; +import org.semanticweb.owlapi.reasoner.impl.OWLNamedIndividualNodeSet; import org.semanticweb.owlapi.util.SimpleShortFormProvider; import org.semanticweb.owlapi.util.Version; +import uk.ac.manchester.cs.owl.owlapi.OWLNamedIndividualImpl; + import com.clarkparsia.pellet.owlapiv3.PelletReasoner; import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; @@ -68,10 +81,17 @@ private FuzzyOwl2toFuzzyDL fuzzyFileParser; private int auxCounter = 0; private PelletReasoner crispReasoner; + private OWLDataFactory factory; + private String baseURI; + private NodeSet<OWLClass> newOwlInstances; // private FileOutputStream errorFile; - public FuzzyDLReasonerManager(String ontologyFile, OWLOntology ontology, OWLReasonerConfiguration conf) throws Exception { + public FuzzyDLReasonerManager(String ontologyFile, OWLOntology ontology, OWLReasonerConfiguration conf, OWLDataFactory factory, String baseURI) throws Exception { + this.factory = factory; + + this.baseURI = baseURI; + startPellet(ontology, conf); queryResult = null; @@ -308,7 +328,52 @@ ClassExpressionNotInProfileException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { - return crispReasoner.getInstances(arg0, arg1); + // commented by Josue in order to use fuzzyDL and not Pellet to answer this OWLAPI method + // return crispReasoner.getInstances(arg0, arg1); + + // added by Josue in order to use fuzzyDL and not Pellet to answer this OWLAPI method + boolean differentInstances = false; + Solution localQuerySolution = null; + NodeSet<OWLNamedIndividual> owlApiOutput = crispReasoner.getInstances(arg0, arg1); + Set<OWLNamedIndividual> owlApiInstances = owlApiOutput.getFlattened(); + for (Individual fuzzyIndividual : fuzzyKB.individuals.values()) { + // TODO this "query process" is repeated several times --> create a (private) method + Query localQuery = new MinInstanceQuery(OWLAPI_fuzzyDLObjectParser.getFuzzyDLExpresion(arg0), fuzzyIndividual); + try { + KnowledgeBase clonedFuzzyKB = fuzzyKB.clone(); + localQuerySolution = localQuery.solve(clonedFuzzyKB); + if (!localQuerySolution.isConsistentKB()){ + System.err.println("Fuzzy KB is inconsistent."); + System.err.println("This may be a fuzzyDL reasoner bug. Press enter to continue."); + System.err.println("concept: " + arg0 + " individual: " + fuzzyIndividual); + Scanner sc = new Scanner(System.in); + sc.nextLine(); + } + } catch (Exception e) { + e.printStackTrace(); + } + if (localQuerySolution.getSolution() == 0) { + for (OWLNamedIndividual owlApiSingleInstance : owlApiOutput.getFlattened()) { + String a = baseURI.concat(fuzzyIndividual.toString()); + String b = owlApiSingleInstance.toStringID(); + if (a.equals(b)) { + owlApiInstances.remove(owlApiSingleInstance); + differentInstances = true; } + } + } + } + + if (differentInstances){ + Set<Node<OWLNamedIndividual>> instances = new HashSet<Node<OWLNamedIndividual>>(); + Iterator<OWLNamedIndividual> fi = owlApiInstances.iterator(); + while (fi.hasNext()) { + DefaultNode<OWLNamedIndividual> e = NodeFactory.getOWLNamedIndividualNode( fi.next() ); + instances.add(e); + } + return new OWLNamedIndividualNodeSet( instances ); + } + else + return owlApiOutput; } @Override @@ -530,8 +595,8 @@ UnsupportedEntailmentTypeException, TimeOutException, AxiomNotInProfileException, FreshEntitiesException, InconsistentOntologyException { - - return crispReasoner.isEntailed(arg0); + + return crispReasoner.isEntailed(arg0); } @Override @@ -541,7 +606,13 @@ AxiomNotInProfileException, FreshEntitiesException, InconsistentOntologyException { - return crispReasoner.isEntailed(arg0); + // commented by Josue + // return crispReasoner.isEntailed(arg0); + + // added by Josue + System.err.println("Method not supported yet"); + System.exit(0); + return false; } @Override Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-06-03 10:24:46 UTC (rev 2847) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-06-03 14:57:18 UTC (rev 2848) @@ -33,6 +33,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Scanner; import java.util.Map.Entry; import java.util.Set; import java.util.SortedSet; @@ -346,7 +347,7 @@ // create actual fuzzy reasoner and computes initial fuzzy memberships // ontology and conf are passed so FuzzyDLReasonerManager can instanciate also a Pellet reasoner try { - reasoner = new FuzzyDLReasonerManager(((OWLFile)sources.iterator().next()).getURL().toString(), ontology, conf); + reasoner = new FuzzyDLReasonerManager(((OWLFile)sources.iterator().next()).getURL().toString(), ontology, conf, factory, baseURI); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -618,8 +619,14 @@ OWLClassExpression d = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept); OWLIndividual i = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - boolean crispReasonerOutput = reasoner.isEntailed(factory.getOWLClassAssertionAxiom(d, i)); - return crispReasonerOutput; + // commented by Josue to make be fuzzyDL and not Pellet to answer this method + // boolean crispReasonerOutput = reasoner.isEntailed(factory.getOWLClassAssertionAxiom(d, i)); + // return crispReasonerOutput; + + // added by Josue to make be fuzzyDL and not Pellet to answer this method + double fuzzyReasonerOutput = ((FuzzyDLReasonerManager) reasoner).getFuzzyMembership(d, i, 1); + + return fuzzyReasonerOutput == 0 ? false : true; } @Override Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-06-03 10:24:46 UTC (rev 2847) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_noFuzzyTrains.java 2011-06-03 14:57:18 UTC (rev 2848) @@ -47,11 +47,11 @@ */ public class FuzzyDLLTest_noFuzzyTrains { - String[] posEx = { + String[] negEx = { "http://www.example.com/fuzzyTrains.owl#east1", "http://www.example.com/fuzzyTrains.owl#east2" }; - String[] negEx = { + String[] posEx = { "http://www.example.com/fuzzyTrains.owl#west6", "http://www.example.com/fuzzyTrains.owl#west7" }; Modified: trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl =================================================================== --- trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl 2011-06-03 10:24:46 UTC (rev 2847) +++ trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl 2011-06-03 14:57:18 UTC (rev 2848) @@ -30,13 +30,19 @@ Some concepts of v1.1 and v1.2 are merged: - (Train) hasCar (Train) - (Train) or (Car) isInFrontOf (Car)</rdfs:comment> - <rdfs:comment xml:lang="en">v1.4: Instead of defining fuzzy data types as (double[>= 5.0] and double[<= 15.0]), this is change to + <rdfs:comment xml:lang="en">v1.4: Instead of defining fuzzy data types as (double[>= 5.0] and double[<= 50.0]), this is change to -- fuzzyShortCar (double[>= 5.0] and double[<= 15.0]) -- fuzzyMediumLengthCar (double[>= 15.0] and double[<= 40.0]) -- fuzzyLongCar (double[>= 40.0] and double[<= 50.0]) +- fuzzyShortCar (double[>= 5.0] and double[<= 150.0]) +- fuzzyMediumLengthCar (double[>= -100.0] and double[<= 100.0]) +- fuzzyLongCar (double[>= -150.0] and double[<= 50.0]) -in order crisp reasoners not to infer that ShortCar, MediumLengthCar and LongCar to be equivalent clases</rdfs:comment> +Now, hasLength range has changed to + +(double[>= -1000.0] and double[<= 1000.0]) + +This is done in order crisp reasoners not to infer that ShortCar, MediumLengthCar and LongCar to be equivalent clases. + +Note that although for a crip reasoner, e.g., fuzzyShortCar range from 5 to 150, for a fuzzy reasoner it would range from 5 to 50 (as it also applies the fuzzy annotations attched to fuzzyShortCar).</rdfs:comment> </owl:Ontology> @@ -75,7 +81,7 @@ <owl:onDatatype rdf:resource="&xsd;double"/> <owl:withRestrictions rdf:parseType="Collection"> <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">40.0</xsd:minInclusive> + <xsd:minInclusive rdf:datatype="&xsd;double">-150.0</xsd:minInclusive> </rdf:Description> </owl:withRestrictions> </rdfs:Datatype> @@ -107,7 +113,7 @@ <owl:onDatatype rdf:resource="&xsd;double"/> <owl:withRestrictions rdf:parseType="Collection"> <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">15.0</xsd:minInclusive> + <xsd:minInclusive rdf:datatype="&xsd;double">-100.0</xsd:minInclusive> </rdf:Description> </owl:withRestrictions> </rdfs:Datatype> @@ -115,7 +121,7 @@ <owl:onDatatype rdf:resource="&xsd;double"/> <owl:withRestrictions rdf:parseType="Collection"> <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">40.0</xsd:maxInclusive> + <xsd:maxInclusive rdf:datatype="&xsd;double">100.0</xsd:maxInclusive> </rdf:Description> </owl:withRestrictions> </rdfs:Datatype> @@ -147,7 +153,7 @@ <owl:onDatatype rdf:resource="&xsd;double"/> <owl:withRestrictions rdf:parseType="Collection"> <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">15.0</xsd:maxInclusive> + <xsd:maxInclusive rdf:datatype="&xsd;double">150.0</xsd:maxInclusive> </rdf:Description> </owl:withRestrictions> </rdfs:Datatype> @@ -230,7 +236,7 @@ <owl:onDatatype rdf:resource="&xsd;double"/> <owl:withRestrictions rdf:parseType="Collection"> <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> + <xsd:minInclusive rdf:datatype="&xsd;double">-1000.0</xsd:minInclusive> </rdf:Description> </owl:withRestrictions> </rdfs:Datatype> @@ -238,7 +244,7 @@ <owl:onDatatype rdf:resource="&xsd;double"/> <owl:withRestrictions rdf:parseType="Collection"> <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> + <xsd:maxInclusive rdf:datatype="&xsd;double">1000.0</xsd:maxInclusive> </rdf:Description> </owl:withRestrictions> </rdfs:Datatype> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2011-06-15 11:00:31
|
Revision: 2878 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2878&view=rev Author: kurzum Date: 2011-06-15 11:00:22 +0000 (Wed, 15 Jun 2011) Log Message: ----------- new NKE server for geizhals Modified Paths: -------------- trunk/interfaces/pom.xml trunk/interfaces/src/main/webapp/WEB-INF/web.xml trunk/pom.xml Added Paths: ----------- trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java trunk/interfaces/src/main/java/org/dllearner/server/nke/ trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java trunk/interfaces/src/main/resources/ trunk/interfaces/src/main/resources/nke/ trunk/interfaces/src/main/resources/nke/geizhals.owl trunk/interfaces/src/main/resources/nke/material.raw trunk/interfaces/src/test/java/org/dllearner/test/junit/Geizhals.java Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2011-06-15 08:50:57 UTC (rev 2877) +++ trunk/interfaces/pom.xml 2011-06-15 11:00:22 UTC (rev 2878) @@ -104,6 +104,13 @@ <dependency> <groupId>org.dllearner</groupId> <artifactId>components-core</artifactId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <!-- Exclude Project-D from Project-B --> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> </dependency> <!--Added the dependency of the core tests so that they will be accessible @@ -119,6 +126,8 @@ <groupId>org.dllearner</groupId> <artifactId>components-ext</artifactId> </dependency> + + <dependency> <groupId>com.jamonapi</groupId> <artifactId>jamon</artifactId> @@ -143,6 +152,23 @@ <artifactId>jstl</artifactId> </dependency> + + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>model</artifactId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <!-- Exclude Project-D from Project-B --> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + </dependency> + </dependencies> Copied: trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java (from rev 2862, trunk/interfaces/src/main/java/org/dllearner/server/Rest.java) =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java (rev 0) +++ trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java 2011-06-15 11:00:22 UTC (rev 2878) @@ -0,0 +1,158 @@ +package org.dllearner.server; + +import com.jamonapi.Monitor; +import com.jamonapi.MonitorFactory; +import org.json.simple.JSONObject; +import org.json.simple.JSONValue; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.net.URLEncoder; +import java.security.InvalidParameterException; + + +public class NKEGeizhals extends HttpServlet { + private static Logger log = LoggerFactory.getLogger(NKEGeizhals.class); + + @Override + protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { + handle(httpServletRequest, httpServletResponse); + } + + @Override + protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { + handle(httpServletRequest, httpServletResponse); + } + + + /** + * * + * + * @param httpServletRequest + * @param httpServletResponse + * @throws javax.servlet.ServletException + * @throws java.io.IOException + */ + private void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { + Monitor mon = MonitorFactory.getTimeMonitor("NIFParameters.getInstance").start(); + String result = ""; + try { + + String action = ""; + if (isSet(httpServletRequest, "action")) { + action = httpServletRequest.getParameter("action"); + //use the function one of + if (!oneOf(action, "learn", "xml")) { + throw new InvalidParameterException("Wrong parameter value for \"action\", must be one of ( learn, xml ) " + getDocumentation(httpServletRequest.getRequestURL().toString())); + } + } else { + throw new InvalidParameterException("No parameter 'conf' found. " + getDocumentation(httpServletRequest.getRequestURL().toString())); + } + + if (action.equals("learn")) { + String json = ""; + if (isSet(httpServletRequest, "data")) { + json = httpServletRequest.getParameter("data"); + + //Object obj=JSONValue.parse(s); + // JSONArray array=(JSONArray)obj; + + /*Iterator i = obj.entrySet().iterator(); + while (i.hasNext()) { + Map.Entry e = (Map.Entry)i.next(); + System.out.println("Key: " + e.getKey()); + System.out.println("Value: " + e.getValue()); + } */ + + } else { + throw new InvalidParameterException("No parameter 'data' found. " + getDocumentation(httpServletRequest.getRequestURL().toString())); + } + } + + //check parameters + /*String conf = ""; + if (isSet(httpServletRequest, "conf")) { + conf = httpServletRequest.getParameter("conf"); + } else { + throw new InvalidParameterException("No parameter 'conf' found. " + getDocumentation(httpServletRequest.getRequestURL().toString())); + }*/ + + PrintWriter pw = httpServletResponse.getWriter(); + log.debug("Request handled: " + logMonitor(mon.stop())); + pw.print(result); + pw.close(); + + } catch (IllegalArgumentException e) { + String msg = e.getMessage() + printParameterMap(httpServletRequest); + log.error(msg); + httpServletResponse.setContentType("text/plain"); + PrintWriter out = httpServletResponse.getWriter(); + out.println(msg); + out.close(); + + } catch (Exception e) { + String msg = "An error occured: " + e.getMessage() + printParameterMap(httpServletRequest); + log.error(msg, e); + httpServletResponse.setContentType("text/plain"); + PrintWriter out = httpServletResponse.getWriter(); + out.println(msg); + out.close(); + + } + + } + + /** + * Examples are from NIF + * + * @param serviceUrl + * @return + */ + public static String getDocumentation(String serviceUrl) { + String doc = ""; + try { + doc = "\nExample1: \n " + serviceUrl + "?input=" + URLEncoder.encode("That's a lot of nuts! That'll be four bucks, baby! You want fries with that? ", "UTF-8") + "&type=text"; + doc += "\nExample2: \n " + serviceUrl + "?input=" + URLEncoder.encode("That's a lot of nuts! That's a lot of nuts! ", "UTF-8") + "&type=text"; + } catch (Exception e) { + log.error("", e); + } + return doc; + } + + public static boolean isSet(HttpServletRequest httpServletRequest, String name) { + log.trace("isSet(" + name + ")"); + log.trace(httpServletRequest.getParameterValues(name) + ""); + return httpServletRequest.getParameterValues(name) != null && httpServletRequest.getParameterValues(name).length == 1 && httpServletRequest.getParameter(name).length() > 0; + } + + public static boolean oneOf(String value, String... possibleValues) { + for (String s : possibleValues) { + if (s.equals(value)) { + return true; + } + } + return false; + } + + protected static String logMonitor(Monitor m) { + return "needed: " + m.getLastValue() + " ms. (" + m.getTotal() + " total)"; + } + + public static String printParameterMap(HttpServletRequest httpServletRequest) { + StringBuffer buf = new StringBuffer(); + for (Object key : httpServletRequest.getParameterMap().keySet()) { + buf.append("\nParameter: " + key + " Values: "); + for (String s : httpServletRequest.getParameterValues((String) key)) { + buf.append(((s.length() > 200) ? s.substring(0, 200) + "..." : s) + " "); + } + } + return buf.toString(); + } + +} Added: trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java (rev 0) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-15 11:00:22 UTC (rev 2878) @@ -0,0 +1,181 @@ +package org.dllearner.server.nke; + + +import com.hp.hpl.jena.ontology.OntModel; +import com.hp.hpl.jena.ontology.OntModelSpec; +import com.hp.hpl.jena.rdf.model.Model; +import com.hp.hpl.jena.rdf.model.ModelFactory; +import org.aksw.commons.jena.ClassIndexer; +import org.apache.log4j.Logger; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.JSONValue; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Sebastian Hellmann - http://bis.informatik.uni-leipzig.de/SebastianHellmann + * Created: 15.06.11 + */ +public class Geizhals2OWL { + private static Logger log = Logger.getLogger(Geizhals2OWL.class); + public static ClassIndexer index = new ClassIndexer(); + public static Geizhals2OWL geizhals2OWL = new Geizhals2OWL(); + + public static Map<String, String> ramMap = new HashMap<String, String>(); + public static Map<String, String> hdMap = new HashMap<String, String>(); + public static Map<String, String> discMap = new HashMap<String, String>(); + public static String prefix = "http://nke.aksw.org/_"; + + static { + + OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); + model.read(Geizhals2OWL.class.getClassLoader().getResourceAsStream("nke/geizhals.owl"), ""); + index.index(model); + + ramMap.put("512MB", "12_512"); + ramMap.put("1024MB", "12_1024"); + ramMap.put("2048MB", "12_2048"); + ramMap.put("3072MB", "12_3072"); + ramMap.put("4096MB", "12_4096"); + ramMap.put("6144MB", "12_6144"); + ramMap.put("8192MB", "12_8192"); + ramMap.put("unbekannt", "12_unbekannt"); + + hdMap.put("32GB", "11_32"); + hdMap.put("80GB", "11_80"); + hdMap.put("120GB", "11_120"); + hdMap.put("128GB", "11_128"); + hdMap.put("160GB", "11_160"); + hdMap.put("250GB", "11_250"); + hdMap.put("256GB", "11_256"); + hdMap.put("320GB", "11_320"); + hdMap.put("500GB", "11_500"); + hdMap.put("640GB", "11_640"); + hdMap.put("1000GB", "11_1000"); + hdMap.put("sonstige", "11_sonstige"); + hdMap.put("unbekannt", "11_unbekannt"); + + discMap.put("kein optisches Laufwerk", "84_ohne"); + discMap.put("DVD/CD-RW Combo", "84_DVD%2FCD-RW+Combo"); + discMap.put("DVD+/-RW DL", "84_DVD%2B%2F-RW"); + discMap.put("DVD+/-RW", "84_DVD%2B%2F-RW"); + discMap.put("Blu-ray (BD-ROM) und DVD+/-RW DL", "84_Blu-ray+(BD-ROM)"); + + //$subs[] = array("84_Blu-ray+(BD-R%2FRE)","84_Blu-ray+(BD-R%2FRE%2FRW)","84_Blu-ray+(BD-ROM)","84_DVD%2B%2F-RW","84_DVD-ROM","84_DVD%2FCD-RW+Combo","84_ohne","84_unbekannt",""); + } + + + public static Geizhals2OWL getInstance() { + return geizhals2OWL; + } + + public List<String> convertFeatureString2Classes(String productdesc) { + List<String> classes = new ArrayList<String>(); + String[] features = productdesc.split(" • "); + String cpu = features[0].trim(); + + String ram = features[1].trim(); + ram = ram.substring(0, ram.indexOf("MB") + 2); + add(classes, ramMap, ram); + + try { + String hd = features[2].trim(); + if (hd.contains("Flash")) { + classes.add("82_Flash"); + } else if (hd.contains("SSD")) { + classes.add("82_SSD"); + } else { + classes.add("82_HDD"); + } + hd = hd.substring(0, hd.indexOf("GB") + 2); + add(classes, hdMap, hd); + } catch (Exception e) { + log.warn("Handling hd failed: " + features[2].trim()); + } + String disc = features[3].trim(); + add(classes, discMap, disc); + + //4 =Intel GMA X4500HD (IGP) max.384MB shared memory + //5 =3x USB 2.0/FireWire/Modem/Gb LAN/WLAN 802.11agn/Bluetooth + + int x = 6; + while (!features[x].contains("\"")) { + x++; + } + + //String next = features[x]; + //System.out.println(next); + //String next1 = features[x+1]; + //System.out.println(next1); + + return classes; + } + + + public static void add(List<String> classes, Map<String, String> map, String key) { + String val = null; + if ((val = map.get(key)) == null) { + log.warn("No value found for: " + key); + return; + } else { + //log.info("Adding " + val); + classes.add(prefix + val); + } + + } + + public class Result { + public List<String> pos = new ArrayList<String>(); + public List<String> neg = new ArrayList<String>(); + private OntModel model; + + public Result(OntModel model) { + this.model = model; + } + + } + + + public void handleJson(String json) { + + OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); + Result r = new Result(model); + + JSONObject j = (JSONObject) JSONValue.parse(json); + JSONArray pos = (JSONArray) j.get("pos"); + JSONArray neg = (JSONArray) j.get("neg"); + + System.out.println(j); + + + fill(pos, r.pos, model); + fill(neg, r.neg, model); + + } + + private void fill(JSONArray arr, List<String> l, OntModel model){ + for (Object o : arr) { + JSONArray one = (JSONArray) o; + String uri = one.get(0).toString(); + String title = one.get(1).toString(); + String featureText = one.get(2).toString(); + + l.add(uri); + + List<String> classes = convertFeatureString2Classes(featureText); + for (String c : classes) { + model.createIndividual(uri, model.createClass(c)); + Model m = index.getHierarchyForClassURI(c); + if (m == null) { + log.warn("recieved null for " + c); + } + model.add(m); + } + } + } + +} Added: trunk/interfaces/src/main/resources/nke/geizhals.owl =================================================================== --- trunk/interfaces/src/main/resources/nke/geizhals.owl (rev 0) +++ trunk/interfaces/src/main/resources/nke/geizhals.owl 2011-06-15 11:00:22 UTC (rev 2878) @@ -0,0 +1,1965 @@ +<?xml version="1.0" encoding="utf-8"?> +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <rdf:Description rdf:about="http://nke.aksw.org/_525_ASUS"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_ASUS"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ASUS</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Acer"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Acer"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Acer</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Apple"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Apple"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Apple</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Belinea"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Belinea"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Belinea</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Dell"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Dell"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Dell</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Fujitsu"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Fujitsu"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Fujitsu</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_HP+Compaq"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_HP+Compaq"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">HP Compaq</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Lenovo+IBM"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Lenovo+IBM"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Lenovo IBM</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_MSI"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_MSI"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">MSI</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Panasonic"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Panasonic"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Panasonic</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Samsung"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Samsung"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Samsung</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Sonstige"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Sonstige"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Sonstige</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Sony"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Sony"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Sony</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Toshiba"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_525_Toshiba"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Toshiba</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">12.5&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.1"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.1"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13.1&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.3"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.3"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13.3&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.4"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.4"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13.4&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">14&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14.1"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14.1"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">14.1&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14.5"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14.5"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">14.5&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.4"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.4"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15.4&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.5"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.5"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15.5&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15.6&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_16"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_16"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_16.4"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_16.4"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16.4&quot;</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_4%3A3"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_4%3A3"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">4:3</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A10"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A10"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16:10</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A9"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A9"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16:9</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1200_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1024x768"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1024x768"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1024x768</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1280x800"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1280x800"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1280x800</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1366x768"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1366x768"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1366x768</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1440x900"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1440x900"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1440x900</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1600x900"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1600x900"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1600x900</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x945"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x945"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1680x945</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x1050"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x1050"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1680x1050</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1080"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1080"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1920x1080</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1200"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1200"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1920x1200</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_9_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.180"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.180"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.180mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.190"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.190"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.190mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.200"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.200"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.200mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.210"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.210"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.210mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.220"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.220"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.220mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.230"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.230"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.230mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.240"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.240"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.240mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.260"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.260"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.260mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.280"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.280"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.280mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_sonstige"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_sonstige"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">&uuml;ber 0.280mm</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1581_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+gl%E4nzend+(glare)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+gl%E4nzend+(glare)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">LCD gl&auml;nzend (glare)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+matt+(non-glare)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+matt+(non-glare)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">LCD matt (non-glare)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_83_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_83_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1482_AMD"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1482_AMD"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1482_Intel"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1482_Intel"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Intel</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1482_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_1482_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_1"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_1"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Single-Core</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_2"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_2"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Dual-Core</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_3"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_3"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Triple-Core</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_4"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_4"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Quad-Core</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_27_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_1000"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_1000"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 1GHz</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_1500"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_1500"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 1.5GHz</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_2000"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_2000"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 2GHz</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_2500"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_2500"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 2.5GHz</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_3000"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_3000"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 3GHz</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_28_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+A6-"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+A6-"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD A6-</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+C-"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+C-"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD C-</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+E-"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+E-"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD E-</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+V"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+V"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD V</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+64"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+64"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Athlon 64</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+II"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+II"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Athlon II</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+X2"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+X2"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Athlon X2</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Celeron</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron+Dual-Core"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron+Dual-Core"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Celeron Dual-Core</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+2+Duo"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+2+Duo"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core 2 Duo</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core i3</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3-2"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3-2"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core i3-2</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core i5</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5-2"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5-2"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core i5-2</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core i7</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7-2"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7-2"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core i7-2</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+Dual-Core"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+Dual-Core"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Pentium Dual-Core</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+P"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+P"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Pentium P</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+SU"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+SU"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Pentium SU</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+U"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+U"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Pentium U</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium-M"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium-M"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Pentium-M</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Phenom+II"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Phenom+II"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Phenom II</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Sempron"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Sempron"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Sempron</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+64"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+64"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Turion 64</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+II"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+II"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Turion II</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+X2"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+X2"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Turion X2</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_512"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_512"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 512MB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_1024"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_1024"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 1GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_2048"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_2048"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 2GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_3072"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_3072"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 3GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_4096"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_4096"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 4GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_6144"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_6144"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 6GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_8192"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_8192"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 8GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_12_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_1"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_1"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1x</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_2"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_2"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">2x</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_4"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_4"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">4x</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_905_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_sonstige"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_sonstige"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unter 8GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_32"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_32"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 32GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_80"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_80"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 80GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_120"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_120"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 120GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_250"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_250"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 250GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_320"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_320"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 320GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_500"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_500"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 500GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_1000"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_1000"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 1000GB</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_11_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_82_Flash"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_82_Flash"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Flash</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_82_HDD"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_82_HDD"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">HDD</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_82_SSD"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_82_SSD"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">SSD</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_Blu-ray+(BD-R%2FRE)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_Blu-ray+(BD-R%2FRE)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Blu-ray (BD-R/RE)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_Blu-ray+(BD-R%2FRE%2FRW)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_Blu-ray+(BD-R%2FRE%2FRW)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Blu-ray (BD-R/RE/RW)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_Blu-ray+(BD-ROM)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_Blu-ray+(BD-ROM)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Blu-ray (BD-ROM)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_DVD%2B%2F-RW"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_DVD%2B%2F-RW"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">DVD+/-RW</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_DVD-ROM"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_DVD-ROM"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">DVD-ROM</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_DVD%2FCD-RW+Combo"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_DVD%2FCD-RW+Combo"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">DVD/CD-RW Combo</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_ohne"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_ohne"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ohne</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_unbekannt"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_84_unbekannt"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_AMD+(dediziert)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_AMD+(dediziert)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD (dediziert)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_AMD+(IGP)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_AMD+(IGP)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD (IGP)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_Intel+(IGP)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_Intel+(IGP)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Intel (IGP)</ns0:label> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_NVIDIA+(dediziert)"> + <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_884_NVIDIA+(dediziert)"> + <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">NVIDIA (dediziert)</ns0:label> + </rdf:Description> + <... [truncated message content] |
From: <ku...@us...> - 2011-06-15 16:24:42
|
Revision: 2887 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2887&view=rev Author: kurzum Date: 2011-06-15 16:24:35 +0000 (Wed, 15 Jun 2011) Log Message: ----------- fixed unknown ontology bug Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java trunk/interfaces/src/main/resources/nke/geizhals.owl Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-06-15 15:51:05 UTC (rev 2886) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-06-15 16:24:35 UTC (rev 2887) @@ -253,6 +253,7 @@ if(source instanceof OWLAPIOntology) { ontology = ((OWLAPIOntology)source).getOWLOntolgy(); + manager = ontology.getOWLOntologyManager(); } else if (source instanceof SparqlKnowledgeSource) { ontology = ((SparqlKnowledgeSource)source).getOWLAPIOntology(); manager = ontology.getOWLOntologyManager(); Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-15 15:51:05 UTC (rev 2886) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-15 16:24:35 UTC (rev 2887) @@ -75,18 +75,24 @@ String[] features = productdesc.split(" • "); String cpu = features[0].trim(); + /* + * RAM + * */ String ram = features[1].trim(); ram = ram.substring(0, ram.indexOf("MB") + 2); add(classes, ramMap, ram); + /* + * Hard drive + * */ try { String hd = features[2].trim(); if (hd.contains("Flash")) { - classes.add(prefix+"82_Flash"); + classes.add(prefix + "82_Flash"); } else if (hd.contains("SSD")) { - classes.add(prefix+"82_SSD"); + classes.add(prefix + "82_SSD"); } else { - classes.add(prefix+"82_HDD"); + classes.add(prefix + "82_HDD"); } hd = hd.substring(0, hd.indexOf("GB") + 2); add(classes, hdMap, hd); @@ -99,11 +105,26 @@ //4 =Intel GMA X4500HD (IGP) max.384MB shared memory //5 =3x USB 2.0/FireWire/Modem/Gb LAN/WLAN 802.11agn/Bluetooth + /* + * this is skipping some optional values + * */ int x = 6; while (!features[x].contains("\"")) { x++; } + /* + * DISPLAY + * */ + // 13.3\" WXGA glare LED TFT (1366x768) " + + String[] display = features[x++].split(" "); + classes.add(prefix + "85_"+ display[0].replace("\"","")); + //display[display.length-1]; + + /* + * Operating System + * */ + // Windows 7 Home Premium (64-bit) //String next = features[x]; //System.out.println(next); //String next1 = features[x+1]; @@ -143,6 +164,7 @@ public Result handleJson(String json) { OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); + Result r = new Result(model); JSONObject j = (JSONObject) JSONValue.parse(json); @@ -172,7 +194,7 @@ Model m = index.getHierarchyForClassURI(c); if (m == null) { log.warn("recieved null for " + c); - }else{ + } else { model.add(m); } } Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-15 15:51:05 UTC (rev 2886) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-15 16:24:35 UTC (rev 2887) @@ -2,18 +2,13 @@ import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.rdf.model.RDFWriter; - +import com.hp.hpl.jena.vocabulary.OWL; import org.aksw.commons.jena.Constants; +import org.aksw.commons.jena.ModelUtils; import org.apache.log4j.Logger; import org.dllearner.algorithms.el.ELLearningAlgorithm; -import org.dllearner.core.ComponentInitException; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.*; import org.dllearner.core.owl.Description; -import org.dllearner.kb.KBFile; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; import org.dllearner.learningproblems.PosNegLPStandard; @@ -24,12 +19,7 @@ import org.semanticweb.owlapi.model.OWLOntologyCreationException; import org.semanticweb.owlapi.model.OWLOntologyManager; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; +import java.io.*; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -43,10 +33,12 @@ */ public class Learner { - private static Logger logger = Logger.getLogger(Learner.class); - + private static Logger logger = Logger.getLogger(Learner.class); + public LearningResult learn(Set<String> pos, Set<String> neg, OntModel model, int maxTime) throws IOException, ComponentInitException, LearningProblemUnsupportedException { + model.createIndividual("http://nke.aksw.org/", model.createClass(OWL.Ontology.getURI())); + ModelUtils.write(model, new File("test.owl")); LearningResult lr = new LearningResult(); PipedOutputStream out = new PipedOutputStream(); model.write(out, Constants.RDFXML); @@ -63,15 +55,21 @@ OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology retOnt = null; try { - retOnt = manager.loadOntologyFromOntologyDocument(bs); + //retOnt = manager.createOntology(IRI.create("http://nke.aksw.org/tmp")); + // manager. + // manager.loadOntologyFromOntologyDocument() + retOnt = manager.loadOntologyFromOntologyDocument(bs); } catch (OWLOntologyCreationException e) { - e.printStackTrace(); + e.printStackTrace(); } - + + // System.out.println(retOnt.getAxiomCount()); + // System.exit(0); + KnowledgeSource ks = new OWLAPIOntology(retOnt); // KnowledgeSource ks = cm.knowledgeSource(null); ks.init(); - + // TODO: should the reasoner be initialised at every request or just once (?) // ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, ks); logger.debug("Initialising reasoner"); @@ -90,13 +88,12 @@ logger.debug("Running learning algorithm"); la.start(); EvaluatedDescriptionPosNeg ed = (EvaluatedDescriptionPosNeg) la.getCurrentlyBestEvaluatedDescription(); - + // remove all components to avoid side effects - cm.freeAllComponents(); - - + cm.freeAllComponents(); + System.out.println(ed); - + // TODO: do we really need a learning result class if we have EvaluatedDescription? return lr; Modified: trunk/interfaces/src/main/resources/nke/geizhals.owl =================================================================== --- trunk/interfaces/src/main/resources/nke/geizhals.owl 2011-06-15 15:51:05 UTC (rev 2886) +++ trunk/interfaces/src/main/resources/nke/geizhals.owl 2011-06-15 16:24:35 UTC (rev 2887) @@ -1804,159 +1804,294 @@ <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5~85_-+13.4"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+16.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5~85_-+13.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_14~85_-+14.5"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+16.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14~85_-+14.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_15~85_-+15.5"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+16.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15~85_-+15.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6~85_-+16.4"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+16.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6~85_-+16.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5~85_-+16.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+13.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_13"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+13.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_13.1"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+13.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.1"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_13.3"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+13.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.3"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_13.4"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+13.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_13.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5~85_-+13.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_14"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_14~85_-+14.5"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_14.1"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_14~85_-+14.5"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14.1"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_14.5"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_14~85_-+14.5"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_14.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_14~85_-+14.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_15"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_15~85_-+15.5"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_15.4"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_15~85_-+15.5"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_15.5"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_15~85_-+15.5"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_15~85_-+15.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+16.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_16"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+16.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_16"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_16.4"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_85_12.5~85_-+16.4"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_85_16.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5~85_-+16.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+A6-"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+A6-"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+C-"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+C-"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+E-"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+E-"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+V"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+V"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+64"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+64"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+II"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+II"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+X2"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+X2"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Sempron"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Sempron"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+64"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+64"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+II"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+II"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+X2"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_AMD"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Turion+X2"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_1482_AMD"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_unbekannt"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_unbekannt"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_1482_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron+Dual-Core"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron+Dual-Core"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+2+Duo"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+2+Duo"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3-2"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3-2"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5-2"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i5-2"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7-2"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i7-2"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+Dual-Core"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+Dual-Core"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+P"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+P"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+SU"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+SU"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+U"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium+U"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium-M"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Pentium-M"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_29_Phenom+II"> + <ns0:subClassOf xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://nke.aksw.org/_1482_Intel"/> + </rdf:Description> + <rdf:Description rdf:about="http://nke.aksw.org/_29_Phenom+II"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> <rdf:Description rdf:about="http://nke.aksw.org/_1482_Intel"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-06-15 17:22:15
|
Revision: 2888 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2888&view=rev Author: jenslehmann Date: 2011-06-15 17:22:09 +0000 (Wed, 15 Jun 2011) Log Message: ----------- working EL learning algorithm for Geizhals Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2011-06-15 16:24:35 UTC (rev 2887) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2011-06-15 17:22:09 UTC (rev 2888) @@ -92,7 +92,7 @@ } @Override - public Configurator getConfigurator() { + public ELLearningAlgorithmConfigurator getConfigurator() { return configurator; } @@ -133,6 +133,7 @@ List<ELDescriptionTree> refinements = operator.refine(best.getDescriptionTree()); // add all refinements to search tree, candidates, best descriptions for(ELDescriptionTree refinement : refinements) { +// System.out.println("refinement: " + refinement); addDescriptionTree(refinement, best); } loop++; Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-15 16:24:35 UTC (rev 2887) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-15 17:22:09 UTC (rev 2888) @@ -6,6 +6,7 @@ import org.aksw.commons.jena.Constants; import org.aksw.commons.jena.ModelUtils; import org.apache.log4j.Logger; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.core.*; import org.dllearner.core.owl.Description; @@ -76,19 +77,26 @@ ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); // try OWL API / Pellet, because ontology is not complex rc.init(); +// System.out.println(rc.getClassHierarchy()); + PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); lp.setPositiveExamples(Helper.getIndividualSet(pos)); lp.setNegativeExamples(Helper.getIndividualSet(neg)); - lp.getConfigurator().setAccuracyMethod("fmeasure"); - lp.getConfigurator().setUseApproximations(false); +// lp.getConfigurator().setAccuracyMethod("fmeasure"); +// lp.getConfigurator().setUseApproximations(false); lp.init(); ELLearningAlgorithm la = cm.learningAlgorithm(ELLearningAlgorithm.class, lp, rc); + la.getConfigurator().setInstanceBasedDisjoints(false); +// CELOE la = cm.learningAlgorithm(CELOE.class, lp, rc); la.init(); logger.debug("Running learning algorithm"); la.start(); EvaluatedDescriptionPosNeg ed = (EvaluatedDescriptionPosNeg) la.getCurrentlyBestEvaluatedDescription(); + // use this to get all solutions + // rc.getIndividuals(ed.getDescription()); + // remove all components to avoid side effects cm.freeAllComponents(); Modified: trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java =================================================================== --- trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java 2011-06-15 16:24:35 UTC (rev 2887) +++ trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java 2011-06-15 17:22:09 UTC (rev 2888) @@ -45,7 +45,7 @@ @Test public void learn() throws Exception{ - Logger.getRootLogger().setLevel(Level.DEBUG); +// Logger.getRootLogger().setLevel(Level.TRACE); System.out.println(json); Geizhals2OWL g = Geizhals2OWL.getInstance(); Geizhals2OWL.Result result = g.handleJson(json); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2011-06-15 20:11:51
|
Revision: 2889 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2889&view=rev Author: heeroyuy Date: 2011-06-15 20:11:44 +0000 (Wed, 15 Jun 2011) Log Message: ----------- -added mvn-pkg plugin for the components-core and interfaces POM file Modified Paths: -------------- trunk/components-core/pom.xml trunk/interfaces/pom.xml Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2011-06-15 17:22:09 UTC (rev 2888) +++ trunk/components-core/pom.xml 2011-06-15 20:11:44 UTC (rev 2889) @@ -1,211 +1,251 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + <modelVersion>4.0.0</modelVersion> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - <packaging>jar</packaging> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + <packaging>jar</packaging> - <name>DL Learner Core Components</name> - <url>http://aksw.org/Projects/DLLearner</url> + <name>DL Learner Core Components</name> + <url>http://aksw.org/Projects/DLLearner</url> - <parent> - <groupId>org.dllearner</groupId> - <artifactId>dllearner-parent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.dllearner</groupId> + <artifactId>dllearner-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> - <build> - <plugins> - <!--Surefire - for JUnits--> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <!--Uncomment this when the junits are independent of a runtime directory--> - <!--<includes>--> - <!--<include>org/dllearner/test/junit/*</include>--> - <!--</includes>--> - <excludes> - <exclude>org/dllearner/test/*</exclude> - <exclude>org/dllearner/test/junit/TestOntologies.java</exclude> - <!--This line excludes inner classes--> - <exclude>**/*$*</exclude> - </excludes> - </configuration> - </plugin> - <!--Jar the tests up into a separate jar so other components tests' can leverage them--> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>jdeb</artifactId> - <groupId>org.vafer</groupId> - <version>0.8</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>jdeb</goal> - </goals> - <configuration> - <dataSet> - <data> - <src>${project.build.directory}/${project.build.finalName}.jar</src> - <type>file</type> - <mapper> - <type>perm</type> - <prefix>/usr/share/dllearner</prefix> - </mapper> - </data> - </dataSet> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> + <build> + <plugins> + <!--Surefire - for JUnits--> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <!-- + Uncomment this when the junits are independent of a runtime + directory + --> + <!--<includes>--> + <!--<include>org/dllearner/test/junit/*</include>--> + <!--</includes>--> + <excludes> + <exclude>org/dllearner/test/*</exclude> + <exclude>org/dllearner/test/junit/TestOntologies.java</exclude> + <!--This line excludes inner classes--> + <exclude>**/*$*</exclude> + </excludes> + </configuration> + </plugin> + <!-- + Jar the tests up into a separate jar so other components tests' can + leverage them + --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>de.tarent.maven.plugins</groupId> + <artifactId>maven-pkg-plugin</artifactId> + <version>2.1.0</version> + <configuration> - <dependencies> + <defaultTarget>all</defaultTarget> - <dependency> - <groupId>org.aksw.commons</groupId> - <artifactId>sparql</artifactId> - </dependency> + <defaultDistro>ubuntu_intrepid</defaultDistro> + <shortDescription>This is the libraries that are necessary for + running dl-learner.</shortDescription> - <!-- THIS IS FROM THE UNIBAS REPO--> - <dependency> - <groupId>net.sourceforge.owlapi</groupId> - <artifactId>owlapi</artifactId> - </dependency> + <defaults> + <section>libs</section> + <architecture>all</architecture> + <srcAuxFilesDir>src/main/pkg</srcAuxFilesDir> + <maintainer>Jens Lehmann</maintainer> + <bundleDependencies> + <boolean>true</boolean> + </bundleDependencies> + </defaults> - <!-- THIS IS FROM THE UNIBAS REPO--> - <dependency> - <groupId>com.owldl</groupId> - <artifactId>pellet</artifactId> - <exclusions> - <exclusion> <!-- declare the exclusion here --> - <groupId>org.mortbay.jetty</groupId> - <artifactId>org.mortbay.jetty</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.projectlombok</groupId> - <artifactId>lombok</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - </dependency> + <targetConfigurations> - <!--Available via central, we use the latest with minor mods to DL Learner source (IE Dig related code)--> - <dependency> - <groupId>com.hp.hpl.jena</groupId> - <artifactId>jena</artifactId> - </dependency> + <targetConfiguration> + <target>i386</target> - <!--SwingX is in central--> - <dependency> - <groupId>org.swinglabs</groupId> - <artifactId>swingx</artifactId> - </dependency> + <architecture>i386</architecture> + <srcJNIFilesDir>src/main/native/i386</srcJNIFilesDir> + </targetConfiguration> - <!--JSON is in Central--> - <dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - </dependency> + <targetConfiguration> + <target>armel</target> + <architecture>armel</architecture> + <srcJNIFilesDir>src/main/native/armel</srcJNIFilesDir> - <dependency> - <groupId>net.sf.jopt-simple</groupId> - <artifactId>jopt-simple</artifactId> - </dependency> + </targetConfiguration> + </targetConfigurations> - <!--Lucene is in Central--> - <dependency> - <groupId>org.apache.lucene</groupId> - <artifactId>lucene-core</artifactId> - </dependency> + <distroConfigurations> + <distroConfiguration> - <dependency> - <groupId>org.ini4j</groupId> - <artifactId>ini4j</artifactId> - </dependency> + <distros> + <distro>ubuntu_intrepid</distro> + <distro>ubuntu_karmic</distro> + </distros> + </distroConfiguration> + </distroConfigurations> + </configuration> + </plugin> + </plugins> + </build> - <dependency> - <groupId>xmlbeans</groupId> - <artifactId>xbean</artifactId> - </dependency> + <dependencies> - <dependency> - <groupId>com.google.code.factplusplus</groupId> - <artifactId>factpp-owlapi</artifactId> - </dependency> + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>sparql</artifactId> + </dependency> - <dependency> - <groupId>net.sourceforge.owlapi.owllink</groupId> - <artifactId>owllink</artifactId> - </dependency> + <!-- THIS IS FROM THE UNIBAS REPO--> + <dependency> + <groupId>net.sourceforge.owlapi</groupId> + <artifactId>owlapi</artifactId> + </dependency> - <dependency> - <groupId>org.semanticweb.hermit</groupId> - <artifactId>hermit</artifactId> - </dependency> + <!-- THIS IS FROM THE UNIBAS REPO--> + <dependency> + <groupId>com.owldl</groupId> + <artifactId>pellet</artifactId> + <exclusions> + <exclusion> <!-- declare the exclusion here --> + <groupId>org.mortbay.jetty</groupId> + <artifactId>org.mortbay.jetty</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> - <groupId>com.jamonapi</groupId> - <artifactId>jamon</artifactId> - </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <scope>provided</scope> + </dependency> - <!--JENA ARQ is in central - we use the latest--> - <dependency> - <groupId>com.hp.hpl.jena</groupId> - <artifactId>arq</artifactId> - </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> + <!-- + Available via central, we use the latest with minor mods to DL + Learner source (IE Dig related code) + --> + <dependency> + <groupId>com.hp.hpl.jena</groupId> + <artifactId>jena</artifactId> + </dependency> - <dependency> - <groupId>net.sourceforge.dig</groupId> - <artifactId>dig-xmlbeans</artifactId> - </dependency> + <!--SwingX is in central--> + <dependency> + <groupId>org.swinglabs</groupId> + <artifactId>swingx</artifactId> + </dependency> - <dependency> - <groupId>com.h2database</groupId> - <artifactId>h2</artifactId> - </dependency> - <dependency> - <groupId>fuzzydll</groupId> - <artifactId>fuzzydl</artifactId> - <version>1.0</version> - </dependency> - - <dependency> - <groupId>fuzzydll</groupId> - <artifactId>fuzzyowl2fuzzydlparser</artifactId> - <version>1.0</version> - </dependency> - - </dependencies> + <!--JSON is in Central--> + <dependency> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + </dependency> + + + <dependency> + <groupId>net.sf.jopt-simple</groupId> + <artifactId>jopt-simple</artifactId> + </dependency> + + + <!--Lucene is in Central--> + <dependency> + <groupId>org.apache.lucene</groupId> + <artifactId>lucene-core</artifactId> + </dependency> + + <dependency> + <groupId>org.ini4j</groupId> + <artifactId>ini4j</artifactId> + </dependency> + + + <dependency> + <groupId>xmlbeans</groupId> + <artifactId>xbean</artifactId> + </dependency> + + <dependency> + <groupId>com.google.code.factplusplus</groupId> + <artifactId>factpp-owlapi</artifactId> + </dependency> + + <dependency> + <groupId>net.sourceforge.owlapi.owllink</groupId> + <artifactId>owllink</artifactId> + </dependency> + + <dependency> + <groupId>org.semanticweb.hermit</groupId> + <artifactId>hermit</artifactId> + </dependency> + + <dependency> + <groupId>com.jamonapi</groupId> + <artifactId>jamon</artifactId> + </dependency> + + <!--JENA ARQ is in central - we use the latest--> + <dependency> + <groupId>com.hp.hpl.jena</groupId> + <artifactId>arq</artifactId> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>net.sourceforge.dig</groupId> + <artifactId>dig-xmlbeans</artifactId> + </dependency> + + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + </dependency> + + <dependency> + <groupId>fuzzydll</groupId> + <artifactId>fuzzydl</artifactId> + <version>1.0</version> + </dependency> + + <dependency> + <groupId>fuzzydll</groupId> + <artifactId>fuzzyowl2fuzzydlparser</artifactId> + <version>1.0</version> + </dependency> + + </dependencies> </project> Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2011-06-15 17:22:09 UTC (rev 2888) +++ trunk/interfaces/pom.xml 2011-06-15 20:11:44 UTC (rev 2889) @@ -1,175 +1,203 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>org.dllearner</groupId> - <artifactId>interfaces</artifactId> - <packaging>jar</packaging> - <name>Interfaces: GUI, CLI, Web Service</name> - <url>http://aksw.org/Projects/DLLearner</url> + <groupId>org.dllearner</groupId> + <artifactId>interfaces</artifactId> + <packaging>jar</packaging> + <name>Interfaces: GUI, CLI, Web Service</name> + <url>http://aksw.org/Projects/DLLearner</url> - <parent> - <groupId>org.dllearner</groupId> - <artifactId>dllearner-parent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.dllearner</groupId> + <artifactId>dllearner-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> - <build> - <finalName>interfaces</finalName> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>tomcat-maven-plugin</artifactId> - </plugin> + <build> + <finalName>interfaces</finalName> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>tomcat-maven-plugin</artifactId> + </plugin> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <configuration> - <stopKey>stopKey</stopKey> - <stopPort>9999</stopPort> - <scanIntervalSeconds>1</scanIntervalSeconds> - <!--requestLog implementation="org.mortbay.jetty.NCSARequestLog"> - <filename>log/yyyy_mm_dd.request.log</filename> - <retainDays>90</retainDays> - <append>true</append> - <extended>false</extended> - <logTimeZone>GMT</logTimeZone> - </requestLog--> - </configuration> - <!--execution is used for testing--> - <executions> - <execution> - <id>start-jetty</id> - <phase>pre-integration-test</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <scanIntervalSeconds>0</scanIntervalSeconds> - <daemon>true</daemon> - <stopKey>stopKey</stopKey> - <stopPort>9999</stopPort> - </configuration> - </execution> - <execution> - <id>stop-jetty</id> - <phase>post-integration-test</phase> - <goals> - <goal>stop</goal> - </goals> - </execution> - </executions> - </plugin> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>maven-jetty-plugin</artifactId> + <configuration> + <stopKey>stopKey</stopKey> + <stopPort>9999</stopPort> + <scanIntervalSeconds>1</scanIntervalSeconds> + <!-- + requestLog implementation="org.mortbay.jetty.NCSARequestLog"> + <filename>log/yyyy_mm_dd.request.log</filename> + <retainDays>90</retainDays> <append>true</append> + <extended>false</extended> <logTimeZone>GMT</logTimeZone> + </requestLog + --> + </configuration> + <!--execution is used for testing--> + <executions> + <execution> + <id>start-jetty</id> + <phase>pre-integration-test</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <scanIntervalSeconds>0</scanIntervalSeconds> + <daemon>true</daemon> + <stopKey>stopKey</stopKey> + <stopPort>9999</stopPort> + </configuration> + </execution> + <execution> + <id>stop-jetty</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin> - <!--Surefire - for JUnits --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <excludes> - <exclude>org/dllearner/test/junit/OWLlinkTest.java</exclude> - </excludes> - </configuration> - </plugin> - <plugin> - <artifactId>jdeb</artifactId> - <groupId>org.vafer</groupId> - <version>0.8</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>jdeb</goal> - </goals> - <configuration> - <dataSet> - <data> - <src>${project.build.directory}/${project.build.finalName}.jar</src> - <type>file</type> - <mapper> - <type>perm</type> - <prefix>/usr/share/dllearner</prefix> - </mapper> - </data> - </dataSet> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> + <!--Surefire - for JUnits --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/dllearner/test/junit/OWLlinkTest.java</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>de.tarent.maven.plugins</groupId> + <artifactId>maven-pkg-plugin</artifactId> + <version>2.1.0</version> + <configuration> - <dependencies> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <!-- Exclude Project-D from Project-B --> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - </exclusions> - </dependency> + <defaultTarget>all</defaultTarget> - <!--Added the dependency of the core tests so that they will be accessible - from the tests in this component --> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - <classifier>tests</classifier> - <scope>test</scope> - </dependency> + <defaultDistro>ubuntu_intrepid</defaultDistro> + <shortDescription>My Short Project Description...</shortDescription> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-ext</artifactId> - </dependency> + <defaults> + <section>misc</section> + <mainClass>org.dllearner.cli.Start</mainClass> + <architecture>all</architecture> + <srcAuxFilesDir>src/main/pkg</srcAuxFilesDir> + <maintainer>Jens Lehmann</maintainer> + </defaults> + <targetConfigurations> - <dependency> - <groupId>com.jamonapi</groupId> - <artifactId>jamon</artifactId> - </dependency> + <targetConfiguration> + <target>i386</target> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> + <architecture>i386</architecture> + <srcJNIFilesDir>src/main/native/i386</srcJNIFilesDir> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jsp-api</artifactId> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jstl</artifactId> - </dependency> + </targetConfiguration> + <targetConfiguration> + <target>armel</target> - <dependency> - <groupId>org.aksw.commons</groupId> - <artifactId>model</artifactId> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <!-- Exclude Project-D from Project-B --> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.googlecode.json-simple</groupId> - <artifactId>json-simple</artifactId> - </dependency> + <architecture>armel</architecture> + <srcJNIFilesDir>src/main/native/armel</srcJNIFilesDir> - </dependencies> + </targetConfiguration> + </targetConfigurations> + <distroConfigurations> + <distroConfiguration> + + <distros> + <distro>ubuntu_intrepid</distro> + <distro>ubuntu_karmic</distro> + </distros> + + </distroConfiguration> + </distroConfigurations> + </configuration> + </plugin> + </plugins> + </build> + + <dependencies> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <!-- Exclude Project-D from Project-B --> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> + </dependency> + + <!-- + Added the dependency of the core tests so that they will be + accessible from the tests in this component + --> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + <classifier>tests</classifier> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-ext</artifactId> + </dependency> + + + <dependency> + <groupId>com.jamonapi</groupId> + <artifactId>jamon</artifactId> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + </dependency> + + + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>model</artifactId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <!-- Exclude Project-D from Project-B --> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + </dependency> + + </dependencies> + + </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2011-06-16 08:07:30
|
Revision: 2890 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2890&view=rev Author: kurzum Date: 2011-06-16 08:07:18 +0000 (Thu, 16 Jun 2011) Log Message: ----------- commented old commitby heeroyuy, improvements on geizhals server Modified Paths: -------------- trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/learningproblems/EvaluatedDescriptionPosNeg.java trunk/interfaces/pom.xml trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java trunk/interfaces/src/main/resources/nke/geizhals.owl trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2011-06-15 20:11:44 UTC (rev 2889) +++ trunk/components-core/pom.xml 2011-06-16 08:07:18 UTC (rev 2890) @@ -52,7 +52,7 @@ </execution> </executions> </plugin> - <plugin> + <!--plugin> <groupId>de.tarent.maven.plugins</groupId> <artifactId>maven-pkg-plugin</artifactId> <version>2.1.0</version> @@ -107,7 +107,7 @@ </distroConfiguration> </distroConfigurations> </configuration> - </plugin> + </plugin--> </plugins> </build> Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/EvaluatedDescriptionPosNeg.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/EvaluatedDescriptionPosNeg.java 2011-06-15 20:11:44 UTC (rev 2889) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/EvaluatedDescriptionPosNeg.java 2011-06-16 08:07:18 UTC (rev 2890) @@ -156,7 +156,7 @@ // we need to use this method instead of the standard JSON array constructor, // otherwise we'll get unexpected results (JSONArray does not take Individuals // as arguments and does not use toString) - private static JSONArray getJSONArray(Set<Individual> individuals) { + public static JSONArray getJSONArray(Set<Individual> individuals) { JSONArray j = new JSONArray(); for(Individual i : individuals) { j.put(i.getName()); Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2011-06-15 20:11:44 UTC (rev 2889) +++ trunk/interfaces/pom.xml 2011-06-16 08:07:18 UTC (rev 2890) @@ -72,7 +72,8 @@ </excludes> </configuration> </plugin> - <plugin> + <!--does not seem to work properly, please test more--> + <!--plugin> <groupId>de.tarent.maven.plugins</groupId> <artifactId>maven-pkg-plugin</artifactId> <version>2.1.0</version> @@ -122,7 +123,7 @@ </distroConfiguration> </distroConfigurations> </configuration> - </plugin> + </plugin--> </plugins> </build> Modified: trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java 2011-06-15 20:11:44 UTC (rev 2889) +++ trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java 2011-06-16 08:07:18 UTC (rev 2890) @@ -1,28 +1,15 @@ package org.dllearner.server; +import com.hp.hpl.jena.ontology.OntClass; import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; - -import org.dllearner.algorithms.celoe.CELOE; -import org.dllearner.algorithms.el.ELLearningAlgorithm; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.KnowledgeSource; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.CELOEConfigurator; -import org.dllearner.core.owl.Individual; -import org.dllearner.gui.Config; -import org.dllearner.gui.ConfigSave; -import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.NamedClass; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; -import org.dllearner.learningproblems.PosNegLPStandard; -import org.dllearner.reasoning.FastInstanceChecker; -import org.dllearner.reasoning.OWLAPIReasoner; -import org.dllearner.utilities.Helper; -import org.dllearner.utilities.datastructures.Datastructures; -import org.dllearner.utilities.datastructures.SortedSetTuple; +import org.dllearner.server.nke.Geizhals2OWL; +import org.dllearner.server.nke.Learner; +import org.json.simple.JSONArray; import org.json.simple.JSONObject; -import org.json.simple.JSONValue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,24 +17,19 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import java.io.File; import java.io.IOException; import java.io.PrintWriter; -import java.net.URL; import java.net.URLEncoder; import java.security.InvalidParameterException; import java.util.Arrays; import java.util.HashSet; -import java.util.SortedSet; +import java.util.Set; public class NKEGeizhals extends HttpServlet { private static Logger log = LoggerFactory.getLogger(NKEGeizhals.class); - - @Override protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { handle(httpServletRequest, httpServletResponse); @@ -87,55 +69,19 @@ String json = ""; if (isSet(httpServletRequest, "data")) { json = httpServletRequest.getParameter("data"); - JSONObject j = (JSONObject) JSONValue.parse(json); - - - //Object obj=JSONValue.parse(s); - // JSONArray array=(JSONArray)obj; + Geizhals2OWL.Result r = Geizhals2OWL.getInstance().handleJson(json); + EvaluatedDescriptionPosNeg ed = new Learner().learn(r.pos, r.neg, r.getModel(), 20); + JSONObject concept = jsonForEd(ed); + JSONObject j = new JSONObject(); + j.put("learned", concept); + j.put("up", JSONArray.toJSONString(Arrays.asList(new String[]{concept.toJSONString(), concept.toJSONString()}))); + j.put("down", JSONArray.toJSONString(Arrays.asList(new String[]{concept.toJSONString(), concept.toJSONString()}))); + PrintWriter pw = httpServletResponse.getWriter(); + log.debug("Request handled: " + logMonitor(mon.stop())); + pw.print(j.toJSONString()); + pw.close(); + return; - /*Iterator i = obj.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry e = (Map.Entry)i.next(); - System.out.println("Key: " + e.getKey()); - System.out.println("Value: " + e.getValue()); - } */ - - // TODO: get examples - SortedSet<Individual> posExamples = null; - SortedSet<Individual> negExamples = null; - - - - ComponentManager cm = ComponentManager.getInstance(); - - // TODO: get a knowledge source - KnowledgeSource ks = cm.knowledgeSource(null); - ks.init(); - - // TODO: should the reasoner be initialised at every request or just once (?) - // ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, ks); - ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); // try OWL API / Pellet, because ontology is not complex - rc.init(); - - PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); - lp.setPositiveExamples(posExamples); - lp.setNegativeExamples(negExamples); - lp.getConfigurator().setAccuracyMethod("fmeasure"); - lp.getConfigurator().setUseApproximations(false); - lp.init(); - - ELLearningAlgorithm la = cm.learningAlgorithm(ELLearningAlgorithm.class, lp, rc); - la.init(); - la.start(); - EvaluatedDescriptionPosNeg ed = (EvaluatedDescriptionPosNeg) la.getCurrentlyBestEvaluatedDescription(); - // return result in JSON format - result = ed.asJSON(); - -// rc.getIndividuals(ed.getDescription()); - - // remove all components to avoid side effects - cm.freeAllComponents(); - } else { throw new InvalidParameterException("No parameter 'data' found. " + getDocumentation(httpServletRequest.getRequestURL().toString())); } @@ -174,6 +120,57 @@ } + + public static JSONObject jsonForEd(EvaluatedDescriptionPosNeg ed) { + Set<NamedClass> n = getNamedClasses(ed.getDescription(), new HashSet<NamedClass>()); + + //prepare retrieval string + StringBuilder sb = new StringBuilder(); + int x = 0; + for (NamedClass nc : n) { + sb.append(nc.getName().replace(Geizhals2OWL.prefix, "")); + if (x < (n.size() - 1)) { + sb.append("~"); + } + x++; + } + sb.insert(0, "http://geizhals.at/?cat=nb15w&xf="); + + JSONObject j = new JSONObject(); + j.put("link", sb.toString()); + + j.put("kbsyntax", ed.getDescription().toKBSyntaxString()); + String mos = ed.getDescription().toManchesterSyntaxString(null, null); + for (NamedClass nc : n) { + String label = null; + OntClass c = null; + if ((c = Geizhals2OWL.labels.getOntClass(nc.getName())) != null && (label = c.getLabel(null)) != null) { + mos = mos.replace(nc.getName(), label); + } else { + mos = mos.replace(nc.getName(), nc.getName().replace(Geizhals2OWL.prefix, "")); + } + } + j.put("label", mos); + j.put("falsePositives", EvaluatedDescriptionPosNeg.getJSONArray(ed.getNotCoveredPositives())); + j.put("falseNegatives", EvaluatedDescriptionPosNeg.getJSONArray(ed.getCoveredNegatives())); + + log.info(sb.toString()); + log.info(ed.toString()); + return j; + } + + public static Set<NamedClass> getNamedClasses(Description d, Set<NamedClass> ret) { + if (d instanceof NamedClass) { + ret.add((NamedClass) d); + } + for (Description ch : d.getChildren()) { + getNamedClasses(ch, ret); + } + return ret; + + } + + /** * Examples are from NIF * Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-15 20:11:44 UTC (rev 2889) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-16 08:07:18 UTC (rev 2890) @@ -19,19 +19,20 @@ */ public class Geizhals2OWL { private static Logger log = Logger.getLogger(Geizhals2OWL.class); - public static ClassIndexer index = new ClassIndexer(); - public static Geizhals2OWL geizhals2OWL = new Geizhals2OWL(); + public static final OntModel labels = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); + public static final ClassIndexer index = new ClassIndexer(); + public static final Geizhals2OWL geizhals2OWL = new Geizhals2OWL(); public static Map<String, String> ramMap = new HashMap<String, String>(); public static Map<String, String> hdMap = new HashMap<String, String>(); public static Map<String, String> discMap = new HashMap<String, String>(); - public static String prefix = "http://nke.aksw.org/_"; + public static final String prefix = "http://nke.aksw.org/geizhals/_"; + //public static final String prefix = "http://geizhals.at/?cat=nb15w&xf="; static { - OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel()); - model.read(Geizhals2OWL.class.getClassLoader().getResourceAsStream("nke/geizhals.owl"), ""); - index.index(model); + labels.read(Geizhals2OWL.class.getClassLoader().getResourceAsStream("nke/geizhals.owl"), ""); + index.index(labels); ramMap.put("512MB", "12_512"); ramMap.put("1024MB", "12_1024"); @@ -193,7 +194,7 @@ model.createIndividual(uri, model.createClass(c)); Model m = index.getHierarchyForClassURI(c); if (m == null) { - log.warn("recieved null for " + c); + log.warn("received null for " + c); } else { model.add(m); } Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-15 20:11:44 UTC (rev 2889) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-16 08:07:18 UTC (rev 2890) @@ -6,10 +6,8 @@ import org.aksw.commons.jena.Constants; import org.aksw.commons.jena.ModelUtils; import org.apache.log4j.Logger; -import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.core.*; -import org.dllearner.core.owl.Description; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; import org.dllearner.learningproblems.PosNegLPStandard; @@ -21,9 +19,6 @@ import org.semanticweb.owlapi.model.OWLOntologyManager; import java.io.*; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; import java.util.Set; /** @@ -34,94 +29,71 @@ */ public class Learner { - private static Logger logger = Logger.getLogger(Learner.class); + private static Logger log = Logger.getLogger(Learner.class); - public LearningResult learn(Set<String> pos, Set<String> neg, OntModel model, int maxTime) throws IOException, ComponentInitException, LearningProblemUnsupportedException { - - model.createIndividual("http://nke.aksw.org/", model.createClass(OWL.Ontology.getURI())); - ModelUtils.write(model, new File("test.owl")); - LearningResult lr = new LearningResult(); - PipedOutputStream out = new PipedOutputStream(); - model.write(out, Constants.RDFXML); + public EvaluatedDescriptionPosNeg learn(Set<String> pos, Set<String> neg, OntModel model, int maxTime) throws IOException, ComponentInitException, LearningProblemUnsupportedException { + ComponentManager cm = ComponentManager.getInstance(); + try { + model.createIndividual("http://nke.aksw.org/", model.createClass(OWL.Ontology.getURI())); + ModelUtils.write(model, new File("test.owl")); + PipedOutputStream out = new PipedOutputStream(); + model.write(out, Constants.RDFXML); // PipedInputStream in = new PipedInputStream(out); - RDFWriter writer = model.getWriter("RDF/XML"); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - writer.write(model, baos, ""); + RDFWriter writer = model.getWriter("RDF/XML"); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + writer.write(model, baos, ""); - ByteArrayInputStream bs = new ByteArrayInputStream(baos.toString().getBytes()); + ByteArrayInputStream bs = new ByteArrayInputStream(baos.toString().getBytes()); - ComponentManager cm = ComponentManager.getInstance(); + log.debug("Loading ontology into OWL API"); + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + OWLOntology retOnt = null; + try { + //retOnt = manager.createOntology(IRI.create("http://nke.aksw.org/tmp")); + // manager. + // manager.loadOntologyFromOntologyDocument() + retOnt = manager.loadOntologyFromOntologyDocument(bs); + } catch (OWLOntologyCreationException e) { + e.printStackTrace(); + } - logger.debug("Loading ontology into OWL API"); - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLOntology retOnt = null; - try { - //retOnt = manager.createOntology(IRI.create("http://nke.aksw.org/tmp")); - // manager. - // manager.loadOntologyFromOntologyDocument() - retOnt = manager.loadOntologyFromOntologyDocument(bs); - } catch (OWLOntologyCreationException e) { - e.printStackTrace(); - } + // System.out.println(retOnt.getAxiomCount()); + // System.exit(0); - // System.out.println(retOnt.getAxiomCount()); - // System.exit(0); - - KnowledgeSource ks = new OWLAPIOntology(retOnt); + KnowledgeSource ks = new OWLAPIOntology(retOnt); // KnowledgeSource ks = cm.knowledgeSource(null); - ks.init(); + ks.init(); - // TODO: should the reasoner be initialised at every request or just once (?) - // ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, ks); - logger.debug("Initialising reasoner"); - ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); // try OWL API / Pellet, because ontology is not complex - rc.init(); + // TODO: should the reasoner be initialised at every request or just once (?) + // ReasonerComponent rc = cm.reasoner(FastInstanceChecker.class, ks); + log.debug("Initialising reasoner"); + ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); // try OWL API / Pellet, because ontology is not complex + rc.init(); // System.out.println(rc.getClassHierarchy()); - - PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); - lp.setPositiveExamples(Helper.getIndividualSet(pos)); - lp.setNegativeExamples(Helper.getIndividualSet(neg)); + + PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); + lp.setPositiveExamples(Helper.getIndividualSet(pos)); + lp.setNegativeExamples(Helper.getIndividualSet(neg)); // lp.getConfigurator().setAccuracyMethod("fmeasure"); // lp.getConfigurator().setUseApproximations(false); - lp.init(); + lp.init(); - ELLearningAlgorithm la = cm.learningAlgorithm(ELLearningAlgorithm.class, lp, rc); - la.getConfigurator().setInstanceBasedDisjoints(false); + ELLearningAlgorithm la = cm.learningAlgorithm(ELLearningAlgorithm.class, lp, rc); + la.getConfigurator().setInstanceBasedDisjoints(false); // CELOE la = cm.learningAlgorithm(CELOE.class, lp, rc); - la.init(); - logger.debug("Running learning algorithm"); - la.start(); - EvaluatedDescriptionPosNeg ed = (EvaluatedDescriptionPosNeg) la.getCurrentlyBestEvaluatedDescription(); + la.init(); + log.debug("Running learning algorithm"); + la.start(); + EvaluatedDescriptionPosNeg ed = (EvaluatedDescriptionPosNeg) la.getCurrentlyBestEvaluatedDescription(); - // use this to get all solutions - // rc.getIndividuals(ed.getDescription()); - - // remove all components to avoid side effects - cm.freeAllComponents(); - - System.out.println(ed); - - // TODO: do we really need a learning result class if we have EvaluatedDescription? - return lr; - - } - - - protected void finalize() { - //TODO cleanup anything there was - - } - - public class LearningResult { - public Set<String> falsePositives = new HashSet<String>(); - public Set<String> falseNegatives = new HashSet<String>(); - //change this if necessary, - public List<Description> best5Results = new ArrayList<Description>(); - - @Override - public String toString() { - return "LearningResult{" + "falsePositives=" + falsePositives + ", falseNegatives=" + falseNegatives + ", best5Results=" + best5Results + '}'; + // use this to get all solutions + // rc.getIndividuals(ed.getDescription()); + log.debug(ed.toString()); + return ed; + } finally { + // remove all components to avoid side effects + cm.freeAllComponents(); } } Modified: trunk/interfaces/src/main/resources/nke/geizhals.owl =================================================================== --- trunk/interfaces/src/main/resources/nke/geizhals.owl 2011-06-15 20:11:44 UTC (rev 2889) +++ trunk/interfaces/src/main/resources/nke/geizhals.owl 2011-06-16 08:07:18 UTC (rev 2890) @@ -1,2100 +1,2235 @@ <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <rdf:Description rdf:about="http://nke.aksw.org/_525_ASUS"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_ASUS"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_ASUS"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_ASUS"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ASUS</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Acer"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Acer"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Acer"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Acer"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Acer</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Apple"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Apple"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Apple"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Apple"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Apple</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Belinea"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Belinea"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Belinea"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Belinea"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Belinea</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Dell"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Dell"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Dell"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Dell"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Dell</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Fujitsu"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Fujitsu"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Fujitsu"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Fujitsu"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Fujitsu</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_HP+Compaq"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_HP+Compaq"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_HP+Compaq"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_HP+Compaq"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">HP Compaq</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Lenovo+IBM"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Lenovo+IBM"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Lenovo+IBM"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Lenovo+IBM"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Lenovo IBM</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_MSI"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_MSI"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_MSI"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_MSI"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">MSI</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Panasonic"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Panasonic"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Panasonic"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Panasonic"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Panasonic</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Samsung"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Samsung"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Samsung"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Samsung"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Samsung</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Sonstige"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Sonstige"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Sonstige"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Sonstige"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Sonstige</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Sony"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Sony"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Sony"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Sony"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Sony</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Toshiba"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Toshiba"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_525_Toshiba"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_525_Toshiba"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Toshiba</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_12.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_12.5"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_12.5"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">12.5&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13.1"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13.1"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13.1"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13.1"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13.1&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13.3"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13.3"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13.3"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13.3"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13.3&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13.4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_13.4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_13.4"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">13.4&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_14"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_14"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_14"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_14"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">14&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_14.1"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_14.1"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_14.1"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_14.1"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">14.1&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_14.5"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_14.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_14.5"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_14.5"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">14.5&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15.4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15.4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15.4"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15.4&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15.5"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15.5"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15.5"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15.5"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15.5&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15.6"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_15.6"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_15.6"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">15.6&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_16"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_16"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_16"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_16"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_16.4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_16.4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_16.4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_16.4"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16.4&quot;</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_85_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_85_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_4%3A3"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_4%3A3"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_4%3A3"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_4%3A3"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">4:3</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A10"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_16%3A10"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A10"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_16%3A10"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16:10</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A9"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_16%3A9"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_16%3A9"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_16%3A9"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">16:9</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1200_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1200_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1024x768"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1024x768"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1024x768"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1024x768"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1024x768</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1280x800"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1280x800"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1280x800"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1280x800"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1280x800</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1366x768"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1366x768"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1366x768"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1366x768"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1366x768</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1440x900"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1440x900"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1440x900"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1440x900"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1440x900</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1600x900"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1600x900"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1600x900"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1600x900"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1600x900</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x945"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1680x945"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x945"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1680x945"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1680x945</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x1050"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1680x1050"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1680x1050"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1680x1050"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1680x1050</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1080"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1920x1080"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1080"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1920x1080"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1920x1080</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1200"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1920x1200"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_1920x1200"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_1920x1200"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">1920x1200</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_9_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_9_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.180"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.180"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.180"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.180"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.180mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.190"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.190"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.190"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.190"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.190mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.200"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.200"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.200"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.200"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.200mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.210"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.210"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.210"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.210"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.210mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.220"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.220"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.220"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.220"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.220mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.230"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.230"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.230"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.230"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.230mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.240"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.240"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.240"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.240"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.240mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.260"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.260"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.260"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.260"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.260mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.280"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.280"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_0.280"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_0.280"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">bis 0.280mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_sonstige"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_sonstige"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_sonstige"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_sonstige"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">&uuml;ber 0.280mm</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1581_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1581_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+gl%E4nzend+(glare)"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_83_LCD+gl%E4nzend+(glare)"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+gl%E4nzend+(glare)"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_83_LCD+gl%E4nzend+(glare)"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">LCD gl&auml;nzend (glare)</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+matt+(non-glare)"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_83_LCD+matt+(non-glare)"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_83_LCD+matt+(non-glare)"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_83_LCD+matt+(non-glare)"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">LCD matt (non-glare)</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_83_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_83_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_83_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_83_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1482_AMD"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1482_AMD"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1482_AMD"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1482_AMD"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1482_Intel"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1482_Intel"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1482_Intel"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1482_Intel"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Intel</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1482_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1482_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_1482_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_1482_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_1"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_1"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_1"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_1"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Single-Core</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_2"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_2"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_2"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_2"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Dual-Core</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_3"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_3"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_3"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_3"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Triple-Core</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_4"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_4"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_4"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Quad-Core</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_27_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_27_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_1000"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_1000"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_1000"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_1000"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 1GHz</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_1500"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_1500"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_1500"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_1500"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 1.5GHz</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_2000"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_2000"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_2000"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_2000"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 2GHz</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_2500"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_2500"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_2500"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_2500"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 2.5GHz</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_3000"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_3000"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_3000"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_3000"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">ab 3GHz</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_unbekannt"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_28_unbekannt"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_28_unbekannt"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">unbekannt</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+A6-"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+A6-"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+A6-"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+A6-"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD A6-</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+C-"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+C-"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+C-"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+C-"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD C-</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+E-"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+E-"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+E-"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+E-"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD E-</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+V"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+V"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_AMD+V"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_AMD+V"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">AMD V</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+64"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Athlon+64"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+64"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Athlon+64"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Athlon 64</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+II"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Athlon+II"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+II"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Athlon+II"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Athlon II</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+X2"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Athlon+X2"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Athlon+X2"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Athlon+X2"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Athlon X2</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Celeron"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Celeron"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Celeron</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron+Dual-Core"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Celeron+Dual-Core"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Celeron+Dual-Core"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Celeron+Dual-Core"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Celeron Dual-Core</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+2+Duo"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Core+2+Duo"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+2+Duo"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Core+2+Duo"> <ns0:label xmlns:ns0="http://www.w3.org/2000/01/rdf-schema#">Core 2 Duo</ns0:label> </rdf:Description> - <rdf:Description rdf:about="http://nke.aksw.org/_29_Core+i3"> + <rdf:Description rdf:about="http://nke.aksw.org/geizhals/_29_Core+i3"> <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/> </rdf:Description> - <rdf:Description rdf:abo... [truncated message content] |
From: <ku...@us...> - 2011-06-16 08:49:30
|
Revision: 2891 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2891&view=rev Author: kurzum Date: 2011-06-16 08:49:23 +0000 (Thu, 16 Jun 2011) Log Message: ----------- finished initial version of geizhals server Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java trunk/interfaces/pom.xml trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java Added Paths: ----------- trunk/interfaces/log/ Modified: trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-06-16 08:07:18 UTC (rev 2890) +++ trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-06-16 08:49:23 UTC (rev 2891) @@ -495,7 +495,7 @@ * Frees all references to components created by <code>ComponentManager</code>. * @see #freeComponent(Component) */ - public void freeAllComponents() { + public synchronized void freeAllComponents() { pool.clearComponents(); } Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2011-06-16 08:07:18 UTC (rev 2890) +++ trunk/interfaces/pom.xml 2011-06-16 08:49:23 UTC (rev 2891) @@ -1,204 +1,204 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>org.dllearner</groupId> - <artifactId>interfaces</artifactId> - <packaging>jar</packaging> - <name>Interfaces: GUI, CLI, Web Service</name> - <url>http://aksw.org/Projects/DLLearner</url> + <groupId>org.dllearner</groupId> + <artifactId>interfaces</artifactId> + <packaging>jar</packaging> + <name>Interfaces: GUI, CLI, Web Service</name> + <url>http://aksw.org/Projects/DLLearner</url> - <parent> - <groupId>org.dllearner</groupId> - <artifactId>dllearner-parent</artifactId> - <version>1.0-SNAPSHOT</version> - </parent> + <parent> + <groupId>org.dllearner</groupId> + <artifactId>dllearner-parent</artifactId> + <version>1.0-SNAPSHOT</version> + </parent> - <build> - <finalName>interfaces</finalName> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>tomcat-maven-plugin</artifactId> - </plugin> + <build> + <finalName>interfaces</finalName> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>tomcat-maven-plugin</artifactId> + </plugin> - <plugin> - <groupId>org.mortbay.jetty</groupId> - <artifactId>maven-jetty-plugin</artifactId> - <configuration> - <stopKey>stopKey</stopKey> - <stopPort>9999</stopPort> - <scanIntervalSeconds>1</scanIntervalSeconds> - <!-- - requestLog implementation="org.mortbay.jetty.NCSARequestLog"> - <filename>log/yyyy_mm_dd.request.log</filename> - <retainDays>90</retainDays> <append>true</append> - <extended>false</extended> <logTimeZone>GMT</logTimeZone> - </requestLog - --> - </configuration> - <!--execution is used for testing--> - <executions> - <execution> - <id>start-jetty</id> - <phase>pre-integration-test</phase> - <goals> - <goal>run</goal> - </goals> - <configuration> - <scanIntervalSeconds>0</scanIntervalSeconds> - <daemon>true</daemon> - <stopKey>stopKey</stopKey> - <stopPort>9999</stopPort> - </configuration> - </execution> - <execution> - <id>stop-jetty</id> - <phase>post-integration-test</phase> - <goals> - <goal>stop</goal> - </goals> - </execution> - </executions> - </plugin> + <plugin> + <groupId>org.mortbay.jetty</groupId> + <artifactId>maven-jetty-plugin</artifactId> + <configuration> + <stopKey>stopKey</stopKey> + <stopPort>9999</stopPort> + <scanIntervalSeconds>1</scanIntervalSeconds> + <requestLog implementation="org.mortbay.jetty.NCSARequestLog"> + <filename>log/yyyy_mm_dd.request.log</filename> + <retainDays>90</retainDays> + <append>true</append> + <extended>false</extended> + <logTimeZone>GMT</logTimeZone> + </requestLog> + </configuration> + <!--execution is used for testing--> + <executions> + <execution> + <id>start-jetty</id> + <phase>pre-integration-test</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <scanIntervalSeconds>0</scanIntervalSeconds> + <daemon>true</daemon> + <stopKey>stopKey</stopKey> + <stopPort>9999</stopPort> + </configuration> + </execution> + <execution> + <id>stop-jetty</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin> - <!--Surefire - for JUnits --> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <excludes> - <exclude>org/dllearner/test/junit/OWLlinkTest.java</exclude> - </excludes> - </configuration> - </plugin> + <!--Surefire - for JUnits --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <excludes> + <exclude>org/dllearner/test/junit/OWLlinkTest.java</exclude> + </excludes> + </configuration> + </plugin> <!--does not seem to work properly, please test more--> - <!--plugin> - <groupId>de.tarent.maven.plugins</groupId> - <artifactId>maven-pkg-plugin</artifactId> - <version>2.1.0</version> - <configuration> + <!--plugin> + <groupId>de.tarent.maven.plugins</groupId> + <artifactId>maven-pkg-plugin</artifactId> + <version>2.1.0</version> + <configuration> - <defaultTarget>all</defaultTarget> + <defaultTarget>all</defaultTarget> - <defaultDistro>ubuntu_intrepid</defaultDistro> - <shortDescription>My Short Project Description...</shortDescription> + <defaultDistro>ubuntu_intrepid</defaultDistro> + <shortDescription>My Short Project Description...</shortDescription> - <defaults> - <section>misc</section> - <mainClass>org.dllearner.cli.Start</mainClass> - <architecture>all</architecture> - <srcAuxFilesDir>src/main/pkg</srcAuxFilesDir> - <maintainer>Jens Lehmann</maintainer> - </defaults> + <defaults> + <section>misc</section> + <mainClass>org.dllearner.cli.Start</mainClass> + <architecture>all</architecture> + <srcAuxFilesDir>src/main/pkg</srcAuxFilesDir> + <maintainer>Jens Lehmann</maintainer> + </defaults> - <targetConfigurations> + <targetConfigurations> - <targetConfiguration> - <target>i386</target> + <targetConfiguration> + <target>i386</target> - <architecture>i386</architecture> - <srcJNIFilesDir>src/main/native/i386</srcJNIFilesDir> + <architecture>i386</architecture> + <srcJNIFilesDir>src/main/native/i386</srcJNIFilesDir> - </targetConfiguration> + </targetConfiguration> - <targetConfiguration> - <target>armel</target> + <targetConfiguration> + <target>armel</target> - <architecture>armel</architecture> - <srcJNIFilesDir>src/main/native/armel</srcJNIFilesDir> + <architecture>armel</architecture> + <srcJNIFilesDir>src/main/native/armel</srcJNIFilesDir> - </targetConfiguration> + </targetConfiguration> - </targetConfigurations> + </targetConfigurations> - <distroConfigurations> - <distroConfiguration> + <distroConfigurations> + <distroConfiguration> - <distros> - <distro>ubuntu_intrepid</distro> - <distro>ubuntu_karmic</distro> - </distros> + <distros> + <distro>ubuntu_intrepid</distro> + <distro>ubuntu_karmic</distro> + </distros> - </distroConfiguration> - </distroConfigurations> - </configuration> - </plugin--> - </plugins> - </build> + </distroConfiguration> + </distroConfigurations> + </configuration> + </plugin--> + </plugins> + </build> - <dependencies> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <!-- Exclude Project-D from Project-B --> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - </exclusions> - </dependency> + <dependencies> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <!-- Exclude Project-D from Project-B --> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> + </dependency> - <!-- - Added the dependency of the core tests so that they will be - accessible from the tests in this component - --> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-core</artifactId> - <classifier>tests</classifier> - <scope>test</scope> - </dependency> + <!-- + Added the dependency of the core tests so that they will be + accessible from the tests in this component + --> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-core</artifactId> + <classifier>tests</classifier> + <scope>test</scope> + </dependency> - <dependency> - <groupId>org.dllearner</groupId> - <artifactId>components-ext</artifactId> - </dependency> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-ext</artifactId> + </dependency> - <dependency> - <groupId>com.jamonapi</groupId> - <artifactId>jamon</artifactId> - </dependency> + <dependency> + <groupId>com.jamonapi</groupId> + <artifactId>jamon</artifactId> + </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jsp-api</artifactId> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jstl</artifactId> - </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + </dependency> - <dependency> - <groupId>org.aksw.commons</groupId> - <artifactId>model</artifactId> - <exclusions> - <exclusion> - <groupId>org.slf4j</groupId> - <!-- Exclude Project-D from Project-B --> - <artifactId>slf4j-log4j12</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>com.googlecode.json-simple</groupId> - <artifactId>json-simple</artifactId> - </dependency> + <dependency> + <groupId>org.aksw.commons</groupId> + <artifactId>model</artifactId> + <exclusions> + <exclusion> + <groupId>org.slf4j</groupId> + <!-- Exclude Project-D from Project-B --> + <artifactId>slf4j-log4j12</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + </dependency> - </dependencies> + </dependencies> </project> Modified: trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java 2011-06-16 08:07:18 UTC (rev 2890) +++ trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java 2011-06-16 08:49:23 UTC (rev 2891) @@ -3,6 +3,7 @@ import com.hp.hpl.jena.ontology.OntClass; import com.jamonapi.Monitor; import com.jamonapi.MonitorFactory; +import org.dllearner.core.ComponentManager; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.NamedClass; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; @@ -21,7 +22,6 @@ import java.io.PrintWriter; import java.net.URLEncoder; import java.security.InvalidParameterException; -import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -50,6 +50,8 @@ * @throws java.io.IOException */ private void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { + ComponentManager cm = ComponentManager.getInstance(); + cm.freeAllComponents(); Monitor mon = MonitorFactory.getTimeMonitor("NIFParameters.getInstance").start(); String result = ""; try { @@ -68,16 +70,23 @@ if (action.equals("learn")) { String json = ""; if (isSet(httpServletRequest, "data")) { + json = httpServletRequest.getParameter("data"); Geizhals2OWL.Result r = Geizhals2OWL.getInstance().handleJson(json); EvaluatedDescriptionPosNeg ed = new Learner().learn(r.pos, r.neg, r.getModel(), 20); JSONObject concept = jsonForEd(ed); JSONObject j = new JSONObject(); j.put("learned", concept); - j.put("up", JSONArray.toJSONString(Arrays.asList(new String[]{concept.toJSONString(), concept.toJSONString()}))); - j.put("down", JSONArray.toJSONString(Arrays.asList(new String[]{concept.toJSONString(), concept.toJSONString()}))); + JSONArray up = new JSONArray(); + up.add(concept); + up.add(concept); + j.put("up", up); + j.put("down", up); + String time = logMonitor(mon.stop()); + j.put("time", time); + PrintWriter pw = httpServletResponse.getWriter(); - log.debug("Request handled: " + logMonitor(mon.stop())); + log.debug("Request handled: " + time); pw.print(j.toJSONString()); pw.close(); return; Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-16 08:07:18 UTC (rev 2890) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-16 08:49:23 UTC (rev 2891) @@ -24,8 +24,8 @@ public static final Geizhals2OWL geizhals2OWL = new Geizhals2OWL(); public static Map<String, String> ramMap = new HashMap<String, String>(); - public static Map<String, String> hdMap = new HashMap<String, String>(); - public static Map<String, String> discMap = new HashMap<String, String>(); + public static Map<String, String> harddriveMap = new HashMap<String, String>(); + public static Map<String, String> optischesLaufwerkMap = new HashMap<String, String>(); public static final String prefix = "http://nke.aksw.org/geizhals/_"; //public static final String prefix = "http://geizhals.at/?cat=nb15w&xf="; @@ -43,25 +43,26 @@ ramMap.put("8192MB", "12_8192"); ramMap.put("unbekannt", "12_unbekannt"); - hdMap.put("32GB", "11_32"); - hdMap.put("80GB", "11_80"); - hdMap.put("120GB", "11_120"); - hdMap.put("128GB", "11_128"); - hdMap.put("160GB", "11_160"); - hdMap.put("250GB", "11_250"); - hdMap.put("256GB", "11_256"); - hdMap.put("320GB", "11_320"); - hdMap.put("500GB", "11_500"); - hdMap.put("640GB", "11_640"); - hdMap.put("1000GB", "11_1000"); - hdMap.put("sonstige", "11_sonstige"); - hdMap.put("unbekannt", "11_unbekannt"); + harddriveMap.put("32GB", "11_32"); + harddriveMap.put("80GB", "11_80"); + harddriveMap.put("120GB", "11_120"); + harddriveMap.put("128GB", "11_128"); + harddriveMap.put("160GB", "11_160"); + harddriveMap.put("250GB", "11_250"); + harddriveMap.put("256GB", "11_256"); + harddriveMap.put("320GB", "11_320"); + harddriveMap.put("500GB", "11_500"); + harddriveMap.put("640GB", "11_640"); + harddriveMap.put("1000GB", "11_1000"); + harddriveMap.put("sonstige", "11_sonstige"); + harddriveMap.put("unbekannt", "11_unbekannt"); - discMap.put("kein optisches Laufwerk", "84_ohne"); - discMap.put("DVD/CD-RW Combo", "84_DVD%2FCD-RW+Combo"); - discMap.put("DVD+/-RW DL", "84_DVD%2B%2F-RW"); - discMap.put("DVD+/-RW", "84_DVD%2B%2F-RW"); - discMap.put("Blu-ray (BD-ROM) und DVD+/-RW DL", "84_Blu-ray+(BD-ROM)"); + optischesLaufwerkMap.put("kein optisches Laufwerk", "84_ohne"); + optischesLaufwerkMap.put("DVD/CD-RW Combo", "84_DVD%2FCD-RW+Combo"); + optischesLaufwerkMap.put("DVD+/-RW DL", "84_DVD%2B%2F-RW"); + optischesLaufwerkMap.put("DVD /-RW DL", "84_DVD%2B%2F-RW"); + optischesLaufwerkMap.put("DVD+/-RW", "84_DVD%2B%2F-RW"); + optischesLaufwerkMap.put("Blu-ray (BD-ROM) und DVD+/-RW DL", "84_Blu-ray+(BD-ROM)"); //$subs[] = array("84_Blu-ray+(BD-R%2FRE)","84_Blu-ray+(BD-R%2FRE%2FRW)","84_Blu-ray+(BD-ROM)","84_DVD%2B%2F-RW","84_DVD-ROM","84_DVD%2FCD-RW+Combo","84_ohne","84_unbekannt",""); } @@ -96,12 +97,12 @@ classes.add(prefix + "82_HDD"); } hd = hd.substring(0, hd.indexOf("GB") + 2); - add(classes, hdMap, hd); + add(classes, harddriveMap, hd); } catch (Exception e) { log.warn("Handling hd failed: " + features[2].trim()); } String disc = features[3].trim(); - add(classes, discMap, disc); + add(classes, optischesLaufwerkMap, disc); //4 =Intel GMA X4500HD (IGP) max.384MB shared memory //5 =3x USB 2.0/FireWire/Modem/Gb LAN/WLAN 802.11agn/Bluetooth @@ -138,7 +139,7 @@ public static void add(List<String> classes, Map<String, String> map, String key) { String val = null; if ((val = map.get(key)) == null) { - log.warn("No value found for: " + key); + log.warn("No value found for: |" + key+"|"); return; } else { //log.info("Adding " + val); Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-16 08:07:18 UTC (rev 2890) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Learner.java 2011-06-16 08:49:23 UTC (rev 2891) @@ -33,6 +33,7 @@ public EvaluatedDescriptionPosNeg learn(Set<String> pos, Set<String> neg, OntModel model, int maxTime) throws IOException, ComponentInitException, LearningProblemUnsupportedException { ComponentManager cm = ComponentManager.getInstance(); + try { model.createIndividual("http://nke.aksw.org/", model.createClass(OWL.Ontology.getURI())); ModelUtils.write(model, new File("test.owl")); @@ -80,6 +81,7 @@ lp.init(); ELLearningAlgorithm la = cm.learningAlgorithm(ELLearningAlgorithm.class, lp, rc); + la.getConfigurator().setInstanceBasedDisjoints(false); // CELOE la = cm.learningAlgorithm(CELOE.class, lp, rc); la.init(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2011-06-17 16:23:59
|
Revision: 2905 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2905&view=rev Author: kurzum Date: 2011-06-17 16:23:50 +0000 (Fri, 17 Jun 2011) Log Message: ----------- geizhals fixes Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-06-17 15:57:04 UTC (rev 2904) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-06-17 16:23:50 UTC (rev 2905) @@ -2,7 +2,7 @@ * Copyright (C) 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 @@ -19,369 +19,307 @@ */ package org.dllearner.reasoning; -import java.io.File; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeMap; -import java.util.TreeSet; - +import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; 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.OWLAPIReasonerConfigurator; -import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.core.options.InvalidConfigOptionValueException; -import org.dllearner.core.options.StringConfigOption; -import org.dllearner.core.options.URLConfigOption; -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.core.options.*; +import org.dllearner.core.owl.*; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; -import org.dllearner.utilities.owl.ConceptComparator; -import org.dllearner.utilities.owl.DLLearnerDescriptionConvertVisitor; -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.dllearner.utilities.owl.*; import org.semanticweb.HermiT.Reasoner.ReasonerFactory; import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.AddAxiom; -import org.semanticweb.owlapi.model.IRI; -import org.semanticweb.owlapi.model.OWLAnnotation; -import org.semanticweb.owlapi.model.OWLAxiom; -import org.semanticweb.owlapi.model.OWLClass; -import org.semanticweb.owlapi.model.OWLClassExpression; -import org.semanticweb.owlapi.model.OWLDataFactory; -import org.semanticweb.owlapi.model.OWLDataProperty; -import org.semanticweb.owlapi.model.OWLDataRange; -import org.semanticweb.owlapi.model.OWLDatatype; -import org.semanticweb.owlapi.model.OWLEntity; -import org.semanticweb.owlapi.model.OWLIndividual; -import org.semanticweb.owlapi.model.OWLLiteral; -import org.semanticweb.owlapi.model.OWLNamedIndividual; -import org.semanticweb.owlapi.model.OWLNamedObject; -import org.semanticweb.owlapi.model.OWLObjectProperty; -import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; -import org.semanticweb.owlapi.model.OWLOntology; -import org.semanticweb.owlapi.model.OWLOntologyChangeException; -import org.semanticweb.owlapi.model.OWLOntologyCreationException; -import org.semanticweb.owlapi.model.OWLOntologyFormat; -import org.semanticweb.owlapi.model.OWLOntologyManager; -import org.semanticweb.owlapi.model.OWLOntologyStorageException; -import org.semanticweb.owlapi.model.RemoveAxiom; -import org.semanticweb.owlapi.model.UnknownOWLOntologyException; +import org.semanticweb.owlapi.model.*; import org.semanticweb.owlapi.owllink.OWLlinkHTTPXMLReasonerFactory; import org.semanticweb.owlapi.owllink.OWLlinkReasonerConfiguration; -import org.semanticweb.owlapi.reasoner.FreshEntityPolicy; -import org.semanticweb.owlapi.reasoner.IndividualNodeSetPolicy; -import org.semanticweb.owlapi.reasoner.InferenceType; -import org.semanticweb.owlapi.reasoner.Node; -import org.semanticweb.owlapi.reasoner.NodeSet; -import org.semanticweb.owlapi.reasoner.NullReasonerProgressMonitor; -import org.semanticweb.owlapi.reasoner.OWLReasoner; -import org.semanticweb.owlapi.reasoner.OWLReasonerConfiguration; -import org.semanticweb.owlapi.reasoner.ReasonerProgressMonitor; -import org.semanticweb.owlapi.reasoner.SimpleConfiguration; +import org.semanticweb.owlapi.reasoner.*; import org.semanticweb.owlapi.util.SimpleIRIMapper; import org.semanticweb.owlapi.vocab.PrefixOWLOntologyFormat; - import uk.ac.manchester.cs.factplusplus.owlapiv3.FaCTPlusPlusReasonerFactory; -import com.clarkparsia.pellet.owlapiv3.PelletReasonerFactory; +import java.io.File; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; +import java.util.Map.Entry; /** - * Mapping to OWL API reasoner interface. The OWL API currently + * Mapping to OWL API reasoner interface. The OWL API currently * supports three reasoners: FaCT++, HermiT and Pellet. FaCT++ is connected * using JNI and native libraries, while HermiT and Pellet are pure Java * libraries. - * - * @author Jens Lehmann * + * @author Jens Lehmann */ public class OWLAPIReasoner extends ReasonerComponent { // private static Logger logger = Logger // .getLogger(OWLAPIReasoner.class); - - //private String reasonerType = "pellet"; - private OWLAPIReasonerConfigurator configurator; - @Override - public OWLAPIReasonerConfigurator getConfigurator(){ - return configurator; - } - - private OWLReasoner reasoner; - private OWLOntologyManager manager; - private OWLOntology ontology; - // the data factory is used to generate OWL API objects - private OWLDataFactory factory; - // static factory + //private String reasonerType = "pellet"; + private OWLAPIReasonerConfigurator configurator; + + @Override + public OWLAPIReasonerConfigurator getConfigurator() { + return configurator; + } + + private OWLReasoner reasoner; + private OWLOntologyManager manager; + + private OWLOntology ontology; + // the data factory is used to generate OWL API objects + private OWLDataFactory factory; + // static factory // private static OWLDataFactory staticFactory = OWLManager.createOWLOntologyManager().getOWLDataFactory(); - - private ConceptComparator conceptComparator = new ConceptComparator(); - private RoleComparator roleComparator = new RoleComparator(); + + private ConceptComparator conceptComparator = new ConceptComparator(); + private RoleComparator roleComparator = new RoleComparator(); // private ClassHierarchy subsumptionHierarchy; // private ObjectPropertyHierarchy roleHierarchy; // private DatatypePropertyHierarchy datatypePropertyHierarchy; // private Set<Description> allowedConceptsInSubsumptionHierarchy; - - // primitives - 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<DatatypeProperty> stringDatatypeProperties = 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 OWLAPIReasoner(Set<KnowledgeSource> sources) { - super(sources); - this.configurator = new OWLAPIReasonerConfigurator(this); - } - - public static String getName() { - return "OWL API reasoner"; - } - - - public static Collection<ConfigOption<?>> createConfigOptions() { - Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - StringConfigOption type = new StringConfigOption("reasonerType", "FaCT++, HermiT, OWLlink or Pellet, which means \"fact\", \"hermit\", \"owllink\" or \"pellet\"", "pellet", false, true); - type.setAllowedValues(new String[] {"fact", "hermit", "owllink", "pellet" }); - - // closure option? see: - // http://owlapi.svn.sourceforge.net/viewvc/owlapi/owl1_1/trunk/tutorial/src/main/java/uk/ac/manchester/owl/tutorial/examples/ClosureAxiomsExample.java?view=markup - options.add(type); - try { - URLConfigOption owlLinkURL = new URLConfigOption("owlLinkURL", "the URL to the remote OWLlink server", new URL("http://localhost:8080/"), false, true); - options.add(owlLinkURL); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - return options; - } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#applyConfigEntry(org.dllearner.core.config.ConfigEntry) - */ - @Override - public <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { - - } - - @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>(); - stringDatatypeProperties = new TreeSet<DatatypeProperty>(); - individuals = new TreeSet<Individual>(); - - // create OWL API ontology manager - manager = OWLManager.createOWLOntologyManager(); - - // it is a bit cumbersome to obtain all classes, because there - // are no reasoner queries to obtain them => hence we query them - // for each ontology and add them to a set; a comparator avoids - // duplicates by checking URIs - Comparator<OWLNamedObject> namedObjectComparator = new Comparator<OWLNamedObject>() { - public int compare(OWLNamedObject o1, OWLNamedObject o2) { - return o1.getIRI().compareTo(o2.getIRI()); - } - }; - Set<OWLClass> classes = new TreeSet<OWLClass>(namedObjectComparator); - Set<OWLObjectProperty> owlObjectProperties = new TreeSet<OWLObjectProperty>(namedObjectComparator); - Set<OWLDataProperty> owlDatatypeProperties = new TreeSet<OWLDataProperty>(namedObjectComparator); - Set<OWLNamedIndividual> owlIndividuals = new TreeSet<OWLNamedIndividual>(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(); + // primitives + 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<DatatypeProperty> stringDatatypeProperties = 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 OWLAPIReasoner(Set<KnowledgeSource> sources) { + super(sources); + this.configurator = new OWLAPIReasonerConfigurator(this); + } + + public static String getName() { + return "OWL API reasoner"; + } + + + public static Collection<ConfigOption<?>> createConfigOptions() { + Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); + StringConfigOption type = new StringConfigOption("reasonerType", "FaCT++, HermiT, OWLlink or Pellet, which means \"fact\", \"hermit\", \"owllink\" or \"pellet\"", "pellet", false, true); + type.setAllowedValues(new String[]{"fact", "hermit", "owllink", "pellet"}); + + // closure option? see: + // http://owlapi.svn.sourceforge.net/viewvc/owlapi/owl1_1/trunk/tutorial/src/main/java/uk/ac/manchester/owl/tutorial/examples/ClosureAxiomsExample.java?view=markup + options.add(type); + try { + URLConfigOption owlLinkURL = new URLConfigOption("owlLinkURL", "the URL to the remote OWLlink server", new URL("http://localhost:8080/"), false, true); + options.add(owlLinkURL); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + return options; + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#applyConfigEntry(org.dllearner.core.config.ConfigEntry) + */ + @Override + public <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { + + } + + @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>(); + stringDatatypeProperties = new TreeSet<DatatypeProperty>(); + individuals = new TreeSet<Individual>(); + + // create OWL API ontology manager + manager = OWLManager.createOWLOntologyManager(); + + // it is a bit cumbersome to obtain all classes, because there + // are no reasoner queries to obtain them => hence we query them + // for each ontology and add them to a set; a comparator avoids + // duplicates by checking URIs + Comparator<OWLNamedObject> namedObjectComparator = new Comparator<OWLNamedObject>() { + public int compare(OWLNamedObject o1, OWLNamedObject o2) { + return o1.getIRI().compareTo(o2.getIRI()); + } + }; + Set<OWLClass> classes = new TreeSet<OWLClass>(namedObjectComparator); + Set<OWLObjectProperty> owlObjectProperties = new TreeSet<OWLObjectProperty>(namedObjectComparator); + Set<OWLDataProperty> owlDatatypeProperties = new TreeSet<OWLDataProperty>(namedObjectComparator); + Set<OWLNamedIndividual> owlIndividuals = new TreeSet<OWLNamedIndividual>(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(); manager = ontology.getOWLOntologyManager(); - } else if (source instanceof SparqlKnowledgeSource) { - ontology = ((SparqlKnowledgeSource)source).getOWLAPIOntology(); - manager = ontology.getOWLOntologyManager(); - } else { - ontology = manager.loadOntologyFromOntologyDocument(IRI.create(url.toURI())); - } - - owlAPIOntologies.add(ontology); - // imports includes the ontology itself - Set<OWLOntology> imports = manager.getImportsClosure(ontology); - allImports.addAll(imports); + } else if (source instanceof SparqlKnowledgeSource) { + ontology = ((SparqlKnowledgeSource) source).getOWLAPIOntology(); + manager = ontology.getOWLOntologyManager(); + } else { + ontology = manager.loadOntologyFromOntologyDocument(IRI.create(url.toURI())); + } + + owlAPIOntologies.add(ontology); + try { + // imports includes the ontology itself + //FIXME this line throws the strange error + Set<OWLOntology> imports = manager.getImportsClosure(ontology); + allImports.addAll(imports); + // System.out.println(imports); - for(OWLOntology ont : imports) { - classes.addAll(ont.getClassesInSignature()); - owlObjectProperties.addAll(ont.getObjectPropertiesInSignature()); - owlDatatypeProperties.addAll(ont.getDataPropertiesInSignature()); - owlIndividuals.addAll(ont.getIndividualsInSignature()); - } - - // 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 PrefixOWLOntologyFormat) { - prefixes.putAll(((PrefixOWLOntologyFormat)format).getPrefixName2PrefixMap()); - baseURI = ((PrefixOWLOntologyFormat) format).getDefaultPrefix(); - prefixes.remove(""); - } - - } 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(); + for (OWLOntology ont : imports) { + classes.addAll(ont.getClassesInSignature()); + owlObjectProperties.addAll(ont.getObjectPropertiesInSignature()); + owlDatatypeProperties.addAll(ont.getDataPropertiesInSignature()); + owlIndividuals.addAll(ont.getIndividualsInSignature()); + } + + } catch (UnknownOWLOntologyException uooe) { + logger.error("UnknownOWLOntologyException occured, imports were not loaded! This is a bug, which has not been fixed yet."); + } + + // 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 PrefixOWLOntologyFormat) { + prefixes.putAll(((PrefixOWLOntologyFormat) format).getPrefixName2PrefixMap()); + baseURI = ((PrefixOWLOntologyFormat) format).getDefaultPrefix(); + prefixes.remove(""); + } + + } 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)); - - IRI ontologyURI = IRI.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 - } - } - try { - ontology = manager.createOntology(IRI.create("http://dl-learner/all"), new HashSet<OWLOntology>(owlAPIOntologies)); - } catch (OWLOntologyCreationException e1) { - e1.printStackTrace(); - } - - //configure reasoner - ReasonerProgressMonitor progressMonitor = new NullReasonerProgressMonitor(); - FreshEntityPolicy freshEntityPolicy = FreshEntityPolicy.ALLOW; - long timeOut = Integer.MAX_VALUE; - IndividualNodeSetPolicy individualNodeSetPolicy = IndividualNodeSetPolicy.BY_NAME; - OWLReasonerConfiguration conf = new SimpleConfiguration(progressMonitor, freshEntityPolicy, timeOut, individualNodeSetPolicy); - - // create actual reasoner - if(configurator.getReasonerType().equals("fact")) { - try { - reasoner = new FaCTPlusPlusReasonerFactory().createNonBufferingReasoner(ontology, conf); - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println("Using FaCT++."); - } else if(configurator.getReasonerType().equals("hermit")){ - // instantiate HermiT reasoner - reasoner = new ReasonerFactory().createNonBufferingReasoner(ontology, conf); - } else if(configurator.getReasonerType().equals("pellet")){ - // instantiate Pellet reasoner - reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology, conf); - - // 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); - } else { - try { - OWLlinkHTTPXMLReasonerFactory factory = new OWLlinkHTTPXMLReasonerFactory(); - URL url = getConfigurator().getOwlLinkURL();//Configure the server end-point - OWLlinkReasonerConfiguration config = new OWLlinkReasonerConfiguration(url); - reasoner = factory.createNonBufferingReasoner(ontology, config); - System.out.println(reasoner.getReasonerName()); - } catch (Exception e) { -// e.printStackTrace(); - throw new ComponentInitException(e); - } - } - /* - Set<OWLOntology> importsClosure = manager.getImportsClosure(ontology); - System.out.println("imports closure : " + importsClosure); + IRI ontologyURI = IRI.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 + } + } try { - reasoner.loadOntologies(importsClosure); - } catch (OWLReasonerException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - }*/ - + ontology = manager.createOntology(IRI.create("http://dl-learner/all"), new HashSet<OWLOntology>(owlAPIOntologies)); + } catch (OWLOntologyCreationException e1) { + e1.printStackTrace(); + } + + //configure reasoner + ReasonerProgressMonitor progressMonitor = new NullReasonerProgressMonitor(); + FreshEntityPolicy freshEntityPolicy = FreshEntityPolicy.ALLOW; + long timeOut = Integer.MAX_VALUE; + IndividualNodeSetPolicy individualNodeSetPolicy = IndividualNodeSetPolicy.BY_NAME; + OWLReasonerConfiguration conf = new SimpleConfiguration(progressMonitor, freshEntityPolicy, timeOut, individualNodeSetPolicy); + + // create actual reasoner + if (configurator.getReasonerType().equals("fact")) { + try { + reasoner = new FaCTPlusPlusReasonerFactory().createNonBufferingReasoner(ontology, conf); + } catch (Exception e) { + e.printStackTrace(); + } + System.out.println("Using FaCT++."); + } else if (configurator.getReasonerType().equals("hermit")) { + // instantiate HermiT reasoner + reasoner = new ReasonerFactory().createNonBufferingReasoner(ontology, conf); + } else if (configurator.getReasonerType().equals("pellet")) { + // instantiate Pellet reasoner + reasoner = PelletReasonerFactory.getInstance().createNonBufferingReasoner(ontology, conf); + + // 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); + } else { + try { + OWLlinkHTTPXMLReasonerFactory factory = new OWLlinkHTTPXMLReasonerFactory(); + URL url = getConfigurator().getOwlLinkURL();//Configure the server end-point + OWLlinkReasonerConfiguration config = new OWLlinkReasonerConfiguration(url); + reasoner = factory.createNonBufferingReasoner(ontology, config); + System.out.println(reasoner.getReasonerName()); + } catch (Exception e) { +// e.printStackTrace(); + throw new ComponentInitException(e); + } + } + + /* + Set<OWLOntology> importsClosure = manager.getImportsClosure(ontology); + System.out.println("imports closure : " + importsClosure); + try { + reasoner.loadOntologies(importsClosure); + } catch (OWLReasonerException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + }*/ + // System.out.println(classes); // System.out.println(properties); // System.out.println(individuals); - - // compute class hierarchy and types of individuals - // (done here to speed up later reasoner calls) - boolean inconsistentOntology = !reasoner.isConsistent(); - - if(!inconsistentOntology) { - reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY, InferenceType.CLASS_ASSERTIONS); - } else { - throw new ComponentInitException("Inconsistent ontologies."); - } - - factory = manager.getOWLDataFactory(); - + + // compute class hierarchy and types of individuals + // (done here to speed up later reasoner calls) + boolean inconsistentOntology = !reasoner.isConsistent(); + + if (!inconsistentOntology) { + reasoner.precomputeInferences(InferenceType.CLASS_HIERARCHY, InferenceType.CLASS_ASSERTIONS); + } else { + throw new ComponentInitException("Inconsistent ontologies."); + } + + factory = manager.getOWLDataFactory(); + // try { // if(reasoner.isDefined(factory.getOWLIndividual(URI.create("http://example.com/father#female")))) // System.out.println("DEFINED."); @@ -391,83 +329,79 @@ // // TODO Auto-generated catch block // e.printStackTrace(); // } - - // read in primitives - for(OWLClass owlClass : classes) - atomicConcepts.add(new NamedClass(owlClass.toStringID())); - for(OWLObjectProperty owlProperty : owlObjectProperties) - atomicRoles.add(new ObjectProperty(owlProperty.toStringID())); - for(OWLDataProperty owlProperty : owlDatatypeProperties) { - DatatypeProperty dtp = new DatatypeProperty(owlProperty.toStringID()); - 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).getIRI().toURI(); - 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); - else if(uri.equals(Datatype.STRING.getURI())) - stringDatatypeProperties.add(dtp); - } - } else { - stringDatatypeProperties.add(dtp); - } - datatypeProperties.add(dtp); - } - for(OWLNamedIndividual owlIndividual : owlIndividuals) { - individuals.add(new Individual(owlIndividual.toStringID())); - } - - // remove top and bottom properties (for backwards compatibility) + + // read in primitives + for (OWLClass owlClass : classes) + atomicConcepts.add(new NamedClass(owlClass.toStringID())); + for (OWLObjectProperty owlProperty : owlObjectProperties) + atomicRoles.add(new ObjectProperty(owlProperty.toStringID())); + for (OWLDataProperty owlProperty : owlDatatypeProperties) { + DatatypeProperty dtp = new DatatypeProperty(owlProperty.toStringID()); + 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).getIRI().toURI(); + 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); + else if (uri.equals(Datatype.STRING.getURI())) stringDatatypeProperties.add(dtp); + } + } else { + stringDatatypeProperties.add(dtp); + } + datatypeProperties.add(dtp); + } + for (OWLNamedIndividual owlIndividual : owlIndividuals) { + individuals.add(new Individual(owlIndividual.toStringID())); + } + + // remove top and bottom properties (for backwards compatibility) // atomicRoles.remove(new ObjectProperty("http://www.w3.org/2002/07/owl#bottomObjectProperty")); // atomicRoles.remove(new ObjectProperty("http://www.w3.org/2002/07/owl#topObjectProperty")); - } + } - /* (non-Javadoc) - * @see org.dllearner.core.Reasoner#getAtomicConcepts() - */ - public Set<NamedClass> getNamedClasses() { - return Collections.unmodifiableSet(atomicConcepts); - } + /* (non-Javadoc) + * @see org.dllearner.core.Reasoner#getAtomicConcepts() + */ + public Set<NamedClass> getNamedClasses() { + return Collections.unmodifiableSet(atomicConcepts); + } - /* (non-Javadoc) - * @see org.dllearner.core.Reasoner#getAtomicRoles() - */ - public Set<ObjectProperty> getObjectProperties() { - return Collections.unmodifiableSet(atomicRoles); - } + /* (non-Javadoc) + * @see org.dllearner.core.Reasoner#getAtomicRoles() + */ + public Set<ObjectProperty> getObjectProperties() { + return Collections.unmodifiableSet(atomicRoles); + } - @Override - public SortedSet<DatatypeProperty> getDatatypePropertiesImpl() { - return datatypeProperties; - } - - /* (non-Javadoc) - * @see org.dllearner.core.Reasoner#getIndividuals() - */ - public SortedSet<Individual> getIndividuals() { - return individuals; - } + @Override + public SortedSet<DatatypeProperty> getDatatypePropertiesImpl() { + return datatypeProperties; + } - /* (non-Javadoc) - * @see org.dllearner.core.Reasoner#getReasonerType() - */ - @Override - public ReasonerType getReasonerType() { - if(configurator.getReasonerType().equals("fact")){ - return ReasonerType.OWLAPI_FACT; - } else if(configurator.getReasonerType().equals("hermit")){ - return ReasonerType.OWLAPI_HERMIT; - } else{ - return ReasonerType.OWLAPI_PELLET; - } - } + /* (non-Javadoc) + * @see org.dllearner.core.Reasoner#getIndividuals() + */ + public SortedSet<Individual> getIndividuals() { + return individuals; + } + /* (non-Javadoc) + * @see org.dllearner.core.Reasoner#getReasonerType() + */ + @Override + public ReasonerType getReasonerType() { + if (configurator.getReasonerType().equals("fact")) { + return ReasonerType.OWLAPI_FACT; + } else if (configurator.getReasonerType().equals("hermit")) { + return ReasonerType.OWLAPI_HERMIT; + } else { + return ReasonerType.OWLAPI_PELLET; + } + } + // @Override // public ObjectPropertyHierarchy prepareRoleHierarchy() { // // code copied from DIG reasoner @@ -487,10 +421,10 @@ // roleHierarchyDown); // return roleHierarchy; // } - - /* (non-Javadoc) - * @see org.dllearner.core.Reasoner#prepareRoleHierarchy(java.util.Set) - */ + + /* (non-Javadoc) + * @see org.dllearner.core.Reasoner#prepareRoleHierarchy(java.util.Set) + */ // public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) { // // code copied from DIG reasoner // @@ -508,12 +442,12 @@ // roleHierarchy = new ObjectPropertyHierarchy(allowedRoles, roleHierarchyUp, // roleHierarchyDown); // } - + // @Override // public ObjectPropertyHierarchy getRoleHierarchy() { // return roleHierarchy; // } - + // public void prepareDatatypePropertyHierarchyImpl(Set<DatatypeProperty> allowedRoles) { // // code copied from DIG reasoner // @@ -531,583 +465,569 @@ // datatypePropertyHierarchy = new DatatypePropertyHierarchy(allowedRoles, datatypePropertyHierarchyUp, // datatypePropertyHierarchyDown); // } - + // @Override // public DatatypePropertyHierarchy getDatatypePropertyHierarchy() { // return datatypePropertyHierarchy; // } - - @Override - public boolean isSuperClassOfImpl(Description superConcept, Description subConcept) { - return reasoner.isEntailed(factory.getOWLSubClassOfAxiom(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(subConcept), - OWLAPIDescriptionConvertVisitor.getOWLClassExpression(superConcept))); - } - - @Override - protected boolean isEquivalentClassImpl(Description class1, Description class2) { - return reasoner.isEntailed(factory.getOWLEquivalentClassesAxiom(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(class1), - OWLAPIDescriptionConvertVisitor.getOWLClassExpression(class2))); - } - @Override - protected TreeSet<Description> getSuperClassesImpl(Description concept) { - NodeSet<OWLClass> classes = null; - - classes = reasoner.getSuperClasses(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept), true); - - return getFirstClasses(classes); - } - - @Override - protected TreeSet<Description> getSubClassesImpl(Description concept) { - NodeSet<OWLClass> classes = null; - - classes = reasoner.getSubClasses(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept), true); - - return getFirstClasses(classes); - } - - @Override - protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectPropertyExpression> properties = null; - - properties = reasoner.getSuperObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); - - return getFirstObjectProperties(properties); - } - - @Override - protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { - NodeSet<OWLObjectPropertyExpression> properties = null; - - properties = reasoner.getSubObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); - - return getFirstObjectProperties(properties); - } - - @Override - protected TreeSet<DatatypeProperty> getSuperPropertiesImpl(DatatypeProperty role) { - NodeSet<OWLDataProperty> properties = null; - - properties = reasoner.getSuperDataProperties(OWLAPIConverter.getOWLAPIDataProperty(role), true); - - return getFirstDatatypeProperties(properties); - } - - @Override - protected TreeSet<DatatypeProperty> getSubPropertiesImpl(DatatypeProperty role) { - NodeSet<OWLDataProperty> properties = null; - - properties = reasoner.getSubDataProperties(OWLAPIConverter.getOWLAPIDataProperty(role), true); - - return getFirstDatatypeProperties(properties); - } - - @Override - public boolean hasTypeImpl(Description concept, Individual individual) { - OWLClassExpression d = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept); - OWLIndividual i = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - return reasoner.isEntailed(factory.getOWLClassAssertionAxiom(d, i)); - } - - @Override - public SortedSet<Individual> getIndividualsImpl(Description concept) { + @Override + public boolean isSuperClassOfImpl(Description superConcept, Description subConcept) { + return reasoner.isEntailed(factory.getOWLSubClassOfAxiom(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(subConcept), OWLAPIDescriptionConvertVisitor.getOWLClassExpression(superConcept))); + } + + @Override + protected boolean isEquivalentClassImpl(Description class1, Description class2) { + return reasoner.isEntailed(factory.getOWLEquivalentClassesAxiom(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(class1), OWLAPIDescriptionConvertVisitor.getOWLClassExpression(class2))); + } + + @Override + protected TreeSet<Description> getSuperClassesImpl(Description concept) { + NodeSet<OWLClass> classes = null; + + classes = reasoner.getSuperClasses(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept), true); + + return getFirstClasses(classes); + } + + @Override + protected TreeSet<Description> getSubClassesImpl(Description concept) { + NodeSet<OWLClass> classes = null; + + classes = reasoner.getSubClasses(OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept), true); + + return getFirstClasses(classes); + } + + @Override + protected TreeSet<ObjectProperty> getSuperPropertiesImpl(ObjectProperty role) { + NodeSet<OWLObjectPropertyExpression> properties = null; + + properties = reasoner.getSuperObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); + + return getFirstObjectProperties(properties); + } + + @Override + protected TreeSet<ObjectProperty> getSubPropertiesImpl(ObjectProperty role) { + NodeSet<OWLObjectPropertyExpression> properties = null; + + properties = reasoner.getSubObjectProperties(OWLAPIConverter.getOWLAPIObjectProperty(role), true); + + return getFirstObjectProperties(properties); + } + + @Override + protected TreeSet<DatatypeProperty> getSuperPropertiesImpl(DatatypeProperty role) { + NodeSet<OWLDataProperty> properties = null; + + properties = reasoner.getSuperDataProperties(OWLAPIConverter.getOWLAPIDataProperty(role), true); + + return getFirstDatatypeProperties(properties); + } + + @Override + protected TreeSet<DatatypeProperty> getSubPropertiesImpl(DatatypeProperty role) { + NodeSet<OWLDataProperty> properties = null; + + properties = reasoner.getSubDataProperties(OWLAPIConverter.getOWLAPIDataProperty(role), true); + + return getFirstDatatypeProperties(properties); + } + + @Override + public boolean hasTypeImpl(Description concept, Individual individual) { + OWLClassExpression d = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept); + OWLIndividual i = factory.getOWLNamedIndividual(IRI.create(individual.getName())); + return reasoner.isEntailed(factory.getOWLClassAssertionAxiom(d, i)); + } + + @Override + public SortedSet<Individual> getIndividualsImpl(Description concept) { // OWLDescription d = getOWLAPIDescription(concept); - OWLClassExpression d = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept); - Set<OWLNamedIndividual> individuals = reasoner.getInstances(d, false).getFlattened(); - SortedSet<Individual> inds = new TreeSet<Individual>(); - for(OWLNamedIndividual ind : individuals) - //ugly code - if(ind != null) - inds.add(new Individual(ind.toStringID())); - return inds; - } - - @Override - public Set<NamedClass> getTypesImpl(Individual individual) { - Set<Node<OWLClass>> result = null; - - result = reasoner.getTypes(factory.getOWLNamedIndividual(IRI.create(individual.getName())),false).getNodes(); - - 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 nodes of named classes, which are more - // general than the actual domain/range - NodeSet<OWLClass> set = reasoner.getObjectPropertyDomains(prop, false); - return getDescriptionFromReturnedDomain(set); - - } - - @Override - public Description getDomainImpl(DatatypeProperty datatypeProperty) { - OWLDataProperty prop = OWLAPIConverter - .getOWLAPIDataProperty(datatypeProperty); + OWLClassExpression d = OWLAPIDescriptionConvertVisitor.getOWLClassExpression(concept); + Set<OWLNamedIndividual> individuals = reasoner.getInstances(d, false).getFlattened(); + SortedSet<Individual> inds = new TreeSet<Individual>(); + for (OWLNamedIndividual ind : individuals) + //ugly code + if (ind != null) inds.add(new Individual(ind.toStringID())); + return inds; + } - NodeSet<OWLClass> set = reasoner.getDataPropertyDomains(prop, true); - return getDescriptionFromReturnedDomain(set); + @Override + public Set<NamedClass> getTypesImpl(Individual individual) { + Set<Node<OWLClass>> result = null; - } - - @Override - public Description getRangeImpl(ObjectProperty objectProperty) { - OWLObjectProperty prop = OWLAPIConverter - .getOWLAPIObjectProperty(objectProperty); + result = reasoner.getTypes(factory.getOWLNamedIndividual(IRI.create(individual.getName())), false).getNodes(); - NodeSet<OWLClass> set = reasoner.getObjectPropertyRanges(prop, true); - if (set.isEmpty()) - return new Thing(); - OWLClass oc = set.iterator().next().getRepresentativeElement(); - if(oc.isOWLThing()){ - return Thing.instance; - } - return new NamedClass(oc.toStringID()); + return getFirstClassesNoTopBottom(result); + } - } - - private Description getDescriptionFromReturnedDomain(NodeSet<OWLClass> set) { - if(set.isEmpty()) - return new Thing(); - - Set<OWLClassExpression> union = new HashSet<OWLClassExpression>(); - Set<OWLClassExpression> domains = new HashSet<OWLClassExpression>(); - - for(Node<OWLClass> descs : set){ - for(OWLClassExpression desc : descs){ - union.add(desc); - } - } - for(OWLClassExpression 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(); - if(oc.isOWLThing()) { - return new Thing(); - } else { - return new NamedClass(oc.toStringID()); - } - } - - @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) { - OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(i.getName())); - - // get all related individuals via OWL API - Set<OWLNamedIndividual> inds = reasoner.getObjectPropertyValues(ind, prop).getFlattened(); - - - // convert data back to DL-Learner structures - SortedSet<Individual> is = new TreeSet<Individual>(); - for(OWLNamedIndividual oi : inds) - is.add(new Individual(oi.toStringID())); - map.put(i, is); - } - return map; - } - - @Override - protected Map<ObjectProperty,Set<Individual>> getObjectPropertyRelationshipsImpl(Individual individual) { - OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - Map<OWLObjectPropertyExpression, Set<OWLNamedIndividual>> mapAPI = new HashMap<OWLObjectPropertyExpression, Set<OWLNamedIndividual>>(); - + @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 nodes of named classes, which are more + // general than the actual domain/range + NodeSet<OWLClass> set = reasoner.getObjectPropertyDomains(prop, false); + return getDescriptionFromReturnedDomain(set); + + } + + @Override + public Description getDomainImpl(DatatypeProperty datatypeProperty) { + OWLDataProperty prop = OWLAPIConverter.getOWLAPIDataProperty(datatypeProperty); + + NodeSet<OWLClass> set = reasoner.getDataPropertyDomains(prop, true); + return getDescriptionFromReturnedDomain(set); + + } + + @Override + public Description getRangeImpl(ObjectProperty objectProperty) { + OWLObjectProperty prop = OWLAPIConverter.getOWLAPIObjectProperty(objectProperty); + + NodeSet<OWLClass> set = reasoner.getObjectPropertyRanges(prop, true); + if (set.isEmpty()) return new Thing(); + OWLClass oc = set.iterator().next().getRepresentativeElement(); + if (oc.isOWLThing()) { + return Thing.instance; + } + return new NamedClass(oc.toStringID()); + + } + + private Description getDescriptionFromReturnedDomain(NodeSet<OWLClass> set) { + if (set.isEmpty()) return new Thing(); + + Set<OWLClassExpression> union = new HashSet<OWLClassExpression>(); + Set<OWLClassExpression> domains = new HashSet<OWLClassExpression>(); + + for (Node<OWLClass> descs : set) { + for (OWLClassExpression desc : descs) { + union.add(desc); + } + } + for (OWLClassExpression 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(); + if (oc.isOWLThing()) { + return new Thing(); + } else { + return new NamedClass(oc.toStringID()); + } + } + + @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) { + OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(i.getName())); + + // get all related individuals via OWL API + Set<OWLNamedIndividual> inds = reasoner.getObjectPropertyValues(ind, prop).getFlattened(); + + // convert data back to DL-Learner structures + SortedSet<Individual> is = new TreeSet<Individual>(); + for (OWLNamedIndividual oi : inds) + is.add(new Individual(oi.toStringID())); + map.put(i, is); + } + return map; + } + + @Override + protected Map<ObjectProperty, Set<Individual>> getObjectPropertyRelationshipsImpl(Individual individual) { + OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(individual.getName())); + Map<OWLObjectPropertyExpression, Set<OWLNamedIndividual>> mapAPI = new HashMap<OWLObjectPropertyExpression, Set<OWLNamedIndividual>>(); + // Map<OWLObjectPropertyExpression, Set<OWLIndividual>> mapAPI = ind.getObjectPropertyValues(ontology); - //no method found in the new reasoner interface, so we have to ask the reasoner for each property in the ontology - for(OWLObjectProperty prop : ontology.getObjectPropertiesInSignature(true)){ - mapAPI.put(prop, reasoner.getObjectPropertyValues(ind, prop).getFlattened()); - } - - Map<ObjectProperty,Set<Individual>> map = new TreeMap<ObjectProperty, Set<Individual>>(); - for(Entry<OWLObjectPropertyExpression,Set<OWLNamedIndividual>> entry : mapAPI.entrySet()) { - ObjectProperty prop = OWLAPIConverter.convertObjectProperty(entry.getKey().asOWLObjectProperty()); - Set<Individual> inds = OWLAPIConverter.convertIndividuals(entry.getValue()); - map.put(prop, inds); - } - return map; - } - - @Override - public Set<Individual> getRelatedIndividualsImpl(Individual individual, ObjectProperty objectProperty) { - OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - OWLObjectProperty prop = OWLAPIConverter.getOWLAPIObjectProperty(objectProperty); - Set<OWLNamedIndividual> inds = null; - - inds = reasoner.getObjectPropertyValues(ind, prop).getFlattened(); - - // convert data back to DL-Learner structures - SortedSet<Individual> is = new TreeSet<Individual>(); - for(OWLNamedIndividual oi : inds) { - is.add(new Individual(oi.toStringID())); - } - return is; - } - - @Override - public Set<Constant> getRelatedValuesImpl(Individual individual, DatatypeProperty datatypeProperty) { - OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(individual.getName())); - OWLDataProperty prop = OWLAPIConverter.getOWLAPIDataProperty(datatypeProperty); - Set<OWLLiteral> constants = null; - - constants = reasoner.getDataPropertyValues(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) { - OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI - .create(i.getName())); + //no method found in the new reasoner interface, so we have to ask the reasoner for each property in the ontology + for (OWLObjectProperty prop : ontology.getObjectPropertiesInSignature(true)) { + mapAPI.put(prop, reasoner.getObjectPropertyValues(ind, prop).getFlattened()); + } - // get all related individuals via OWL API - Set<OWLLiteral> inds = null; + Map<ObjectProperty, Set<Individual>> map = new TreeMap<ObjectProperty, Set<Individual>>(); + for (Entry<OWLObjectPropertyExpression, Set<OWLNamedIndividual>> entry : mapAPI.entrySet()) { + ObjectProperty prop = OWLAPIConverter.convertObjectProperty(entry.getKey().asOWLObjectProperty()); + Set<Individual> inds = OWLAPIConverter.convertIndividuals(entry.getValue()); + map.put(prop, inds); + } + return map; + } - inds = reasoner.getDataPropertyValues(ind, prop); + @Override + public Set<Individual> getRelatedIndividualsImpl(Individual individual, ObjectProperty objectProperty) { + OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(individual.getName())); + OWLObjectProperty prop = OWLAPIConverter.getOWLAPIObjectProperty(objectProperty); + Set<OWLNamedIndividual> inds = null; - // convert data back to DL-Learner structures - SortedSet<Double> is = new TreeSet<Double>(); - for (OWLLiteral 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) { - OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(i.getName())); - - // get all related values via OWL API - Set<OWLLiteral> constants = null; - - constants = reasoner.getDataPropertyValues(ind, prop); - - - // convert data back to DL-Learner structures - SortedSet<Constant> is = new TreeSet<Constant>(); - for(OWLLiteral literal : constants) { - // for typed constants we have to figure out the correct - // data type and value - if(!literal.isRDFPlainLiteral()) { - Datatype dt = OWLAPIConverter.convertDatatype(literal.getDatatype()); - is.add(new TypedConstant(literal.getLiteral(), dt)); - // for untyped constants we have to figure out the value - // and language tag (if any) - } else { - if(literal.hasLang()) - is.add(new UntypedConstant(literal.getLiteral(), literal.getLang())); - else - is.add(new UntypedConstant(literal.getLiteral())); - } - } - // only add individuals using the datatype property - if(is.size()>0) - map.put(i, is); - } - return map; - } - - // OWL API returns a set of nodes of classes, where each node - // consists of equivalent classes; this method picks one class - // from each node to flatten the set of nodes - private TreeSet<Description> getFirstClasses(NodeSet<OWLClass> nodeSet) { - TreeSet<Description> concepts = new TreeSet<Description>(conceptComparator); - for(Node<OWLClass> node : nodeSet) { - // take one element from the set and ignore the rest - // (TODO: we need to make sure we always ignore the same concepts) - OWLClass concept = node.getRepresentativeElement(); - if(concept.isOWLThing()) { - concepts.add(new Thing()); - } else if(concept.isOWLNothing()) { - concepts.add(new Nothing()); - } else { - concepts.add(new NamedClass(concept.toStringID())); - } - } - return concepts; - } - - private Set<NamedClass> getFirstClassesNoTopBottom(Set<Node<OWLClass>> nodeSet) { - Set<NamedClass> concepts = new HashSet<NamedClass>(); - for(Node<OWLClass> node : nodeSet) { - // take one element from the set and ignore the rest - // (TODO: we need to make sure we always ignore the same concepts) - OWLClass concept = node.getRepresentativeElement(); - if(!concept.isOWLThing() && !concept.isOWLNothing()) - concepts.add(new NamedClass(concept.toStringID())); - } - return concepts; - } - - private TreeSet<ObjectProperty> getFirstObjectProperties(NodeSet<OWLObjectPropertyExpression> nodeSet) { - TreeSet<ObjectProperty> roles = new TreeSet<ObjectProperty>(roleComparator); - for(Node<OWLObjectPropertyExpression> node : nodeSet) { - if(node.isBottomNode() || node.isTopNode()){ - continue; - } - // take one element from the set and ignore the rest - // (TODO: we need to make sure we always ignore the same concepts) - OWLObjectPropertyExpression property = node.getRepresentativeElement(); - roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); - } - roles.remove(new ObjectProperty(factory.getOWLTopObjectProperty().toStringID())); - roles.remove(new ObjectProperty(factory.getOWLBottomObjectProperty().toStringID())); - return roles; - } - - private TreeSet<DatatypeProperty> getFirstDatatypeProperties(NodeSet<OWLDataProperty> nodeSet) { - TreeSet<DatatypeProperty> roles = new TreeSet<DatatypeProperty>(roleComparator); - for(Node<OWLDataProperty> node : nodeSet) { - if(node.isBottomNode() || node.isTopNode()){ - continue; - } - OWLDataProperty property = node.getRepresentativeElement(); - roles.add(new DatatypeProperty(property.toStringID())); - } - roles.remove(new DatatypeProperty(factory.getOWLTopDataProperty().toStringID())); - roles.remove(new DatatypeProperty(factory.getOWLBottomDataProperty().toStringID())); - 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, IRI ontologyIRI) { - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - //URI ontologyURI = URI.create("http://example.com"); - IRI physicalIRI = IRI.create(owlOutputFile.toURI()); - SimpleIRIMapper mapper = new SimpleIRIMapper(ontologyIRI, physicalIRI); - manager.addIRIMapper(mapper); - OWLOntology ontology; - try { - ontology = manager.createOntology(ontologyIRI); - // 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 iri = "http://www.co-ode.org/ontologies/pizza/2007/02/12/pizza.owl"; - - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - try { - OWLOntology ontology = manager.loadOntologyFromOntologyDocument(IRI.create(iri)); - new PelletReasonerFactory().createReasoner(ontology); - System.out.println("Reasoner loaded succesfully."); - } catch (Exception e) { - e.printStackTrace(); - } - } + inds = reasoner.getObjectPropertyValues(ind, prop).getFlattened(); - /... [truncated message content] |
From: <ku...@us...> - 2011-06-19 11:25:18
|
Revision: 2907 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2907&view=rev Author: kurzum Date: 2011-06-19 11:25:11 +0000 (Sun, 19 Jun 2011) Log Message: ----------- autrosparql, turned off permutations, geizhals, json error message Modified Paths: -------------- trunk/autosparql/pom.xml trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java Modified: trunk/autosparql/pom.xml =================================================================== --- trunk/autosparql/pom.xml 2011-06-19 08:16:41 UTC (rev 2906) +++ trunk/autosparql/pom.xml 2011-06-19 11:25:11 UTC (rev 2907) @@ -15,6 +15,7 @@ <properties> <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding> + <this.usePermutations>false</this.usePermutations> </properties> <repositories> Modified: trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java 2011-06-19 08:16:41 UTC (rev 2906) +++ trunk/interfaces/src/main/java/org/dllearner/server/NKEGeizhals.java 2011-06-19 11:25:11 UTC (rev 2907) @@ -134,12 +134,20 @@ public static JSONObject jsonForEd(EvaluatedDescriptionPosNeg ed, String requestUrl) { SortedSet<NamedClass> namedClasses = getNamedClasses(ed.getDescription(), new TreeSet<NamedClass>()); - String xf = getID(ed.getDescription(), namedClasses); - String link = "http://geizhals.at/?cat=nb15w&xf=" + xf; + String link = ""; + String label = ""; + if (ed.getDescription().toKBSyntaxString().equals("TOP")) { + label = "No suggestions for current selection (click to show all)"; + link = "http://geizhals.at/?cat=nb15"; + } else { + link = "http://geizhals.at/?cat=nb15w&xf=" + getID(ed.getDescription(), namedClasses); + label = getLabel(ed.getDescription(), namedClasses); + } + JSONObject j = new JSONObject(); j.put("link", link); - j.put("label", getLabel(ed.getDescription(), namedClasses)); + j.put("label", label); j.put("truePositives", EvaluatedDescriptionPosNeg.getJSONArray(ed.getCoveredPositives())); j.put("falsePositives", EvaluatedDescriptionPosNeg.getJSONArray(ed.getNotCoveredPositives())); j.put("trueNegatives", EvaluatedDescriptionPosNeg.getJSONArray(ed.getNotCoveredNegatives())); @@ -152,6 +160,7 @@ } public static String getID(Description d, SortedSet<NamedClass> namedClasses) { + //prepare retrieval string StringBuilder sb = new StringBuilder(); int x = 0; @@ -166,6 +175,7 @@ } public static String getLabel(Description d, SortedSet<NamedClass> namedClasses) { + String mos = d.toManchesterSyntaxString(null, null); for (NamedClass nc : namedClasses) { String label = null; Modified: trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-19 08:16:41 UTC (rev 2906) +++ trunk/interfaces/src/main/java/org/dllearner/server/nke/Geizhals2OWL.java 2011-06-19 11:25:11 UTC (rev 2907) @@ -184,7 +184,11 @@ model.createIndividual(negative, OWL.Thing); } } catch (org.json.simple.parser.ParseException e) { - String msg = "Parsing the JSON string failed\nJSON was:\n" + json; + int position = e.getPosition(); + String msg = "Parsing the JSON string failed\n" + e.toString() + "\n"; + String before = (position >= 30) ? json.substring(position - 30, position) : json.substring(0, position); + String after = (position + 30 < json.length()) ? json.substring(position, position + 29) : json.substring(position); + msg += "String before position " + position + ": " + before + "\n" + "String after position " + position + ": " + after + "\n" + "JSON was:\n" + json; log.error(msg, e); throw new InvalidParameterException(msg); } Modified: trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java =================================================================== --- trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java 2011-06-19 08:16:41 UTC (rev 2906) +++ trunk/interfaces/src/test/java/org/dllearner/test/junit/GeizhalsTest.java 2011-06-19 11:25:11 UTC (rev 2907) @@ -1,7 +1,6 @@ package org.dllearner.test.junit; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; -import org.dllearner.server.NKEGeizhals; import org.dllearner.server.nke.Geizhals2OWL; import org.dllearner.server.nke.Learner; import org.dllearner.utilities.Helper; @@ -17,24 +16,28 @@ public class GeizhalsTest { - public static String i1 = "Sempron SI-40 2.00GHz • 1024MB • 120GB • DVD+/-RW DL • NVIDIA GeForce 9100M (IGP) max.256MB shared memory • 3x USB 2.0/Modem/LAN/WLAN 802.11bg • ExpressCard/54 Slot • 3in1 Card Reader (SD/MMC/MS) • Webcam (1.3 Megapixel) • 16\\\" WXGA glare TFT (1366x768) • Windows Vista Home Basic • Li-Ionen-Akku (6 Zellen) • 2.70kg • 24 Monate Herstellergarantie"; - public static String i2 = "Core 2 Duo 2x 1.86GHz • 2048MB • 128GB Flash • kein optisches Laufwerk • NVIDIA GeForce 320M (IGP) max. 256MB shared memory • 2x USB 2.0/WLAN 802.11n/Bluetooth 2.1 • Mini DisplayPort • Webcam • 13.3\\\" WSXGA glare LED TFT (1440x900) • Mac OS X 10.6 Snow Leopard inkl. iLife • Lithium-Polymer-Akku • 1.32kg • 12 Monate Herstellergarantie"; - public static String i3 = "Core i5-2410M 2x 2.30GHz • 4096MB • 500GB • DVD+/-RW DL • NVIDIA GeForce GT520M 1024MB • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn/BLuetooth 3.0 • HDMI • 5in1 Card Reader • Webcam (1.3 Megapixel) • 13.3\\\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; - public static String i4= "Pentium B940 2x 2.00GHz • 4096MB • 500GB • DVD+/-RW DL • Intel GMA HD 3000 (IGP) shared memory • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn • HDMI • 5in1 Card Reader • Webcam (1.3 Megapixel) • 13.3\\\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; - public static String i5 = "Core i3-2310M 2x 2.10GHz • 4096MB • 500GB • DVD+/-RW DL • Intel GMA HD 3000 (IGP) shared memory • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn/BLuetooth 3.0 • HDMI • 5in1 Card Reader • 13.3\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; - public static String i6 = "Core i5-2410M 2x 2.30GHz • 4096MB • 500GB • DVD+/-RW DL • NVIDIA GeForce GT520M 1024MB • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn/BLuetooth 3.0 • HDMI • 5in1 Card Reader • Webcam (1.3 Megapixel) • 13.3\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; - public static String i7 = "AMD C-50 2x 1.00GHz • 2048MB • 320GB • DVD+/-RW DL • AMD Radeon HD 6250 (IGP) shared memory • 3x USB 2.0/LAN/WLAN 802.11bgn • HDMI • 2in1 Card Reader • 15.6\" WXGA glare LED TFT 1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku • 2.60kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; + public static String[] featureDesc = new String[7]; + public static String[] jsonEx = new String[featureDesc.length]; + public static String json1 = ""; + static { - public static String json1 = ""; + featureDesc[0] = "Sempron SI-40 2.00GHz • 1024MB • 120GB • DVD+/-RW DL • NVIDIA GeForce 9100M (IGP) max.256MB shared memory • 3x USB 2.0/Modem/LAN/WLAN 802.11bg • ExpressCard/54 Slot • 3in1 Card Reader (SD/MMC/MS) • Webcam (1.3 Megapixel) • 16\\\" WXGA glare TFT (1366x768) • Windows Vista Home Basic • Li-Ionen-Akku (6 Zellen) • 2.70kg • 24 Monate Herstellergarantie"; + featureDesc[1] = "Core 2 Duo 2x 1.86GHz • 2048MB • 128GB Flash • kein optisches Laufwerk • NVIDIA GeForce 320M (IGP) max. 256MB shared memory • 2x USB 2.0/WLAN 802.11n/Bluetooth 2.1 • Mini DisplayPort • Webcam • 13.3\\\" WSXGA glare LED TFT (1440x900) • Mac OS X 10.6 Snow Leopard inkl. iLife • Lithium-Polymer-Akku • 1.32kg • 12 Monate Herstellergarantie"; + featureDesc[2] = "Core i5-2410M 2x 2.30GHz • 4096MB • 500GB • DVD+/-RW DL • NVIDIA GeForce GT520M 1024MB • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn/BLuetooth 3.0 • HDMI • 5in1 Card Reader • Webcam (1.3 Megapixel) • 13.3\\\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; + featureDesc[3] = "Pentium B940 2x 2.00GHz • 4096MB • 500GB • DVD+/-RW DL • Intel GMA HD 3000 (IGP) shared memory • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn • HDMI • 5in1 Card Reader • Webcam (1.3 Megapixel) • 13.3\\\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; + featureDesc[4] = "Core i3-2310M 2x 2.10GHz • 4096MB • 500GB • DVD+/-RW DL • Intel GMA HD 3000 (IGP) shared memory • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn/BLuetooth 3.0 • HDMI • 5in1 Card Reader • 13.3\\\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; + featureDesc[5] = "Core i5-2410M 2x 2.30GHz • 4096MB • 500GB • DVD+/-RW DL • NVIDIA GeForce GT520M 1024MB • 3x USB (2x USB 2.0, 1x USB 3.0)/Gb LAN/WLAN 802.11bgn/BLuetooth 3.0 • HDMI • 5in1 Card Reader • Webcam (1.3 Megapixel) • 13.3\\\" WXGA glare LED TFT (1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku (6 Zellen) • 2.10kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; + featureDesc[6] = "AMD C-50 2x 1.00GHz • 2048MB • 320GB • DVD+/-RW DL • AMD Radeon HD 6250 (IGP) shared memory • 3x USB 2.0/LAN/WLAN 802.11bgn • HDMI • 2in1 Card Reader • 15.6\\\" WXGA glare LED TFT 1366x768) • Windows 7 Home Premium (64-bit) • Li-Ionen-Akku • 2.60kg • 24 Monate Herstellergarantie • Besonderheiten: Nummernblock"; - static { - i1 = " [\"http://test.de/p1\",\"ignore1\", \"" + i1 + "\" ] "; - i2 = " [\"http://test.de/p2\",\"ignore1\", \"" + i2 + "\" ] "; - i3 = " [\"http://test.de/n1\",\"ignore1\", \"" + i3 + "\" ] "; - i4 = " [\"http://test.de/n2\",\"ignore1\", \"" + i4 + "\" ] "; - json1 = "{" + "\"pos\": [ " + i1 + " , " + i2 + " ] , " + "\"neg\": [ " + i3 + " , " + i4 + " ] " + " }"; + for (int x = 0; x < featureDesc.length; x++) + { + jsonEx[x] = " [\"http://test.de/x" + (x) + "\",\"ignore1\", \"" + featureDesc[x] + "\" ] "; + + } + + //json1 = "{" + "\"pos\": [ " + i1 + " , " + i2 + " ] , " + "\"neg\": [ " + i3 + " , " + i4 + " ] " + " }";*/ } @@ -53,15 +56,18 @@ @Test public void learn() throws Exception { // Logger.getRootLogger().setLevel(Level.TRACE); - System.out.println(json1); + //System.out.println(json1); Geizhals2OWL g = Geizhals2OWL.getInstance(); - Geizhals2OWL.Result result = g.handleJson(json1); - Learner l = new Learner(); - long start = System.nanoTime(); - EvaluatedDescriptionPosNeg ed = l.learn(result.pos, result.neg, result.getModel(), 20); - long duration = System.nanoTime() - start; - System.out.println("total time: " + Helper.prettyPrintNanoSeconds(duration)); - System.out.println(ed.asJSON()); -// System.out.println(NKEGeizhals.jsonForEd(ed).toJSONString()); + + for (int x = 1; x < jsonEx.length; x++) { + String json = "{" + "\"pos\": [ " + jsonEx[x - 1] + " ] , " + "\"neg\": [ " + jsonEx[x] + " ] " + " }"; + Geizhals2OWL.Result result = g.handleJson(json); + Learner l = new Learner(); + long start = System.nanoTime(); + EvaluatedDescriptionPosNeg ed = l.learn(result.pos, result.neg, result.getModel(), 20); + long duration = System.nanoTime() - start; + System.out.println("total time: " + Helper.prettyPrintNanoSeconds(duration)); + System.out.println(ed.asJSON()); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ji...@us...> - 2011-06-20 11:04:31
|
Revision: 2915 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2915&view=rev Author: jialva Date: 2011-06-20 11:04:22 +0000 (Mon, 20 Jun 2011) Log Message: ----------- Last changes in fuzzyDL-Learner before going back to Spain. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java Added Paths: ----------- trunk/examples/fuzzydll/fuzzyTrains_v5.0.owl trunk/examples/fuzzydll/noFuzzyTrains_v1.5.owl Removed Paths: ------------- trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput_manual.fuzzyDL.txt trunk/examples/fuzzydll/fuzzyTrains_v1.3.owl trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl trunk/examples/fuzzydll/noFuzzyTrains_v1.3.owl Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-06-20 11:04:22 UTC (rev 2915) @@ -149,9 +149,10 @@ private int minHorizExp = 0; private int maxHorizExp = 0; - // TODO remove this variable, just for testing purposes - private int counter = 0; - private PrintWriter out; + // TODO: remove this variable, just for testing purposes +// private int counter = 0; +// private PrintWriter out; +// private long start = 0; @Override public FuzzyCELOEConfigurator getConfigurator() { @@ -206,15 +207,15 @@ @Override public void init() throws ComponentInitException { - // TODO remove, just for testing purposes - FileWriter fstream; - try { - fstream = new FileWriter("../examples/fuzzydll/testOut_v2.0_noise30_10000.log"); - out = new PrintWriter(fstream); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + // TODO: remove, just for testing purposes +// FileWriter fstream; +// try { +// fstream = new FileWriter("../examples/fuzzydll/kk.log"); +// out = new PrintWriter(fstream); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } // copy class hierarchy and modify it such that each class is only // reachable via a single path @@ -378,8 +379,8 @@ addNode(startClass, null); int loop = 0; + while (!terminationCriteriaSatisfied()) { -// System.out.println("loop " + loop); if(!singleSuggestionMode && bestEvaluatedDescriptions.getBestAccuracy() > highestAccuracy) { highestAccuracy = bestEvaluatedDescriptions.getBestAccuracy(); @@ -395,13 +396,13 @@ TreeSet<Description> refinements = refineNode(nextNode); mon.stop(); - // TODO just for testing purposes - counter++; - out.println(counter + " next node: " + nextNode); - for(Description refinement : refinements) { - out.println("refinement: " + refinement); - } - out.println(); + // TODO: just for testing purposes +// counter++; +// out.println(counter + " next node: " + nextNode); +// for(Description refinement : refinements) { +// out.println("refinement: " + refinement); +// } +// out.println(); while(refinements.size() != 0) { // pick element from set @@ -414,7 +415,16 @@ // System.out.println("potentially adding " + refinement + " to search tree as child of " + nextNode + " " + new Date()); Monitor mon2 = MonitorFactory.start("addNode"); + + // TODO: remove +// start = System.currentTimeMillis(); + addNode(refinement, nextNode); + + // TODO: remove, just testing purposes +// counter++; +// System.out.println(counter + " * " + (System.currentTimeMillis() - start)); + mon2.stop(); // adding nodes is potentially computationally expensive, so we have // to check whether max time is exceeded Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/fuzzydll/FuzzyPosNegLPStandard.java 2011-06-20 11:04:22 UTC (rev 2915) @@ -622,7 +622,6 @@ double invertedCoveredMembershipDegree = 0; double lastMembershipDegree = 0; - // TODO to optimize for (FuzzyIndividual ind: fuzzyExamples) { lastMembershipDegree = (1 - Math.abs(ind.getTruthDegree() - reasoner.hasTypeFuzzyMembership(description, ind))); coveredMembershipDegree += lastMembershipDegree * ind.getTruthDegree(); @@ -630,7 +629,7 @@ invertedCoveredMembershipDegree += (1 - ind.getTruthDegree()) * (1 - lastMembershipDegree); } double fuzzyRecall = totalMembershipDegree == 0 ? 0 :coveredMembershipDegree/totalMembershipDegree; - // TODO this is like this??? not sure + if(fuzzyRecall < 1 - noise) { return -1; } Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyDLReasonerManager.java 2011-06-20 11:04:22 UTC (rev 2915) @@ -3,6 +3,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.IOException; import java.io.PrintStream; import java.io.PrintWriter; @@ -84,10 +85,25 @@ private OWLDataFactory factory; private String baseURI; private NodeSet<OWLClass> newOwlInstances; + + // TODO: remove, just for testing purposes // private FileOutputStream errorFile; +// private PrintStream out; +// private int counter = 1; +// private int counter2 = 1; public FuzzyDLReasonerManager(String ontologyFile, OWLOntology ontology, OWLReasonerConfiguration conf, OWLDataFactory factory, String baseURI) throws Exception { + // TODO: remove, just for testing purposes +// FileOutputStream fstream; +// try { +// fstream = new FileOutputStream("../examples/fuzzydll/milpSolverLogs.log"); +// out = new PrintStream(fstream); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + this.factory = factory; this.baseURI = baseURI; @@ -152,7 +168,16 @@ try { KnowledgeBase clonedFuzzyKB = fuzzyKB.clone(); + + // TODO: just for testing, remove +// long start = System.nanoTime(); + queryResult = q.solve(clonedFuzzyKB); + + // TODO: just for testing, remove +// out.println(counter + " * " + (System.nanoTime() - start)); +// counter++; + if (!queryResult.isConsistentKB()){ System.err.println("Fuzzy KB is inconsistent."); System.err.println("This may be a fuzzyDL reasoner bug. Press enter to continue."); @@ -597,7 +622,16 @@ AxiomNotInProfileException, FreshEntitiesException, InconsistentOntologyException { - return crispReasoner.isEntailed(arg0); + // TODO: just for testing, remove +// long start = System.nanoTime(); + + boolean outBoolean = crispReasoner.isEntailed(arg0); + + // TODO: just for testing, remove +// out.println(counter2 + " + " + (System.nanoTime() - start)); +// counter2++; + + return outBoolean; } @Override Modified: trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/components-core/src/test/java/org/dllearner/test/FuzzyDLLTest_Trains.java 2011-06-20 11:04:22 UTC (rev 2915) @@ -43,31 +43,32 @@ */ public class FuzzyDLLTest_Trains { +// String[] posEx = { +// "http://www.example.com/fuzzyTrains.owl#east1", +// "http://www.example.com/fuzzyTrains.owl#east2", +// "http://www.example.com/fuzzyTrains.owl#east3", +// "http://www.example.com/fuzzyTrains.owl#east4", +// "http://www.example.com/fuzzyTrains.owl#east5" +// }; +// String[] negEx = { +// "http://www.example.com/fuzzyTrains.owl#west6", +// "http://www.example.com/fuzzyTrains.owl#west7", +// "http://www.example.com/fuzzyTrains.owl#west8", +// "http://www.example.com/fuzzyTrains.owl#west9", +// "http://www.example.com/fuzzyTrains.owl#west0" +// }; + String[] posEx = { "http://www.example.com/fuzzyTrains.owl#east1", - "http://www.example.com/fuzzyTrains.owl#east2", - "http://www.example.com/fuzzyTrains.owl#east3", - "http://www.example.com/fuzzyTrains.owl#east4", - "http://www.example.com/fuzzyTrains.owl#east5" + "http://www.example.com/fuzzyTrains.owl#east2" }; String[] negEx = { "http://www.example.com/fuzzyTrains.owl#west6", - "http://www.example.com/fuzzyTrains.owl#west7", - "http://www.example.com/fuzzyTrains.owl#west8", - "http://www.example.com/fuzzyTrains.owl#west9", - "http://www.example.com/fuzzyTrains.owl#west0" + "http://www.example.com/fuzzyTrains.owl#west7" }; + private static long start; // String[] posEx = { -// "http://www.example.com/fuzzyTrains.owl#east1", -// "http://www.example.com/fuzzyTrains.owl#east2" -// }; -// String[] negEx = { -// "http://www.example.com/fuzzyTrains.owl#west6", -// "http://www.example.com/fuzzyTrains.owl#west7" -// }; - -// String[] posEx = { // "http://www.example.com/fuzzyTrains.owl#carPositive" // }; // String[] negEx = { @@ -98,18 +99,22 @@ for (int i=0; i<negEx.length; i++) { fuzzyExamples.add(new FuzzyExample(negEx[i],0.0)); } +// fuzzyExamples.add(new FuzzyExample(posEx[0],1.0)); +// fuzzyExamples.add(new FuzzyExample(posEx[1],0.9)); +// fuzzyExamples.add(new FuzzyExample(negEx[0],0.1)); +// fuzzyExamples.add(new FuzzyExample(negEx[1],0.0)); ComponentManager cm = ComponentManager.getInstance(); OWLFile ks = cm.knowledgeSource(OWLFile.class); - ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/fuzzyTrains_v2.0.owl")); + ks.getConfigurator().setUrl(new URL("file", null, "../examples/fuzzydll/fuzzyTrains_v5.0.owl")); ks.init(); // ReasonerComponent rc = cm.reasoner(OWLAPIReasoner.class, ks); FuzzyOWLAPIReasoner rc = cm.reasoner(FuzzyOWLAPIReasoner.class, ks); rc.getConfigurator().setReasonerType("fuzzydl"); rc.init(); - System.out.println(rc.getClassHierarchy()); + // System.out.println(rc.getClassHierarchy()); FuzzyPosNegLPStandard lp = cm.learningProblem(FuzzyPosNegLPStandard.class, rc); //PosNegLPStandard lp = cm.learningProblem(PosNegLPStandard.class, rc); @@ -127,20 +132,24 @@ // aaaaaaaaaa.add("Nothing"); // fc.getConfigurator().setIgnoredConcepts(aaaaaaaaaa); fc.getConfigurator().setMaxClassDescriptionTests(10000); + // fc.getConfigurator().setMaxNrOfResults(50); fc.getConfigurator().setMaxExecutionTimeInSeconds(0); fc.getConfigurator().setUseDoubleDatatypes(false); fc.getConfigurator().setUseCardinalityRestrictions(false); - fc.getConfigurator().setWriteSearchTree(true); - fc.getConfigurator().setSearchTreeFile("log/searchTreeFuzzy.txt"); - fc.getConfigurator().setNoisePercentage(30); + // fc.getConfigurator().setWriteSearchTree(true); + // fc.getConfigurator().setSearchTreeFile("log/searchTreeFuzzy.txt"); + fc.getConfigurator().setNoisePercentage(100); fc.init(); + + start = System.currentTimeMillis(); + fc.start(); - + + return fc.getCurrentlyBestDescription(); } public static void main(String args[]) throws LearningProblemUnsupportedException, IOException, ComponentInitException { - long start = System.currentTimeMillis(); FuzzyDLLTest_Trains test = new FuzzyDLLTest_Trains(); test.learn(); Deleted: trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt =================================================================== --- trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput.fuzzyDL.txt 2011-06-20 11:04:22 UTC (rev 2915) @@ -1,93 +0,0 @@ -(define-fuzzy-concept fuzzyLongCar right-shoulder(5.0, 50.0, 40.0, 40.0) ) -(define-fuzzy-concept fuzzyShortCar left-shoulder(5.0, 50.0, 15.0, 15.0) ) -(define-fuzzy-concept fuzzyMediumLengthCar trapezoidal(5.0, 50.0, 15.0, 15.0, 40.0, 40.0) ) -(functional isInFrontOf) -(functional hasCarLength) -(domain hasLoad Car ) -(domain isInFrontOf (or Car Train ) ) -(domain hasCar Train ) -(range hasCar Car ) -(range isInFrontOf Car ) -(range hasLoad Load ) -(domain hasCarLength Car ) -(range hasCarLength *real* 5.0 50.0 ) -(instance load62a Triangle 1.0) -(instance load63a Rectangle 1.0) -(instance east2 Train 1.0) -(instance car72 Car 1.0) -(instance car22 Car 1.0) -(instance car61 Car 1.0) -(instance load21b Triangle 1.0) -(instance car13 Car 1.0) -(instance load72c Triangle 1.0) -(instance load63b Triangle 1.0) -(instance car21 Car 1.0) -(instance car62 Car 1.0) -(instance load71b Rectangle 1.0) -(instance car63 Car 1.0) -(instance load72b Rectangle 1.0) -(instance load11a Rectangle 1.0) -(instance car11 Car 1.0) -(instance car12 Car 1.0) -(instance west7 Train 1.0) -(instance load11c Triangle 1.0) -(instance load11b Rectangle 1.0) -(instance load71a Triangle 1.0) -(instance car71 Car 1.0) -(instance west6 Train 1.0) -(instance load62b Rectangle 1.0) -(instance load12a Rectangle 1.0) -(instance east1 Train 1.0) -(instance load21a Rectangle 1.0) -(instance load72a Rectangle 1.0) -(related west6 car61 isInFrontOf 1.0) -(related car63 load63a hasLoad 1.0) -(related west6 car63 hasCar 1.0) -(related east1 car13 hasCar 1.0) -(related east2 car21 hasCar 1.0) -(related car72 load72b hasLoad 1.0) -(related east1 car11 hasCar 1.0) -(related west7 car72 hasCar 1.0) -(related car62 load62a hasLoad 1.0) -(related car11 load11a hasLoad 1.0) -(related west6 car61 hasCar 1.0) -(related car71 load71a hasLoad 1.0) -(related west7 car71 isInFrontOf 1.0) -(related car21 load12a hasLoad 1.0) -(related car11 load11c hasLoad 1.0) -(related west7 car71 hasCar 1.0) -(related east2 car22 hasCar 1.0) -(related car21 car22 isInFrontOf 1.0) -(related car63 load63b hasLoad 1.0) -(related west6 car62 hasCar 1.0) -(related east1 car11 isInFrontOf 1.0) -(related car12 car13 isInFrontOf 1.0) -(related car61 car62 isInFrontOf 1.0) -(related car12 load12a hasLoad 1.0) -(related car11 car12 isInFrontOf 1.0) -(related car62 load62b hasLoad 1.0) -(related east1 car12 hasCar 1.0) -(related car72 load72c hasLoad 1.0) -(related east2 car21 isInFrontOf 1.0) -(related car71 car72 isInFrontOf 1.0) -(related car71 load71b hasLoad 1.0) -(related car21 load21a hasLoad 1.0) -(related car62 car63 isInFrontOf 1.0) -(related car11 load11b hasLoad 1.0) -(related car72 load72a hasLoad 1.0) -(instance car13 (= hasCarLength 13) 1.0 ) -(instance car22 (= hasCarLength 7) 1.0 ) -(instance car71 (= hasCarLength 7) 1.0 ) -(instance car11 (= hasCarLength 49) 1.0 ) -(instance car62 (= hasCarLength 8) 1.0 ) -(instance car21 (= hasCarLength 47) 1.0 ) -(instance car61 (= hasCarLength 45) 1.0 ) -(instance car63 (= hasCarLength 25) 1.0 ) -(instance car12 (= hasCarLength 25) 1.0 ) -(instance car72 (= hasCarLength 6) 1.0 ) -(disjoint Car Load ) -(disjoint Car Train ) -(disjoint Load Train ) -(define-concept LongCar (and Car (some hasCarLength fuzzyLongCar))) -(define-concept ShortCar (and Car (some hasCarLength fuzzyShortCar))) -(define-concept MediumLenghtCar (and Car (some hasCarLength fuzzyMediumLengthCar))) Deleted: trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput_manual.fuzzyDL.txt =================================================================== --- trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput_manual.fuzzyDL.txt 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/examples/fuzzydll/fuzzyOWL2fuzzyDLparserOutput_manual.fuzzyDL.txt 2011-06-20 11:04:22 UTC (rev 2915) @@ -1,93 +0,0 @@ -(define-fuzzy-concept fuzzyLongCar right-shoulder(5.0, 50.0, 40.0, 40.0) ) -(define-fuzzy-concept fuzzyShortCar left-shoulder(5.0, 50.0, 15.0, 15.0) ) -(define-fuzzy-concept fuzzyMediumLengthCar trapezoidal(5.0, 50.0, 15.0, 15.0, 40.0, 40.0) ) -(functional isInFrontOf) -(functional hasCarLength) -(domain hasLoad Car ) -(domain isInFrontOf (or Car Train ) ) -(domain hasCar Train ) -(range hasCar Car ) -(range isInFrontOf Car ) -(range hasLoad Load ) -(domain hasCarLength Car ) -(range hasCarLength *real* 5.0 50.0 ) -(instance load62a Triangle 1.0) -(instance load63a Rectangle 1.0) -(instance east2 Train 1.0) -(instance car72 Car 1.0) -(instance car22 Car 1.0) -(instance car61 Car 1.0) -(instance load21b Triangle 1.0) -(instance car13 Car 1.0) -(instance load72c Triangle 1.0) -(instance load63b Triangle 1.0) -(instance car21 Car 1.0) -(instance car62 Car 1.0) -(instance load71b Rectangle 1.0) -(instance car63 Car 1.0) -(instance load72b Rectangle 1.0) -(instance load11a Rectangle 1.0) -(instance car11 Car 1.0) -(instance car12 Car 1.0) -(instance west7 Train 1.0) -(instance load11c Triangle 1.0) -(instance load11b Rectangle 1.0) -(instance load71a Triangle 1.0) -(instance car71 Car 1.0) -(instance west6 Train 1.0) -(instance load62b Rectangle 1.0) -(instance load12a Rectangle 1.0) -(instance east1 Train 1.0) -(instance load21a Rectangle 1.0) -(instance load72a Rectangle 1.0) -(related west6 car61 isInFrontOf 1.0) -(related car63 load63a hasLoad 1.0) -(related west6 car63 hasCar 1.0) -(related east1 car13 hasCar 1.0) -(related east2 car21 hasCar 1.0) -(related car72 load72b hasLoad 1.0) -(related east1 car11 hasCar 1.0) -(related west7 car72 hasCar 1.0) -(related car62 load62a hasLoad 1.0) -(related car11 load11a hasLoad 1.0) -(related west6 car61 hasCar 1.0) -(related car71 load71a hasLoad 1.0) -(related west7 car71 isInFrontOf 1.0) -(related car21 load12a hasLoad 1.0) -(related car11 load11c hasLoad 1.0) -(related west7 car71 hasCar 1.0) -(related east2 car22 hasCar 1.0) -(related car21 car22 isInFrontOf 1.0) -(related car63 load63b hasLoad 1.0) -(related west6 car62 hasCar 1.0) -(related east1 car11 isInFrontOf 1.0) -(related car12 car13 isInFrontOf 1.0) -(related car61 car62 isInFrontOf 1.0) -(related car12 load12a hasLoad 1.0) -(related car11 car12 isInFrontOf 1.0) -(related car62 load62b hasLoad 1.0) -(related east1 car12 hasCar 1.0) -(related car72 load72c hasLoad 1.0) -(related east2 car21 isInFrontOf 1.0) -(related car71 car72 isInFrontOf 1.0) -(related car71 load71b hasLoad 1.0) -(related car21 load21a hasLoad 1.0) -(related car62 car63 isInFrontOf 1.0) -(related car11 load11b hasLoad 1.0) -(related car72 load72a hasLoad 1.0) -(instance car13 (= hasCarLength 13) 1.0 ) -(instance car22 (= hasCarLength 7) 1.0 ) -(instance car71 (= hasCarLength 7) 1.0 ) -(instance car11 (= hasCarLength 49) 1.0 ) -(instance car62 (= hasCarLength 8) 1.0 ) -(instance car21 (= hasCarLength 47) 1.0 ) -(instance car61 (= hasCarLength 45) 1.0 ) -(instance car63 (= hasCarLength 25) 1.0 ) -(instance car12 (= hasCarLength 25) 1.0 ) -(instance car72 (= hasCarLength 6) 1.0 ) -(disjoint Car Load ) -(disjoint Car Train ) -(disjoint Load Train ) -(define-concept LongCar (and Car (some hasCarLength fuzzyLongCar))) -(define-concept ShortCar (and Car (some hasCarLength fuzzyShortCar))) -(define-concept MediumLenghtCar (and Car (some hasCarLength fuzzyMediumLengthCar))) Deleted: trunk/examples/fuzzydll/fuzzyTrains_v1.3.owl =================================================================== --- trunk/examples/fuzzydll/fuzzyTrains_v1.3.owl 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/examples/fuzzydll/fuzzyTrains_v1.3.owl 2011-06-20 11:04:22 UTC (rev 2915) @@ -1,634 +0,0 @@ -<?xml version="1.0"?> - - -<!DOCTYPE rdf:RDF [ - <!ENTITY owl "http://www.w3.org/2002/07/owl#" > - <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > - <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > - <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > -]> - - -<rdf:RDF xmlns="http://www.example.com/fuzzyTrains.owl#" - xml:base="http://www.example.com/fuzzyTrains.owl" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" - xmlns:owl="http://www.w3.org/2002/07/owl#" - xmlns:xsd="http://www.w3.org/2001/XMLSchema#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <owl:Ontology rdf:about="http://www.example.com/fuzzyTrains.owl"> - <rdfs:comment xml:lang="en">Fuzzy adaptation of Michalsky's trains problem [1] -Original idea from [2] - -Developed by Josue Iglesias (josue at grpss.ssr.upm.es) - -[1] http://www.mli.gmu.edu/papers/79-80/80-05.pdf -[2] http://users.iit.demokritos.gr/~konstant/dload/Pubs/fuzz10.pdf</rdfs:comment> - <rdfs:comment xml:lang="en">v1.0: Cars can be (fuzzy) classified as being short, medium or long depending on their length (double)</rdfs:comment> - <rdfs:comment xml:lang="en">v1.1: Car's load can be more or less similar to a triangle and/or a rectangle</rdfs:comment> - <rdfs:comment xml:lang="en">v1.2: Change properties (Train) hasFirstCar (Car) + (Car) isInFrontOf (Car) for just (Train) hasCar (Car) in order to make the example easier</rdfs:comment> - <rdfs:comment xml:lang="en">v1.3: -Some concepts of v1.1 and v1.2 are merged: -- (Train) hasCar (Train) -- (Train) or (Car) isInFrontOf (Car)</rdfs:comment> - </owl:Ontology> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Annotation properties - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - <owl:AnnotationProperty rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLabel"/> - <owl:AnnotationProperty rdf:about="&rdfs;comment"/> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Datatypes - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#fuzzyLongCar --> - - <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"> - <owl:equivalentClass> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </owl:equivalentClass> - <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> -<Datatype type="rightshoulder" a="40" b="40" /> -</fuzzyOwl2></fuzzyLabel> - </rdfs:Datatype> - - - - <!-- http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar --> - - <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"> - <owl:equivalentClass> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </owl:equivalentClass> - <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> -<Datatype type="trapezoidal" a="15" b="15" c="40" d="40" /> -</fuzzyOwl2></fuzzyLabel> - </rdfs:Datatype> - - - - <!-- http://www.example.com/fuzzyTrains.owl#fuzzyShortCar --> - - <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"> - <owl:equivalentClass> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </owl:equivalentClass> - <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> -<Datatype type="leftshoulder" a="15" b="15" /> -</fuzzyOwl2></fuzzyLabel> - </rdfs:Datatype> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Object Properties - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#hasCar --> - - <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCar"> - <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:ObjectProperty> - - - - <!-- http://www.example.com/fuzzyTrains.owl#hasLoad --> - - <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasLoad"> - <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - </owl:ObjectProperty> - - - - <!-- http://www.example.com/fuzzyTrains.owl#isInFrontOf --> - - <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#isInFrontOf"> - <rdf:type rdf:resource="&owl;FunctionalProperty"/> - <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:domain> - <owl:Class> - <owl:unionOf rdf:parseType="Collection"> - <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:unionOf> - </owl:Class> - </rdfs:domain> - </owl:ObjectProperty> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Data properties - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#hasCarLength --> - - <owl:DatatypeProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCarLength"> - <rdf:type rdf:resource="&owl;FunctionalProperty"/> - <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:range> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </rdfs:range> - </owl:DatatypeProperty> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Classes - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#Car --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Car"> - <rdfs:subClassOf rdf:resource="&owl;Thing"/> - <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Load --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Load"> - <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#LongCar --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"> - <owl:equivalentClass> - <owl:Restriction> - <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> - <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"/> - </owl:Restriction> - </owl:equivalentClass> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#MediumLenghtCar --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"> - <owl:equivalentClass> - <owl:Restriction> - <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> - <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"/> - </owl:Restriction> - </owl:equivalentClass> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Rectangle --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Rectangle"> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#ShortCar --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"> - <owl:equivalentClass> - <owl:Restriction> - <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> - <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"/> - </owl:Restriction> - </owl:equivalentClass> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Train --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Triangle --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Triangle"> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - </owl:Class> - - - - <!-- http://www.w3.org/2002/07/owl#Thing --> - - <owl:Class rdf:about="&owl;Thing"/> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Individuals - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#car11 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car11"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">49</hasCarLength> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11a"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11b"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load11c"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car12 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car12"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car13 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car13"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">13</hasCarLength> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car21 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car21"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">47</hasCarLength> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load12a"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load21a"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car22 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car22"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">7</hasCarLength> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car61 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car61"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">45</hasCarLength> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car62 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car62"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">8</hasCarLength> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62a"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load62b"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car63 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car63"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">25</hasCarLength> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63a"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load63b"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car71 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car71"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">7</hasCarLength> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71a"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load71b"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#car72 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#car72"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <hasCarLength rdf:datatype="&xsd;double">6</hasCarLength> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72a"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72b"/> - <hasLoad rdf:resource="http://www.example.com/fuzzyTrains.owl#load72c"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#east1 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east1"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car11"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car12"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car13"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#east2 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#east2"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car21"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car22"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load11a --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11a"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load11b --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11b"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load11c --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load11c"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load12a --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load12a"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load21a --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21a"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load21b --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load21b"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load62a --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62a"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load62b --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load62b"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load63a --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63a"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load63b --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load63b"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load71a --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71a"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load71b --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load71b"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load72a --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72a"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load72b --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72b"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Rectangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#load72c --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#load72c"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Triangle"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#west6 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west6"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car61"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car62"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car63"/> - </owl:NamedIndividual> - - - - <!-- http://www.example.com/fuzzyTrains.owl#west7 --> - - <owl:NamedIndividual rdf:about="http://www.example.com/fuzzyTrains.owl#west7"> - <rdf:type rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> - <isInFrontOf rdf:resource="http://www.example.com/fuzzyTrains.owl#car71"/> - <hasCar rdf:resource="http://www.example.com/fuzzyTrains.owl#car72"/> - </owl:NamedIndividual> -</rdf:RDF> - - - -<!-- Generated by the OWL API (version 3.1.0.20069) http://owlapi.sourceforge.net --> - Deleted: trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl =================================================================== --- trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl 2011-06-20 10:33:20 UTC (rev 2914) +++ trunk/examples/fuzzydll/fuzzyTrains_v1.4.owl 2011-06-20 11:04:22 UTC (rev 2915) @@ -1,647 +0,0 @@ -<?xml version="1.0"?> - - -<!DOCTYPE rdf:RDF [ - <!ENTITY owl "http://www.w3.org/2002/07/owl#" > - <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > - <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > - <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > -]> - - -<rdf:RDF xmlns="http://www.example.com/fuzzyTrains.owl#" - xml:base="http://www.example.com/fuzzyTrains.owl" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" - xmlns:owl="http://www.w3.org/2002/07/owl#" - xmlns:xsd="http://www.w3.org/2001/XMLSchema#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <owl:Ontology rdf:about="http://www.example.com/fuzzyTrains.owl"> - <rdfs:comment xml:lang="en">Fuzzy adaptation of Michalsky's trains problem [1] -Original idea from [2] - -Developed by Josue Iglesias (josue at grpss.ssr.upm.es) - -[1] http://www.mli.gmu.edu/papers/79-80/80-05.pdf -[2] http://users.iit.demokritos.gr/~konstant/dload/Pubs/fuzz10.pdf</rdfs:comment> - <rdfs:comment xml:lang="en">v1.0: Cars can be (fuzzy) classified as being short, medium or long depending on their length (double)</rdfs:comment> - <rdfs:comment xml:lang="en">v1.1: Car's load can be more or less similar to a triangle and/or a rectangle</rdfs:comment> - <rdfs:comment xml:lang="en">v1.2: Change properties (Train) hasFirstCar (Car) + (Car) isInFrontOf (Car) for just (Train) hasCar (Car) in order to make the example easier</rdfs:comment> - <rdfs:comment xml:lang="en">v1.3: -Some concepts of v1.1 and v1.2 are merged: -- (Train) hasCar (Train) -- (Train) or (Car) isInFrontOf (Car)</rdfs:comment> - <rdfs:comment xml:lang="en">v1.4: Instead of defining fuzzy data types as (double[>= 5.0] and double[<= 50.0]), this is change to - -- fuzzyShortCar (double[>= 5.0] and double[<= 150.0]) -- fuzzyMediumLengthCar (double[>= -100.0] and double[<= 100.0]) -- fuzzyLongCar (double[>= -150.0] and double[<= 50.0]) - -Now, hasLength range has changed to - -(double[>= -1000.0] and double[<= 1000.0]) - -This is done in order crisp reasoners not to infer that ShortCar, MediumLengthCar and LongCar to be equivalent clases. - -Note that although for a crip reasoner, e.g., fuzzyShortCar range from 5 to 150, for a fuzzy reasoner it would range from 5 to 50 (as it also applies the fuzzy annotations attched to fuzzyShortCar).</rdfs:comment> - </owl:Ontology> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Annotation properties - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - <owl:AnnotationProperty rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLabel"/> - <owl:AnnotationProperty rdf:about="&rdfs;comment"/> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Datatypes - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#fuzzyLongCar --> - - <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"> - <owl:equivalentClass> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">-150.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">50.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </owl:equivalentClass> - <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> -<Datatype type="rightshoulder" a="40" b="40" /> -</fuzzyOwl2></fuzzyLabel> - </rdfs:Datatype> - - - - <!-- http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar --> - - <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"> - <owl:equivalentClass> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">-100.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">100.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </owl:equivalentClass> - <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> -<Datatype type="trapezoidal" a="15" b="15" c="40" d="40" /> -</fuzzyOwl2></fuzzyLabel> - </rdfs:Datatype> - - - - <!-- http://www.example.com/fuzzyTrains.owl#fuzzyShortCar --> - - <rdfs:Datatype rdf:about="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"> - <owl:equivalentClass> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">5.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">150.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </owl:equivalentClass> - <fuzzyLabel><fuzzyOwl2 fuzzyType="datatype"> -<Datatype type="leftshoulder" a="15" b="15" /> -</fuzzyOwl2></fuzzyLabel> - </rdfs:Datatype> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Object Properties - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#hasCar --> - - <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCar"> - <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:ObjectProperty> - - - - <!-- http://www.example.com/fuzzyTrains.owl#hasLoad --> - - <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasLoad"> - <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - </owl:ObjectProperty> - - - - <!-- http://www.example.com/fuzzyTrains.owl#isInFrontOf --> - - <owl:ObjectProperty rdf:about="http://www.example.com/fuzzyTrains.owl#isInFrontOf"> - <rdf:type rdf:resource="&owl;FunctionalProperty"/> - <rdfs:range rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:domain> - <owl:Class> - <owl:unionOf rdf:parseType="Collection"> - <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdf:Description rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:unionOf> - </owl:Class> - </rdfs:domain> - </owl:ObjectProperty> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Data properties - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#hasCarLength --> - - <owl:DatatypeProperty rdf:about="http://www.example.com/fuzzyTrains.owl#hasCarLength"> - <rdf:type rdf:resource="&owl;FunctionalProperty"/> - <rdfs:domain rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - <rdfs:range> - <rdfs:Datatype> - <owl:intersectionOf rdf:parseType="Collection"> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:minInclusive rdf:datatype="&xsd;double">-1000.0</xsd:minInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - <rdfs:Datatype> - <owl:onDatatype rdf:resource="&xsd;double"/> - <owl:withRestrictions rdf:parseType="Collection"> - <rdf:Description> - <xsd:maxInclusive rdf:datatype="&xsd;double">1000.0</xsd:maxInclusive> - </rdf:Description> - </owl:withRestrictions> - </rdfs:Datatype> - </owl:intersectionOf> - </rdfs:Datatype> - </rdfs:range> - </owl:DatatypeProperty> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Classes - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://www.example.com/fuzzyTrains.owl#Car --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Car"> - <rdfs:subClassOf rdf:resource="&owl;Thing"/> - <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Load --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Load"> - <owl:disjointWith rdf:resource="http://www.example.com/fuzzyTrains.owl#Train"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#LongCar --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#LongCar"> - <owl:equivalentClass> - <owl:Restriction> - <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> - <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyLongCar"/> - </owl:Restriction> - </owl:equivalentClass> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#MediumLenghtCar --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#MediumLenghtCar"> - <owl:equivalentClass> - <owl:Restriction> - <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> - <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyMediumLengthCar"/> - </owl:Restriction> - </owl:equivalentClass> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Rectangle --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Rectangle"> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#ShortCar --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#ShortCar"> - <owl:equivalentClass> - <owl:Restriction> - <owl:onProperty rdf:resource="http://www.example.com/fuzzyTrains.owl#hasCarLength"/> - <owl:someValuesFrom rdf:resource="http://www.example.com/fuzzyTrains.owl#fuzzyShortCar"/> - </owl:Restriction> - </owl:equivalentClass> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Car"/> - </owl:Class> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Train --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Train"/> - - - - <!-- http://www.example.com/fuzzyTrains.owl#Triangle --> - - <owl:Class rdf:about="http://www.example.com/fuzzyTrains.owl#Triangle"> - <rdfs:subClassOf rdf:resource="http://www.example.com/fuzzyTrains.owl#Load"/> - </owl:Class> - - - - <!-- http://www.w3.org/2002/07/owl#Thing --> - - <owl:Class rdf:about="&owl;T... [truncated message content] |