From: <ku...@us...> - 2008-04-10 13:20:23
|
Revision: 785 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=785&view=rev Author: kurzum Date: 2008-04-10 06:20:09 -0700 (Thu, 10 Apr 2008) Log Message: ----------- some kbsyntax manchester fixes, added option useCardinalityRestrictions Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/examples/KRK.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-04-10 13:20:09 UTC (rev 785) @@ -101,6 +101,7 @@ private boolean improveSubsumptionHierarchy = true; private boolean useAllConstructor = true; private boolean useExistsConstructor = true; + private boolean useCardinalityRestrictions = true; private boolean useNegation = true; private boolean useBooleanDatatypes = true; private double noisePercentage = 0.0; @@ -160,8 +161,10 @@ options.add(CommonConfigOptions.ignoredRoles()); options.add(CommonConfigOptions.useAllConstructor()); options.add(CommonConfigOptions.useExistsConstructor()); + options.add(CommonConfigOptions.useCardinalityRestrictions()); options.add(CommonConfigOptions.useNegation()); options.add(CommonConfigOptions.useBooleanDatatypes()); + DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples"); noisePercentage.setLowerLimit(0); noisePercentage.setUpperLimit(100); @@ -213,6 +216,8 @@ useAllConstructor = (Boolean) entry.getValue(); } else if(name.equals("useExistsConstructor")) { useExistsConstructor = (Boolean) entry.getValue(); + } else if(name.equals("useCardinalityRestrictions")) { + useCardinalityRestrictions = (Boolean) entry.getValue(); } else if(name.equals("useNegation")) { useNegation = (Boolean) entry.getValue(); } else if(name.equals("noisePercentage")) { @@ -292,6 +297,7 @@ applyExistsFilter, useAllConstructor, useExistsConstructor, + useCardinalityRestrictions, useNegation, useBooleanDatatypes, startClass Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-04-10 13:20:09 UTC (rev 785) @@ -739,8 +739,11 @@ // String bestNodeString = "currently best node: " + bestNode + " accuracy: " + df.format(accuracy) + "%"; logger.debug("start node: " + startNode.getShortDescription(nrOfPositiveExamples, nrOfNegativeExamples, baseURI)); String bestNodeString = "currently best node: " + bestNode.getShortDescription(nrOfPositiveExamples, nrOfNegativeExamples, baseURI); + String bestNodeStringKBSyntax = "currently best node KBSyntax: " + bestNode.getConcept().toKBSyntaxString(); + // searchTree += bestNodeString + "\n"; logger.debug(bestNodeString); + logger.debug(bestNodeStringKBSyntax); String expandedNodeString = "next expanded node: " + candidates.last().getShortDescription(nrOfPositiveExamples, nrOfNegativeExamples, baseURI); // searchTree += expandedNodeString + "\n"; logger.debug(expandedNodeString); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-04-10 13:20:09 UTC (rev 785) @@ -78,7 +78,7 @@ private double expansionPenaltyFactor; private double gainBonusFactor; private double nodeChildPenalty = 0.0001; - private double startNodeBonus = 2.0; + private double startNodeBonus = 0.1; //was 2.0 // penalise errors on positive examples harder than on negative examples // (positive weight = 1) private double negativeWeight = 0.8; Modified: trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-04-10 13:20:09 UTC (rev 785) @@ -28,6 +28,21 @@ * */ public final class CommonConfigOptions { + + //public static boolean applyAllFilterDefault = true; + //public static boolean applyExistsFilterDefault = true; + //public static boolean useTooWeakListDefault = true; + //public static boolean useOverlyGeneralListDefault = true; + //public static boolean useShortConceptConstructionDefault = true; + //public static boolean improveSubsumptionHierarchyDefault = true; + public static boolean useAllConstructorDefault = true; + public static boolean useExistsConstructorDefault = true; + public static boolean useCardinalityRestrictionsDefault = true; + public static boolean useNegationDefault = true; + public static boolean useBooleanDatatypesDefault = true; + //public static double noisePercentageDefault = 0.0; + + public static StringConfigOption getVerbosityOption() { StringConfigOption verbosityOption = new StringConfigOption("verbosity", "control verbosity of output for this component", "warning"); @@ -72,18 +87,22 @@ } public static BooleanConfigOption useAllConstructor() { - return new BooleanConfigOption("useAllConstructor", "specifies whether to universal concept constructor is used in the learning algorothm"); + return new BooleanConfigOption("useAllConstructor", "specifies whether the universal concept constructor is used in the learning algorithm",useAllConstructorDefault); } public static BooleanConfigOption useExistsConstructor() { - return new BooleanConfigOption("useExistsConstructor", "specifies whether to existential concept constructor is used in the learning algorothm"); + return new BooleanConfigOption("useExistsConstructor", "specifies whether the existential concept constructor is used in the learning algorithm",useExistsConstructorDefault); } + public static BooleanConfigOption useCardinalityRestrictions() { + return new BooleanConfigOption("useCardinalityRestrictions", "specifies whether CardinalityRestrictions is used in the learning algorithm",useCardinalityRestrictionsDefault); + } + public static BooleanConfigOption useNegation() { - return new BooleanConfigOption("useNegation", "specifies whether negation is used in the learning algorothm"); + return new BooleanConfigOption("useNegation", "specifies whether negation is used in the learning algorothm",useNegationDefault); } public static BooleanConfigOption useBooleanDatatypes() { - return new BooleanConfigOption("useBooleanDatatypes", "specifies whether boolean datatypes are used in the learning algorothm"); + return new BooleanConfigOption("useBooleanDatatypes", "specifies whether boolean datatypes are used in the learning algorothm",useBooleanDatatypesDefault); } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java 2008-04-10 13:20:09 UTC (rev 785) @@ -37,11 +37,11 @@ } public String toString(String baseURI, Map<String,String> prefixes) { - return "= " + number + " " + role.toString(baseURI, prefixes) + " " + getChild(0).toString(baseURI, prefixes); + return "= " + number + " " + role.toString(baseURI, prefixes) + "." + getChild(0).toString(baseURI, prefixes); } public String toKBSyntaxString(String baseURI, Map<String,String> prefixes) { - return "= " + number + " " + role.toKBSyntaxString(baseURI, prefixes) + " " + getChild(0).toKBSyntaxString(baseURI, prefixes); + return "= " + number + " " + role.toKBSyntaxString(baseURI, prefixes) + "." + getChild(0).toKBSyntaxString(baseURI, prefixes); } @Override Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java 2008-04-10 13:20:09 UTC (rev 785) @@ -14,11 +14,11 @@ } public String toString(String baseURI, Map<String,String> prefixes) { - return "<= " + number + " " + role.toString(baseURI, prefixes) + " " + getChild(0).toString(baseURI, prefixes); + return "<= " + number + " " + role.toString(baseURI, prefixes) + "." + getChild(0).toString(baseURI, prefixes); } public String toKBSyntaxString(String baseURI, Map<String,String> prefixes) { - return "<= " + number + " " + role.toKBSyntaxString(baseURI, prefixes) + " " + getChild(0).toKBSyntaxString(baseURI, prefixes); + return "<= " + number + " " + role.toKBSyntaxString(baseURI, prefixes) + "." + getChild(0).toKBSyntaxString(baseURI, prefixes); } @Override Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java 2008-04-10 13:20:09 UTC (rev 785) @@ -14,11 +14,11 @@ } public String toString(String baseURI, Map<String,String> prefixes) { - return ">= " + number + " " + role.toString(baseURI, prefixes) + " " + getChild(0).toString(baseURI, prefixes); + return ">= " + number + " " + role.toString(baseURI, prefixes) + "." + getChild(0).toString(baseURI, prefixes); } public String toKBSyntaxString(String baseURI, Map<String,String> prefixes) { - return ">= " + number + " " + role.toKBSyntaxString(baseURI, prefixes) + " " + getChild(0).toKBSyntaxString(baseURI, prefixes); + return ">= " + number + " " + role.toKBSyntaxString(baseURI, prefixes) + "." + getChild(0).toKBSyntaxString(baseURI, prefixes); } @Override Modified: trunk/src/dl-learner/org/dllearner/examples/KRK.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/KRK.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/examples/KRK.java 2008-04-10 13:20:09 UTC (rev 785) @@ -56,7 +56,7 @@ static boolean writeConciseOWLAllDifferent = false; - static boolean closeKB=true; + static boolean closeKB=false; static boolean closeConcise= true && closeKB; static boolean writeClosedOWL = true && closeKB; static boolean verifySomeConcepts = false && closeKB; Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-04-10 13:01:21 UTC (rev 784) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-04-10 13:20:09 UTC (rev 785) @@ -167,16 +167,17 @@ // private Map<NamedClass,Map<NamedClass,Boolean>> notABMeaningful = new TreeMap<NamedClass,Map<NamedClass,Boolean>>(); public RhoDRDown(ReasoningService reasoningService) { - this(reasoningService, true, true, true, true, true, true, null); + this(reasoningService, true, true, true, true, true, true, true, null); } public RhoDRDown(ReasoningService reasoningService, boolean applyAllFilter, boolean applyExistsFilter, boolean useAllConstructor, - boolean useExistsConstructor, boolean useNegation, boolean useBooleanDatatypes, NamedClass startClass) { + boolean useExistsConstructor,boolean useCardinalityRestrictions,boolean useNegation, boolean useBooleanDatatypes, NamedClass startClass) { this.rs = reasoningService; this.applyAllFilter = applyAllFilter; this.applyExistsFilter = applyExistsFilter; this.useAllConstructor = useAllConstructor; this.useExistsConstructor = useExistsConstructor; + this.useCardinalityRestrictions = useCardinalityRestrictions; this.useNegation = useNegation; this.useBooleanDatatypes = useBooleanDatatypes; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |