From: <jen...@us...> - 2008-02-24 08:45:18
|
Revision: 633 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=633&view=rev Author: jenslehmann Date: 2008-02-24 00:45:08 -0800 (Sun, 24 Feb 2008) Log Message: ----------- - preparations for boolean data type support in refinement operator - added literals/constants in OWL framework - improved package Javadoc Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java trunk/src/dl-learner/org/dllearner/core/owl/package.html trunk/src/dl-learner/org/dllearner/gui/package.html Added Paths: ----------- trunk/src/dl-learner/org/dllearner/cli/package.html trunk/src/dl-learner/org/dllearner/core/config/package.html trunk/src/dl-learner/org/dllearner/core/owl/Constant.java trunk/src/dl-learner/org/dllearner/core/owl/TypedConstant.java trunk/src/dl-learner/org/dllearner/core/owl/UntypedConstant.java trunk/src/dl-learner/org/dllearner/core/package.html trunk/src/dl-learner/org/dllearner/kb/package.html trunk/src/dl-learner/org/dllearner/learningproblems/package.html trunk/src/dl-learner/org/dllearner/prolog/package.html trunk/src/dl-learner/org/dllearner/test/package.html Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-02-24 08:45:08 UTC (rev 633) @@ -103,7 +103,8 @@ private boolean improveSubsumptionHierarchy = true; private boolean useAllConstructor = true; private boolean useExistsConstructor = true; - private boolean useNegation = true; + private boolean useNegation = true; + private boolean useBooleanDatatypes = true; private double noisePercentage = 0.0; // Variablen zur Einstellung der Protokollierung @@ -161,6 +162,7 @@ options.add(CommonConfigOptions.useAllConstructor()); options.add(CommonConfigOptions.useExistsConstructor()); options.add(CommonConfigOptions.useNegation()); + options.add(CommonConfigOptions.useBooleanDatatypes()); DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples"); noisePercentage.setLowerLimit(0.0); noisePercentage.setUpperLimit(1.0); @@ -215,6 +217,8 @@ useNegation = (Boolean) entry.getValue(); } else if(name.equals("noisePercentage")) { noisePercentage = (Double) entry.getValue(); + } else if(name.equals("useBooleanDatatypes")) { + useBooleanDatatypes = (Boolean) entry.getValue(); } } @@ -281,7 +285,8 @@ applyExistsFilter, useAllConstructor, useExistsConstructor, - useNegation + useNegation, + useBooleanDatatypes ); // create an algorithm object and pass all configuration Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-24 08:45:08 UTC (rev 633) @@ -67,6 +67,7 @@ private boolean useAllConstructor = true; private boolean useExistsConstructor = true; private boolean useNegation = true; + private boolean useBooleanDatatypes = true; private boolean quiet = false; @@ -208,6 +209,7 @@ options.add(CommonConfigOptions.useAllConstructor()); options.add(CommonConfigOptions.useExistsConstructor()); options.add(CommonConfigOptions.useNegation()); + options.add(CommonConfigOptions.useBooleanDatatypes()); return options; } @@ -258,6 +260,8 @@ useExistsConstructor = (Boolean) entry.getValue(); } else if(name.equals("useNegation")) { useNegation = (Boolean) entry.getValue(); + } else if(name.equals("useBooleanDatatypes")) { + useBooleanDatatypes = (Boolean) entry.getValue(); } } @@ -284,7 +288,7 @@ } // this.learningProblem2 = learningProblem2; - operator = new RhoDown(rs, applyAllFilter, applyExistsFilter, useAllConstructor, useExistsConstructor, useNegation); + operator = new RhoDown(rs, applyAllFilter, applyExistsFilter, useAllConstructor, useExistsConstructor, useNegation, useBooleanDatatypes); // candidate sets entsprechend der gewählten Heuristik initialisieren candidates = new TreeSet<Node>(nodeComparator); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java 2008-02-24 08:45:08 UTC (rev 633) @@ -89,18 +89,20 @@ private boolean applyExistsFilter = true; private boolean useAllConstructor = true; private boolean useExistsConstructor = true; - private boolean useNegation = true; + private boolean useNegation = true; + private boolean useBooleanDatatypes = true; // braucht man wirklich das learningProblem oder reicht der Reasoning-Service? // TODO: conceptComparator könnte auch noch Parameter sein public RhoDown(ReasoningService reasoningService, boolean applyAllFilter, boolean applyExistsFilter, boolean useAllConstructor, - boolean useExistsConstructor, boolean useNegation) { + boolean useExistsConstructor, boolean useNegation, boolean useBooleanDatatypes) { this.rs = reasoningService; this.applyAllFilter = applyAllFilter; this.applyExistsFilter = applyExistsFilter; this.useAllConstructor = useAllConstructor; this.useExistsConstructor = useExistsConstructor; this.useNegation = useNegation; + this.useBooleanDatatypes = useBooleanDatatypes; // this.learningProblem = learningProblem; // rs = learningProblem.getReasoningService(); @@ -141,6 +143,7 @@ } else if (concept instanceof Nothing) { // return new HashSet<Concept>(); +// } else if (concept instanceof ) } else if (concept instanceof NamedClass) { // Erkenntnisse aus Benchmarks: dieser Teil wird sehr häufig aufgerufen, // allerdings lässt er sich kaum weiter verbessern (selbst ohne klonen Added: trunk/src/dl-learner/org/dllearner/cli/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/package.html (rev 0) +++ trunk/src/dl-learner/org/dllearner/cli/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,7 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head></head> +<body bgcolor="white"> +<p>DL-Learner command line interface.</p> +</body> +</html> \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-02-24 08:45:08 UTC (rev 633) @@ -82,4 +82,8 @@ public static BooleanConfigOption useNegation() { return new BooleanConfigOption("useNegation", "specifies whether negation is used in the learning algorothm"); } + + public static BooleanConfigOption useBooleanDatatypes() { + return new BooleanConfigOption("useBooleanDatatypes", "specifies whether boolean datatypes are used in the learning algorothm"); + } } Added: trunk/src/dl-learner/org/dllearner/core/config/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/package.html (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/config/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head></head> +<body bgcolor="white"> +<p>Classes for managing the configuration options of DL-Learner +components.</p> +</body> +</html> \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/core/owl/Constant.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Constant.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/Constant.java 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,42 @@ +/** + * 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.owl; + +/** + * A constant value. + * + * @author Jens Lehmann + * + */ +public abstract class Constant implements KBElement { + + String literal; + + public Constant(String literal) { + this.literal = literal; + } + + /** + * @return the literal + */ + public String getLiteral() { + return literal; + } +} Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java 2008-02-24 08:45:08 UTC (rev 633) @@ -22,11 +22,17 @@ import java.util.Map; /** + * Examples for datatype value restrictions: + * Male AND hasAge HASVALUE 18 + * Male AND hasDriverLicense HASVALUE true + * * @author Jens Lehmann * */ public class DatatypeValueRestriction extends ValueRestriction { +// public DatatypeValueRestriction(DatatypeProperty) + /* (non-Javadoc) * @see org.dllearner.core.owl.Description#accept(org.dllearner.core.owl.DescriptionVisitor) */ Modified: trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/core/owl/KBElementVisitor.java 2008-02-24 08:45:08 UTC (rev 633) @@ -39,4 +39,8 @@ void visit(KB kb); + void visit(TypedConstant typedConstant); + + void visit(UntypedConstant untypedConstant); + } Added: trunk/src/dl-learner/org/dllearner/core/owl/TypedConstant.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/TypedConstant.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/TypedConstant.java 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,67 @@ +/** + * 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.owl; + +import java.util.Map; + +/** + * A constant which has an explicitly assigned datatype. + * + * @author Jens Lehmann + * + */ +public class TypedConstant extends Constant { + + private Datatype datatype; + + public TypedConstant(String literal, Datatype datatype) { + super(literal); + this.datatype = datatype; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + return 1; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + return literal + datatype.toString(baseURI, prefixes); + } + + /** + * @return the datatype + */ + public Datatype getDatatype() { + return datatype; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#accept(org.dllearner.core.owl.KBElementVisitor) + */ + public void accept(KBElementVisitor visitor) { + visitor.visit(this); + } + +} Added: trunk/src/dl-learner/org/dllearner/core/owl/UntypedConstant.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/UntypedConstant.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/owl/UntypedConstant.java 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,85 @@ +/** + * 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.owl; + +import java.util.Map; + +/** + * An untyped constant is a string which has not been assigned + * a datatype and can have an optional language tag. + * + * @author Jens Lehmann + * + */ +public class UntypedConstant extends Constant { + + private String lang; + private boolean hasLang = false; + + public UntypedConstant(String literal) { + super(literal); + } + + public UntypedConstant(String literal, String lang) { + super(literal); + this.lang = lang; + hasLang = true; + } + + + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#getLength() + */ + public int getLength() { + return 1; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + if(hasLang) + return literal + "@" + lang; + else + return literal; + } + + /** + * @return the lang + */ + public String getLang() { + return lang; + } + + /** + * @return the hasLang + */ + public boolean hasLang() { + return hasLang; + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.KBElement#accept(org.dllearner.core.owl.KBElementVisitor) + */ + public void accept(KBElementVisitor visitor) { + visitor.visit(this); + } +} Modified: trunk/src/dl-learner/org/dllearner/core/owl/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/package.html 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/core/owl/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -2,6 +2,8 @@ <html> <head></head> <body bgcolor="white"> -<p>Classes for representing OWL constructs.</p> +<p>Classes/Interfaces for representing OWL constructs - see +the <a href="http://www.w3.org/TR/owl11-syntax">OWL 1.1 Structural +Specification</a> for details.</p> </body> </html> \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/core/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/core/package.html (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,7 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head></head> +<body bgcolor="white"> +<p>Core structure of DL-Learner including the definition of component types and a component manager.</p> +</body> +</html> \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/gui/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/package.html 2008-02-23 21:13:06 UTC (rev 632) +++ trunk/src/dl-learner/org/dllearner/gui/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -2,6 +2,6 @@ <html> <head></head> <body bgcolor="white"> -<p>Classes to generate a Graphical User Interface for DL-Learner.</p> +<p>Graphical user interface for DL-Learner.</p> </body> </html> \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/kb/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/package.html (rev 0) +++ trunk/src/dl-learner/org/dllearner/kb/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head></head> +<body bgcolor="white"> +<p>DL-Learner knowledge sources, which can be used as background +knowledge in learning problems.</p> +</body> +</html> \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/learningproblems/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/package.html (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,7 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head></head> +<body bgcolor="white"> +<p>Supported DL-Learner learning problems.</p> +</body> +</html> \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/prolog/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/prolog/package.html (rev 0) +++ trunk/src/dl-learner/org/dllearner/prolog/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,7 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head></head> +<body bgcolor="white"> +<p>Prolog syntax structures.</p> +</body> +</html> \ No newline at end of file Added: trunk/src/dl-learner/org/dllearner/test/package.html =================================================================== --- trunk/src/dl-learner/org/dllearner/test/package.html (rev 0) +++ trunk/src/dl-learner/org/dllearner/test/package.html 2008-02-24 08:45:08 UTC (rev 633) @@ -0,0 +1,7 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head></head> +<body bgcolor="white"> +<p>DL-Learner tests for performance, bug reports etc.</p> +</body> +</html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |