You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(120) |
Sep
(36) |
Oct
(116) |
Nov
(17) |
Dec
(44) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(143) |
Feb
(192) |
Mar
(74) |
Apr
(84) |
May
(105) |
Jun
(64) |
Jul
(49) |
Aug
(120) |
Sep
(159) |
Oct
(156) |
Nov
(51) |
Dec
(28) |
2009 |
Jan
(17) |
Feb
(55) |
Mar
(33) |
Apr
(57) |
May
(54) |
Jun
(28) |
Jul
(6) |
Aug
(16) |
Sep
(38) |
Oct
(30) |
Nov
(26) |
Dec
(52) |
2010 |
Jan
(7) |
Feb
(91) |
Mar
(65) |
Apr
(2) |
May
(14) |
Jun
(25) |
Jul
(38) |
Aug
(48) |
Sep
(80) |
Oct
(70) |
Nov
(75) |
Dec
(77) |
2011 |
Jan
(68) |
Feb
(53) |
Mar
(51) |
Apr
(35) |
May
(65) |
Jun
(101) |
Jul
(29) |
Aug
(230) |
Sep
(95) |
Oct
(49) |
Nov
(110) |
Dec
(63) |
2012 |
Jan
(41) |
Feb
(42) |
Mar
(25) |
Apr
(46) |
May
(51) |
Jun
(44) |
Jul
(45) |
Aug
(29) |
Sep
(12) |
Oct
(9) |
Nov
(17) |
Dec
(2) |
2013 |
Jan
(12) |
Feb
(14) |
Mar
(7) |
Apr
(16) |
May
(54) |
Jun
(27) |
Jul
(11) |
Aug
(5) |
Sep
(85) |
Oct
(27) |
Nov
(37) |
Dec
(32) |
2014 |
Jan
(8) |
Feb
(29) |
Mar
(5) |
Apr
(3) |
May
(22) |
Jun
(3) |
Jul
(4) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <ku...@us...> - 2009-02-17 19:18:36
|
Revision: 1608 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1608&view=rev Author: kurzum Date: 2009-02-17 19:18:32 +0000 (Tue, 17 Feb 2009) Log Message: ----------- tried to fix null in configoptions.txt, a little bit better now, but not perfect. import(""); is a CLI anomaly. fixed test script for extraction component worked on manual Modified Paths: -------------- trunk/doc/configOptions.txt trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/core/ComponentManager.java trunk/src/dl-learner/org/dllearner/test/SparqlExtractionTest.java Modified: trunk/doc/configOptions.txt =================================================================== --- trunk/doc/configOptions.txt 2009-02-17 15:28:41 UTC (rev 1607) +++ trunk/doc/configOptions.txt 2009-02-17 19:18:32 UTC (rev 1608) @@ -7,7 +7,7 @@ component: KB file (org.dllearner.kb.KBFile) ============================================ -CLI usage: null = null; +CLI usage: import ("$url", "null"); option name: url description: URL pointer to the KB file @@ -19,13 +19,13 @@ component: OWL API Ontology (org.dllearner.kb.OWLAPIOntology) ============================================================= -CLI usage: null = null; +CLI usage: import ("$url", "null"); component: OWL file (org.dllearner.kb.OWLFile) ============================================== -CLI usage: null = owlfile; +CLI usage: import ("$url", "owlfile"); option name: url description: URL pointing to the OWL file @@ -37,7 +37,7 @@ component: SPARQL Endpoint (org.dllearner.kb.sparql.SparqlKnowledgeSource) ========================================================================== -CLI usage: null = sparql; +CLI usage: import ("$url", "sparql"); option name: url description: URL of SPARQL Endpoint @@ -185,7 +185,7 @@ component: DIG reasoner (org.dllearner.reasoning.DIGReasoner) ============================================================= -CLI usage: null = digReasoner; +CLI usage: reasoner = digReasoner; option name: reasonerUrl description: URL of the DIG reasoner @@ -209,7 +209,7 @@ component: fast instance checker (org.dllearner.reasoning.FastInstanceChecker) ============================================================================== -CLI usage: null = fastInstanceChecker; +CLI usage: reasoner = fastInstanceChecker; option name: reasonerType description: FaCT++ or Pellet to dematerialize @@ -223,17 +223,23 @@ default value: true CLI usage: fastInstanceChecker.defaultNegation = true; +option name: forallRetrievalSemantics +description: This option controls how to interpret the all quantifier in orall r.C. The standard option isto return all those which do not have an r-filler not in C. The domain semantics is to use thosewhich are in the domain of r and do not have an r-filler not in C. The forallExists semantics is touse those which have at least one r-filler and do not have an r-filler not in C. +values: class org.dllearner.core.options.StringConfigOption +default value: forallExists +CLI usage: fastInstanceChecker.forallRetrievalSemantics = forallExists; + component: fast retrieval reasoner (org.dllearner.reasoning.FastRetrievalReasoner) ================================================================================== -CLI usage: null = fastRetrievalReasoner; +CLI usage: reasoner = fastRetrievalReasoner; component: OWL API reasoner (org.dllearner.reasoning.OWLAPIReasoner) ==================================================================== -CLI usage: null = owlAPIReasoner; +CLI usage: reasoner = owlAPIReasoner; option name: reasonerType description: FaCT++ or Pellet, which means "pellet" or "fact" @@ -249,164 +255,152 @@ component: unnamed component (org.dllearner.learningproblems.ClassLearningProblem) ================================================================================== -CLI usage: null = null; +CLI usage: problem = classLearning; option name: classToDescribe description: class of which a description should be learned values: class org.dllearner.core.options.StringConfigOption default value: null -CLI usage: null.classToDescribe = null; +CLI usage: classLearning.classToDescribe = null; option name: type description: Whether to learn an equivalence class or super class axiom. values: class org.dllearner.core.options.StringConfigOption default value: equivalence -CLI usage: null.type = equivalence; +CLI usage: classLearning.type = equivalence; -component: two valued definition learning problem (org.dllearner.learningproblems.PosNegDefinitionLP) -===================================================================================================== +component: two valued inclusion learning problem (org.dllearner.learningproblems.PosNegInclusionLP) +=================================================================================================== -CLI usage: null = posNegDefinitionLP; +CLI usage: problem = posNegInclusionLP; option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegDefinitionLP.positiveExamples = null; +CLI usage: posNegInclusionLP.positiveExamples = null; option name: negativeExamples description: negative examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegDefinitionLP.negativeExamples = null; +CLI usage: posNegInclusionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: posNegDefinitionLP.useRetrievalForClassficiation = false; +CLI usage: posNegInclusionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 -CLI usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; +CLI usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. values: class org.dllearner.core.options.StringConfigOption default value: twoChecks -CLI usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; +CLI usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; -component: three valued definition learning problem (org.dllearner.learningproblems.PosNegDefinitionLPStrict) -============================================================================================================= +component: two valued definition learning problem (org.dllearner.learningproblems.PosNegLPStandard) +=================================================================================================== -CLI usage: null = null; +CLI usage: problem = posNegDefinitionLP; option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: null.positiveExamples = null; +CLI usage: posNegDefinitionLP.positiveExamples = null; option name: negativeExamples description: negative examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: null.negativeExamples = null; +CLI usage: posNegDefinitionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: null.useRetrievalForClassficiation = false; +CLI usage: posNegDefinitionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 -CLI usage: null.percentPerLenghtUnit = 0.05; +CLI usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. values: class org.dllearner.core.options.StringConfigOption default value: twoChecks -CLI usage: null.useMultiInstanceChecks = twoChecks; +CLI usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; -option name: penaliseNeutralExamples -description: if set to true neutral examples are penalised -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: null.penaliseNeutralExamples = null; -option name: accuracyPenalty -description: penalty for pos/neg examples which are classified as neutral -values: class org.dllearner.core.options.DoubleConfigOption -default value: 1.0 -CLI usage: null.accuracyPenalty = 1.0; - -option name: errorPenalty -description: penalty for pos. examples classified as negative or vice versa -values: class org.dllearner.core.options.DoubleConfigOption -default value: 3.0 -CLI usage: null.errorPenalty = 3.0; - - -component: two valued inclusion learning problem (org.dllearner.learningproblems.PosNegInclusionLP) +component: three valued definition learning problem (org.dllearner.learningproblems.PosNegLPStrict) =================================================================================================== -CLI usage: null = posNegInclusionLP; +CLI usage: problem = posNegDefinitionLPStrict; option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegInclusionLP.positiveExamples = null; +CLI usage: posNegDefinitionLPStrict.positiveExamples = null; option name: negativeExamples description: negative examples values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: posNegInclusionLP.negativeExamples = null; +CLI usage: posNegDefinitionLPStrict.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: posNegInclusionLP.useRetrievalForClassficiation = false; +CLI usage: posNegDefinitionLPStrict.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 -CLI usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; +CLI usage: posNegDefinitionLPStrict.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. values: class org.dllearner.core.options.StringConfigOption default value: twoChecks -CLI usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; +CLI usage: posNegDefinitionLPStrict.useMultiInstanceChecks = twoChecks; +option name: penaliseNeutralExamples +description: if set to true neutral examples are penalised +values: class org.dllearner.core.options.BooleanConfigOption +default value: null +CLI usage: posNegDefinitionLPStrict.penaliseNeutralExamples = null; -component: positive only definition learning problem (org.dllearner.learningproblems.PosOnlyDefinitionLP) -========================================================================================================= +option name: accuracyPenalty +description: penalty for pos/neg examples which are classified as neutral +values: class org.dllearner.core.options.DoubleConfigOption +default value: 1.0 +CLI usage: posNegDefinitionLPStrict.accuracyPenalty = 1.0; -CLI usage: null = posOnlyDefinitionLP; +option name: errorPenalty +description: penalty for pos. examples classified as negative or vice versa +values: class org.dllearner.core.options.DoubleConfigOption +default value: 3.0 +CLI usage: posNegDefinitionLPStrict.errorPenalty = 3.0; -option name: positiveExamples -description: positive examples -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: posOnlyDefinitionLP.positiveExamples = null; +component: positive only definition learning problem (org.dllearner.learningproblems.PosOnlyLP) +=============================================================================================== -component: pos only inclusion learning problem (org.dllearner.learningproblems.PosOnlyInclusionLP) -================================================================================================== +CLI usage: problem = null; -CLI usage: null = null; - option name: positiveExamples description: positive examples values: class org.dllearner.core.options.StringSetConfigOption @@ -421,7 +415,7 @@ component: brute force learning algorithm (org.dllearner.algorithms.BruteForceLearner) ====================================================================================== -CLI usage: null = bruteForce; +CLI usage: algorithm = bruteForce; option name: maxLength description: maximum length of generated concepts @@ -436,226 +430,112 @@ CLI usage: bruteForce.returnType = null; -component: DBpedia Navigation Suggestor (org.dllearner.algorithms.DBpediaNavigationSuggestor) -============================================================================================= +component: random guesser learning algorithm (org.dllearner.algorithms.RandomGuesser) +===================================================================================== -CLI usage: null = dbpediaNavigationSuggestor; +CLI usage: algorithm = random; -option name: writeSearchTree -description: specifies whether to write a search tree -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: dbpediaNavigationSuggestor.writeSearchTree = false; +option name: numberOfTrees +description: number of randomly generated concepts/trees +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: random.numberOfTrees = 5; -option name: searchTreeFile -description: file to use for the search tree -values: class org.dllearner.core.options.StringConfigOption -default value: log/searchTree.txt -CLI usage: dbpediaNavigationSuggestor.searchTreeFile = log/searchTree.txt; +option name: maxDepth +description: maximum depth of generated concepts/trees +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: random.maxDepth = 5; -option name: replaceSearchTree -description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: dbpediaNavigationSuggestor.replaceSearchTree = false; -option name: heuristic -description: specifiy the heuristic to use -values: class org.dllearner.core.options.StringConfigOption -default value: lexicographic -CLI usage: dbpediaNavigationSuggestor.heuristic = lexicographic; +component: CELOE (org.dllearner.algorithms.celoe.CELOE) +======================================================= -option name: applyAllFilter -description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.applyAllFilter = true; +CLI usage: algorithm = celoe; -option name: applyExistsFilter -description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.applyExistsFilter = true; - -option name: useTooWeakList -description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useTooWeakList = true; - -option name: useOverlyGeneralList -description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useOverlyGeneralList = true; - -option name: useShortConceptConstruction -description: shorten concept to see whether they already exist -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useShortConceptConstruction = true; - -option name: horizontalExpansionFactor -description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 -default value: 0.6 -CLI usage: dbpediaNavigationSuggestor.horizontalExpansionFactor = 0.6; - -option name: improveSubsumptionHierarchy -description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.improveSubsumptionHierarchy = true; - -option name: allowedConcepts -description: concepts the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.allowedConcepts = null; - -option name: ignoredConcepts -description: concepts the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.ignoredConcepts = null; - -option name: allowedRoles -description: roles the algorithm is allowed to use -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.allowedRoles = null; - -option name: ignoredRoles -description: roles the algorithm must ignore -values: class org.dllearner.core.options.StringSetConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.ignoredRoles = null; - option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useAllConstructor = true; +CLI usage: celoe.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useExistsConstructor = true; +CLI usage: celoe.useExistsConstructor = true; -option name: useCardinalityRestrictions -description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: dbpediaNavigationSuggestor.useCardinalityRestrictions = true; - option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: dbpediaNavigationSuggestor.useHasValueConstructor = false; +CLI usage: celoe.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions values: class org.dllearner.core.options.IntegerConfigOption default value: 3 -CLI usage: dbpediaNavigationSuggestor.valueFrequencyThreshold = 3; +CLI usage: celoe.valueFrequencyThreshold = 3; +option name: useCardinalityRestrictions +description: specifies whether CardinalityRestrictions is used in the learning algorithm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: celoe.useCardinalityRestrictions = true; + +option name: cardinalityLimit +description: Gives the maximum number used in cardinality restrictions. +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: celoe.cardinalityLimit = 5; + option name: useNegation description: specifies whether negation is used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useNegation = true; +CLI usage: celoe.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: dbpediaNavigationSuggestor.useBooleanDatatypes = true; +CLI usage: celoe.useBooleanDatatypes = true; +option name: useDoubleDatatypes +description: specifies whether boolean datatypes are used in the learning algorothm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: celoe.useDoubleDatatypes = true; + option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: dbpediaNavigationSuggestor.maxExecutionTimeInSeconds = 0; +default value: 10 +CLI usage: celoe.maxExecutionTimeInSeconds = 10; -option name: minExecutionTimeInSeconds -description: algorithm will run at least specified seconds -values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: dbpediaNavigationSuggestor.minExecutionTimeInSeconds = 0; - -option name: guaranteeXgoodDescriptions -description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.options.IntegerConfigOption -default value: 1 -CLI usage: dbpediaNavigationSuggestor.guaranteeXgoodDescriptions = 1; - -option name: logLevel -description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.options.StringConfigOption -default value: DEBUG -CLI usage: dbpediaNavigationSuggestor.logLevel = DEBUG; - option name: noisePercentage description: the (approximated) percentage of noise within the examples values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 default value: 0.0 -CLI usage: dbpediaNavigationSuggestor.noisePercentage = 0.0; +CLI usage: celoe.noisePercentage = 0.0; -option name: startClass -description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.startClass = null; - -option name: forceRefinementLengthIncrease -description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: dbpediaNavigationSuggestor.forceRefinementLengthIncrease = null; - - -component: random guesser learning algorithm (org.dllearner.algorithms.RandomGuesser) -===================================================================================== - -CLI usage: null = random; - -option name: numberOfTrees -description: number of randomly generated concepts/trees -values: class org.dllearner.core.options.IntegerConfigOption -default value: 5 -CLI usage: random.numberOfTrees = 5; - option name: maxDepth -description: maximum depth of generated concepts/trees +description: maximum depth of description values: class org.dllearner.core.options.IntegerConfigOption -default value: 5 -CLI usage: random.maxDepth = 5; +default value: 4 +CLI usage: celoe.maxDepth = 4; -component: simple suggestion algorithm (org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm) -=================================================================================================== - -CLI usage: null = null; - - -component: unnamed component (org.dllearner.algorithms.celoe.CELOE) -=================================================================== - -CLI usage: null = null; - - component: standard EL learning algorithm (org.dllearner.algorithms.el.ELLearningAlgorithm) =========================================================================================== -CLI usage: null = el; +CLI usage: algorithm = el; component: genetic programming learning algorithm (org.dllearner.algorithms.gp.GP) ================================================================================== -CLI usage: null = gp; +CLI usage: algorithm = gp; option name: selectionType description: selection type @@ -760,399 +640,399 @@ CLI usage: gp.maxConceptLength = 75; -component: refinement operator based learning algorithm II (org.dllearner.algorithms.refexamples.ExampleBasedROLComponent) -========================================================================================================================== +component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) +======================================================================================================= -CLI usage: null = refexamples; +CLI usage: algorithm = refinement; option name: writeSearchTree description: specifies whether to write a search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refexamples.writeSearchTree = false; +CLI usage: refinement.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt -CLI usage: refexamples.searchTreeFile = log/searchTree.txt; +CLI usage: refinement.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refexamples.replaceSearchTree = false; +CLI usage: refinement.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use values: class org.dllearner.core.options.StringConfigOption default value: lexicographic -CLI usage: refexamples.heuristic = lexicographic; +CLI usage: refinement.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.applyAllFilter = true; +CLI usage: refinement.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.applyExistsFilter = true; +CLI usage: refinement.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useTooWeakList = true; +CLI usage: refinement.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useOverlyGeneralList = true; +CLI usage: refinement.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useShortConceptConstruction = true; +CLI usage: refinement.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 -CLI usage: refexamples.horizontalExpansionFactor = 0.6; +CLI usage: refinement.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.improveSubsumptionHierarchy = true; +CLI usage: refinement.improveSubsumptionHierarchy = true; +option name: quiet +description: may be deprecated soon +values: class org.dllearner.core.options.BooleanConfigOption +default value: false +CLI usage: refinement.quiet = false; + option name: allowedConcepts description: concepts the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.allowedConcepts = null; +CLI usage: refinement.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.ignoredConcepts = null; +CLI usage: refinement.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.allowedRoles = null; +CLI usage: refinement.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refexamples.ignoredRoles = null; +CLI usage: refinement.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useAllConstructor = true; +CLI usage: refinement.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useExistsConstructor = true; +CLI usage: refinement.useExistsConstructor = true; -option name: useHasValueConstructor -description: specifies whether the hasValue constructor is used in the learning algorithm +option name: useNegation +description: specifies whether negation is used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: refexamples.useHasValueConstructor = false; +default value: true +CLI usage: refinement.useNegation = true; -option name: valueFrequencyThreshold -description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.options.IntegerConfigOption -default value: 3 -CLI usage: refexamples.valueFrequencyThreshold = 3; - option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useCardinalityRestrictions = true; +CLI usage: refinement.useCardinalityRestrictions = true; -option name: cardinalityLimit -description: Gives the maximum number used in cardinality restrictions. -values: class org.dllearner.core.options.IntegerConfigOption -default value: 5 -CLI usage: refexamples.cardinalityLimit = 5; - -option name: useNegation -description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refexamples.useNegation = true; - option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refexamples.useBooleanDatatypes = true; +CLI usage: refinement.useBooleanDatatypes = true; -option name: useDoubleDatatypes -description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refexamples.useDoubleDatatypes = true; - option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refexamples.maxExecutionTimeInSeconds = 0; +CLI usage: refinement.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refexamples.minExecutionTimeInSeconds = 0; +CLI usage: refinement.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found values: class org.dllearner.core.options.IntegerConfigOption default value: 1 -CLI usage: refexamples.guaranteeXgoodDescriptions = 1; +CLI usage: refinement.guaranteeXgoodDescriptions = 1; -option name: maxClassDescriptionTests -description: The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.) -values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: refexamples.maxClassDescriptionTests = 0; - option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} values: class org.dllearner.core.options.StringConfigOption default value: DEBUG -CLI usage: refexamples.logLevel = DEBUG; +CLI usage: refinement.logLevel = DEBUG; -option name: usePropernessChecks -description: specifies whether to check for equivalence (i.e. discard equivalent refinements) -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: refexamples.usePropernessChecks = false; -option name: maxPosOnlyExpansion -description: specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate -values: class org.dllearner.core.options.IntegerConfigOption -default value: 4 -CLI usage: refexamples.maxPosOnlyExpansion = 4; +component: refinement operator based learning algorithm II (org.dllearner.algorithms.refinement2.ROLComponent2) +=============================================================================================================== -option name: noisePercentage -description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 -default value: 0.0 -CLI usage: refexamples.noisePercentage = 0.0; +CLI usage: algorithm = refexamples; -option name: terminateOnNoiseReached -description: specifies whether to terminate when noise criterion is met -values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refexamples.terminateOnNoiseReached = true; - -option name: startClass -description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.options.StringConfigOption -default value: null -CLI usage: refexamples.startClass = null; - -option name: forceRefinementLengthIncrease -description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.options.BooleanConfigOption -default value: null -CLI usage: refexamples.forceRefinementLengthIncrease = null; - -option name: negativeWeight -description: Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives). -values: class org.dllearner.core.options.DoubleConfigOption -default value: 1.0 -CLI usage: refexamples.negativeWeight = 1.0; - -option name: startNodeBonus -description: You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space). -values: class org.dllearner.core.options.DoubleConfigOption -default value: 0.0 -CLI usage: refexamples.startNodeBonus = 0.0; - -option name: negationPenalty -description: Penalty on negations (TODO: better explanation). -values: class org.dllearner.core.options.IntegerConfigOption -default value: 0 -CLI usage: refexamples.negationPenalty = 0; - -option name: expansionPenaltyFactor -description: describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.options.DoubleConfigOption -default value: 0.02 -CLI usage: refexamples.expansionPenaltyFactor = 0.02; - - -component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) -======================================================================================================= - -CLI usage: null = refinement; - option name: writeSearchTree description: specifies whether to write a search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refinement.writeSearchTree = false; +CLI usage: refexamples.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt -CLI usage: refinement.searchTreeFile = log/searchTree.txt; +CLI usage: refexamples.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree values: class org.dllearner.core.options.BooleanConfigOption default value: false -CLI usage: refinement.replaceSearchTree = false; +CLI usage: refexamples.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use values: class org.dllearner.core.options.StringConfigOption default value: lexicographic -CLI usage: refinement.heuristic = lexicographic; +CLI usage: refexamples.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.applyAllFilter = true; +CLI usage: refexamples.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.applyExistsFilter = true; +CLI usage: refexamples.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useTooWeakList = true; +CLI usage: refexamples.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useOverlyGeneralList = true; +CLI usage: refexamples.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useShortConceptConstruction = true; +CLI usage: refexamples.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 -CLI usage: refinement.horizontalExpansionFactor = 0.6; +CLI usage: refexamples.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.improveSubsumptionHierarchy = true; +CLI usage: refexamples.improveSubsumptionHierarchy = true; -option name: quiet -description: may be deprecated soon -values: class org.dllearner.core.options.BooleanConfigOption -default value: false -CLI usage: refinement.quiet = false; - option name: allowedConcepts description: concepts the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.allowedConcepts = null; +CLI usage: refexamples.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.ignoredConcepts = null; +CLI usage: refexamples.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.allowedRoles = null; +CLI usage: refexamples.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore values: class org.dllearner.core.options.StringSetConfigOption default value: null -CLI usage: refinement.ignoredRoles = null; +CLI usage: refexamples.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useAllConstructor = true; +CLI usage: refexamples.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useExistsConstructor = true; +CLI usage: refexamples.useExistsConstructor = true; -option name: useNegation -description: specifies whether negation is used in the learning algorothm +option name: useHasValueConstructor +description: specifies whether the hasValue constructor is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption -default value: true -CLI usage: refinement.useNegation = true; +default value: false +CLI usage: refexamples.useHasValueConstructor = false; +option name: valueFrequencyThreshold +description: specifies how often an object must occur as value in order to be considered for hasValue restrictions +values: class org.dllearner.core.options.IntegerConfigOption +default value: 3 +CLI usage: refexamples.valueFrequencyThreshold = 3; + option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useCardinalityRestrictions = true; +CLI usage: refexamples.useCardinalityRestrictions = true; +option name: cardinalityLimit +description: Gives the maximum number used in cardinality restrictions. +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: refexamples.cardinalityLimit = 5; + +option name: useNegation +description: specifies whether negation is used in the learning algorothm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.useNegation = true; + option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm values: class org.dllearner.core.options.BooleanConfigOption default value: true -CLI usage: refinement.useBooleanDatatypes = true; +CLI usage: refexamples.useBooleanDatatypes = true; +option name: useDoubleDatatypes +description: specifies whether boolean datatypes are used in the learning algorothm +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.useDoubleDatatypes = true; + option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refinement.maxExecutionTimeInSeconds = 0; +CLI usage: refexamples.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds values: class org.dllearner.core.options.IntegerConfigOption default value: 0 -CLI usage: refinement.minExecutionTimeInSeconds = 0; +CLI usage: refexamples.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found values: class org.dllearner.core.options.IntegerConfigOption default value: 1 -CLI usage: refinement.guaranteeXgoodDescriptions = 1; +CLI usage: refexamples.guaranteeXgoodDescriptions = 1; +option name: maxClassDescriptionTests +description: The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.) +values: class org.dllearner.core.options.IntegerConfigOption +default value: 0 +CLI usage: refexamples.maxClassDescriptionTests = 0; + option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} values: class org.dllearner.core.options.StringConfigOption default value: DEBUG -CLI usage: refinement.logLevel = DEBUG; +CLI usage: refexamples.logLevel = DEBUG; +option name: usePropernessChecks +description: specifies whether to check for equivalence (i.e. discard equivalent refinements) +values: class org.dllearner.core.options.BooleanConfigOption +default value: false +CLI usage: refexamples.usePropernessChecks = false; +option name: maxPosOnlyExpansion +description: specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate +values: class org.dllearner.core.options.IntegerConfigOption +default value: 4 +CLI usage: refexamples.maxPosOnlyExpansion = 4; + +option name: noisePercentage +description: the (approximated) percentage of noise within the examples +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 +default value: 0.0 +CLI usage: refexamples.noisePercentage = 0.0; + +option name: terminateOnNoiseReached +description: specifies whether to terminate when noise criterion is met +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.terminateOnNoiseReached = true; + +option name: startClass +description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) +values: class org.dllearner.core.options.StringConfigOption +default value: null +CLI usage: refexamples.startClass = null; + +option name: forceRefinementLengthIncrease +description: specifies whether nodes should be expanded until only longer refinements are reached +values: class org.dllearner.core.options.BooleanConfigOption +default value: null +CLI usage: refexamples.forceRefinementLengthIncrease = null; + +option name: negativeWeight +description: Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 1.0 +CLI usage: refexamples.negativeWeight = 1.0; + +option name: startNodeBonus +description: You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.0 +CLI usage: refexamples.startNodeBonus = 0.0; + +option name: negationPenalty +description: Penalty on negations (TODO: better explanation). +values: class org.dllearner.core.options.IntegerConfigOption +default value: 0 +CLI usage: refexamples.negationPenalty = 0; + +option name: expansionPenaltyFactor +description: describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.02 +CLI usage: refexamples.expansionPenaltyFactor = 0.02; + + Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-17 15:28:41 UTC (rev 1607) +++ trunk/doc/manual/manual.tex 2009-02-17 19:18:32 UTC (rev 1608) @@ -54,7 +54,7 @@ In the most common scenario we consider, supervised learning in OWL/DLs, means that we have a background knowledge base in OWL/DLs. Additionally, we are given positive and negative examples. Each example is an individual in our knowledge base. The goal is to find an OWL \emph{class expression}\footnote{\owlce} such that all/many of the positive examples are \emph{instances} of this expression and none/few of the negative examples are instances of it. The primary purpose of learning is to find a class expression, which can classify unseen individuals (i.e.~not belonging to the examples) correctly. It is also important that the obtained class expression is easy to understand for a domain expert. We call these criteria \emph{accuracy} and \emph{readability}. -As an example, consider the problem to find out whether a chemical compound can cause cancer\footnote{see \carc{} for a more detailed description}. In this case, the background knowledge contains information about chemical compounds in general and certain compounds we are interested in. The positive examples are those compounds causing cancer, whereas the negative examples are those compounds not causing cancer. The prediction for the examples is likely to have been obtained from experiments and long-term research trials in this case. Of course, all examples have to be present in the considered background knowledge. A learning algorithm can now derive a class expression from examples and background knowledge, e.g.~this class expression in natural language could be ``chemical compounds containing a phosphorus atom''. (Of course, in practice the expression will be more complex to obtain a reasonable accuracy.) Using this class expression, we can no classify unseen chemical compounds. +As an example, consider the problem to find out whether a chemical compound can cause cancer\footnote{see \carc{} for a more detailed description}. In this case, the background knowledge contains information about chemical compounds in general and certain compounds we are interested in. The positive examples are those compounds causing cancer, whereas the negative examples are those compounds not causing cancer. The prediction for the examples is likely to have been obtained from experiments and long-term research trials in this case. Of course, all examples have to be present in the considered background knowledge. A learning algorithm can now derive a class expression from examples and background knowledge, e.g.~this class expression in natural language could be ``chemical compounds containing a phosphorus atom''. (Of course, in practice the expression will be more complex to obtain a reasonable accuracy.) Using this class expression, we can not classify unseen chemical compounds. \section{Getting Started} \label{sec:start} @@ -119,22 +119,25 @@ \section{DL-Learner Components} \label{sec:components} -In this part, we describe concrete components currently implemented in DL-Learner. Each of the subsections contains a list of components of type specified in the subsection heading. Note that this constitute a full description, i.e.~we omit some components and many configuration options. The purpose of the manual is to obtain a general understanding of the implemented components. A full list of components, which is generated automatically from the source code, can be found in \verb|doc/configOptions.txt| including the default values for all options and their usage in conf files. \todo{ConfigDocumentationGenerator seems partially broken, because it prints things like CLI usage: null = owlAPIReasoner;} +In this part, we describe concrete components currently implemented in DL-Learner. Each of the subsections contains a list of components according to the type specified in the subsection heading. Note that this does not constitute a full description, i.e.~we omit some components and many configuration options. The purpose of the manual is to obtain a general understanding of the implemented components. A full list of components, which is generated automatically from the source code, can be found in \verb|doc/configOptions.txt| including the default values for all options and their usage in conf files. \todo{ConfigDocumentationGenerator seems partially broken, because it prints things like CLI usage: null = owlAPIReasoner;} \subsection{Knowledge Sources} Knowledge sources have a URI and can be included in conf files using \verb|import("$url");|, e.g.~\verb|import("ontology.owl")|. Depending on the file ending, DL-Learner will guess the correct type of knowledge source. If you want to overwrite this, you can use a second parameter with value \verb|OWL|, \verb|KB|, or \verb|SPARQL|, e.g.~\verb|import("ontology.owl","OWL")|. \begin{description} - \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. + \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. Note: As we use the OWL API for parsing, all formats supported by it are possible\footnote{ for a list see \url{http://owlapi.sourceforge.net/}}. \item[KB File] KB files are an internal non-standardised knowledge representation format, which corresponds to description logic syntax except that the special symbols have been replaced by ASCII strings, e.g.~\verb|AND| instead of $\sqcap$. You can find several KB files in the examples folder. - \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently to be processed in reasonable time. Please see \cite{2009_ijswis} for details. Some options of the SPARQL component are: + \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently small to be processed in reasonable time. Please see \cite{2009_ijswis} for details, the parameters for the extraction algorithm are similar (different names only) to the ones here. Some options of the SPARQL component are: \begin{itemize} \item instances: Set of individuals to use for starting the knowledge fragment extraction. Example use in conf file: \begin{verbatim}sparql.instances = {"http://dbpedia.org/resource/Matt_Stone", "http://dbpedia.org/resource/Sarah_Silverman"};\end{verbatim} - \item recursionDepth: Maximum distance of an extracted individual from a start individual. This influences the size of the extracted fragment and depends on the maximum property depth you want the learned class expression to have. Example use in conf file: \verb|sparql.recursionDepth = 3;|. + \item recursionDepth: Maximum distance of an extracted individual from a start individual. This influences the size of the extracted fragment and depends on the maximum property depth you want the learned class expression to have. Example use in conf file: \verb|sparql.recursionDepth = 1;|. +\item pecifies whether the extracted ontology is written to a file or not. The OWL file is written to the cache dir. The output is produced by OWL API, which does not check URI validity, but rather writes invalid XML. +\verb|sparql.saveExtractedFragment = true;| \end{itemize} Many further options allow to modify the extracted fragment on the fly or fine-tune the extraction process. +The extraction can be started separately by running and modifying \verb|org.dllearner.test.SparqlExtractionTest|. The collected ontology will be saved in the root dir. \end{description} \subsection{Reasoner Components} @@ -147,12 +150,13 @@ \item reasonerType: Selects the desired reasoner. By default, Pellet is used. Usage: \verb|owlAPIReasoner.reasonerType = fact;|. Note that FaCT++ is written in C++ and we currently ship the 32 bit version of the JNI layer. This may change to 64 bit in the future. \end{itemize} \item[DIG] DIG 1.1\footnote{\dig} is an interface to description logic reasoners and supported by a large variety of reasoners including Pellet, FaCT++, KAON2, and Racer Pro. The major drawback is that the current version DIG 1.1 is not aligned with the OWL specification and therefore lacks several features, which are crucial to the more recent learning algorithms in DL-Learner. If you still want to use the DIG interface, you have to download a DIG capable reasoner and start the DIG server there. DL-Learner communicates with the reasoner using the XML based protocol over HTTP. - \item[Fast Instance Checker] Instance checks, i.e.~testing whether an individual is instance of a class, is the major reasoner task in many learning algorithms. This reasoner is a self-developed for the DL-Learner project. It remedies some problems related to Machine Learning and the Open World Assumption in OWL and therefore is not correct w.r.t.~OWL semantics. (See \cite{cheng00} Section 4 for an explanation.) Furthermore, it provides an improved performance for instance checks by precomputing some inferences. The fast instance checker is build on top of Pellet and the default reasoner component in DL-Learner. + \item[Fast Instance Checker] Instance checks, i.e.~testing whether an individual is instance of a class, is the major reasoner task in many learning algorithms. This reasoner is a self-development of the DL-Learner project. It remedies some problems related to Machine Learning and the Open World Assumption in OWL and therefore is not correct w.r.t.~OWL semantics. (See \cite{cheng00} Section 4 for an explanation.) Furthermore, it provides an improved performance for instance checks by precomputing some inferences. The fast instance checker is build on top of Pellet and the default reasoner component in DL-Learner. \end{description} \subsection{Learning Problems} In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|$value| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. +Default is \verb|posNegDefinitionLP;|. \begin{description} \item[Positive a... [truncated message content] |
From: <jen...@us...> - 2009-02-17 15:28:47
|
Revision: 1607 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1607&view=rev Author: jenslehmann Date: 2009-02-17 15:28:41 +0000 (Tue, 17 Feb 2009) Log Message: ----------- OE algorithm ctd. Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-16 17:09:30 UTC (rev 1606) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-17 15:28:41 UTC (rev 1607) @@ -204,6 +204,7 @@ int horizExp = bestNode.getHorizontalExpansion(); // apply operator + System.out.println(bestNode.getDescription()); TreeSet<Description> refinements = refineNode(bestNode); while(refinements.size() != 0) { @@ -301,7 +302,8 @@ } private boolean terminationCriteriaSatisfied() { - return stop || (System.nanoTime() - nanoStartTime >= (configurator.getMaxExecutionTimeInSeconds()*1000000)); +// double runtimeSec = (System.nanoTime() - nanoStartTime; + return stop || (System.nanoTime() - nanoStartTime >= (configurator.getMaxExecutionTimeInSeconds()*1000000000)); } private void reset() { Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2009-02-16 17:09:30 UTC (rev 1606) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2009-02-17 15:28:41 UTC (rev 1607) @@ -19,21 +19,47 @@ */ package org.dllearner.algorithms.celoe; -import java.util.Comparator; - /** + * 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 OEHeuristicRuntime implements OEHeuristic { - - /* (non-Javadoc) - * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) - */ + + // 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 has very many children since exploring such a node is + // computationally very expensive + private double nodeChildPenalty = 0.0005; + @Override - public int compare(OENode o1, OENode o2) { - // TODO Auto-generated method stub - return 0; + public int compare(OENode node1, OENode node2) { + double diff = getNodeScore(node1) - getNodeScore(node2); + if(diff>0) + return 1; + else if(diff<0) + return -1; + else + return 0; } + public double getNodeScore(OENode 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.getChildren().size() * nodeChildPenalty; + return score; + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-16 17:09:30 UTC (rev 1606) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-17 15:28:41 UTC (rev 1607) @@ -19,6 +19,7 @@ */ package org.dllearner.algorithms.celoe; +import java.util.LinkedList; import java.util.List; import org.dllearner.core.owl.Description; @@ -47,7 +48,7 @@ private int horizontalExpansion; private OENode parent; - private List<OENode> children; + private List<OENode> children = new LinkedList<OENode>(); public OENode(OENode parentNode, Description description, double accuracy) { this.parent = parentNode; @@ -64,6 +65,10 @@ horizontalExpansion++; } + public boolean isRoot() { + return (parent == null); + } + /** * @return the description */ Modified: trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java 2009-02-16 17:09:30 UTC (rev 1606) +++ trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java 2009-02-17 15:28:41 UTC (rev 1607) @@ -20,13 +20,13 @@ package org.dllearner.core.configurators; /** - * Common options of refinement operators. + * Common options of refinement operators (manually created interface). * * @author Jens Lehmann * */ public abstract class RefinementOperatorConfigurator { + public abstract boolean getUseCardinalityRestrictions(); - } Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-16 17:09:30 UTC (rev 1606) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-17 15:28:41 UTC (rev 1607) @@ -190,7 +190,9 @@ public RhoDRDown(ReasonerComponent reasoner, ClassHierarchy subHierarchy, RefinementOperatorConfigurator configurator) { this.rs = reasoner; this.subHierarchy = subHierarchy; + useCardinalityRestrictions = configurator.getUseCardinalityRestrictions(); // TODO add more options from configurator object + init(); } // TODO constructor which takes a RhoDRDownConfigurator object; @@ -212,9 +214,11 @@ this.useNegation = useNegation; this.useBooleanDatatypes = useBooleanDatatypes; this.useDoubleDatatypes = useDoubleDatatypes; + init(); + } // subHierarchy = rs.getClassHierarchy(); - + public void init() { // query reasoner for domains and ranges // (because they are used often in the operator) for(ObjectProperty op : rs.getObjectProperties()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-16 17:09:37
|
Revision: 1606 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1606&view=rev Author: jenslehmann Date: 2009-02-16 17:09:30 +0000 (Mon, 16 Feb 2009) Log Message: ----------- continued ontology engineering algorithm Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java Added Paths: ----------- trunk/examples/family/father_oe.conf trunk/examples/family/father_oe.owl Added: trunk/examples/family/father_oe.conf =================================================================== --- trunk/examples/family/father_oe.conf (rev 0) +++ trunk/examples/family/father_oe.conf 2009-02-16 17:09:30 UTC (rev 1606) @@ -0,0 +1,7 @@ + +import("father_oe.owl"); + +problem = classLearning; +classLearning.classToDescribe = "http://example.com/father#father"; + +algorithm = celoe; Added: trunk/examples/family/father_oe.owl =================================================================== --- trunk/examples/family/father_oe.owl (rev 0) +++ trunk/examples/family/father_oe.owl 2009-02-16 17:09:30 UTC (rev 1606) @@ -0,0 +1,136 @@ +<?xml version="1.0"?> + + +<!DOCTYPE rdf:RDF [ + <!ENTITY father "http://example.com/father#" > + <!ENTITY owl "http://www.w3.org/2002/07/owl#" > + <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > + <!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" > + <!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://example.com/father#" + xml:base="http://example.com/father" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#" + 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#" + xmlns:father="http://example.com/father#"> + <owl:Ontology rdf:about=""/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Object Properties + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/father#hasChild --> + + <owl:ObjectProperty rdf:about="#hasChild"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Classes + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/father#father --> + + <owl:Class rdf:about="#father"> + <rdfs:subClassOf rdf:resource="#male"/> + </owl:Class> + + + + <!-- http://example.com/father#female --> + + <owl:Class rdf:about="#female"> + <owl:disjointWith rdf:resource="#male"/> + </owl:Class> + + + + <!-- http://example.com/father#male --> + + <owl:Class rdf:about="#male"/> + + + + <!-- + /////////////////////////////////////////////////////////////////////////////////////// + // + // Individuals + // + /////////////////////////////////////////////////////////////////////////////////////// + --> + + + + + <!-- http://example.com/father#anna --> + + <female rdf:about="#anna"> + <hasChild rdf:resource="#heinz"/> + </female> + + + + <!-- http://example.com/father#heinz --> + + <male rdf:about="#heinz"/> + + + + <!-- http://example.com/father#markus --> + + <male rdf:about="#markus"> + <rdf:type rdf:resource="#father"/> + <hasChild rdf:resource="#anna"/> + </male> + + + + <!-- http://example.com/father#martin --> + + <male rdf:about="#martin"> + <rdf:type rdf:resource="#father"/> + <hasChild rdf:resource="#heinz"/> + </male> + + + + <!-- http://example.com/father#michelle --> + + <female rdf:about="#michelle"/> + + + + <!-- http://example.com/father#stefan --> + + <father rdf:about="#stefan"> + <rdf:type rdf:resource="#male"/> + <hasChild rdf:resource="#markus"/> + </father> +</rdf:RDF> + + + +<!-- Generated by the OWL API (version 2.2.1.974) http://owlapi.sourceforge.net --> + Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -19,9 +19,11 @@ */ package org.dllearner.algorithms.celoe; +import java.text.DecimalFormat; import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -85,7 +87,13 @@ // important parameters private double minAcc; + private double maxDepth; + // utility variables + private String baseURI; + private Map<String, String> prefixes; + DecimalFormat dfPercent = new DecimalFormat("0.00%"); + @Override public Configurator getConfigurator() { return configurator; @@ -93,6 +101,7 @@ public CELOE(ClassLearningProblem problem, ReasonerComponent reasoner) { super(problem, reasoner); + configurator = new CELOEConfigurator(this); classToDescribe = problem.getClassToDescribe(); isEquivalenceProblem = problem.isEquivalenceProblem(); } @@ -114,8 +123,9 @@ options.add(CommonConfigOptions.useNegation()); options.add(CommonConfigOptions.useBooleanDatatypes()); options.add(CommonConfigOptions.useDoubleDatatypes()); - options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); + options.add(CommonConfigOptions.maxExecutionTimeInSeconds(10)); options.add(CommonConfigOptions.getNoisePercentage()); + options.add(CommonConfigOptions.getMaxDepth(4)); return options; } @@ -135,6 +145,7 @@ // we put important parameters in class variables minAcc = configurator.getNoisePercentage()/100d; + maxDepth = configurator.getMaxDepth(); } @Override @@ -164,6 +175,10 @@ reset(); nanoStartTime = System.nanoTime(); + // highest accuracy so far + double highestAccuracy = 0.0; + OENode bestNode; + // 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) @@ -176,16 +191,67 @@ } addNode(startClass, null); + int loop = 0; + while (!terminationCriteriaSatisfied()) { + + if(bestEvaluatedDescriptions.getBest().getAccuracy() > highestAccuracy) { + highestAccuracy = bestEvaluatedDescriptions.getBest().getAccuracy(); + logger.info("more accurate (" + dfPercent.format(100*highestAccuracy) + ") class expression found: " + descriptionToString(bestEvaluatedDescriptions.getBest().getDescription())); + } + + // chose best node according to heuristics + bestNode = nodes.last(); + int horizExp = bestNode.getHorizontalExpansion(); + + // apply operator + TreeSet<Description> refinements = refineNode(bestNode); + + 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 + if(length >= horizExp && refinement.getDepth() <= maxDepth) { + boolean added = addNode(refinement, bestNode); + + // if refinements have the same length, we apply the operator again + // (descending the subsumption hierarchy) + if(added && length == horizExp) { + // ... refine node (first check whether we need this as there will + // the penalty for longer descriptions will be quite hard anyway) + } + + } + + } + + // Anzahl Schleifendurchläufe + loop++; + } + + if (stop) { + logger.info("Algorithm stopped.\n"); + } else { + logger.info("Algorithm terminated succesfully.\n"); + } + // print solution(s) - logger.info("solution : " + bestEvaluatedDescriptions.getBest()); + logger.info("solution : " + bestDescriptionToString()); isRunning = false; } // expand node horizontically - private void expandNode(OENode node) { - + private TreeSet<Description> refineNode(OENode node) { + // we have to remove and add the node since its heuristic evaluation changes through the expansion + nodes.remove(node); + int horizExp = node.getHorizontalExpansion(); + TreeSet<Description> refinements = (TreeSet<Description>) operator.refine(node.getDescription(), horizExp+1); + node.incHorizontalExpansion(); + nodes.add(node); + return refinements; } // add node to search tree if it is not too weak @@ -212,9 +278,13 @@ } else { parentNode.addChild(node); } + + nodes.add(node); // maybe add to best descriptions (method keeps set size fixed) - bestEvaluatedDescriptions.add(description, accuracy, learningProblem); + if(checkNode(node)) { + bestEvaluatedDescriptions.add(description, accuracy, learningProblem); + } return true; } @@ -222,11 +292,16 @@ // check whether the node is a potential solution candidate // (sufficient accuracy; minimal; rewriting steps?) private boolean checkNode(OENode node) { + + // what to do if super class occurs? either return false, but then it + // does not make sense to expand it further; or rewrite but then we have to + // take care of double occurrences + return true; } private boolean terminationCriteriaSatisfied() { - return !stop && (System.nanoTime() - nanoStartTime >= (configurator.getMaxExecutionTimeInSeconds()/1000000)); + return stop || (System.nanoTime() - nanoStartTime >= (configurator.getMaxExecutionTimeInSeconds()*1000000)); } private void reset() { @@ -248,4 +323,17 @@ stop = true; } + public OENode getSearchTreeRoot() { + return startNode; + } + + // central function for printing description + private String descriptionToString(Description description) { + return description.toManchesterSyntaxString(baseURI, prefixes); + } + + private String bestDescriptionToString() { + EvaluatedDescription best = bestEvaluatedDescriptions.getBest(); + return best.getDescription().toManchesterSyntaxString(baseURI, prefixes) + " (accuracy: " + dfPercent.format(best.getAccuracy()*100) + ")"; + } } Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -44,6 +44,8 @@ private double accuracy; + private int horizontalExpansion; + private OENode parent; private List<OENode> children; @@ -51,12 +53,17 @@ this.parent = parentNode; this.description = description; this.accuracy = accuracy; + horizontalExpansion = 0; } public void addChild(OENode node) { children.add(node); } + public void incHorizontalExpansion() { + horizontalExpansion++; + } + /** * @return the description */ @@ -84,5 +91,12 @@ public List<OENode> getChildren() { return children; } + + /** + * @return the horizontalExpansion + */ + public int getHorizontalExpansion() { + return horizontalExpansion; + } } Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -294,11 +294,14 @@ lpClass = PosNegLPStandard.class; } lp = cm.learningProblem(lpClass, rc); - SortedSet<String> posExamples = parser.getPositiveExamples(); - SortedSet<String> negExamples = parser.getNegativeExamples(); - cm.applyConfigEntry(lp, "positiveExamples", posExamples); - if (lpClass != PosOnlyLP.class) + if(lpClass == PosNegLPStandard.class || lpClass == PosOnlyLP.class) { + SortedSet<String> posExamples = parser.getPositiveExamples(); + cm.applyConfigEntry(lp, "positiveExamples", posExamples); + } + if(lpClass == PosNegLPStandard.class) { + SortedSet<String> negExamples = parser.getNegativeExamples(); cm.applyConfigEntry(lp, "negativeExamples", negExamples); + } configureComponent(cm, lp, parser); initComponent(cm, lp); lpMonitor.stop(); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -155,6 +155,15 @@ public double getNoisePercentage() { return (Double) ComponentManager.getInstance().getConfigOptionValue(cELOE, "noisePercentage") ; } +/** +* maxDepth maximum depth of description. +* mandatory: false| reinit necessary: true +* default value: 3 +* @return int +**/ +public int getMaxDepth() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxDepth") ; +} /** * @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. @@ -255,6 +264,15 @@ ComponentManager.getInstance().applyConfigEntry(cELOE, "noisePercentage", noisePercentage); reinitNecessary = true; } +/** +* @param maxDepth maximum depth of description. +* mandatory: false| reinit necessary: true +* default value: 3 +**/ +public void setMaxDepth(int maxDepth) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "maxDepth", maxDepth); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/core/options/CommonConfigOptions.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -73,6 +73,10 @@ return new BooleanConfigOption("terminateOnNoiseReached", "specifies whether to terminate when noise criterion is met", terminateOnNoiseReachedDefault); } + public static IntegerConfigOption getMaxDepth(int defaultValue) { + return new IntegerConfigOption("maxDepth", "maximum depth of description", defaultValue); + } + public static DoubleConfigOption getPercentPerLenghtUnitOption(double defaultValue) { DoubleConfigOption option = new DoubleConfigOption("percentPerLenghtUnit", "describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one", defaultValue); option.setLowerLimit(0.0); @@ -153,6 +157,10 @@ return new IntegerConfigOption("maxExecutionTimeInSeconds", "algorithm will stop after specified seconds",maxExecutionTimeInSecondsDefault); } + public static IntegerConfigOption maxExecutionTimeInSeconds(int defaultValue) { + return new IntegerConfigOption("maxExecutionTimeInSeconds", "algorithm will stop after specified seconds",defaultValue); + } + public static IntegerConfigOption minExecutionTimeInSeconds() { return new IntegerConfigOption("minExecutionTimeInSeconds", "algorithm will run at least specified seconds",minExecutionTimeInSecondsDefault); } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -28,6 +28,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ClassLearningProblemConfigurator; +import org.dllearner.core.configurators.PosNegLPStandardConfigurator; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.owl.Description; @@ -55,6 +56,7 @@ public ClassLearningProblem(ReasonerComponent reasoner) { super(reasoner); + configurator = new ClassLearningProblemConfigurator(this); } public static Collection<ConfigOption<?>> createConfigOptions() { Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-16 13:03:46 UTC (rev 1605) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-16 17:09:30 UTC (rev 1606) @@ -335,6 +335,11 @@ throw new RuntimeException(); } + @Override + public Set<Description> refine(Description description, int maxLength) { + return refine(description, maxLength, null, startClass); + } + /* (non-Javadoc) * @see org.dllearner.algorithms.refinement.RefinementOperator#refine(org.dllearner.core.owl.Description, int, java.util.List) */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-16 13:03:55
|
Revision: 1605 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1605&view=rev Author: jenslehmann Date: 2009-02-16 13:03:46 +0000 (Mon, 16 Feb 2009) Log Message: ----------- continued ontology engineering algorithm Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java trunk/src/dl-learner/org/dllearner/core/LearningProblem.java trunk/src/dl-learner/org/dllearner/core/Score.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionClass.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicStable.java Added: trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionClass.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionClass.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionClass.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -0,0 +1,43 @@ +/** + * 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; + +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.owl.Description; +import org.dllearner.learningproblems.ClassScore; + +/** + * An evaluated description for learning classes in ontologies. + * + * @author Jens Lehmann + * + */ +public class EvaluatedDescriptionClass extends EvaluatedDescription { + + /** + * Constructs an evaluated description for learning classes in ontologies. + * @param description Description. + * @param score Score of description. + */ + public EvaluatedDescriptionClass(Description description, ClassScore score) { + super(description, score); + } + +} Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -19,13 +19,33 @@ */ package org.dllearner.algorithms.celoe; -import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +import org.apache.log4j.Logger; import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.configurators.Configurator; +import org.dllearner.core.options.CommonConfigOptions; +import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.owl.ClassHierarchy; import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.ClassLearningProblem; +import org.dllearner.refinementoperators.RefinementOperator; +import org.dllearner.refinementoperators.RhoDRDown; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.EvaluatedDescriptionSet; /** * The CELOE (Class Expression Learner for Ontology Engineering) algorithm. @@ -37,71 +57,195 @@ */ public class CELOE extends LearningAlgorithm { + private static Logger logger = Logger.getLogger(CELOE.class); + private CELOEConfigurator configurator; + + private boolean isRunning = false; + private boolean stop = false; + +// private OEHeuristicStable heuristicStable = new OEHeuristicStable(); +// private OEHeuristicRuntime heuristicRuntime = new OEHeuristicRuntime(); + + private RefinementOperator operator; + + // all nodes in the search tree (used for selecting most promising node) + private TreeSet<OENode> nodes; + // root of search tree + private OENode startNode; + + // all descriptions in the search tree plus those which were too weak (for fast redundancy check) + private TreeSet<Description> descriptions; + + private EvaluatedDescriptionSet bestEvaluatedDescriptions = new EvaluatedDescriptionSet(LearningAlgorithm.MAX_NR_OF_RESULTS); + + private NamedClass classToDescribe; + private boolean isEquivalenceProblem; + + private long nanoStartTime; + + // important parameters + private double minAcc; + + @Override + public Configurator getConfigurator() { + return configurator; + } + public CELOE(ClassLearningProblem problem, ReasonerComponent reasoner) { super(problem, reasoner); + classToDescribe = problem.getClassToDescribe(); + isEquivalenceProblem = problem.isEquivalenceProblem(); } - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#getCurrentlyBestDescription() - */ + public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { + Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); + problems.add(ClassLearningProblem.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.valueFreqencyThreshold()); + options.add(CommonConfigOptions.useCardinalityRestrictions()); + options.add(CommonConfigOptions.cardinalityLimit()); + options.add(CommonConfigOptions.useNegation()); + options.add(CommonConfigOptions.useBooleanDatatypes()); + options.add(CommonConfigOptions.useDoubleDatatypes()); + options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); + options.add(CommonConfigOptions.getNoisePercentage()); + return options; + } + + public static String getName() { + return "CELOE"; + } + @Override - public Description getCurrentlyBestDescription() { - // TODO Auto-generated method stub - return null; + 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(); + + // create refinement operator + operator = new RhoDRDown(reasoner, classHierarchy, configurator); + + // we put important parameters in class variables + minAcc = configurator.getNoisePercentage()/100d; } - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#getCurrentlyBestEvaluatedDescription() - */ @Override - public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { - // TODO Auto-generated method stub - return null; + public Description getCurrentlyBestDescription() { + return getCurrentlyBestEvaluatedDescription().getDescription(); } - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#isRunning() - */ @Override - public boolean isRunning() { - // TODO Auto-generated method stub - return false; + public List<Description> getCurrentlyBestDescriptions() { + return bestEvaluatedDescriptions.toDescriptionList(); } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#start() - */ + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + return bestEvaluatedDescriptions.getSet().last(); + } + + @Override + public SortedSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + return bestEvaluatedDescriptions.getSet(); + } + + @Override public void start() { - // TODO Auto-generated method stub - + stop = false; + isRunning = true; + reset(); + nanoStartTime = System.nanoTime(); + + // 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) + Description startClass; + if(isEquivalenceProblem) { + Set<Description> superClasses = reasoner.getClassHierarchy().getSuperClasses(classToDescribe); + startClass = new Intersection(new LinkedList<Description>(superClasses)); + } else { + startClass = Thing.instance; + } + addNode(startClass, null); + + + // print solution(s) + logger.info("solution : " + bestEvaluatedDescriptions.getBest()); + + isRunning = false; } - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#stop() - */ - @Override - public void stop() { - // TODO Auto-generated method stub - + // expand node horizontically + private void expandNode(OENode node) { + } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#getConfigurator() - */ - @Override - public Configurator getConfigurator() { - // TODO Auto-generated method stub - return null; + + // 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, OENode parentNode) { + + // redundancy check (return if redundant) + boolean nonRedundant = descriptions.add(description); + if(!nonRedundant) { + return false; + } + + // quality of description (return if too weak) + double accuracy = learningProblem.getAccuracyOrTooWeak(description, minAcc); + if(accuracy == -1) { + return false; + } + + OENode node = new OENode(parentNode, description, accuracy); + + // link to parent (unless start node) + if(parentNode == null) { + startNode = node; + } else { + parentNode.addChild(node); + } + + // maybe add to best descriptions (method keeps set size fixed) + bestEvaluatedDescriptions.add(description, accuracy, learningProblem); + + return true; + } + + // check whether the node is a potential solution candidate + // (sufficient accuracy; minimal; rewriting steps?) + private boolean checkNode(OENode node) { + return true; } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#init() - */ + + private boolean terminationCriteriaSatisfied() { + return !stop && (System.nanoTime() - nanoStartTime >= (configurator.getMaxExecutionTimeInSeconds()/1000000)); + } + + private void reset() { + // set all values back to their default values (used for running + // the algorithm more than once) +// candidates.clear(); + nodes = new TreeSet<OENode>(new OEHeuristicRuntime()); + descriptions = new TreeSet<Description>(new ConceptComparator()); + bestEvaluatedDescriptions.getSet().clear(); + } + @Override - public void init() throws ComponentInitException { - // TODO Auto-generated method stub - + public boolean isRunning() { + return isRunning; + } + + @Override + public void stop() { + stop = true; } } Added: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristic.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristic.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -0,0 +1,32 @@ +/** + * 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.celoe; + +import java.util.Comparator; + +/** + * Marker interface for heurist comparators over nodes in the search tree. + * + * @author Jens Lehmann + * + */ +public interface OEHeuristic extends Comparator<OENode> { + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -0,0 +1,39 @@ +/** + * 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.celoe; + +import java.util.Comparator; + +/** + * @author Jens Lehmann + * + */ +public class OEHeuristicRuntime implements OEHeuristic { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(OENode o1, OENode o2) { + // TODO Auto-generated method stub + return 0; + } + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicStable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicStable.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OEHeuristicStable.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -0,0 +1,37 @@ +/** + * 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.celoe; + +/** + * @author Jens Lehmann + * + */ +public class OEHeuristicStable implements OEHeuristic { + + /* (non-Javadoc) + * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) + */ + @Override + public int compare(OENode o1, OENode o2) { + // TODO Auto-generated method stub + return 0; + } + +} Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -19,12 +19,70 @@ */ package org.dllearner.algorithms.celoe; +import java.util.List; + +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 OENode { + private Description description; + + private double accuracy; + + private OENode parent; + private List<OENode> children; + + public OENode(OENode parentNode, Description description, double accuracy) { + this.parent = parentNode; + this.description = description; + this.accuracy = accuracy; + } + + public void addChild(OENode node) { + children.add(node); + } + + /** + * @return the description + */ + public Description getDescription() { + return description; + } + + /** + * @return the accuracy + */ + public double getAccuracy() { + return accuracy; + } + + /** + * @return the parent + */ + public OENode getParent() { + return parent; + } + + /** + * @return the children + */ + public List<OENode> getChildren() { + return children; + } + } Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -168,7 +168,7 @@ // the description has a chance to make it in the set if it has // at least as high accuracy - if not we can save the reasoner calls // for fully computing the evaluated description - if(bestEvaluatedDescriptions.size() == 0 || bestEvaluatedDescriptions.getWorst().getCoveredNegatives().size() >= node.getCoveredNegatives()) { + if(bestEvaluatedDescriptions.size() == 0 || ((EvaluatedDescriptionPosNeg)bestEvaluatedDescriptions.getWorst()).getCoveredNegatives().size() >= node.getCoveredNegatives()) { ScorePosNeg score = (ScorePosNeg) learningProblem.computeScore(description); EvaluatedDescriptionPosNeg ed = new EvaluatedDescriptionPosNeg(description, score); bestEvaluatedDescriptions.add(ed); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -42,6 +42,8 @@ */ public class ExampleBasedNode { +// public static long exampleMemoryCounter = 0; + private ROLComponent2Configurator configurator; private static DecimalFormat df = new DecimalFormat(); @@ -114,6 +116,8 @@ this.coveredPositives = coveredPositives; this.coveredNegatives = coveredNegatives; isQualityEvaluated = true; +// exampleMemoryCounter += coveredPositives.size() * 4; +// exampleMemoryCounter += coveredNegatives.size() * 4; } @Override Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -418,6 +418,8 @@ printStatistics(false); lastPrintTime = currentTime; logger.debug("--- loop " + loop + " started ---"); +// logger.info("used memory: " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/1024); +// logger.info("test: " + ExampleBasedNode.exampleMemoryCounter/1024); } // traverse the current search tree to find a solution Modified: trunk/src/dl-learner/org/dllearner/core/LearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -77,6 +77,15 @@ public abstract Score computeScore(Description description); /** + * Evaluates the description by computing the score and returning an + * evaluated description of the correct type (ClassLearningProblem + * returns EvaluatedDescriptionClass instead of generic EvaluatedDescription). + * @param description Description to evaluate. + * @return + */ + public abstract EvaluatedDescription evaluate(Description description); + + /** * This method returns a value, which indicates how accurate a * class description solves a learning problem. There can be different * ways to compute accuracy depending on the type of learning problem Modified: trunk/src/dl-learner/org/dllearner/core/Score.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -25,6 +25,8 @@ * different criteria can be used. (Similar learning problems probably * score class descriptions/hypothesis in a similar way.) * + * TODO: Maybe we don't really need a score, but only EvaluatedDescription. + * * @author Jens Lehmann * */ Modified: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -25,12 +25,13 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; /** * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class CELOEConfigurator implements Configurator { +public class CELOEConfigurator extends RefinementOperatorConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") @@ -55,7 +56,205 @@ 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(cELOE, "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(cELOE, "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(cELOE, "useHasValueConstructor") ; +} +/** +* 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(cELOE, "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(cELOE, "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(cELOE, "cardinalityLimit") ; +} +/** +* useNegation specifies whether negation is used in the learning algorothm. +* mandatory: false| reinit necessary: true +* default value: true +* @return boolean +**/ +public boolean getUseNegation() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "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(cELOE, "useBooleanDatatypes") ; +} +/** +* useDoubleDatatypes specifies whether boolean 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(cELOE, "useDoubleDatatypes") ; +} +/** +* maxExecutionTimeInSeconds algorithm will stop after specified seconds. +* mandatory: false| reinit necessary: true +* default value: 0 +* @return int +**/ +public int getMaxExecutionTimeInSeconds() { +return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "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(cELOE, "noisePercentage") ; +} +/** +* @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setUseAllConstructor(boolean useAllConstructor) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "useAllConstructor", useAllConstructor); +reinitNecessary = true; +} +/** +* @param useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setUseExistsConstructor(boolean useExistsConstructor) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "useExistsConstructor", useExistsConstructor); +reinitNecessary = true; +} +/** +* @param useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: false +**/ +public void setUseHasValueConstructor(boolean useHasValueConstructor) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "useHasValueConstructor", useHasValueConstructor); +reinitNecessary = true; +} +/** +* @param 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 +**/ +public void setValueFrequencyThreshold(int valueFrequencyThreshold) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "valueFrequencyThreshold", valueFrequencyThreshold); +reinitNecessary = true; +} +/** +* @param useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setUseCardinalityRestrictions(boolean useCardinalityRestrictions) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "useCardinalityRestrictions", useCardinalityRestrictions); +reinitNecessary = true; +} +/** +* @param cardinalityLimit Gives the maximum number used in cardinality restrictions.. +* mandatory: false| reinit necessary: true +* default value: 5 +**/ +public void setCardinalityLimit(int cardinalityLimit) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "cardinalityLimit", cardinalityLimit); +reinitNecessary = true; +} +/** +* @param useNegation specifies whether negation is used in the learning algorothm. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setUseNegation(boolean useNegation) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "useNegation", useNegation); +reinitNecessary = true; +} +/** +* @param useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setUseBooleanDatatypes(boolean useBooleanDatatypes) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "useBooleanDatatypes", useBooleanDatatypes); +reinitNecessary = true; +} +/** +* @param useDoubleDatatypes specifies whether boolean datatypes are used in the learning algorothm. +* mandatory: false| reinit necessary: true +* default value: true +**/ +public void setUseDoubleDatatypes(boolean useDoubleDatatypes) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "useDoubleDatatypes", useDoubleDatatypes); +reinitNecessary = true; +} +/** +* @param maxExecutionTimeInSeconds algorithm will stop after specified seconds. +* mandatory: false| reinit necessary: true +* default value: 0 +**/ +public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); +reinitNecessary = true; +} +/** +* @param noisePercentage the (approximated) percentage of noise within the examples. +* mandatory: false| reinit necessary: true +* default value: 0.0 +**/ +public void setNoisePercentage(double noisePercentage) { +ComponentManager.getInstance().applyConfigEntry(cELOE, "noisePercentage", noisePercentage); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/core/owl/ClassHierarchy.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -197,6 +197,11 @@ return str; } + @Override + public ClassHierarchy clone() { + return new ClassHierarchy(subsumptionHierarchyUp, subsumptionHierarchyDown); + } + /** * The method computes a new class hierarchy, which is a copy of this * one, but only the specified classes are allowed to occur. For instance, Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -23,6 +23,8 @@ import java.util.LinkedList; import java.util.Set; +import org.dllearner.algorithms.EvaluatedDescriptionClass; +import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ClassLearningProblemConfigurator; @@ -129,4 +131,20 @@ // TODO Auto-generated method stub return 0; } + + /** + * @return the classToDescribe + */ + public NamedClass getClassToDescribe() { + return classToDescribe; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#evaluate(org.dllearner.core.owl.Description) + */ + @Override + public EvaluatedDescription evaluate(Description description) { + ClassScore score = computeScore(description); + return new EvaluatedDescriptionClass(description, score); + } } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -22,6 +22,7 @@ import java.util.Set; import java.util.SortedSet; +import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ComponentFactory; import org.dllearner.core.configurators.PosNegInclusionLPConfigurator; @@ -217,4 +218,13 @@ return 0; } + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#evaluate(org.dllearner.core.owl.Description) + */ + @Override + public EvaluatedDescription evaluate(Description description) { + // TODO Auto-generated method stub + return null; + } + } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -24,6 +24,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.PosNegLPStandardConfigurator; import org.dllearner.core.options.ConfigOption; @@ -247,4 +248,13 @@ return 0; } + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#evaluate(org.dllearner.core.owl.Description) + */ + @Override + public EvaluatedDescription evaluate(Description description) { + // TODO Auto-generated method stub + return null; + } + } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -23,6 +23,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.PosNegLPStrictConfigurator; import org.dllearner.core.options.BooleanConfigOption; @@ -221,4 +222,13 @@ // TODO Auto-generated method stub return 0; } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#evaluate(org.dllearner.core.owl.Description) + */ + @Override + public EvaluatedDescription evaluate(Description description) { + // TODO Auto-generated method stub + return null; + } } Modified: trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -39,6 +39,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.configurators.ROLearnerConfigurator; import org.dllearner.core.configurators.RefinementOperatorConfigurator; import org.dllearner.core.options.ConfigOption; @@ -65,7 +66,7 @@ private static final SortedSet<String> EXTENDSREFINEMENTOPERATOR = new TreeSet<String>(Arrays.asList(new String[]{ ROLearnerConfigurator.class.getSimpleName(), - CELOE.class.getSimpleName(), + CELOEConfigurator.class.getSimpleName(), })); @SuppressWarnings("unchecked") Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java 2009-02-13 17:10:49 UTC (rev 1604) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java 2009-02-16 13:03:46 UTC (rev 1605) @@ -27,6 +27,8 @@ import java.util.TreeSet; import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.LearningProblem; import org.dllearner.core.owl.Description; /** @@ -39,9 +41,9 @@ */ public class EvaluatedDescriptionSet { - private EvaluatedDescriptionPosNegComparator comp = new EvaluatedDescriptionPosNegComparator(); + private EvaluatedDescriptionComparator comp = new EvaluatedDescriptionComparator(); - private SortedSet<EvaluatedDescriptionPosNeg> set = new TreeSet<EvaluatedDescriptionPosNeg>(comp); + private SortedSet<EvaluatedDescription> set = new TreeSet<EvaluatedDescription>(comp); private int maxSize; @@ -49,10 +51,21 @@ this.maxSize = maxSize; } - public void add(EvaluatedDescriptionPosNeg ed) { + public void add(Description description, double accuracy, LearningProblem problem) { + if(set.size()==0 || getWorst().getAccuracy() <= accuracy) { + set.add(problem.evaluate(description)); + } + if(set.size()>maxSize) { + Iterator<EvaluatedDescription> it = set.iterator(); + it.next(); + it.remove(); + } + } + + public void add(EvaluatedDescription ed) { set.add(ed); if(set.size()>maxSize) { - Iterator<EvaluatedDescriptionPosNeg> it = set.iterator(); + Iterator<EvaluatedDescription> it = set.iterator(); it.next(); it.remove(); } @@ -68,24 +81,24 @@ return set.size(); } - public EvaluatedDescriptionPosNeg getBest() { + public EvaluatedDescription getBest() { return set.first(); } - public EvaluatedDescriptionPosNeg getWorst() { + public EvaluatedDescription getWorst() { return set.last(); } /** * @return the set */ - public SortedSet<EvaluatedDescriptionPosNeg> getSet() { + public SortedSet<EvaluatedDescription> getSet() { return set; } public List<Description> toDescriptionList() { List<Description> list = new LinkedList<Description>(); - for(EvaluatedDescriptionPosNeg ed : set) { + for(EvaluatedDescription ed : set) { list.add(ed.getDescription()); } return list; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-13 17:10:53
|
Revision: 1604 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1604&view=rev Author: jenslehmann Date: 2009-02-13 17:10:49 +0000 (Fri, 13 Feb 2009) Log Message: ----------- fast retrieval algorithm started Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java 2009-02-13 11:44:38 UTC (rev 1603) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java 2009-02-13 17:10:49 UTC (rev 1604) @@ -49,6 +49,8 @@ // example based variables private Set<Individual> coveredPositives; private Set<Individual> coveredNegatives; +// private int coveredPositiveSize; +// private int coveredNegativeSize; // the method by which quality was evaluated in this node public enum QualityEvaluationMethod { START, REASONER, TOO_WEAK_LIST, OVERLY_GENERAL_LIST }; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-02-13 11:44:38 UTC (rev 1603) +++ trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-02-13 17:10:49 UTC (rev 1604) @@ -70,6 +70,15 @@ public boolean getDefaultNegation() { return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fastInstanceChecker, "defaultNegation") ; } +/** +* forallRetrievalSemantics This option controls how to interpret the all quantifier in orall r.C. The standard option isto return all those which do not have an r-filler not in C. The domain semantics is to use thosewhich are in the domain of r and do not have an r-filler not in C. The forallExists semantics is touse those which have at least one r-filler and do not have an r-filler not in C.. +* mandatory: false| reinit necessary: true +* default value: forallExists +* @return String +**/ +public String getForallRetrievalSemantics() { +return (String) ComponentManager.getInstance().getConfigOptionValue(fastInstanceChecker, "forallRetrievalSemantics") ; +} /** * @param reasonerType FaCT++ or Pellet to dematerialize. @@ -89,6 +98,15 @@ ComponentManager.getInstance().applyConfigEntry(fastInstanceChecker, "defaultNegation", defaultNegation); reinitNecessary = true; } +/** +* @param forallRetrievalSemantics This option controls how to interpret the all quantifier in orall r.C. The standard option isto return all those which do not have an r-filler not in C. The domain semantics is to use thosewhich are in the domain of r and do not have an r-filler not in C. The forallExists semantics is touse those which have at least one r-filler and do not have an r-filler not in C.. +* mandatory: false| reinit necessary: true +* default value: forallExists +**/ +public void setForallRetrievalSemantics(String forallRetrievalSemantics) { +ComponentManager.getInstance().applyConfigEntry(fastInstanceChecker, "forallRetrievalSemantics", forallRetrievalSemantics); +reinitNecessary = true; +} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2009-02-13 11:44:38 UTC (rev 1603) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2009-02-13 17:10:49 UTC (rev 1604) @@ -28,6 +28,7 @@ import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; import org.apache.log4j.Logger; import org.dllearner.core.ComponentInitException; @@ -82,7 +83,10 @@ * object creation, which makes it extremely fast compared to standard * reasoners. * - * Note: This algorithm works only on concepts in negation normal form! + * Meanwhile, the algorithm has been extended to also perform fast retrieval + * operations. However, those need write access to memory and potentially have + * to deal with all individuals in a knowledge base. For many knowledge bases, + * they should still be reasonably fast. * * @author Jens Lehmann * @@ -149,6 +153,15 @@ // 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); options.add(new BooleanConfigOption("defaultNegation", "Whether to use default negation, i.e. an instance not being in a class means that it is in the negation of the class.", true, false, true)); + StringConfigOption forallSemantics = new StringConfigOption("forallRetrievalSemantics", + "This option controls how to interpret the all quantifier in \forall r.C. The standard option is" + + "to return all those which do not have an r-filler not in C. The domain semantics is to use those" + + "which are in the domain of r and do not have an r-filler not in C. The forallExists semantics is to" + + "use those which have at least one r-filler and do not have an r-filler not in C.", "forallExists"); + forallSemantics.setAllowedValues(new String[] { "standard", "domain", "forallExists" }); + // 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(forallSemantics); return options; } @@ -482,22 +495,111 @@ } @Override - public SortedSet<Individual> getIndividualsImpl(Description concept) + public SortedSet<Individual> getIndividualsImpl(Description description) throws ReasoningMethodUnsupportedException { - if (concept instanceof NamedClass) { - return classInstancesPos.get((NamedClass) concept); - } else if (concept instanceof Negation && concept.getChild(0) instanceof NamedClass) { - return classInstancesNeg.get((NamedClass) concept.getChild(0)); + // policy: returned sets are clones, i.e. can be modified + // (of course we only have to clone the leafs of a class description tree) + if (description instanceof NamedClass) { + return new TreeSet<Individual>(classInstancesPos.get((NamedClass) description)); + } else if (description instanceof Negation && description.getChild(0) instanceof NamedClass) { + return new TreeSet<Individual>(classInstancesNeg.get((NamedClass) description.getChild(0))); + } else if (description instanceof Thing) { + return new TreeSet<Individual>(individuals); + } else if (description instanceof Nothing) { + return new TreeSet<Individual>(); + } else if (description instanceof Union) { + // copy instances of first element and then subtract all others + SortedSet<Individual> ret = getIndividualsImpl(description.getChild(0)); + int childNr = 0; + for(Description child : description.getChildren()) { + if(childNr != 0) { + ret.addAll(getIndividualsImpl(child)); + } + childNr++; + } + return ret; + } else if (description instanceof Intersection) { + // copy instances of first element and then subtract all others + SortedSet<Individual> ret = getIndividualsImpl(description.getChild(0)); + int childNr = 0; + for(Description child : description.getChildren()) { + if(childNr != 0) { + ret.retainAll(getIndividualsImpl(child)); + } + childNr++; + } + return ret; + } else if (description instanceof ObjectSomeRestriction) { + SortedSet<Individual> targetSet = getIndividualsImpl(description.getChild(0)); + SortedSet<Individual> returnSet = new TreeSet<Individual>(); + + ObjectPropertyExpression ope = ((ObjectSomeRestriction) description).getRole(); + if (!(ope instanceof ObjectProperty)) { + throw new ReasoningMethodUnsupportedException("Instance check for description " + + description + " unsupported. Inverse object properties not supported."); + } + ObjectProperty op = (ObjectProperty) ope; + Map<Individual, SortedSet<Individual>> mapping = opPos.get(op); + + // each individual is connected to a set of individuals via the property; + // we loop through the complete mapping + for(Entry<Individual, SortedSet<Individual>> entry : mapping.entrySet()) { + SortedSet<Individual> inds = entry.getValue(); + for(Individual ind : inds) { + if(targetSet.contains(ind)) { + returnSet.add(ind); + // once we found an individual, we do not need to check the others + continue; + } + } + } + } else if (description instanceof ObjectAllRestriction) { + // \forall restrictions are difficult to handle; assume we want to check + // \forall hasChild.male with domain(hasChild)=Person; then for all non-persons + // this is satisfied trivially (all of their non-existing children are male) + if(!configurator.getForallRetrievalSemantics().equals("forallExists")) { + throw new Error("Only forallExists semantics currently implemented."); + } + + // problem: we need to make sure that \neg \exists r.\top \equiv \forall r.\bot + // can still be reached in an algorithm (\forall r.\bot \equiv \bot under forallExists + // semantics) + + SortedSet<Individual> targetSet = getIndividualsImpl(description.getChild(0)); + + ObjectPropertyExpression ope = ((ObjectAllRestriction) description).getRole(); + if (!(ope instanceof ObjectProperty)) { + throw new ReasoningMethodUnsupportedException("Instance check for description " + + description + " unsupported. Inverse object properties not supported."); + } + ObjectProperty op = (ObjectProperty) ope; + Map<Individual, SortedSet<Individual>> mapping = opPos.get(op); + SortedSet<Individual> returnSet = new TreeSet<Individual>(mapping.keySet()); + + // each individual is connected to a set of individuals via the property; + // we loop through the complete mapping + for(Entry<Individual, SortedSet<Individual>> entry : mapping.entrySet()) { + SortedSet<Individual> inds = entry.getValue(); + for(Individual ind : inds) { + if(!targetSet.contains(ind)) { + returnSet.remove(ind); + continue; + } + } + } } - + + throw new ReasoningMethodUnsupportedException("Retrieval for description " + + description + " unsupported."); + // return rs.retrieval(concept); - SortedSet<Individual> inds = new TreeSet<Individual>(); - for (Individual i : individuals) { - if (hasType(concept, i)) { - inds.add(i); - } - } - return inds; +// SortedSet<Individual> inds = new TreeSet<Individual>(); +// for (Individual i : individuals) { +// if (hasType(concept, i)) { +// inds.add(i); +// } +// } +// return inds; } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-13 13:01:10
|
Revision: 1603 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1603&view=rev Author: jenslehmann Date: 2009-02-13 11:44:38 +0000 (Fri, 13 Feb 2009) Log Message: ----------- removed unused/unmaintained components and continued learning problem structure Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/FlexibleHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/LexicographicHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/NodeComparatorStable.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/SubsumptionComparator.java trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/examples/KRKModular.java trunk/src/dl-learner/org/dllearner/gui/EBNodeTreeModel.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/gui/SearchTree.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/scripts/DumbLPFinder.java trunk/src/dl-learner/org/dllearner/scripts/NewSample.java trunk/src/dl-learner/org/dllearner/scripts/Sample.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBibleComparison.java trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/test/ComponentTest.java trunk/src/dl-learner/org/dllearner/test/SworeTest.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/utilities/JamonMonitorLogger.java trunk/src/dl-learner/org/dllearner/utilities/components/ComponentCombo.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/core/configurators/DBpediaNavigationSuggestorConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-02-13 11:06:53 UTC (rev 1602) +++ trunk/lib/components.ini 2009-02-13 11:44:38 UTC (rev 1603) @@ -20,9 +20,7 @@ org.dllearner.algorithms.RandomGuesser org.dllearner.algorithms.BruteForceLearner org.dllearner.algorithms.refinement.ROLearner -org.dllearner.algorithms.refexamples.ExampleBasedROLComponent +org.dllearner.algorithms.refinement2.ROLComponent2 org.dllearner.algorithms.gp.GP -org.dllearner.algorithms.DBpediaNavigationSuggestor -org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm org.dllearner.algorithms.el.ELLearningAlgorithm org.dllearner.algorithms.celoe.CELOE Deleted: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-13 11:06:53 UTC (rev 1602) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,226 +0,0 @@ -/** - * 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.algorithms; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; - -import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; -import org.dllearner.core.ComponentInitException; -import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.ComponentFactory; -import org.dllearner.core.configurators.DBpediaNavigationSuggestorConfigurator; -import org.dllearner.core.options.BooleanConfigOption; -import org.dllearner.core.options.CommonConfigOptions; -import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.core.options.DoubleConfigOption; -import org.dllearner.core.options.InvalidConfigOptionValueException; -import org.dllearner.core.options.StringConfigOption; -import org.dllearner.core.owl.Description; -import org.dllearner.learningproblems.PosNegLPStandard; -import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyLP; -import org.dllearner.learningproblems.ScorePosNeg; - -/** - * The DBpedia Navigation suggestor takes a knowledge fragment extracted - * from DBpedia, performs some preprocessing steps, invokes a learning - * algorithm, and then performs postprocessing steps. It does not - * implement a completely new learning algorithm itself, but uses the - * example based refinement operator learning algorithm. - * - * TODO: This should not be implemented as a learning algorithm (as it does - * almost nothing by itself) and maybe can be completely deleted. - * - * @author Jens Lehmann - * - */ -public class DBpediaNavigationSuggestor extends LearningAlgorithm { - - private DBpediaNavigationSuggestorConfigurator configurator; - @Override - public DBpediaNavigationSuggestorConfigurator getConfigurator(){ - return configurator; - } - - -// private ReasonerComponent rs; - private ExampleBasedROLComponent learner; - private static String defaultSearchTreeFile = "log/searchTree.txt"; - - public DBpediaNavigationSuggestor(LearningProblem learningProblem, ReasonerComponent rs) { - super(learningProblem, rs); -// this.rs=rs; - this.configurator = new DBpediaNavigationSuggestorConfigurator(this); - try{ - if(learningProblem instanceof PosNegLP) { - PosNegLP lp = (PosNegLP) learningProblem; - this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); - //this.learner=new ExampleBasedROLComponent(lp, rs); - } else if(learningProblem instanceof PosOnlyLP) { - PosOnlyLP lp = (PosOnlyLP) learningProblem; - this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); - //this.learner=new ExampleBasedROLComponent(lp, rs); - } - }catch (Exception e) { - System.out.println("this error should never occur"+this.getClass().getCanonicalName()); - e.printStackTrace(); - } - } - - 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 String getName() { - return "DBpedia Navigation Suggestor"; - } - - public DBpediaNavigationSuggestor(PosOnlyLP learningProblem, ReasonerComponent rs) { - super(learningProblem, rs); - System.out.println("test1"); - } - - public DBpediaNavigationSuggestor(PosNegLPStandard learningProblem, ReasonerComponent rs) { - super(learningProblem, rs); - System.out.println("test2"); - } - - public static Collection<ConfigOption<?>> createConfigOptions() { - Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - 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", defaultSearchTreeFile)); - 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)); - StringConfigOption heuristicOption = new StringConfigOption("heuristic", "specifiy the heuristic to use", "lexicographic"); - heuristicOption.setAllowedValues(new String[] {"lexicographic", "flexible"}); - options.add(heuristicOption); - options.add(new BooleanConfigOption("applyAllFilter", "usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D)", true)); - options.add(new BooleanConfigOption("applyExistsFilter", "usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D)", true)); - options.add(new BooleanConfigOption("useTooWeakList", "try to filter out too weak concepts without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useOverlyGeneralList", "try to find overly general concept without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useShortConceptConstruction", "shorten concept to see whether they already exist", true)); - DoubleConfigOption horizExp = new DoubleConfigOption("horizontalExpansionFactor", "horizontal expansion factor (see publication for description)", 0.6); - horizExp.setLowerLimit(0.0); - horizExp.setUpperLimit(1.0); - options.add(horizExp); - options.add(new BooleanConfigOption("improveSubsumptionHierarchy", "simplify subsumption hierarchy to reduce search space (see publication for description)", true)); - // allowed/ignored concepts/roles could also be a reasoner option (?) - options.add(CommonConfigOptions.allowedConcepts()); - options.add(CommonConfigOptions.ignoredConcepts()); - options.add(CommonConfigOptions.allowedRoles()); - options.add(CommonConfigOptions.ignoredRoles()); - options.add(CommonConfigOptions.useAllConstructor()); - options.add(CommonConfigOptions.useExistsConstructor()); - options.add(CommonConfigOptions.useCardinalityRestrictions()); - options.add(CommonConfigOptions.useHasValueConstructor()); - options.add(CommonConfigOptions.valueFreqencyThreshold()); - options.add(CommonConfigOptions.useNegation()); - options.add(CommonConfigOptions.useBooleanDatatypes()); - options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); - options.add(CommonConfigOptions.minExecutionTimeInSeconds()); - options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); - options.add(CommonConfigOptions.getLogLevel()); - //TODO make a commonconfig Option out of this - DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples",0.0); - noisePercentage.setLowerLimit(0); - noisePercentage.setUpperLimit(100); - options.add(noisePercentage); - options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); - options.add(new BooleanConfigOption("forceRefinementLengthIncrease", "specifies whether nodes should be expanded until only longer refinements are reached")); - return options; - } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#applyConfigEntry(org.dllearner.core.ConfigEntry) - */ - @Override - public <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { - learner.applyConfigEntry(entry); - } - - @Override - public void init() throws ComponentInitException { - learner.init(); - } - - @Override - public void start() { - learner.start(); - } - - @Override - public void stop() { - learner.stop(); - } - - @Override - public Description getCurrentlyBestDescription() { - return learner.getCurrentlyBestDescription(); - } - - @Override - public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { - return learner.getCurrentlyBestEvaluatedDescription(); - } - - @Override - public List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions){ - return learner.getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, accuracyThreshold, filterNonMinimalDescriptions); - } - -// @Override - public ScorePosNeg getSolutionScore() { - return learner.getSolutionScore(); - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#pause() - */ - @Override - public void pause() { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#resume() - */ - @Override - public void resume() { - // TODO Auto-generated method stub - - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#isRunning() - */ - @Override - public boolean isRunning() { - // TODO Auto-generated method stub - return false; - } -} Deleted: trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2009-02-13 11:06:53 UTC (rev 1602) +++ trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,128 +0,0 @@ -/** - * 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.algorithms; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.SimpleSuggestionLearningAlgorithmConfigurator; -import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.core.owl.ObjectProperty; -import org.dllearner.core.owl.ObjectSomeRestriction; -import org.dllearner.core.owl.Thing; -import org.dllearner.learningproblems.ScorePosNeg; - -/** - * Algorithm for getting "simple" suggestions, e.g. it tests some of the most likely candidates on whether - * they are solutions of a learning problem. - * - * @author Christian Kötteritzsch - * - */ -public class SimpleSuggestionLearningAlgorithm extends LearningAlgorithm implements Runnable { - - private SimpleSuggestionLearningAlgorithmConfigurator configurator; - @Override - public SimpleSuggestionLearningAlgorithmConfigurator getConfigurator(){ - return configurator; - } - -// private boolean stop = false; - private ScorePosNeg solutionScore; - private Description bestSollution; - private Set<Description> simpleSuggestions; - - public SimpleSuggestionLearningAlgorithm() { - super(null, null); - this.configurator = new SimpleSuggestionLearningAlgorithmConfigurator(this); - } - - @Override - public Description getCurrentlyBestDescription() { - return bestSollution; - } - - @Override - public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescriptionPosNeg(bestSollution, solutionScore); - } - - public static String getName() { - return "simple suggestion algorithm"; - } - - @Override - public void stop() { -// stop = true; - } - - @Override - public void start() { - - } - - @Override - public <T> void applyConfigEntry(ConfigEntry<T> entry) { - - } - - @Override - public void init() { - - } - -// @Override - public ScorePosNeg getSolutionScore() { - return solutionScore; - } - - public void run() { - - } - - public Set<Description> getSimpleSuggestions(ReasonerComponent rs, Set<Individual> indi) { - // EXISTS property.TOP - // ESISTS hasChild - // EXISTS hasChild.male - simpleSuggestions = new HashSet<Description>(); - List<ObjectProperty> test = rs.getAtomicRolesList(); - while (test.iterator().hasNext()) { - test.iterator().next(); - Description d1 = new ObjectSomeRestriction(test.iterator().next(), new Thing()); - test.remove(rs.getAtomicRolesList().iterator().next()); - simpleSuggestions.add(d1); - } - return simpleSuggestions; - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#isRunning() - */ - @Override - public boolean isRunning() { - // TODO Auto-generated method stub - return false; - } -} Property changes on: trunk/src/dl-learner/org/dllearner/algorithms/refinement2 ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedHeuristic.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedHeuristic.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -package org.dllearner.algorithms.refexamples; +package org.dllearner.algorithms.refinement2; import java.util.Comparator; Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedNode.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -18,14 +18,14 @@ * */ -package org.dllearner.algorithms.refexamples; +package org.dllearner.algorithms.refinement2; import java.text.DecimalFormat; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; -import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; +import org.dllearner.core.configurators.ROLComponent2Configurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.utilities.owl.ConceptComparator; @@ -42,7 +42,7 @@ */ public class ExampleBasedNode { - private ExampleBasedROLComponentConfigurator configurator; + private ROLComponent2Configurator configurator; private static DecimalFormat df = new DecimalFormat(); @@ -75,7 +75,7 @@ // a flag whether this could be a solution for a posonly learning problem private boolean isPosOnlyCandidate = true; - public ExampleBasedNode(ExampleBasedROLComponentConfigurator configurator, Description concept) { + public ExampleBasedNode(ROLComponent2Configurator configurator, Description concept) { this.configurator = configurator; this.concept = concept; horizontalExpansion = 0; Deleted: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLComponent.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,494 +0,0 @@ -/** - * 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.algorithms.refexamples; - -import java.io.File; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.SortedSet; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; -import org.dllearner.core.ComponentInitException; -import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; -import org.dllearner.core.options.BooleanConfigOption; -import org.dllearner.core.options.CommonConfigMappings; -import org.dllearner.core.options.CommonConfigOptions; -import org.dllearner.core.options.ConfigEntry; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.core.options.DoubleConfigOption; -import org.dllearner.core.options.IntegerConfigOption; -import org.dllearner.core.options.InvalidConfigOptionValueException; -import org.dllearner.core.options.StringConfigOption; -import org.dllearner.core.owl.ClassHierarchy; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.ObjectProperty; -import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; -import org.dllearner.learningproblems.PosOnlyLP; -import org.dllearner.learningproblems.ScorePosNeg; -import org.dllearner.reasoning.ReasonerType; -import org.dllearner.refinementoperators.RhoDRDown; -import org.dllearner.utilities.Files; -import org.dllearner.utilities.Helper; - -/** - * The DL-Learner learning algorithm component for the example - * based refinement operator approach. It handles all - * configuration options, creates the corresponding objects and - * passes them to the actual refinement operator, heuristic, and - * learning algorithm implementations. - * - * Note: The options supported by the ROLearner component and this - * one are not equal. Options that have been dropped for now: - * - horizontal expansion factor: The goal of the algorithm will - * be to (hopefully) be able to learn long and complex concepts - * more efficiently. - * A horizontal expansion factor has its benefits, but limits - * the length of concepts learnable in reasonable time to - * about 15 with its default value of 0.6 and a small sized - * background knowledge base. We hope to get more fine-grained - * control of whether it makes sense to extend a node with - * more sophisticated heuristics. - * Dropping the horizontal expansion factor means that the - * completeness of the algorithm depends on the heuristic. - * - * @author Jens Lehmann - * - */ -public class ExampleBasedROLComponent extends LearningAlgorithm { - - private ExampleBasedROLComponentConfigurator configurator; - @Override - public ExampleBasedROLComponentConfigurator getConfigurator(){ - return configurator; - } - - // actual algorithm - private ExampleBasedROLearner algorithm; - private static Logger logger = Logger - .getLogger(ExampleBasedROLComponent.class); - private String logLevel = CommonConfigOptions.logLevelDefault; - - // configuration options - private boolean writeSearchTree; - private File searchTreeFile; - private boolean replaceSearchTree = false; - private static String defaultSearchTreeFile = "log/searchTree.txt"; - private String heuristic = "multi"; - Set<NamedClass> allowedConcepts; - Set<ObjectProperty> allowedRoles; - Set<NamedClass> ignoredConcepts; - Set<ObjectProperty> ignoredRoles; - // these are computed as the result of the previous four settings - Set<NamedClass> usedConcepts; - Set<ObjectProperty> usedRoles; - private boolean applyAllFilter = true; - private boolean applyExistsFilter = true; - private boolean useTooWeakList = true; - private boolean useOverlyGeneralList = true; - private boolean useShortConceptConstruction = true; - private boolean improveSubsumptionHierarchy = true; - private boolean useAllConstructor = CommonConfigOptions.useAllConstructorDefault; - private boolean useExistsConstructor = CommonConfigOptions.useExistsConstructorDefault; - private boolean useHasValueConstructor = CommonConfigOptions.useHasValueConstructorDefault; - private int valueFrequencyThreshold = CommonConfigOptions.valueFrequencyThresholdDefault; - private boolean useCardinalityRestrictions = CommonConfigOptions.useCardinalityRestrictionsDefault; - private boolean useNegation = CommonConfigOptions.useNegationDefault; - private boolean useBooleanDatatypes = CommonConfigOptions.useBooleanDatatypesDefault; - private boolean useDoubleDatatypes = CommonConfigOptions.useDoubleDatatypesDefault; - private static double noisePercentageDefault = 0.0; - private double noisePercentage = noisePercentageDefault; - private NamedClass startClass = null; - //refactor this - private static boolean usePropernessChecksDefault = false; - private boolean usePropernessChecks = usePropernessChecksDefault; - // refactor this - private static int maxPosOnlyExpansionDefault = 4; - private int maxPosOnlyExpansion = maxPosOnlyExpansionDefault; - private boolean forceRefinementLengthIncrease = true; - //extended Options - //in seconds - private int maxExecutionTimeInSeconds = CommonConfigOptions.maxExecutionTimeInSecondsDefault; - private int minExecutionTimeInSeconds = CommonConfigOptions.minExecutionTimeInSecondsDefault; - private int guaranteeXgoodDescriptions = CommonConfigOptions.guaranteeXgoodDescriptionsDefault; - private int maxClassDescriptionTests = CommonConfigOptions.maxClassDescriptionTestsDefault; - - // Variablen zur Einstellung der Protokollierung - // boolean quiet = false; - boolean showBenchmarkInformation = false; - // boolean createTreeString = false; - // String searchTree = new String(); - - // Konfiguration des Algorithmus - // Faktor für horizontale Erweiterung (notwendig für completeness) - // double horizontalExpansionFactor = 0.6; - - // soll später einen Operator und eine Heuristik entgegennehmen - // public ROLearner(LearningProblem learningProblem, LearningProblem learningProblem2) { - public ExampleBasedROLComponent(PosNegLP learningProblem, ReasonerComponent reasoningService) { - super(learningProblem, reasoningService); - this.configurator = new ExampleBasedROLComponentConfigurator(this); - } - - public ExampleBasedROLComponent(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { - super(learningProblem, reasoningService); - this.configurator = new ExampleBasedROLComponentConfigurator(this); - } - - public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { - Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); - problems.add(PosNegLP.class); - problems.add(PosOnlyDefinitionLP.class); - return problems; - } - - public static Collection<ConfigOption<?>> createConfigOptions() { - Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - 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", defaultSearchTreeFile)); - 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)); - StringConfigOption heuristicOption = new StringConfigOption("heuristic", "specifiy the heuristic to use", "lexicographic"); - heuristicOption.setAllowedValues(new String[] {"lexicographic", "flexible"}); - options.add(heuristicOption); - options.add(new BooleanConfigOption("applyAllFilter", "usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D)", true)); - options.add(new BooleanConfigOption("applyExistsFilter", "usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D)", true)); - options.add(new BooleanConfigOption("useTooWeakList", "try to filter out too weak concepts without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useOverlyGeneralList", "try to find overly general concept without sending them to the reasoner", true)); - options.add(new BooleanConfigOption("useShortConceptConstruction", "shorten concept to see whether they already exist", true)); - DoubleConfigOption horizExp = new DoubleConfigOption("horizontalExpansionFactor", "horizontal expansion factor (see publication for description)", 0.6); - horizExp.setLowerLimit(0.0); - horizExp.setUpperLimit(1.0); - options.add(horizExp); - options.add(new BooleanConfigOption("improveSubsumptionHierarchy", "simplify subsumption hierarchy to reduce search space (see publication for description)", true)); - // allowed/ignored concepts/roles could also be a reasoner option (?) - options.add(CommonConfigOptions.allowedConcepts()); - options.add(CommonConfigOptions.ignoredConcepts()); - options.add(CommonConfigOptions.allowedRoles()); - options.add(CommonConfigOptions.ignoredRoles()); - options.add(CommonConfigOptions.useAllConstructor()); - options.add(CommonConfigOptions.useExistsConstructor()); - options.add(CommonConfigOptions.useHasValueConstructor()); - options.add(CommonConfigOptions.valueFreqencyThreshold()); - options.add(CommonConfigOptions.useCardinalityRestrictions()); - options.add(CommonConfigOptions.cardinalityLimit()); - options.add(CommonConfigOptions.useNegation()); - options.add(CommonConfigOptions.useBooleanDatatypes()); - options.add(CommonConfigOptions.useDoubleDatatypes()); - options.add(CommonConfigOptions.maxExecutionTimeInSeconds()); - options.add(CommonConfigOptions.minExecutionTimeInSeconds()); - options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); - options.add(CommonConfigOptions.maxClassDescriptionTests()); - options.add(CommonConfigOptions.getLogLevel()); - options.add(new BooleanConfigOption("usePropernessChecks", "specifies whether to check for equivalence (i.e. discard equivalent refinements)",usePropernessChecksDefault)); - options.add(new IntegerConfigOption("maxPosOnlyExpansion", "specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is" + - " considered as solution candidate",maxPosOnlyExpansionDefault)); - options.add(CommonConfigOptions.getNoisePercentage()); - options.add(CommonConfigOptions.getTerminateOnNoiseReached()); - options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); - options.add(new BooleanConfigOption("forceRefinementLengthIncrease", "specifies whether nodes should be expanded until only longer refinements are reached")); - options.add(new DoubleConfigOption("negativeWeight", "Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives).",1.0)); - options.add(new DoubleConfigOption("startNodeBonus", "You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space).",0.0)); - options.add(new IntegerConfigOption("negationPenalty", "Penalty on negations (TODO: better explanation).", 0)); - options.add(CommonConfigOptions.getExpansionPenaltyFactor(0.02)); - return options; - } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#applyConfigEntry(org.dllearner.core.ConfigEntry) - */ - @Override - @SuppressWarnings({"unchecked"}) - public <T> void applyConfigEntry(ConfigEntry<T> entry) throws InvalidConfigOptionValueException { - String name = entry.getOptionName(); - if(name.equals("writeSearchTree")) - writeSearchTree = (Boolean) entry.getValue(); - else if(name.equals("searchTreeFile")) - searchTreeFile = new File((String)entry.getValue()); - else if(name.equals("replaceSearchTree")) - replaceSearchTree = (Boolean) entry.getValue(); - else if(name.equals("heuristic")) { - String value = (String) entry.getValue(); - if(value.equals("lexicographic")) - heuristic = "lexicographic"; - else - heuristic = "flexible"; - } else if(name.equals("allowedConcepts")) { - allowedConcepts = CommonConfigMappings.getAtomicConceptSet((Set<String>)entry.getValue()); - } else if(name.equals("allowedRoles")) { - allowedRoles = CommonConfigMappings.getAtomicRoleSet((Set<String>)entry.getValue()); - } else if(name.equals("ignoredConcepts")) { - ignoredConcepts = CommonConfigMappings.getAtomicConceptSet((Set<String>)entry.getValue()); - } else if(name.equals("ignoredRoles")) { - ignoredRoles = CommonConfigMappings.getAtomicRoleSet((Set<String>)entry.getValue()); - } else if(name.equals("applyAllFilter")) { - applyAllFilter = (Boolean) entry.getValue(); - } else if(name.equals("applyExistsFilter")) { - applyExistsFilter = (Boolean) entry.getValue(); - } else if(name.equals("useTooWeakList")) { - useTooWeakList = (Boolean) entry.getValue(); - } else if(name.equals("useOverlyGeneralList")) { - useOverlyGeneralList = (Boolean) entry.getValue(); - } else if(name.equals("useShortConceptConstruction")) { - useShortConceptConstruction = (Boolean) entry.getValue(); - } else if(name.equals("improveSubsumptionHierarchy")) { - improveSubsumptionHierarchy = (Boolean) entry.getValue(); - } else if(name.equals("useAllConstructor")) { - useAllConstructor = (Boolean) entry.getValue(); - } else if(name.equals("useExistsConstructor")) { - useExistsConstructor = (Boolean) entry.getValue(); - } else if(name.equals("useHasValueConstructor")) { - useHasValueConstructor = (Boolean) entry.getValue(); - } else if(name.equals("valueFrequencyThreshold")) { - valueFrequencyThreshold = (Integer) 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")) { - noisePercentage = (Double) entry.getValue(); - } else if(name.equals("useBooleanDatatypes")) { - useBooleanDatatypes = (Boolean) entry.getValue(); - } else if(name.equals("useDoubleDatatypes")) { - useDoubleDatatypes = (Boolean) entry.getValue(); - } else if(name.equals("usePropernessChecks")) { - usePropernessChecks = (Boolean) entry.getValue(); - } else if(name.equals("maxPosOnlyExpansion")) { - maxPosOnlyExpansion = (Integer) entry.getValue(); - } else if(name.equals("startClass")) { - startClass = new NamedClass((String)entry.getValue()); - }else if(name.equals("maxExecutionTimeInSeconds")) { - maxExecutionTimeInSeconds = (Integer) entry.getValue(); - }else if(name.equals("minExecutionTimeInSeconds")) { - minExecutionTimeInSeconds = (Integer) entry.getValue(); - }else if(name.equals("guaranteeXgoodDescriptions")) { - guaranteeXgoodDescriptions = (Integer) entry.getValue(); - } else if(name.equals("maxClassDescriptionTests")) { - maxClassDescriptionTests = (Integer) entry.getValue(); - } else if(name.equals("logLevel")) { - logLevel = ((String)entry.getValue()).toUpperCase(); - } else if(name.equals("forceRefinementLengthIncrease")) { - forceRefinementLengthIncrease = (Boolean) entry.getValue(); - } - } - - /* (non-Javadoc) - * @see org.dllearner.core.Component#init() - */ - @Override - public void init() throws ComponentInitException { - - // exit with a ComponentInitException if the reasoner is unsupported for this learning algorithm - if(reasoner.getReasonerType() == ReasonerType.DIG) { - throw new ComponentInitException("DIG does not support the inferences needed in the selected learning algorithm component: " + getName()); - } - - // set log level if the option has been set - if(!logLevel.equals(CommonConfigOptions.logLevelDefault)) - logger.setLevel(Level.toLevel(logLevel,Level.toLevel(CommonConfigOptions.logLevelDefault))); - - if(searchTreeFile == null) - searchTreeFile = new File(defaultSearchTreeFile); - - if(writeSearchTree) - Files.clearFile(searchTreeFile); - - // adjust heuristic - ExampleBasedHeuristic algHeuristic; - - if(heuristic == "lexicographic") - algHeuristic = new LexicographicHeuristic(); - else if(heuristic == "flexible") { - if(learningProblem instanceof PosOnlyDefinitionLP) { - throw new RuntimeException("does not work with positive examples only yet"); - } - algHeuristic = new FlexibleHeuristic(((PosNegLP)learningProblem).getNegativeExamples().size(), ((PosNegLP)learningProblem).getPercentPerLengthUnit()); - } else { - if(learningProblem instanceof PosOnlyLP) { -// throw new RuntimeException("does not work with positive examples only yet"); - algHeuristic = new MultiHeuristic(((PosOnlyLP)learningProblem).getPositiveExamples().size(),0, configurator); - } else { - algHeuristic = new MultiHeuristic(((PosNegLP)learningProblem).getPositiveExamples().size(),((PosNegLP)learningProblem).getNegativeExamples().size(), configurator); - } - } - - // compute used concepts/roles from allowed/ignored - // concepts/roles - if(allowedConcepts != null) { - // sanity check to control if no non-existing concepts are in the list - Helper.checkConcepts(reasoner, allowedConcepts); - usedConcepts = allowedConcepts; - } else if(ignoredConcepts != null) { - usedConcepts = Helper.computeConceptsUsingIgnoreList(reasoner, ignoredConcepts); - } else { - usedConcepts = Helper.computeConcepts(reasoner); - } - - if(allowedRoles != null) { - Helper.checkRoles(reasoner, allowedRoles); - usedRoles = allowedRoles; - } else if(ignoredRoles != null) { - Helper.checkRoles(reasoner, ignoredRoles); - usedRoles = Helper.difference(reasoner.getObjectProperties(), ignoredRoles); - } else { - usedRoles = reasoner.getObjectProperties(); - } - - // prepare subsumption and role hierarchies, because they are needed - // during the run of the algorithm; - // in contrast to before, the learning algorithms have to maintain their - // own view on the class hierarchy - ClassHierarchy classHierarchy = reasoner.getClassHierarchy().cloneAndRestrict(usedConcepts); - if(improveSubsumptionHierarchy) - classHierarchy.thinOutSubsumptionHierarchy(); - -// reasoner.prepareRoleHierarchy(usedRoles); - // prepare datatype hierarchy only if necessary -// if(reasoner.hasDatatypeSupport()) -// reasoner.prepareDatatypePropertyHierarchy(); - - // create a refinement operator and pass all configuration - // variables to it - RhoDRDown operator = new RhoDRDown( - reasoner, - classHierarchy, - configurator, - applyAllFilter, - applyExistsFilter, - useAllConstructor, - useExistsConstructor, - useHasValueConstructor, - valueFrequencyThreshold, - useCardinalityRestrictions, - useNegation, - useBooleanDatatypes, - useDoubleDatatypes, - startClass - ); - - // create an algorithm object and pass all configuration - // options to it - algorithm = new ExampleBasedROLearner( - configurator, - learningProblem, - reasoner, - operator, - algHeuristic, - startClass, - // usedConcepts, - // usedRoles, - noisePercentage/(double)100, - writeSearchTree, - replaceSearchTree, - searchTreeFile, - useTooWeakList, - useOverlyGeneralList, - useShortConceptConstruction, - usePropernessChecks, - maxPosOnlyExpansion, - maxExecutionTimeInSeconds, - minExecutionTimeInSeconds, - guaranteeXgoodDescriptions, - maxClassDescriptionTests, - forceRefinementLengthIncrease - ); - // note: used concepts and roles do not need to be passed - // as argument, because it is sufficient to prepare the - // concept and role hierarchy accordingly - } - - public static String getName() { - return "refinement operator based learning algorithm II"; - } - - public static String getUsage() { - return "algorithm = refexamples;"; - } - - @Override - public void start() { - algorithm.start(); - } - -// @Override - public ScorePosNeg getSolutionScore() { - return algorithm.getSolutionScore(); - } - - @Override - public Description getCurrentlyBestDescription() { - return algorithm.getBestSolution(); - } - - @Override - public synchronized List<Description> getCurrentlyBestDescriptions() { - return algorithm.getCurrentlyBestDescriptions(); - } - - @Override - public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescriptionPosNeg(algorithm.getBestSolution(),algorithm.getSolutionScore()); - } - - @Override - public synchronized SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { - return algorithm.getCurrentlyBestEvaluatedDescriptions(); - } - - /** {@inheritDoc} */ - @Override - public void stop() { - algorithm.stop(); - } - - public ExampleBasedNode getStartNode() { - return algorithm.getStartNode(); - } - - /** {@inheritDoc} */ - @Override - public void pause() { - // TODO: not implemented - } - - /** {@inheritDoc} */ - @Override - public void resume() { - // TODO: not implemented - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningAlgorithm#isRunning() - */ - /** {@inheritDoc} */ - @Override - public boolean isRunning() { - return algorithm.isRunning(); - } - -} Deleted: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ExampleBasedROLearner.java 2009-02-13 11:44:38 UTC (rev 1603) @@ -1,1531 +0,0 @@ -/** - * 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.refexamples; - -import java.io.File; -import java.text.DecimalFormat; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.NavigableSet; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; -import java.util.concurrent.ConcurrentSkipListSet; - -import org.apache.log4j.Logger; -import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; -import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Thing; -import org.dllearner.core.owl.Union; -import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; -import org.dllearner.learningproblems.ScorePosNeg; -import org.dllearner.refinementoperators.RefinementOperator; -import org.dllearner.refinementoperators.RhoDRDown; -import org.dllearner.utilities.Files; -import org.dllearner.utilities.Helper; -import org.dllearner.utilities.JamonMonitorLogger; -import org.dllearner.utilities.owl.ConceptComparator; -import org.dllearner.utilities.owl.ConceptTransformation; -import org.dllearner.utilities.owl.EvaluatedDescriptionPosNegComparator; - -import com.jamonapi.Monitor; - -/** - * Implements the 2nd version of the refinement operator based learning approach. - * - * @author Jens Lehmann - * - */ -public class ExampleBasedROLearner { - - private static Logger logger = Logger.getLogger(ExampleBasedROLearner.class); - private ExampleBasedROLComponentConfigurator configurator; - - // basic setup: learning problem and reasoning service - private ReasonerComponent rs; - // often the learning problems needn't be accessed directly; instead - // use the example sets below and the posonly variable - private PosNegLP learningProblem; - private PosOnlyDefinitionLP posOnlyLearningProblem; - private Description startDescription; - private boolean posOnly = false; - private int nrOfExamples; - private int nrOfPositiveExamples; - private Set<Individual> positiveExamples; - private int nrOfNegativeExamples; - private Set<Individual> negativeExamples; - - // noise regulates how many positives can be misclassified and when the - // algorithm terminates - private double noise = 0.0; - private int allowedMisclassifications = 0; - - // positive only learning options: - // if no negatives are given, then one possible strategy is to find a very - // special concept still entailing all positive examples; - // this is realised by changing the termination criterion: a concept is a - // solution if it has been expanded x times (x is - // configurable) but no more special concept is found (all are either - // equivalent or too weak) - private int maxPosOnlyExpansion; - - // search tree options - private boolean writeSearchTree; - private File searchTreeFile; - private boolean replaceSearchTree = false; - - // constructs to improve performance - private boolean useTooWeakList = true; - private boolean useOverlyGeneralList = true; - private boolean useShortConceptConstruction = true; - - // extended Options - private long maxExecutionTimeInSeconds; - private boolean maxExecutionTimeAlreadyReached = false; - private long minExecutionTimeInSeconds = 0; - private boolean minExecutionTimeAlreadyReached = false; - private int guaranteeXgoodDescriptions = 1; - private boolean guaranteeXgoodAlreadyReached = false; - private int maxClassDescriptionTests; - - // if set to false we do not test properness; this may seem wrong - // but the disadvantage of properness testing are additional reasoner - // queries and a search bias towards ALL r.something because - // ALL r.TOP is improper and automatically expanded further - private boolean usePropernessChecks = false; - - // tree traversal means to run through the most promising concepts - // and connect them in an intersection to find a solution - // (this is called irregularly e.g. every 100 seconds) - private boolean useTreeTraversal = false; - - // if this variable is set to true, then the refinement operator - // is applied until all concept of equal length have been found - // e.g. TOP -> A1 -> A2 -> A3 is found in one loop; the disadvantage - // are potentially more method calls, but the advantage is that - // the algorithm is better in locating relevant concept in the - // subsumption hierarchy (otherwise, if the most general concept - // is not promising, it may never get expanded) - private boolean forceRefinementLengthIncrease; - - // candidate reduction: using this mechanism we can simulate - // the divide&conquer approach in many ILP programs using a - // clause by clause search; after a period of time the candidate - // set is reduced to focus CPU time on the most promising concepts - private boolean useCandidateReduction = true; - private int candidatePostReductionSize = 30; - - // setting to true gracefully stops the algorithm - private boolean stop = false; - private boolean isRunning = false; - - // node from which algorithm has started - private ExampleBasedNode startNode; - - // solution protocol - // TODO isn't solution found already true if solutions.size()>=0 ??? - @Deprecated - private boolean solutionFound = false; - private List<Description> solutions = new LinkedList<Description>(); - - // used refinement operator and heuristic (exchangeable) - private RhoDRDown operator; - // private RefinementOperator operator; - // private ExampleBasedHeuristic heuristic; - - // specifies whether to compute and log benchmark information - private boolean computeBenchmarkInformation = false; - - // comparator used to maintain a stable ordering of nodes, i.e. - // an ordering which does not change during the run of the algorithm - private NodeComparatorStable nodeComparatorStable = new NodeComparatorStable(); - // stable candidate set; it has no functional part in the algorithm, - // but is a list of the currently best concepts found; - // it is very important to use a concurrent set here as other threads will - // access it (usual iterating is likely to throw a ConcurrentModificationException) - private NavigableSet<ExampleBasedNode> candidatesStable = new ConcurrentSkipListSet<ExampleBasedNode>( - nodeComparatorStable); - // evaluated descriptions -// private EvaluatedDescriptionSet evaluatedDescriptions = new EvaluatedDescriptionSet(LearningAlgorithm.MAX_NR_OF_RESULTS); - - // comparator used to create ordered sets of concepts - private ConceptComparator conceptComparator = new ConceptComparator(); - // comparator for evaluated descriptions - private EvaluatedDescriptionPosNegComparator edComparator = new EvaluatedDescriptionPosNegComparator(); - - // utility variables - private DecimalFormat df = new DecimalFormat(); - - // candidates for refinement (used for directly accessing - // nodes in the search tree) - private TreeSet<ExampleBasedNode> candidates; - - // new nodes found during a run of the algorithm - private List<ExampleBasedNode> newCandidates = new LinkedList<ExampleBasedNode>(); - - // all concepts which have been evaluated as being proper refinements - private SortedSet<Description> properRefinements = new TreeSet<Description>(conceptComparator); - - // blacklists - private SortedSet<Description> tooWeakList = new TreeSet<Description>(conceptComparator); - private SortedSet<Description> overlyGeneralList = new TreeSet<Description>(conceptComparator); - - // set of expanded nodes (TODO: better explanation) - TreeSet<ExampleBasedNode> expandedNodes = new TreeSet<ExampleBasedNode>(nodeComparatorStable); - - // statistic variables - private int maxRecDepth = 0; - private int maxNrOfRefinements = 0; - private int maxNrOfChildren = 0; - private int redundantConcepts = 0; - private int propernessTestsReasoner = 0; - private int propernessTestsAvoidedByShortConceptConstruction = 0; - private int propernessTestsAvoidedByTooWeakList = 0; - private int conceptTestsTooWeakList = 0; - private int conceptTestsOverlyGeneralList = 0; - private int conceptTestsReasoner = 0; - - // time variables - private long runtime; - private long algorithmStartTime; - private long propernessCalcTimeNs = 0; - private long propernessCalcReasoningTimeNs = 0; - private long childConceptsDeletionTimeNs = 0; - private long refinementCalcTimeNs = 0; - private long redundancyCheckTimeNs = 0; - private long evaluateSetCreationTimeNs = 0; - private long improperConceptsRemovalTimeNs = 0; - - // prefixes - private String baseURI; - private Map<String, String> prefixes; - - public ExampleBasedROLearner( - ExampleBasedROLComponentConfigurator configurator, - LearningProblem learningProblem, - ReasonerComponent rs, - RefinementOperator operator, - ExampleBasedHeuristic heuristic, - Description startDescription, - // Set<AtomicConcept> allowedConcepts, - // Set<AtomicRole> allowedRoles, - double noise, boolean writeSearchTree, boolean replaceSearchTree, File searchTreeFile, - boolean useTooWeakList, boolean useOverlyGeneralList, - boolean useShortConceptConstruction, boolean usePropernessChecks, - int maxPosOnlyExpansion, int maxExecutionTimeInSeconds, int minExecutionTimeInSeconds, - int guaranteeXgoodDescriptions, int maxClassDescriptionTests, boolean forceRefinementLengthIncrease) { - - if (learningProblem instanceof PosNegLP) { - PosNegLP lp = (PosNegLP) learningProblem; - this.learningProblem = lp; - posOnly = false; - positiveExamples = lp.getPositiveExamples(); - negativeExamples = lp.getNegativeExamples(); - nrOfPositiveExamples = positiveExamples.size(); - nrOfNegativeExamples = negativeExamples.size(); - - // System.out.println(nrOfPositiveExamples); - // System.out.println(nrOfNegativeExamples); - // System.exit(0); - - } else if (learningProblem instanceof PosOnlyDefinitionLP) { - PosOnlyDefinitionLP lp = (PosOnlyDefinitionLP) learningProblem; - this.posOnlyLearningProblem = lp; - posOnly = true; - positiveExamples = lp.getPositiveExamples(); - negativeExamples = new TreeSet<Individual>(); - nrOfPositiveExamples = lp.getPositiveExamples().size(); - // nrOfNegativeExamples = lp.getPseudoNegatives().size(); - nrOfNegativeExamples = 0; - } - this.configurator = configurator; - nrOfExamples = nrOfPositiveExamples + nrOfNegativeExamples; - this.rs = rs; - this.operator = (RhoDRDown) operator; - this.startDescription = startDescription; - // initialise candidate set with heuristic as ordering - candidates = new TreeSet<ExampleBasedNode>(heuristic); - this.noise = noise; - this.writeSearchTree = writeSearchTree; - this.replaceSearchTree = replaceSearchTree; - this.searchTreeFile = searchTreeFile; - this.useTooWeakList = useTooWeakList; - this.useOverlyGeneralList = useOverlyGeneralList; - this.useShortConceptConstruction = useShortConceptConstruction; - this.usePropernessChecks = usePropernessChecks; - baseURI = rs.getBaseURI(); - prefixes = rs.getPrefixes(); - this.maxPosOnlyExpansion = maxPosOnlyExpansion; - this.maxExecutionTimeInSeconds = maxExecutionTimeInSeconds; - this.minExecutionTimeInSeconds = minExecutionTimeInSeconds; - this.guaranteeXgoodDescriptions = guaranteeXgoodDescriptions; - this.maxClassDescriptionTests = maxClassDescriptionTests; - this.forceRefinementLengthIncrease = forceRefinementLengthIncrease; - - // logger.setLevel(Level.DEBUG); - } - - public void start() { - stop = false; - isRunning = true; - runtime = System.currentTimeMillis(); - - // reset values (algorithms may be started several times) - candidates.clear(); - candidatesStable.clear(); - newCandidates.clear(); - solutionFound = false; - solutions.clear(); - maxExecutionTimeAlreadyReached = false; - minExecutionTimeAlreadyReached = false; - guaranteeXgoodAlreadyReached = false; - propernessTestsReasoner = 0; - propernessTestsAvoidedByShortConceptConstruction = 0; - propernessTestsAvoidedByTooWeakList = 0; - conceptTestsTooWeakList = 0; - conceptTestsOverlyGeneralList = 0; - propernessCalcTimeNs = 0; - propernessCalcReasoningTimeNs = 0; - childConceptsDeletionTimeNs = 0; - refinementCalcTimeNs = 0; - redundancyCheckTimeNs = 0; - evaluateSetCreationTimeNs = 0; - improperConceptsRemovalTimeNs = 0; - - Monitor totalLearningTime = JamonMonitorLogger.getTimeMonitor(ExampleBasedROLComponent.class, "totalLearningTime") - .start(); - // TODO: write a JUnit test for this problem (long-lasting or infinite - // loops because - // redundant children of a node are called recursively when a node is - // extended - // twice) - /* - * // String conceptStr = - * "(\"http://dl-learner.org/carcinogenesis#Compound\" AND (>= 2 - * \"http://dl-learner.org/carcinogenesis#hasStructure\".\"http://dl-learner.org/carcinogenesis#Ar_halide\" - * OR ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE) AND >= 5 \"http://dl-learner.org/carcinogenesis#hasBond\". - * TOP)))"; // String conceptStr = - * "(\"http://dl-learner.org/carcinogenesis#Compound\" AND - * ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS TRUE) - * AND (\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE)))"; String conceptStr = - * "(\"http://dl-learner.org/carcinogenesis#Compound\" AND (>= 3 - * \"http://dl-learner.org/carcinogenesis#hasStructure\".\"http://dl-learner.org/carcinogenesis#Halide\" - * OR ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE) AND ALL - * \"http://dl-learner.org/carcinogenesis#hasAtom\".TOP)))"; String - * conceptStr2 = "(\"http://dl-learner.org/carcinogenesis#Compound\" AND - * (>= 4 - * \"http://dl-learner.org/carcinogenesis#hasStructure\".\"http://dl-learner.org/carcinogenesis#Halide\" - * OR ((\"http://dl-learner.org/carcinogenesis#amesTestPositive\" IS - * TRUE) AND ALL - * \"http://dl-learner.org/carcinogenesis#hasAtom\".TOP)))"; try { - * NamedClass struc = new - * NamedClass("http://dl-learner.org/carcinogenesis#Compound"); - * Description d = KBParser.parseConcept(conceptStr); Description d2 = - * KBParser.parseConcept(conceptStr2); // SortedSet<Description> ds = - * (SortedSet<Description>) operator.refine(d,15,null,struc); // - * System.out.println(ds); - * // System.out.println(RhoDRDown.checkIntersection((Intersection)d)); - * - * - * Set<Individual> coveredNegatives = rs.instanceCheck(d, - * learningProblem.getNegativeExamples()); Set<Individual> - * coveredPositives = rs.instanceCheck(d, - * learningProblem.getPositiveExamples()); ExampleBasedNode ebn = new - * ExampleBasedNode(d); ebn.setCoveredExamples(coveredPositives, - * coveredNegatives); - * - * properRefinements.add(d2); extendNodeProper(ebn,13); - * extendNodeProper(ebn,14); for(Description refinement: - * ebn.getChildConcepts()) System.out.println("refinement: " + - * refinement); - * // Individual i = new - * Individual("http://dl-learner.org/carcinogenesis#d101"); // - * for(Individual i : learningProblem.getPositiveExamples()) // - * rs.instanceCheck(ds.last(), i); - * - * System.out.println("finished"); } catch (ParseException e) { // TODO - * Auto-generated catch block e.printStackTrace(); } System.exit(0); - */ - - // calculate quality threshold required for a solution - allowedMisclassifications = (int) Math.round(noise ... [truncated message content] |
From: <jen...@us...> - 2009-02-13 11:07:02
|
Revision: 1602 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1602&view=rev Author: jenslehmann Date: 2009-02-13 11:06:53 +0000 (Fri, 13 Feb 2009) Log Message: ----------- improved learning problem structure Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 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/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/core/LearningProblem.java trunk/src/dl-learner/org/dllearner/core/Score.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/examples/KRKModular.java trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java trunk/src/dl-learner/org/dllearner/learningproblems/ScorePosNeg.java trunk/src/dl-learner/org/dllearner/scripts/DumbLPFinder.java trunk/src/dl-learner/org/dllearner/scripts/NewSample.java trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java trunk/src/dl-learner/org/dllearner/scripts/Sample.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBibleComparison.java trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/test/ComponentTest.java trunk/src/dl-learner/org/dllearner/test/SworeTest.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/utilities/components/ComponentCombo.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionComparator.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStandard.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLPStrict.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLPStrict.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyInclusionLP.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/lib/components.ini 2009-02-13 11:06:53 UTC (rev 1602) @@ -11,11 +11,10 @@ org.dllearner.reasoning.FastRetrievalReasoner org.dllearner.reasoning.FastInstanceChecker # learning problems -org.dllearner.learningproblems.PosNegDefinitionLP -org.dllearner.learningproblems.PosNegDefinitionLPStrict +org.dllearner.learningproblems.PosNegLPStandard +org.dllearner.learningproblems.PosNegLPStrict org.dllearner.learningproblems.PosNegInclusionLP -org.dllearner.learningproblems.PosOnlyDefinitionLP -org.dllearner.learningproblems.PosOnlyInclusionLP +org.dllearner.learningproblems.PosOnlyLP org.dllearner.learningproblems.ClassLearningProblem # learning algorithms org.dllearner.algorithms.RandomGuesser Modified: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -39,9 +39,9 @@ import org.dllearner.core.options.InvalidConfigOptionValueException; import org.dllearner.core.options.StringConfigOption; import org.dllearner.core.owl.Description; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; /** @@ -79,8 +79,8 @@ PosNegLP lp = (PosNegLP) learningProblem; this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); //this.learner=new ExampleBasedROLComponent(lp, rs); - } else if(learningProblem instanceof PosOnlyDefinitionLP) { - PosOnlyDefinitionLP lp = (PosOnlyDefinitionLP) learningProblem; + } else if(learningProblem instanceof PosOnlyLP) { + PosOnlyLP lp = (PosOnlyLP) learningProblem; this.learner = ComponentFactory.getExampleBasedROLComponent(lp, rs); //this.learner=new ExampleBasedROLComponent(lp, rs); } @@ -100,12 +100,12 @@ return "DBpedia Navigation Suggestor"; } - public DBpediaNavigationSuggestor(PosOnlyDefinitionLP learningProblem, ReasonerComponent rs) { + public DBpediaNavigationSuggestor(PosOnlyLP learningProblem, ReasonerComponent rs) { super(learningProblem, rs); System.out.println("test1"); } - public DBpediaNavigationSuggestor(PosNegDefinitionLP learningProblem, ReasonerComponent rs) { + public DBpediaNavigationSuggestor(PosNegLPStandard learningProblem, ReasonerComponent rs) { super(learningProblem, rs); System.out.println("test2"); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -22,7 +22,7 @@ import org.dllearner.core.owl.Negation; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.Thing; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.learningproblems.ScoreThreeValued; import org.dllearner.reasoning.FastRetrieval; @@ -459,7 +459,7 @@ // learningProblem.getReasoner().getIndividuals(); // neutClassified.retainAll(posClassified); neutClassified.retainAll(negClassified); - PosNegDefinitionLPStrict lp = (PosNegDefinitionLPStrict)learningProblem; + PosNegLPStrict lp = (PosNegLPStrict)learningProblem; return new ScoreThreeValued(conceptLength, lp.getAccuracyPenalty(), lp.getErrorPenalty(), lp.isPenaliseNeutralExamples(), lp.getPercentPerLengthUnit(), posClassified, neutClassified, negClassified, lp.getPositiveExamples(),lp.getNeutralExamples(),lp.getNegativeExamples()); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -49,7 +49,6 @@ import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.reasoning.ReasonerType; @@ -156,7 +155,7 @@ this.configurator = new ExampleBasedROLComponentConfigurator(this); } - public ExampleBasedROLComponent(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { + public ExampleBasedROLComponent(PosOnlyLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.configurator = new ExampleBasedROLComponentConfigurator(this); } @@ -164,7 +163,7 @@ public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); problems.add(PosNegLP.class); - problems.add(PosOnlyDefinitionLP.class); + problems.add(PosOnlyLP.class); return problems; } @@ -324,7 +323,7 @@ if(heuristic == "lexicographic") algHeuristic = new LexicographicHeuristic(); else if(heuristic == "flexible") { - if(learningProblem instanceof PosOnlyDefinitionLP) { + if(learningProblem instanceof PosOnlyLP) { throw new RuntimeException("does not work with positive examples only yet"); } algHeuristic = new FlexibleHeuristic(((PosNegLP)learningProblem).getNegativeExamples().size(), ((PosNegLP)learningProblem).getPercentPerLengthUnit()); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -43,7 +43,7 @@ import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.RefinementOperator; import org.dllearner.refinementoperators.RhoDRDown; @@ -72,7 +72,7 @@ // often the learning problems needn't be accessed directly; instead // use the example sets below and the posonly variable private PosNegLP learningProblem; - private PosOnlyDefinitionLP posOnlyLearningProblem; + private PosOnlyLP posOnlyLearningProblem; private Description startDescription; private boolean posOnly = false; private int nrOfExamples; @@ -254,8 +254,8 @@ // System.out.println(nrOfNegativeExamples); // System.exit(0); - } else if (learningProblem instanceof PosOnlyDefinitionLP) { - PosOnlyDefinitionLP lp = (PosOnlyDefinitionLP) learningProblem; + } else if (learningProblem instanceof PosOnlyLP) { + PosOnlyLP lp = (PosOnlyLP) learningProblem; this.posOnlyLearningProblem = lp; posOnly = true; positiveExamples = lp.getPositiveExamples(); @@ -1305,14 +1305,14 @@ public ScorePosNeg getSolutionScore() { if (posOnly) - return posOnlyLearningProblem.computeScore(getBestSolution()); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(getBestSolution()); else return (ScorePosNeg) learningProblem.computeScore(getBestSolution()); } private ScorePosNeg getScore(Description d) { if (posOnly) - return posOnlyLearningProblem.computeScore(d); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(d); else return (ScorePosNeg) learningProblem.computeScore(d); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -34,7 +34,7 @@ import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.RhoDown; import org.dllearner.utilities.Files; @@ -111,7 +111,7 @@ DecimalFormat df = new DecimalFormat(); private PosNegLP learningProblem; - private PosOnlyDefinitionLP posOnlyLearningProblem; + private PosOnlyLP posOnlyLearningProblem; private boolean posOnly = false; // Menge von Kandidaten für Refinement @@ -203,7 +203,7 @@ } - public ROLearner(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { + public ROLearner(PosOnlyLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.posOnlyLearningProblem = learningProblem; this.configurator = new ROLearnerConfigurator(this); @@ -214,7 +214,7 @@ public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { Collection<Class<? extends LearningProblem>> problems = new LinkedList<Class<? extends LearningProblem>>(); problems.add(PosNegLP.class); - problems.add(PosOnlyDefinitionLP.class); + problems.add(PosOnlyLP.class); return problems; } @@ -1102,7 +1102,7 @@ // @Override public ScorePosNeg getSolutionScore() { if(posOnly) - return posOnlyLearningProblem.computeScore(getCurrentlyBestDescription()); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(getCurrentlyBestDescription()); else return (ScorePosNeg) learningProblem.computeScore(getCurrentlyBestDescription()); } @@ -1110,7 +1110,7 @@ public ScorePosNeg getSolutionScore(Description d) { if(posOnly) - return posOnlyLearningProblem.computeScore(d); + return (ScorePosNeg) posOnlyLearningProblem.computeScore(d); else return (ScorePosNeg) learningProblem.computeScore(d); } Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -41,10 +41,9 @@ import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.learningproblems.ClassLearningProblem; -import org.dllearner.learningproblems.PosNegDefinitionLP; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; @@ -85,10 +84,9 @@ reasonerMapping.put("owlAPIReasoner", OWLAPIReasoner.class); reasonerMapping.put("fastInstanceChecker", FastInstanceChecker.class); reasonerMapping.put("fastRetrievalReasoner", FastRetrievalReasoner.class); - learningProblemMapping.put("posNegDefinitionLP", PosNegDefinitionLP.class); + learningProblemMapping.put("posNegDefinitionLP", PosNegLPStandard.class); learningProblemMapping.put("posNegInclusionLP", PosNegInclusionLP.class); - learningProblemMapping.put("posOnlyDefinitionLP", PosOnlyDefinitionLP.class); - learningProblemMapping.put("posNegDefinitionLPStrict", PosNegDefinitionLPStrict.class); + learningProblemMapping.put("posNegDefinitionLPStrict", PosNegLPStrict.class); learningProblemMapping.put("classLearning", ClassLearningProblem.class); learningAlgorithmMapping.put("random", RandomGuesser.class); learningAlgorithmMapping.put("bruteForce", BruteForceLearner.class); Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -73,9 +73,9 @@ import org.dllearner.kb.KBFile; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosNegInclusionLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.parser.ConfParser; import org.dllearner.parser.KBParser; @@ -291,13 +291,13 @@ handleError("Invalid value \"" + problemOption.getStringValue() + "\" in " + problemOption + ". Valid values are " + confMapper.getLearningProblems() + "."); } } else { - lpClass = PosNegDefinitionLP.class; + lpClass = PosNegLPStandard.class; } lp = cm.learningProblem(lpClass, rc); SortedSet<String> posExamples = parser.getPositiveExamples(); SortedSet<String> negExamples = parser.getNegativeExamples(); cm.applyConfigEntry(lp, "positiveExamples", posExamples); - if (lpClass != PosOnlyDefinitionLP.class) + if (lpClass != PosOnlyLP.class) cm.applyConfigEntry(lp, "negativeExamples", negExamples); configureComponent(cm, lp, parser); initComponent(cm, lp); @@ -365,9 +365,9 @@ componentPrefixMapping.put(FastRetrievalReasoner.class, "fastRetrieval"); // learning problems - configured via + and - flags for examples - componentPrefixMapping.put(PosNegDefinitionLP.class, "posNegDefinitionLP"); + componentPrefixMapping.put(PosNegLPStandard.class, "posNegDefinitionLP"); componentPrefixMapping.put(PosNegInclusionLP.class, "posNegInclusionLP"); - componentPrefixMapping.put(PosOnlyDefinitionLP.class, "posOnlyDefinitionLP"); + componentPrefixMapping.put(PosOnlyLP.class, "posOnlyDefinitionLP"); // learning algorithms componentPrefixMapping.put(ROLearner.class, "refinement"); @@ -943,11 +943,11 @@ ConfFileOption problemOption) { Class<? extends LearningProblem> lpClass = null; if (problemOption == null || problemOption.getStringValue().equals("posNegDefinitionLP")) - lpClass = PosNegDefinitionLP.class; + lpClass = PosNegLPStandard.class; else if (problemOption.getStringValue().equals("posNegInclusionLP")) lpClass = PosNegInclusionLP.class; else if (problemOption.getStringValue().equals("posOnlyDefinitionLP")) - lpClass = PosOnlyDefinitionLP.class; + lpClass = PosOnlyLP.class; else handleError("Unknown value " + problemOption.getValue() + " for option \"problem\"."); Modified: trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -86,8 +86,8 @@ * @see org.dllearner.core.Score#getScoreValue() * @return Value in this score system. */ - public double getScoreValue() { - return score.getScoreValue(); + public double getAccuracy() { + return score.getAccuracy(); } /** @@ -117,7 +117,7 @@ OWLDescription d = OWLAPIDescriptionConvertVisitor.getOWLDescription(description); object.put("descriptionOWLXML", OWLAPIRenderers.toOWLXMLSyntax(d)); object.put("descriptionKBSyntax", description.toKBSyntaxString()); - object.put("scoreValue", score.getScoreValue()); + object.put("scoreValue", score.getAccuracy()); return object.toString(3); } catch (JSONException e) { e.printStackTrace(); Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -239,7 +239,7 @@ // 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.getScoreValue() < accuracyThreshold) { + if(ed.getAccuracy() < accuracyThreshold) { return returnList; } Modified: trunk/src/dl-learner/org/dllearner/core/LearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007-2008, Jens Lehmann + * Copyright (C) 2007-2009, Jens Lehmann * * This file is part of DL-Learner. * @@ -20,7 +20,6 @@ package org.dllearner.core; import org.dllearner.core.owl.Description; -import org.dllearner.learningproblems.ScorePosNeg; /** * Base class for all learning problems. @@ -30,14 +29,6 @@ * of learning class descriptions. However, this may be extended * to other scenarios if desired. * - * TODO: The current learning problem implementations assume that - * we learn a description for a class, which does not exist - * in the knowledge base so far (if it exists, it needs to be ignored - * explicitly). However, often we want to learn a complex definition - * for a concept which is already integrated in a subsumption hierarchy - * or may already have an associated description. It may make sense - * to use this knowledge for (re-)learning descriptions. - * * @author Jens Lehmann * */ @@ -71,15 +62,43 @@ public void changeReasonerComponent(ReasonerComponent reasoner) { this.reasoner = reasoner; } - + /** * Computes the <code>Score</code> of a given class description * with respect to this learning problem. * This can (but does not need to) be used by learning algorithms * to measure how good the description fits the learning problem. + * Score objects are used to store e.g. covered examples, accuracy etc., + * so often it is more efficient to only create score objects for + * promising class descriptions. * @param description A class description (as solution candidate for this learning problem). * @return A <code>Score</code> object. */ public abstract Score computeScore(Description description); + /** + * This method returns a value, which indicates how accurate a + * class description solves a learning problem. There can be different + * ways to compute accuracy depending on the type of learning problem + * and other factors. However, all implementations are required to + * return a value between 0 and 1, where 1 stands for the highest + * possible accuracy and 0 for the lowest possible accuracy. + * + * @return A value between 0 and 1 indicating the quality (of a class description). + */ + public abstract double getAccuracy(Description description); + + /** + * This method computes the accuracy as {@link #getAccuracy(Description)}, + * but returns -1 instead of the accuracy if 1.) the accuracy of the + * description is below the given threshold and 2.) the accuracy of all + * more special w.r.t. subsumption descriptions is below the given threshold. + * This is used for efficiency reasons, i.e. -1 can be returned instantly if + * it is clear that the description and all its refinements are not + * sufficiently accurate. + * + * @return A value between 0 and 1 indicating the quality (of a class description) + * or -1 as described above. + */ + public abstract double getAccuracyOrTooWeak(Description description, double minAccuracy); } Modified: trunk/src/dl-learner/org/dllearner/core/Score.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -31,14 +31,12 @@ public abstract class Score { /** - * This method returns a value, which indicates how well a - * class description solves a learning problem. Different implementations - * of scoring systems can implement this differently. Higher values - * are better and it is recommended to assign a score value in - * the closed interval from 0 to 1 if possible. + * This method returns a value, which indicates how accurate a + * class description solves a learning problem. * - * @return A value indicating the quality (of a class description). - */ - public abstract double getScoreValue(); + * @see LearningProblem#getAccuracy(Description) + * @return A value between 0 and 1 indicating the quality (of a class description). + */ + public abstract double getAccuracy(); } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -40,11 +40,10 @@ import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.learningproblems.ClassLearningProblem; -import org.dllearner.learningproblems.PosNegDefinitionLP; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; -import org.dllearner.learningproblems.PosOnlyInclusionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; @@ -136,7 +135,7 @@ * @param reasoningService see ReasoningService * @return a component ready for initialization PosNegDefinitionLP **/ -public static PosNegDefinitionLP getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +public static PosNegLPStandard getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { return PosNegDefinitionLPConfigurator.getPosNegDefinitionLP(reasoningService, positiveExamples, negativeExamples); } @@ -146,7 +145,7 @@ * @param reasoningService see ReasoningService * @return a component ready for initialization PosNegDefinitionLPStrict **/ -public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +public static PosNegLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { return PosNegDefinitionLPStrictConfigurator.getPosNegDefinitionLPStrict(reasoningService, positiveExamples, negativeExamples); } @@ -163,22 +162,13 @@ /** * @param positiveExamples positive examples * @param reasoningService see ReasoningService -* @return a component ready for initialization PosOnlyDefinitionLP +* @return a component ready for initialization PosOnlyLP **/ -public static PosOnlyDefinitionLP getPosOnlyDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -return PosOnlyDefinitionLPConfigurator.getPosOnlyDefinitionLP(reasoningService, positiveExamples); +public static PosOnlyLP getPosOnlyLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { +return PosOnlyLPConfigurator.getPosOnlyLP(reasoningService, positiveExamples); } /** -* @param positiveExamples positive examples -* @param reasoningService see ReasoningService -* @return a component ready for initialization PosOnlyInclusionLP -**/ -public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -return PosOnlyInclusionLPConfigurator.getPosOnlyInclusionLP(reasoningService, positiveExamples); -} - -/** * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -23,7 +23,7 @@ import java.util.Set; import org.dllearner.core.ComponentManager; import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; /** * automatically generated, do not edit manually. @@ -34,12 +34,12 @@ private boolean reinitNecessary = false; @SuppressWarnings("unused") -private PosNegDefinitionLP posNegDefinitionLP; +private PosNegLPStandard posNegDefinitionLP; /** * @param posNegDefinitionLP see PosNegDefinitionLP **/ -public PosNegDefinitionLPConfigurator(PosNegDefinitionLP posNegDefinitionLP){ +public PosNegDefinitionLPConfigurator(PosNegLPStandard posNegDefinitionLP){ this.posNegDefinitionLP = posNegDefinitionLP; } @@ -49,8 +49,8 @@ * @param negativeExamples negative examples * @return PosNegDefinitionLP **/ -public static PosNegDefinitionLP getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { -PosNegDefinitionLP component = ComponentManager.getInstance().learningProblem(PosNegDefinitionLP.class, reasoningService); +public static PosNegLPStandard getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +PosNegLPStandard component = ComponentManager.getInstance().learningProblem(PosNegLPStandard.class, reasoningService); ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); ComponentManager.getInstance().applyConfigEntry(component, "negativeExamples", negativeExamples); return component; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -23,7 +23,7 @@ import java.util.Set; import org.dllearner.core.ComponentManager; import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.PosNegLPStrict; /** * automatically generated, do not edit manually. @@ -34,12 +34,12 @@ private boolean reinitNecessary = false; @SuppressWarnings("unused") -private PosNegDefinitionLPStrict posNegDefinitionLPStrict; +private PosNegLPStrict posNegDefinitionLPStrict; /** * @param posNegDefinitionLPStrict see PosNegDefinitionLPStrict **/ -public PosNegDefinitionLPStrictConfigurator(PosNegDefinitionLPStrict posNegDefinitionLPStrict){ +public PosNegDefinitionLPStrictConfigurator(PosNegLPStrict posNegDefinitionLPStrict){ this.posNegDefinitionLPStrict = posNegDefinitionLPStrict; } @@ -49,8 +49,8 @@ * @param negativeExamples negative examples * @return PosNegDefinitionLPStrict **/ -public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { -PosNegDefinitionLPStrict component = ComponentManager.getInstance().learningProblem(PosNegDefinitionLPStrict.class, reasoningService); +public static PosNegLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +PosNegLPStrict component = ComponentManager.getInstance().learningProblem(PosNegLPStrict.class, reasoningService); ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); ComponentManager.getInstance().applyConfigEntry(component, "negativeExamples", negativeExamples); return component; Deleted: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,86 +0,0 @@ -/** - * Copyright (C) 2007-2008, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -package org.dllearner.core.configurators; - -import java.util.Set; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; - -/** -* automatically generated, do not edit manually. -* run org.dllearner.scripts.ConfigJavaGenerator to update -**/ -public class PosOnlyDefinitionLPConfigurator implements Configurator { - -private boolean reinitNecessary = false; -@SuppressWarnings("unused") - -private PosOnlyDefinitionLP posOnlyDefinitionLP; - -/** -* @param posOnlyDefinitionLP see PosOnlyDefinitionLP -**/ -public PosOnlyDefinitionLPConfigurator(PosOnlyDefinitionLP posOnlyDefinitionLP){ -this.posOnlyDefinitionLP = posOnlyDefinitionLP; -} - -/** -* @param reasoningService see reasoningService -* @param positiveExamples positive examples -* @return PosOnlyDefinitionLP -**/ -public static PosOnlyDefinitionLP getPosOnlyDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -PosOnlyDefinitionLP component = ComponentManager.getInstance().learningProblem(PosOnlyDefinitionLP.class, reasoningService); -ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); -return component; -} - -/** -* positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getPositiveExamples() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posOnlyDefinitionLP, "positiveExamples") ; -} - -/** -* @param positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -**/ -public void setPositiveExamples(Set<String> positiveExamples) { -ComponentManager.getInstance().applyConfigEntry(posOnlyDefinitionLP, "positiveExamples", positiveExamples); -} - -/** -* true, if this component needs reinitializsation. -* @return boolean -**/ -public boolean isReinitNecessary(){ -return reinitNecessary; -} - - -} Deleted: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,86 +0,0 @@ -/** - * Copyright (C) 2007-2008, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -package org.dllearner.core.configurators; - -import java.util.Set; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosOnlyInclusionLP; - -/** -* automatically generated, do not edit manually. -* run org.dllearner.scripts.ConfigJavaGenerator to update -**/ -public class PosOnlyInclusionLPConfigurator implements Configurator { - -private boolean reinitNecessary = false; -@SuppressWarnings("unused") - -private PosOnlyInclusionLP posOnlyInclusionLP; - -/** -* @param posOnlyInclusionLP see PosOnlyInclusionLP -**/ -public PosOnlyInclusionLPConfigurator(PosOnlyInclusionLP posOnlyInclusionLP){ -this.posOnlyInclusionLP = posOnlyInclusionLP; -} - -/** -* @param reasoningService see reasoningService -* @param positiveExamples positive examples -* @return PosOnlyInclusionLP -**/ -public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { -PosOnlyInclusionLP component = ComponentManager.getInstance().learningProblem(PosOnlyInclusionLP.class, reasoningService); -ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); -return component; -} - -/** -* positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getPositiveExamples() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posOnlyInclusionLP, "positiveExamples") ; -} - -/** -* @param positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -**/ -public void setPositiveExamples(Set<String> positiveExamples) { -ComponentManager.getInstance().applyConfigEntry(posOnlyInclusionLP, "positiveExamples", positiveExamples); -} - -/** -* true, if this component needs reinitializsation. -* @return boolean -**/ -public boolean isReinitNecessary(){ -return reinitNecessary; -} - - -} Added: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -0,0 +1,86 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +package org.dllearner.core.configurators; + +import java.util.Set; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.learningproblems.PosOnlyLP; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class PosOnlyLPConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private PosOnlyLP posOnlyLP; + +/** +* @param posOnlyLP see PosOnlyLP +**/ +public PosOnlyLPConfigurator(PosOnlyLP posOnlyLP){ +this.posOnlyLP = posOnlyLP; +} + +/** +* @param reasoningService see reasoningService +* @param positiveExamples positive examples +* @return PosOnlyLP +**/ +public static PosOnlyLP getPosOnlyLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { +PosOnlyLP component = ComponentManager.getInstance().learningProblem(PosOnlyLP.class, reasoningService); +ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); +return component; +} + +/** +* positiveExamples positive examples. +* mandatory: true| reinit necessary: false +* default value: null +* @return Set(String) +**/ +@SuppressWarnings("unchecked") +public Set<String> getPositiveExamples() { +return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posOnlyLP, "positiveExamples") ; +} + +/** +* @param positiveExamples positive examples. +* mandatory: true| reinit necessary: false +* default value: null +**/ +public void setPositiveExamples(Set<String> positiveExamples) { +ComponentManager.getInstance().applyConfigEntry(posOnlyLP, "positiveExamples", positiveExamples); +} + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/examples/KRKModular.java =================================================================== --- trunk/src/dl-learner/org/dllearner/examples/KRKModular.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/examples/KRKModular.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -31,7 +31,7 @@ import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyAssertion; import org.dllearner.kb.KBFile; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.parser.KBParser; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.OWLAPIReasoner; @@ -258,7 +258,7 @@ // ReasonerComponent rs = new ReasonerComponent(r); //cm.learningProblem(lpClass, reasoner) - LearningProblem lp = new PosNegDefinitionLP(r); + LearningProblem lp = new PosNegLPStandard(r); //cm.getConfigOptionValue(lp, ""); cm.applyConfigEntry(lp, "positiveExamples",pos); cm.applyConfigEntry(lp, "negativeExamples",neg); Modified: trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -49,7 +49,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.kb.OWLFile; -import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.reasoning.DIGReasoner; /** @@ -168,7 +168,7 @@ exampleSet.add(individuals.get(i).toString()); // create a positive only learning problem - LearningProblem lp = cm.learningProblem(PosOnlyDefinitionLP.class, rs); + LearningProblem lp = cm.learningProblem(PosOnlyLP.class, rs); cm.applyConfigEntry(lp, "positiveExamples", exampleSet); try { lp.init(); Modified: trunk/src/dl-learner/org/dllearner/gui/RunPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -51,7 +51,7 @@ import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; /** * @author Tilo Hielscher @@ -417,7 +417,7 @@ // enable tree button if((config.getLearningAlgorithm() instanceof ExampleBasedROLComponent) - && (config.getLearningProblem() instanceof PosNegDefinitionLP)) { + && (config.getLearningProblem() instanceof PosNegLPStandard)) { treeButton.setEnabled(true); } } Modified: trunk/src/dl-learner/org/dllearner/gui/StartGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -54,7 +54,7 @@ import org.dllearner.core.ReasonerComponent; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.reasoning.FastInstanceChecker; /** @@ -128,7 +128,7 @@ ignoredKnowledgeSources.add(OWLAPIOntology.class); panels[0] = new ComponentPanel(config, this, KnowledgeSource.class, OWLFile.class, ignoredKnowledgeSources); panels[1] = new ComponentPanel(config, this, ReasonerComponent.class, FastInstanceChecker.class); - panels[2] = new ComponentPanel(config, this, LearningProblem.class, PosNegDefinitionLP.class); + panels[2] = new ComponentPanel(config, this, LearningProblem.class, PosNegLPStandard.class); panels[3] = new ComponentPanel(config, this, LearningAlgorithm.class, ExampleBasedROLComponent.class); runPanel = new RunPanel(config, this); Modified: trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -30,7 +30,7 @@ import org.dllearner.algorithms.refexamples.ExampleBasedNode; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; -import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegLPStandard; /** * TreeWindow @@ -78,7 +78,7 @@ // ebNodeModel.getChildren((ExampleBasedNode) first)); // collect some helper values for display and accuracy calculations - PosNegDefinitionLP lp = (PosNegDefinitionLP) config.getLearningProblem(); + PosNegLPStandard lp = (PosNegLPStandard) config.getLearningProblem(); Set<String> posExamples = lp.getConfigurator().getPositiveExamples(); Set<String> negExamples = lp.getConfigurator().getNegativeExamples(); String baseURI = config.getReasoner().getBaseURI(); Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -111,4 +111,22 @@ public boolean isEquivalenceProblem() { return equivalence; } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#getAccuracy(org.dllearner.core.owl.Description) + */ + @Override + public double getAccuracy(Description description) { + // TODO Auto-generated method stub + return 0; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningProblem#getAccuracyOrTooWeak(org.dllearner.core.owl.Description, double) + */ + @Override + public double getAccuracyOrTooWeak(Description description, double minAccuracy) { + // TODO Auto-generated method stub + return 0; + } } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -52,17 +52,15 @@ */ public double getProtusion() { return protusion; - } - - /** - * - * @return + } + + /* (non-Javadoc) + * @see org.dllearner.core.Score#getAccuracy() */ @Override - public double getScoreValue() { - - - throw new UnsupportedOperationException(); - } + public double getAccuracy() { + // TODO Auto-generated method stub + return 0; + } } Deleted: trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/DefinitionLP.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,30 +0,0 @@ -/** - * 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.learningproblems; - -/** - * Marker interface for definition learning problems. - * - * @author Jens Lehmann - * - */ -public interface DefinitionLP { - -} Deleted: trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/InclusionLP.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,30 +0,0 @@ -/** - * 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.learningproblems; - -/** - * Marker interface for inclusion learning problems. - * - * @author Jens Lehmann - * - */ -public interface InclusionLP { - -} Deleted: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2009-02-12 18:34:45 UTC (rev 1601) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java 2009-02-13 11:06:53 UTC (rev 1602) @@ -1,232 +0,0 @@ -/** - * 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.learningproblems; - -import java.util.Collection; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.PosNegDefinitionLPConfigurator; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.utilities.Helper; - -/** - * The aim of this learning problem is to learn a concept definition such that - * the positive examples and the negative examples do not follow. It is - * 2-valued, because we only distinguish between covered and non-covered - * examples. (A 3-valued problem distinguishes between covered examples, - * examples covered by the negation of the concept, and all other examples.) The - * 2-valued learning problem is often more useful for Description Logics due to - * (the Open World Assumption and) the fact that negative knowledge, e.g. that a - * person does not have a child, is or cannot be expressed. - * - * @author Jens Lehmann - * - */ -public class PosNegDefinitionLP extends PosNegLP implements DefinitionLP { - - private PosNegDefinitionLPConfigurator configurator; - @Override - public PosNegDefinitionLPConfigurator getConfigurator() { - return configurator; - } - - public PosNegDefinitionLP(ReasonerComponent reasoningService) { - super(reasoningService); - this.configurator = new PosNegDefinitionLPConfigurator(this); - } - - public PosNegDefinitionLP(ReasonerComponent reasoningService, SortedSet<Individual> positiveExamples, SortedSet<Individual> negativeExamples) { - super(reasoningService); - this.positiveExamples = positiveExamples; - this.negativeExamples = negativeExamples; - this.configurator = new PosNegDefinitionLPConfigurator(this); - } - - /* - * (non-Javadoc) - * - * @see org.dllearner.core.Component#getName() - */ - public static String getName() { - return "two valued definition learning problem"; - } - - - public static Collection<ConfigOption<?>> createConfigOptions() { - return PosNegLP.createConfigOptions(); - } - - /** - * This method computes (using the reasoner) whether a concept is too weak. - * If it is not weak, it returns the number of covered negative examples. It - * can use retrieval or instance checks for classification. - * - * @see org.dllearner.learningproblems.PosNegLP.UseMultiInstanceChecks - * TODO: Performance could be slightly improved by counting the number of - * covers instead of using sets and counting their size. - * @param concept - * The concept to test. - * @return -1 if concept is too weak and the number of covered negative - * examples otherwise. - */ - @Override - public int coveredNegativeExamplesOrTooWeak(Description concept) { - - if (useRetrievalForClassification) { - SortedSet<Individual> posClassified = reasoner.getIndividuals(concept); - SortedSet<Individual> negAsPos = Helper.intersection(negativeExamples, posClassified); - SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - - // the set is constructed piecewise to avoid expensive set - // operations - // on a large number of individuals - for (Individual posExample : positiveExamples) { - if (!posClassified.contains(posExample)) - posAsNeg.add(posExample); - } - - // too weak - if (posAsNeg.size() > 0) - return -1; - // number of covered negatives - else - return negAsPos.size(); - } else { - if (useMultiInstanceChecks != UseMultiInstanceChecks.NEVER) { - // two checks - if (useMultiInstanceChecks == UseMultiInstanceChecks.TWOCHECKS) { - Set<Individual> s = reasoner.hasType(concept, positiveExamples); - // if the concept is too weak, then do not query negative - // examples - if (s.size() != positiveExamples.size()) - return -1; - else { - s = reasoner.hasType(concept, negativeExamples); - return s.size(); - } - // one check - } else { - Set<Individual> s = reasoner.hasType(concept, allExamples); - // test whether all positive examples are covered - if (s.containsAll(positiveExamples)) - return s.size() - positiveExamples.size(); - else - return -1; - } - } else { - // SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - SortedSet<Individual> negAsPos = new TreeSet<Individual>(); - - for (Individual example : positiveExamples) { - if (!reasoner.hasType(concept, example)) - return -1; - // posAsNeg.add(example); - } - for (Individual example : negativeExamples) { - if (reasoner.hasType(concept, example)) - negAsPos.add(example); - } - - return negAsPos.size(); - } - } - } - - /** - * Computes score of a given concept using the reasoner. Either retrieval or - * instance check are used. For the latter, this method treats - * <code>UseMultiInstanceChecks.TWO_CHECKS</code> as if it were - * <code>UseMultiInstanceChecks.ONE_CHECKS</code> (it does not make much sense - * to implement TWO_CHECKS in this function, because we have to test all - * examples to create a score object anyway). - * - * @see org.dllearner.learningproblems.PosNegLP.UseMultiInstanceChecks - * @param concept - * The concept to test. - * @return Corresponding Score object. - */ - @Override - public ScorePosNeg computeScore(Description concept) { - if (useRetrievalForClassification) { - SortedSet<Individual> posClassified = reasoner.getIndividuals(concept); - SortedSet<Individual> posAsPos = Helper.intersection(positiveExamples, posClassified); - SortedSet<Individual> negAsPos = Helper.intersection(negativeExamples, posClassified); - SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - - // piecewise set construction - for (Individual posExample : positiveExamples) { - if (!posClassified.contains(posExample)) - posAsNeg.add(posExample); - } - SortedSet<Individual> negAsNeg = new TreeSet<Individual>(); - for (Individual negExample : negativeExamples) { - if (!posClassified.contains(negExample)) - negAsNeg.add(negExample); - } - return new ScoreTwoValued(concept.getLength(), percentPerLengthUnit, posAsPos, posAsNeg, negAsPos, negAsNeg); - // instance checks for classification - } else { - SortedSet<Individual> posAsPos = new TreeSet<Individual>(); - SortedSet<Individual> posAsNeg = new TreeSet<Individual>(); - Sorte... [truncated message content] |
From: <jen...@us...> - 2009-02-12 18:34:49
|
Revision: 1601 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1601&view=rev Author: jenslehmann Date: 2009-02-12 18:34:45 +0000 (Thu, 12 Feb 2009) Log Message: ----------- fixes in manual Modified Paths: -------------- trunk/doc/manual/manual.tex Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 18:28:45 UTC (rev 1600) +++ trunk/doc/manual/manual.tex 2009-02-12 18:34:45 UTC (rev 1601) @@ -70,39 +70,31 @@ \begin{verbatim} DL-Learner 2008-10-13 command line interface -starting component manager ... OK (201ms) +starting component manager ... OK (81ms) initialising component "OWL file" ... OK (0ms) -initialising component "fast instance checker" ... OK (839ms) -initialising component "two valued definition learning problem" -... OK (0ms) -initialising component "example driven refinement operator based -learning algorithm" ... OK (14ms) +initialising component "fast instance checker" ... OK (861ms) +initialising component "two valued definition learning + problem" ... OK (0ms) +initialising component "refinement operator based learning + algorithm II" ... OK (14ms) -more accurate (83,33%) node found: http://example.com/father#male -[q:1, he:0, children:0] -more accurate (100,00%) node found: (http://example.com/father#male -AND EXISTS http://example.com/father#hasChild.TOP) -[q:0, he:4, children:0] -best node (male AND EXISTS hasChild.TOP) [acc:100% h:0,962 q:0p-0n -(REASONER), he:7 c:12] +starting top down refinement with: Thing (50% accuracy) +more accurate (83,33%) class expression found: male solutions (at most 20 are shown): -1: (male AND EXISTS hasChild.TOP) (length 5, depth 3) -2: (male AND EXISTS hasChild.ALL hasChild.TOP) (length 7, depth 4) -3: (male AND EXISTS hasChild.(female OR male)) (length 7, depth 4) +1: (male and hasChild some Thing) (length 5, depth 3) Algorithm terminated succesfully. number of retrievals: 4 retrieval reasoning time: 0ms ( 0ms per retrieval) -number of instance checks: 194 (0 multiple) -instance check reasoning time: 3ms ( 0ms per instance check) -overall reasoning time: 3ms (13,901% of overall runtime) -overall algorithm runtime: 26ms +number of instance checks: 93 (0 multiple) +instance check reasoning time: 0ms ( 0ms per instance check) +overall reasoning time: 0ms (1,931% of overall runtime) +overall algorithm runtime: 28ms \end{verbatim} \todo{display accuracy of solutions} -\todo{find out why algorithm continues after finding EXISTS hasChild.TOP} -The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. The last part of the output contains some runtime statistics. +The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. In this case the only solution is \verb|male and hasChild some Thing| defining the class father. The last part of the output contains some runtime statistics. \section{DL-Learner Architecture} @@ -183,7 +175,7 @@ The GP algorithm has 15 more options documented in \verb|doc/configOptions.txt|. \item[Refinement] This is a top down refinement operator approach, which is described in \cite{alc_learning_algorithm}. Some options include: \begin{itemize} - \item target language: The standard target language of this algorithm is $\mathcal{ALCN(D)}$. However, you can specify the target language in more detail, i.e.~you can exclude the $\forall$ constructor by using \verb|refinement.useAllConstructor = true;|. Similar options exist for $\exists$, $\not$, cardinality restrictions, and boolean datatypes. + \item target language: The standard target language of this algorithm is $\mathcal{ALCN(D)}$. However, you can specify the target language in more detail, i.e.~you can exclude the $\forall$ constructor by using \verb|refinement.useAllConstructor = true;|. Similar options exist for $\exists$, $\neg$, cardinality restrictions, and boolean datatypes. \item maximum execution time: If there is no perfect solution of a given problem, the algorithm can potentially run forever (in practice it will run out of memory). It is therefore often interesting to limit the execution time. You can use e.g.~\verb|refinement.maxExecutionTimeInSeconds = 100| to say that the algorithm should run for at most 100 seconds. Often, it will run slightly longer than the maximum executiontime since it waits until the next internal loop of the algorithm to stop gracefully. \end{itemize} The algorithm supports a range of further options. For instance, one can specify which classes and properties must not occur in resulting class expressions. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 18:28:50
|
Revision: 1600 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1600&view=rev Author: jenslehmann Date: 2009-02-12 18:28:45 +0000 (Thu, 12 Feb 2009) Log Message: ----------- small changes Modified Paths: -------------- trunk/examples/father.conf trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2009-02-12 18:23:56 UTC (rev 1599) +++ trunk/examples/father.conf 2009-02-12 18:28:45 UTC (rev 1600) @@ -7,8 +7,6 @@ * Copyright (C) 2007, Jens Lehmann */ -algorithm = jjj; - // background knowledge import("father.owl"); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:23:56 UTC (rev 1599) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 18:28:45 UTC (rev 1600) @@ -1412,8 +1412,10 @@ if (guaranteeXgoodAlreadyReached){ result = true; } else if(solutions.size() >= guaranteeXgoodDescriptions) { + if(guaranteeXgoodDescriptions != 1) { logger.info("Minimum number (" + guaranteeXgoodDescriptions + ") of good descriptions reached."); + } guaranteeXgoodAlreadyReached = true; result = true; } @@ -1422,8 +1424,10 @@ if (minExecutionTimeAlreadyReached){ result = result && true; }else if(minMilliSeconds < totalTimeNeeded) { + if(minExecutionTimeInSeconds != 0) { logger.info("Minimum time (" + minExecutionTimeInSeconds + " seconds) reached."); + } minExecutionTimeAlreadyReached = true; result = result && true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 18:24:00
|
Revision: 1599 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1599&view=rev Author: jenslehmann Date: 2009-02-12 18:23:56 +0000 (Thu, 12 Feb 2009) Log Message: ----------- first manual draft Modified Paths: -------------- trunk/doc/manual/bibliography.bib trunk/doc/manual/manual.tex trunk/examples/father.conf trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java Modified: trunk/doc/manual/bibliography.bib =================================================================== --- trunk/doc/manual/bibliography.bib 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/doc/manual/bibliography.bib 2009-02-12 18:23:56 UTC (rev 1599) @@ -36,4 +36,38 @@ year = "2000", ISBN = "3-540-67795-X", pages = "40--59", -} \ No newline at end of file +} + +@InProceedings{hybrid_gp, + title = "Hybrid Learning of Ontology Classes", + author = "Jens Lehmann", + bibdate = "2007-08-29", + bibsource = "DBLP, + http://dblp.uni-trier.de/db/conf/mldm/mldm2007.html#Lehmann07", + booktitle = "Machine Learning and Data Mining in Pattern + Recognition, 5th International Conference", + publisher = "Springer", + year = "2007", + volume = "4571", + editor = "Petra Perner", + ISBN = "978-3-540-73498-7", + pages = "883--898", + series = "Lecture Notes in Computer Science", + URL = "http://dx.doi.org/10.1007/978-3-540-73499-4_66", +} + +@inproceedings{alc_learning_algorithm, + author = {Jens Lehmann and Pascal Hitzler}, + title = { A Refinement Operator Based Learning Algorithm for the {ALC} Description Logic}, + booktitle = {Proc. of 17th Int. Conf. on Inductive Logic Programming (ILP 2007)}, + year = {2008}, + editor = {Hendrik Blockeel and + Jan Ramon and + Jude W. Shavlik and + Prasad Tadepalli}, + publisher = {Springer}, + series = {Lecture Notes in Computer Science}, + volume = {4894}, + pages = {147--160}, + note = {Best Student Paper} +} Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/doc/manual/manual.tex 2009-02-12 18:23:56 UTC (rev 1599) @@ -160,7 +160,7 @@ \subsection{Learning Problems} -In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|problem| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. +In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|$value| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. \begin{description} \item[Positive and Negative Examples] Let the name of the background ontology be $\mathcal{O}$. The goal in this learning problem is to find an OWL class expression $C$ such that all/many positive examples are instances of $C$ w.r.t.~$\mathcal{O}$ and none/few negative examples are instances of $C$ w.r.t.~$\mathcal{O}$. As explained previously, $C$ should be learned such that it generalises to unseen individuals and is readable. The important configuration options of this component are obviously the positive and negative examples, which are often indicated with \verb|+| and \verb|-| signs in conf files as an optional shortcut to using e.g.~\verb|posNegDefinitionLP.positiveExamples = {...}|. @@ -168,11 +168,27 @@ \item[Class Learning] In class learning, you are given an existing class $A$ within your ontology $\mathcal{O}$ and want to describe it. It is similar to the previous problem in that you can use the instances of the class as positive examples. However, there are some differences, e.g.~you do not want to have $A$ itself as a solution of the problem, and since this is an ontology engineering task, the focus on short and readable class expressions is stronger than for the two problems mentioned before. \todo{This is under construction, but will be implemented soon.} \end{description} - \subsection{Learning Algorithms} +The implemented algorithms vary from very simple (and usually inappropriate) algorithms to sophisticated ones. You can switch between the different algorithms using \verb|algorithm=$value;|, where \verb|$value| is one of \verb|bruteForce|, \verb|random|, \verb|gp|, \verb|refinement|, \verb|refexamples|, and \verb|celoe|. \todo{Rename refexamples to refinement2.} + \begin{description} - \item + \item[Brute Force]: This algorithm tests all class expressions up to a specified length, which you can set using e.g.~\verb|bruteForce.maxlength = 7|. + \item[Random Guesser]: This algorithm randomly generates class expressions. To do this it creates trees, which can be mapped to class expressions. Its main parameter is the number of created trees, which you can set using e.g.~\verb|random.numberOfTrees = 5|. + \item[Genetic Programming (GP)]: GP is a well-known general problem solution method, which can be adapted to class expression learning. The adaption is straightforward. In DL-Learner, however, an additional genetic refinement operator was implemented, which has shown to improve GP performance\cite{hybrid_gp}. Some options are: + \begin{itemize} + \item number of individuals: The individual count is the size of each generation in a GP algorithm. It is one of the most crucial parameters. Setting it to a higher value usually means investing more computational resource for increasing the likelihood that a solution will be found. Usage: \verb|gp.numberOfIndividuals = 100| + \item refinement probability: This is used to specify how likely the usage of the genetic refinement operator should be, e.g.~\verb|gp.refinementProbability = 0.6| means that it will be selected 60\% of the time. + \end{itemize} + The GP algorithm has 15 more options documented in \verb|doc/configOptions.txt|. + \item[Refinement] This is a top down refinement operator approach, which is described in \cite{alc_learning_algorithm}. Some options include: + \begin{itemize} + \item target language: The standard target language of this algorithm is $\mathcal{ALCN(D)}$. However, you can specify the target language in more detail, i.e.~you can exclude the $\forall$ constructor by using \verb|refinement.useAllConstructor = true;|. Similar options exist for $\exists$, $\not$, cardinality restrictions, and boolean datatypes. + \item maximum execution time: If there is no perfect solution of a given problem, the algorithm can potentially run forever (in practice it will run out of memory). It is therefore often interesting to limit the execution time. You can use e.g.~\verb|refinement.maxExecutionTimeInSeconds = 100| to say that the algorithm should run for at most 100 seconds. Often, it will run slightly longer than the maximum executiontime since it waits until the next internal loop of the algorithm to stop gracefully. + \end{itemize} + The algorithm supports a range of further options. For instance, one can specify which classes and properties must not occur in resulting class expressions. + \item[Refinement II] The previous algorithm has been extended to make more sophisticated use of background knowledge and therefore run more efficiently on many problems. It also supports double datatypes and hasValue restrictions (which again can be turned on or off as desired). It also includes explicit noise handling through the \verb|noisePercentage| option. This is currently the default and recommend algorithm for learning from positive and negative examples. More than 30 options can be set to control its behaviour. However, apart from the target language the most important setting is noise, which should be optimised for the given problem. \todo{say more about it?, include option descriptions?, rename noise to minAccuracy which describes it better} + \item[Class Expression Learning for Ontology Engineering (CELOE)] \todo{This algorithm is under construction.} \end{description} Please note that while components are interchangeable, it is not possibly to arbitrarily combine them. For instance, the newer learning algorithms do not work with the DIG interface, since it does not provide the necessary inference tasks. Furthermore, a learning algorithm can specify which learning problems it can solve, i.e.~we do not require a learning algorithm to be able to solve each learning problem. In later versions of this manual, we may include a compatibility matrix. In the meantime, you can easily verify whether a combination works by testing it in a conf file. @@ -183,7 +199,7 @@ \begin{figure} \centering - \includegraphics[width=.85\textwidth]{../../resources/screenshots/gui_algorithm} + \includegraphics[width=.8\textwidth]{../../resources/screenshots/gui_algorithm} \caption{GUI screenshot showing the learning algorithm tab. The UI allows you to set different options and then proceed to the next tab and execute the algorithm.} \label{fig:gui} \end{figure} Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/examples/father.conf 2009-02-12 18:23:56 UTC (rev 1599) @@ -7,6 +7,8 @@ * Copyright (C) 2007, Jens Lehmann */ +algorithm = jjj; + // background knowledge import("father.owl"); Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 17:34:55 UTC (rev 1598) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 18:23:56 UTC (rev 1599) @@ -28,6 +28,7 @@ import org.dllearner.algorithms.BruteForceLearner; import org.dllearner.algorithms.DBpediaNavigationSuggestor; import org.dllearner.algorithms.RandomGuesser; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; @@ -96,6 +97,7 @@ learningAlgorithmMapping.put("refexamples", ExampleBasedROLComponent.class); learningAlgorithmMapping.put("dbpediaNavigationSuggestor", DBpediaNavigationSuggestor.class); learningAlgorithmMapping.put("el", ELLearningAlgorithm.class); + learningAlgorithmMapping.put("celoe", CELOE.class); // you do not need to edit anything below This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-02-12 17:34:58
|
Revision: 1598 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1598&view=rev Author: kurzum Date: 2009-02-12 17:34:55 +0000 (Thu, 12 Feb 2009) Log Message: ----------- flagged functions as deprecated, which should be removed. new function isTerminationCriteriaReached introduced. which should be the only function that cares for stopping solutionFound: see comment where I marked deprecated it Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 16:50:12 UTC (rev 1597) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 17:34:55 UTC (rev 1598) @@ -107,11 +107,11 @@ // extended Options private long maxExecutionTimeInSeconds; - private boolean maxExecutionTimeShown = false; + private boolean maxExecutionTimeAlreadyReached = false; private long minExecutionTimeInSeconds = 0; - private boolean minExecutionTimeShown = false; + private boolean minExecutionTimeAlreadyReached = false; private int guaranteeXgoodDescriptions = 1; - private boolean guaranteeXgoodShown = false; + private boolean guaranteeXgoodAlreadyReached = false; private int maxClassDescriptionTests; // if set to false we do not test properness; this may seem wrong @@ -149,6 +149,8 @@ private ExampleBasedNode startNode; // solution protocol + // TODO isn't solution found already true if solutions.size()>=0 ??? + @Deprecated private boolean solutionFound = false; private List<Description> solutions = new LinkedList<Description>(); @@ -300,9 +302,9 @@ newCandidates.clear(); solutionFound = false; solutions.clear(); - maxExecutionTimeShown = false; - minExecutionTimeShown = false; - guaranteeXgoodShown = false; + maxExecutionTimeAlreadyReached = false; + minExecutionTimeAlreadyReached = false; + guaranteeXgoodAlreadyReached = false; propernessTestsReasoner = 0; propernessTestsAvoidedByShortConceptConstruction = 0; propernessTestsAvoidedByTooWeakList = 0; @@ -407,7 +409,8 @@ long reductionInterval = 300l * 1000000000l; long currentTime; - while ((!solutionFound || !configurator.getTerminateOnNoiseReached() ) && !stop) { + while (!isTerminationCriteriaReached()) { + //while ((!solutionFound || !configurator.getTerminateOnNoiseReached() ) && !stop) { // print statistics at most once a second currentTime = System.nanoTime(); @@ -515,7 +518,8 @@ loop++; }// end while - if (solutionFound) { + if (isSolutionFound()) { + //if (solutionFound) { int solutionLimit = 20; // we do not need to print the best node if we display the top 20 solutions below anyway // logger.info("best node " @@ -1351,6 +1355,100 @@ return true; } + + + /** + * In this function it is calculated if the algorithm should stop. + * This is not always depends whether an actual solution was found + * The algorithm stops if: + * 1. the object attribute stop is set to true (possibly by an outside source) + * 2. the maximimum execution time is reached + * 3. the maximum number of class description tests is reached + * + * Continuation criteria and result improvement + * The algorithm continues (although it would normally stop) if + * 1. Minimum execution time is not reached (default 0) + * 2. not enough good solutions are found (default 1) + * otherwise it stops + * + * @return true if the algorithm should stop, this is mostly indepent of the question if a solution was found + */ + private boolean isTerminationCriteriaReached(){ + if(this.stop){ + return true; + } + long totalTimeNeeded = System.currentTimeMillis() - this.runtime; + long maxMilliSeconds = maxExecutionTimeInSeconds * 1000; + long minMilliSeconds = minExecutionTimeInSeconds * 1000; + int conceptTests = conceptTestsReasoner + conceptTestsTooWeakList + conceptTestsOverlyGeneralList; + boolean result = false; + + //ignore default + if (maxExecutionTimeInSeconds == 0) + result = false; + //alreadyReached + else if (maxExecutionTimeAlreadyReached) + return true; + //test + else if (maxMilliSeconds < totalTimeNeeded) { + this.stop(); + logger.info("Maximum time (" + maxExecutionTimeInSeconds + + " seconds) reached, stopping now..."); + maxExecutionTimeAlreadyReached = true; + return true; + } + + //ignore default + if(maxClassDescriptionTests == 0) + result = false; + //test + else if(conceptTests >= maxClassDescriptionTests){ + logger.info("Maximum Class Description tests (" + maxClassDescriptionTests + + " tests [actual: "+conceptTests+"]) reached, stopping now..."); + return true; + } + + + if (guaranteeXgoodAlreadyReached){ + result = true; + } else if(solutions.size() >= guaranteeXgoodDescriptions) { + logger.info("Minimum number (" + guaranteeXgoodDescriptions + + ") of good descriptions reached."); + guaranteeXgoodAlreadyReached = true; + result = true; + } + + + if (minExecutionTimeAlreadyReached){ + result = result && true; + }else if(minMilliSeconds < totalTimeNeeded) { + logger.info("Minimum time (" + minExecutionTimeInSeconds + + " seconds) reached."); + minExecutionTimeAlreadyReached = true; + result = result && true; + } + + return result; + + } + + /** + * shows if a solution is found + * @return + */ + private boolean isSolutionFound(){ + if(this.solutionFound){ + return true; + }else if(solutions.size()>0){ + return true; + } + + return false; + + + } + + @Deprecated private void handleStoppingConditions() { solutionFound = (guaranteeXgoodDescriptions()); solutionFound = (minExecutionTimeReached() && solutionFound); @@ -1365,32 +1463,34 @@ } } + @Deprecated private boolean guaranteeXgoodDescriptions() { - if (guaranteeXgoodShown) + if (guaranteeXgoodAlreadyReached) return true; if (solutions.size() > guaranteeXgoodDescriptions) { if (guaranteeXgoodDescriptions != 1) { logger.info("Minimum number (" + guaranteeXgoodDescriptions + ") of good descriptions reached, stopping now."); } - guaranteeXgoodShown = true; + guaranteeXgoodAlreadyReached = true; return true; } else return false; } + @Deprecated private boolean maxExecutionTimeReached() { if (maxExecutionTimeInSeconds == 0) return false; - if (maxExecutionTimeShown) + if (maxExecutionTimeAlreadyReached) return true; long needed = System.currentTimeMillis() - this.runtime; long maxMilliSeconds = maxExecutionTimeInSeconds * 1000; if (maxMilliSeconds < needed) { logger.info("Maximum time (" + maxExecutionTimeInSeconds + " seconds) reached, stopping now..."); - maxExecutionTimeShown = true; + maxExecutionTimeAlreadyReached = true; return true; } else return false; @@ -1402,8 +1502,9 @@ * * @return true */ + @Deprecated private boolean minExecutionTimeReached() { - if (minExecutionTimeShown) + if (minExecutionTimeAlreadyReached) return true; long needed = System.currentTimeMillis() - this.runtime; long minMilliSeconds = minExecutionTimeInSeconds * 1000; @@ -1412,7 +1513,7 @@ logger.info("Minimum time (" + minExecutionTimeInSeconds + " seconds) reached, stopping when next solution is found"); } - minExecutionTimeShown = true; + minExecutionTimeAlreadyReached = true; return true; } else return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 16:50:17
|
Revision: 1597 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1597&view=rev Author: jenslehmann Date: 2009-02-12 16:50:12 +0000 (Thu, 12 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 16:17:41 UTC (rev 1596) +++ trunk/doc/manual/manual.tex 2009-02-12 16:50:12 UTC (rev 1597) @@ -44,6 +44,7 @@ \clearpage \section{What is DL-Learner?} +\label{sec:whatis} DL-Learner is an open source framework for (supervised) machine learning in OWL and Description Logics (from instance data). We further detail what this means: @@ -159,8 +160,12 @@ \subsection{Learning Problems} +In the introduction Sections \ref{sec:whatis} and \ref{sec:start}, we described a specific learning problem where positive and negative examples are given. In practice different variations of similar problems occur. You can switch between the different problems using \verb|problem=$value;|, where \verb|problem| is one of \verb|posNegDefinitionLP|, \verb|posOnlyDefinitionLP|, \verb|classLearning|. + \begin{description} - \item + \item[Positive and Negative Examples] Let the name of the background ontology be $\mathcal{O}$. The goal in this learning problem is to find an OWL class expression $C$ such that all/many positive examples are instances of $C$ w.r.t.~$\mathcal{O}$ and none/few negative examples are instances of $C$ w.r.t.~$\mathcal{O}$. As explained previously, $C$ should be learned such that it generalises to unseen individuals and is readable. The important configuration options of this component are obviously the positive and negative examples, which are often indicated with \verb|+| and \verb|-| signs in conf files as an optional shortcut to using e.g.~\verb|posNegDefinitionLP.positiveExamples = {...}|. + \item[Positive Examples] This learning problem is similar to the one before, but without negative examples. In this case, it is desirable to find a class expression which closely fits the positive examples while still generalising sufficiently well. For instance, you usually do not want to have \verb|owl:Thing| as a solution for this problem, but neither do you want to have an enumeration of individuals. + \item[Class Learning] In class learning, you are given an existing class $A$ within your ontology $\mathcal{O}$ and want to describe it. It is similar to the previous problem in that you can use the instances of the class as positive examples. However, there are some differences, e.g.~you do not want to have $A$ itself as a solution of the problem, and since this is an ontology engineering task, the focus on short and readable class expressions is stronger than for the two problems mentioned before. \todo{This is under construction, but will be implemented soon.} \end{description} @@ -170,6 +175,7 @@ \item \end{description} +Please note that while components are interchangeable, it is not possibly to arbitrarily combine them. For instance, the newer learning algorithms do not work with the DIG interface, since it does not provide the necessary inference tasks. Furthermore, a learning algorithm can specify which learning problems it can solve, i.e.~we do not require a learning algorithm to be able to solve each learning problem. In later versions of this manual, we may include a compatibility matrix. In the meantime, you can easily verify whether a combination works by testing it in a conf file. \section{DL-Learner Interfaces} Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 16:17:41 UTC (rev 1596) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-12 16:50:12 UTC (rev 1597) @@ -39,7 +39,9 @@ import org.dllearner.core.ReasonerComponent; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegDefinitionLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.reasoning.DIGReasoner; @@ -85,6 +87,8 @@ learningProblemMapping.put("posNegDefinitionLP", PosNegDefinitionLP.class); learningProblemMapping.put("posNegInclusionLP", PosNegInclusionLP.class); learningProblemMapping.put("posOnlyDefinitionLP", PosOnlyDefinitionLP.class); + learningProblemMapping.put("posNegDefinitionLPStrict", PosNegDefinitionLPStrict.class); + learningProblemMapping.put("classLearning", ClassLearningProblem.class); learningAlgorithmMapping.put("random", RandomGuesser.class); learningAlgorithmMapping.put("bruteForce", BruteForceLearner.class); learningAlgorithmMapping.put("gp", GP.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 16:17:47
|
Revision: 1596 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1596&view=rev Author: jenslehmann Date: 2009-02-12 16:17:41 +0000 (Thu, 12 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/doc/configOptions.txt trunk/doc/manual/bibliography.bib trunk/doc/manual/manual.tex trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/doc/configOptions.txt =================================================================== --- trunk/doc/configOptions.txt 2009-02-12 13:04:36 UTC (rev 1595) +++ trunk/doc/configOptions.txt 2009-02-12 16:17:41 UTC (rev 1596) @@ -11,7 +11,7 @@ option name: url description: URL pointer to the KB file -values: class org.dllearner.core.config.URLConfigOption +values: class org.dllearner.core.options.URLConfigOption default value: null CLI usage: null.url = null; @@ -29,7 +29,7 @@ option name: url description: URL pointing to the OWL file -values: class org.dllearner.core.config.URLConfigOption +values: class org.dllearner.core.options.URLConfigOption default value: null CLI usage: owlfile.url = null; @@ -41,139 +41,139 @@ option name: url description: URL of SPARQL Endpoint -values: class org.dllearner.core.config.URLConfigOption +values: class org.dllearner.core.options.URLConfigOption default value: null CLI usage: sparql.url = null; option name: cacheDir description: dir of cache -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: cache CLI usage: sparql.cacheDir = cache; option name: useCache description: If true a Cache is used -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.useCache = true; option name: instances description: relevant instances e.g. positive and negative examples in a learning problem -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: sparql.instances = null; option name: recursionDepth description: recursion depth of KB fragment selection -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: sparql.recursionDepth = 1; option name: predefinedFilter description: the mode of the SPARQL Filter, use one of YAGO,SKOS,YAGOSKOS , YAGOSPECIALHIERARCHY, TEST -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: sparql.predefinedFilter = null; option name: predefinedEndpoint description: the mode of the SPARQL Filter, use one of DBPEDIA, LOCAL, GOVTRACK, REVYU, MYOPENLINK, FACTBOOK -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: sparql.predefinedEndpoint = null; option name: predefinedManipulator description: the mode of the Manipulator, use one of STANDARD, DBPEDIA-NAVIGATOR -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: sparql.predefinedManipulator = null; option name: predList description: list of all ignored roles -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.predList = []; option name: objList description: list of all ignored objects -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.objList = []; option name: saveExtractedFragment description: Specifies whether the extracted ontology is written to a file or not. The OWL file is written to the cache dir.Some DBpedia URI will make the XML invalid -values: class org.dllearner.core.config.BooleanConfigOption -default value: true -CLI usage: sparql.saveExtractedFragment = true; +values: class org.dllearner.core.options.BooleanConfigOption +default value: false +CLI usage: sparql.saveExtractedFragment = false; option name: replacePredicate description: rule for replacing predicates -values: class org.dllearner.core.config.StringTupleListConfigOption +values: class org.dllearner.core.options.StringTupleListConfigOption default value: [] CLI usage: sparql.replacePredicate = []; option name: replaceObject description: rule for replacing predicates -values: class org.dllearner.core.config.StringTupleListConfigOption +values: class org.dllearner.core.options.StringTupleListConfigOption default value: [] CLI usage: sparql.replaceObject = []; option name: breakSuperClassRetrievalAfter description: stops a cyclic hierarchy after specified number of classes -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1000 CLI usage: sparql.breakSuperClassRetrievalAfter = 1000; option name: useLits description: use Literals in SPARQL query -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.useLits = true; option name: getAllSuperClasses description: If true then all superclasses are retrieved until the most general class (owl:Thing) is reached. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.getAllSuperClasses = true; option name: closeAfterRecursion description: gets all classes for all instances -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.closeAfterRecursion = true; option name: getPropertyInformation description: gets all types for extracted ObjectProperties -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: sparql.getPropertyInformation = false; option name: dissolveBlankNodes description: determines whether Blanknodes are dissolved. This is a costly function. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: sparql.dissolveBlankNodes = true; option name: useImprovedSparqlTupelAquisitor description: uses deeply nested SparqlQueries, according to recursion depth, still EXPERIMENTAL -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: sparql.useImprovedSparqlTupelAquisitor = false; option name: verbosity description: control verbosity of output for this component -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: warning CLI usage: sparql.verbosity = warning; option name: defaultGraphURIs description: a list of all default Graph URIs -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.defaultGraphURIs = []; option name: namedGraphURIs description: a list of all named Graph URIs -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: [] CLI usage: sparql.namedGraphURIs = []; @@ -189,19 +189,19 @@ option name: reasonerUrl description: URL of the DIG reasoner -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: digReasoner.reasonerUrl = null; option name: writeDIGProtocol description: specifies whether or not to write a protocoll of send and received DIG requests -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: digReasoner.writeDIGProtocol = false; option name: digProtocolFile description: the file to store the DIG protocol -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/digProtocol.txt CLI usage: digReasoner.digProtocolFile = log/digProtocol.txt; @@ -213,13 +213,13 @@ option name: reasonerType description: FaCT++ or Pellet to dematerialize -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: pellet CLI usage: fastInstanceChecker.reasonerType = pellet; option name: defaultNegation description: Whether to use default negation, i.e. an instance not being in a class means that it is in the negation of the class. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: fastInstanceChecker.defaultNegation = true; @@ -237,7 +237,7 @@ option name: reasonerType description: FaCT++ or Pellet, which means "pellet" or "fact" -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: pellet CLI usage: owlAPIReasoner.reasonerType = pellet; @@ -246,6 +246,24 @@ * Learning Problems * ********************* +component: unnamed component (org.dllearner.learningproblems.ClassLearningProblem) +================================================================================== + +CLI usage: null = null; + +option name: classToDescribe +description: class of which a description should be learned +values: class org.dllearner.core.options.StringConfigOption +default value: null +CLI usage: null.classToDescribe = null; + +option name: type +description: Whether to learn an equivalence class or super class axiom. +values: class org.dllearner.core.options.StringConfigOption +default value: equivalence +CLI usage: null.type = equivalence; + + component: two valued definition learning problem (org.dllearner.learningproblems.PosNegDefinitionLP) ===================================================================================================== @@ -253,31 +271,31 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegDefinitionLP.positiveExamples = null; option name: negativeExamples description: negative examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegDefinitionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: posNegDefinitionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 CLI usage: posNegDefinitionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: twoChecks CLI usage: posNegDefinitionLP.useMultiInstanceChecks = twoChecks; @@ -289,49 +307,49 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: null.positiveExamples = null; option name: negativeExamples description: negative examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: null.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: null.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 CLI usage: null.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: twoChecks CLI usage: null.useMultiInstanceChecks = twoChecks; option name: penaliseNeutralExamples description: if set to true neutral examples are penalised -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: null CLI usage: null.penaliseNeutralExamples = null; option name: accuracyPenalty description: penalty for pos/neg examples which are classified as neutral -values: class org.dllearner.core.config.DoubleConfigOption +values: class org.dllearner.core.options.DoubleConfigOption default value: 1.0 CLI usage: null.accuracyPenalty = 1.0; option name: errorPenalty description: penalty for pos. examples classified as negative or vice versa -values: class org.dllearner.core.config.DoubleConfigOption +values: class org.dllearner.core.options.DoubleConfigOption default value: 3.0 CLI usage: null.errorPenalty = 3.0; @@ -343,31 +361,31 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegInclusionLP.positiveExamples = null; option name: negativeExamples description: negative examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posNegInclusionLP.negativeExamples = null; option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: posNegInclusionLP.useRetrievalForClassficiation = false; option name: percentPerLenghtUnit description: describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 CLI usage: posNegInclusionLP.percentPerLenghtUnit = 0.05; option name: useMultiInstanceChecks description: See UseMultiInstanceChecks enum. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: twoChecks CLI usage: posNegInclusionLP.useMultiInstanceChecks = twoChecks; @@ -379,7 +397,7 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: posOnlyDefinitionLP.positiveExamples = null; @@ -391,7 +409,7 @@ option name: positiveExamples description: positive examples -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: null.positiveExamples = null; @@ -407,13 +425,13 @@ option name: maxLength description: maximum length of generated concepts -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 7 CLI usage: bruteForce.maxLength = 7; option name: returnType description: Specifies the type which the solution has to belong to (if already) known. This means we inform the learning algorithm that the solution is a subclass of this type. -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: bruteForce.returnType = null; @@ -425,175 +443,175 @@ option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: dbpediaNavigationSuggestor.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt CLI usage: dbpediaNavigationSuggestor.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: dbpediaNavigationSuggestor.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: lexicographic CLI usage: dbpediaNavigationSuggestor.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 CLI usage: dbpediaNavigationSuggestor.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.improveSubsumptionHierarchy = true; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useExistsConstructor = true; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useCardinalityRestrictions = true; option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: dbpediaNavigationSuggestor.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 3 CLI usage: dbpediaNavigationSuggestor.valueFrequencyThreshold = 3; option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: dbpediaNavigationSuggestor.useBooleanDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: dbpediaNavigationSuggestor.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: dbpediaNavigationSuggestor.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: dbpediaNavigationSuggestor.guaranteeXgoodDescriptions = 1; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: DEBUG CLI usage: dbpediaNavigationSuggestor.logLevel = DEBUG; option name: noisePercentage description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 100.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 default value: 0.0 CLI usage: dbpediaNavigationSuggestor.noisePercentage = 0.0; option name: startClass description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.startClass = null; option name: forceRefinementLengthIncrease description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: null CLI usage: dbpediaNavigationSuggestor.forceRefinementLengthIncrease = null; @@ -605,13 +623,13 @@ option name: numberOfTrees description: number of randomly generated concepts/trees -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 5 CLI usage: random.numberOfTrees = 5; option name: maxDepth description: maximum depth of generated concepts/trees -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 5 CLI usage: random.maxDepth = 5; @@ -622,6 +640,18 @@ CLI usage: null = null; +component: unnamed component (org.dllearner.algorithms.celoe.CELOE) +=================================================================== + +CLI usage: null = null; + + +component: standard EL learning algorithm (org.dllearner.algorithms.el.ELLearningAlgorithm) +=========================================================================================== + +CLI usage: null = el; + + component: genetic programming learning algorithm (org.dllearner.algorithms.gp.GP) ================================================================================== @@ -629,311 +659,347 @@ option name: selectionType description: selection type -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: rankSelection CLI usage: gp.selectionType = rankSelection; option name: tournamentSize description: tournament size (applies only to tournament selection) -values: class org.dllearner.core.config.IntegerConfigOption min 2 max 20 +values: class org.dllearner.core.options.IntegerConfigOption min 2 max 20 default value: 3 CLI usage: gp.tournamentSize = 3; option name: elitism description: specifies whether to use elitism in selection -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: gp.elitism = true; option name: algorithmType description: algorithm type -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: steadyState CLI usage: gp.algorithmType = steadyState; option name: mutationProbability description: mutation probability -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.03 CLI usage: gp.mutationProbability = 0.03; option name: crossoverProbability description: crossover probability -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.95 CLI usage: gp.crossoverProbability = 0.95; option name: hillClimbingProbability description: hill climbing probability -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.0 CLI usage: gp.hillClimbingProbability = 0.0; option name: refinementProbability description: refinement operator probability (values higher than 0 turn this into a hybrid GP algorithm - see publication) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.0 CLI usage: gp.refinementProbability = 0.0; option name: numberOfIndividuals description: number of individuals -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 100 CLI usage: gp.numberOfIndividuals = 100; option name: numberOfSelectedIndividuals description: number of selected individuals -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 92 CLI usage: gp.numberOfSelectedIndividuals = 92; option name: useFixedNumberOfGenerations description: specifies whether to use a fixed number of generations -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: gp.useFixedNumberOfGenerations = false; option name: generations description: number of generations (only valid if a fixed number of generations is used) -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 20 CLI usage: gp.generations = 20; option name: postConvergenceGenerations description: number of generations after which to stop if no improvement wrt. the best solution has been achieved -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 50 CLI usage: gp.postConvergenceGenerations = 50; option name: adc description: whether to use automatically defined concept (this invents new helper concepts, but enlarges the search space -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: gp.adc = false; option name: initMinDepth description: minimum depth to use when creating the initial population -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 4 CLI usage: gp.initMinDepth = 4; option name: initMaxDepth description: maximum depth to use when creating the initial population -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 6 CLI usage: gp.initMaxDepth = 6; option name: maxConceptLength description: maximum concept length (higher length means lowest possible fitness) -values: class org.dllearner.core.config.IntegerConfigOption min 1 +values: class org.dllearner.core.options.IntegerConfigOption min 1 default value: 75 CLI usage: gp.maxConceptLength = 75; -component: example driven refinement operator based learning algorithm (org.dllearner.algorithms.refexamples.ExampleBasedROLComponent) -====================================================================================================================================== +component: refinement operator based learning algorithm II (org.dllearner.algorithms.refexamples.ExampleBasedROLComponent) +========================================================================================================================== CLI usage: null = refexamples; option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt CLI usage: refexamples.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: lexicographic CLI usage: refexamples.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 CLI usage: refexamples.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.improveSubsumptionHierarchy = true; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refexamples.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useExistsConstructor = true; option name: useHasValueConstructor description: specifies whether the hasValue constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.useHasValueConstructor = false; option name: valueFrequencyThreshold description: specifies how often an object must occur as value in order to be considered for hasValue restrictions -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 3 CLI usage: refexamples.valueFrequencyThreshold = 3; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useCardinalityRestrictions = true; +option name: cardinalityLimit +description: Gives the maximum number used in cardinality restrictions. +values: class org.dllearner.core.options.IntegerConfigOption +default value: 5 +CLI usage: refexamples.cardinalityLimit = 5; + option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useNegation = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useBooleanDatatypes = true; option name: useDoubleDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refexamples.useDoubleDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refexamples.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refexamples.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: refexamples.guaranteeXgoodDescriptions = 1; option name: maxClassDescriptionTests description: The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.) -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refexamples.maxClassDescriptionTests = 0; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: DEBUG CLI usage: refexamples.logLevel = DEBUG; option name: usePropernessChecks description: specifies whether to check for equivalence (i.e. discard equivalent refinements) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refexamples.usePropernessChecks = false; option name: maxPosOnlyExpansion description: specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 4 CLI usage: refexamples.maxPosOnlyExpansion = 4; option name: noisePercentage description: the (approximated) percentage of noise within the examples -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 100.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 100.0 default value: 0.0 CLI usage: refexamples.noisePercentage = 0.0; +option name: terminateOnNoiseReached +description: specifies whether to terminate when noise criterion is met +values: class org.dllearner.core.options.BooleanConfigOption +default value: true +CLI usage: refexamples.terminateOnNoiseReached = true; + option name: startClass description: the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: null CLI usage: refexamples.startClass = null; option name: forceRefinementLengthIncrease description: specifies whether nodes should be expanded until only longer refinements are reached -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: null CLI usage: refexamples.forceRefinementLengthIncrease = null; +option name: negativeWeight +description: Used to penalise errors on negative examples different from those of positive examples (lower = less importance for negatives). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 1.0 +CLI usage: refexamples.negativeWeight = 1.0; +option name: startNodeBonus +description: You can use this to give a heuristic bonus on the start node (= initially broader exploration of search space). +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.0 +CLI usage: refexamples.startNodeBonus = 0.0; + +option name: negationPenalty +description: Penalty on negations (TODO: better explanation). +values: class org.dllearner.core.options.IntegerConfigOption +default value: 0 +CLI usage: refexamples.negationPenalty = 0; + +option name: expansionPenaltyFactor +description: describes the reduction in heuristic score one is willing to accept for reducing the length of the concept by one +values: class org.dllearner.core.options.DoubleConfigOption +default value: 0.02 +CLI usage: refexamples.expansionPenaltyFactor = 0.02; + + component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) ======================================================================================================= @@ -941,151 +1007,151 @@ option name: writeSearchTree description: specifies whether to write a search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refinement.writeSearchTree = false; option name: searchTreeFile description: file to use for the search tree -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: log/searchTree.txt CLI usage: refinement.searchTreeFile = log/searchTree.txt; option name: replaceSearchTree description: specifies whether to replace the search tree in the log file after each run or append the new search tree -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refinement.replaceSearchTree = false; option name: heuristic description: specifiy the heuristic to use -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: lexicographic CLI usage: refinement.heuristic = lexicographic; option name: applyAllFilter description: usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.applyAllFilter = true; option name: applyExistsFilter description: usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.applyExistsFilter = true; option name: useTooWeakList description: try to filter out too weak concepts without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useTooWeakList = true; option name: useOverlyGeneralList description: try to find overly general concept without sending them to the reasoner -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useOverlyGeneralList = true; option name: useShortConceptConstruction description: shorten concept to see whether they already exist -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useShortConceptConstruction = true; option name: horizontalExpansionFactor description: horizontal expansion factor (see publication for description) -values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +values: class org.dllearner.core.options.DoubleConfigOption min 0.0 max 1.0 default value: 0.6 CLI usage: refinement.horizontalExpansionFactor = 0.6; option name: improveSubsumptionHierarchy description: simplify subsumption hierarchy to reduce search space (see publication for description) -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.improveSubsumptionHierarchy = true; option name: quiet description: may be deprecated soon -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: false CLI usage: refinement.quiet = false; option name: allowedConcepts description: concepts the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.allowedConcepts = null; option name: ignoredConcepts description: concepts the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.ignoredConcepts = null; option name: allowedRoles description: roles the algorithm is allowed to use -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.allowedRoles = null; option name: ignoredRoles description: roles the algorithm must ignore -values: class org.dllearner.core.config.StringSetConfigOption +values: class org.dllearner.core.options.StringSetConfigOption default value: null CLI usage: refinement.ignoredRoles = null; option name: useAllConstructor description: specifies whether the universal concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useAllConstructor = true; option name: useExistsConstructor description: specifies whether the existential concept constructor is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useExistsConstructor = true; option name: useNegation description: specifies whether negation is used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useNegation = true; option name: useCardinalityRestrictions description: specifies whether CardinalityRestrictions is used in the learning algorithm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useCardinalityRestrictions = true; option name: useBooleanDatatypes description: specifies whether boolean datatypes are used in the learning algorothm -values: class org.dllearner.core.config.BooleanConfigOption +values: class org.dllearner.core.options.BooleanConfigOption default value: true CLI usage: refinement.useBooleanDatatypes = true; option name: maxExecutionTimeInSeconds description: algorithm will stop after specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refinement.maxExecutionTimeInSeconds = 0; option name: minExecutionTimeInSeconds description: algorithm will run at least specified seconds -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 0 CLI usage: refinement.minExecutionTimeInSeconds = 0; option name: guaranteeXgoodDescriptions description: algorithm will run until X good (100%) concept descritpions are found -values: class org.dllearner.core.config.IntegerConfigOption +values: class org.dllearner.core.options.IntegerConfigOption default value: 1 CLI usage: refinement.guaranteeXgoodDescriptions = 1; option name: logLevel description: determines the logLevel for this component, can be {TRACE, DEBUG, INFO} -values: class org.dllearner.core.config.StringConfigOption +values: class org.dllearner.core.options.StringConfigOption default value: DEBUG CLI usage: refinement.logLevel = DEBUG; Modified: trunk/doc/manual/bibliography.bib =================================================================== --- trunk/doc/manual/bibliography.bib 2009-02-12 13:04:36 UTC (rev 1595) +++ trunk/doc/manual/bibliography.bib 2009-02-12 16:17:41 UTC (rev 1596) @@ -5,3 +5,35 @@ publisher = {Cambridge University Press}, isbn = {0-521-78176-0}, } + +@article{2009_ijswis, + title = "Learning of {OWL} Class Descriptions on Very Large Knowledge Bases", + author = "Sebastian Hellmann and Jens Lehmann and Sören Auer", + journal = "International Journal On Semantic Web and Information Systems", + year = "2009", +} + +@inproceedings{2008_dbpedia, + title = "{DB}pedia: A Nucleus for a Web of Open Data", + author = "Sören Auer and Chris Bizer and Georgi Kobilarov and Jens Lehmann and Richard Cyganiak and Zachary Ives", + publisher = "Springer", + booktitle = "Proceedings of the 6th International Semantic Web Conference (ISWC)", + series = "Lecture Notes in Computer Science", + volume = "4825", + pages = "722-735", + year = "2008", +} + +@InProceedings{cheng00, + author = "Liviu Badea and Shan-Hwei Nienhuys-Cheng", + title = "A Refinement Operator for Description Logics", + booktitle = "Proceedings of the 10th International Conference on + Inductive Logic Programming", + series = "Lecture Notes in Artificial Intelligence", + volume = "1866", + editor = "J. Cussens and A. Frisch", + publisher = "Springer-Verlag", + year = "2000", + ISBN = "3-540-67795-X", + pages = "40--59", +} \ No newline at end of file Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 13:04:36 UTC (rev 1595) +++ trunk/doc/manual/manual.tex 2009-02-12 16:17:41 UTC (rev 1596) @@ -20,6 +20,8 @@ \urldef{\wsjavadoc}{\url}{http://dl-learner.org/javadoc/org/dllearner/server/DLLearnerWS.html} \urldef{\wsphpexamples}{\url}{http://dl-learner.svn.sourceforge.net/viewvc/dl-learner/trunk/src/php-examples/} \urldef{\wikiprotplugin}{\url}{http://dl-learner.org/wiki/ProtegePlugin} +\urldef{\owlapi}{\url}{http://owlapi.sourceforge.net} +\urldef{\dig}{\url}{http://dl.kr.org/dig/} \title{DL-Learner Manual [Draft]} \author{Jens Lehmann} @@ -124,16 +126,49 @@ \section{DL-Learner Components} \label{sec:components} +In this part, we describe concrete components currently implemented in DL-Learner. Each of the subsections contains a list of components of type specified in the subsection heading. Note that this constitute a full description, i.e.~we omit some components and many configuration options. The purpose of the manual is to obtain a general understanding of the implemented components. A full list of components, which is generated automatically from the source code, can be found in \verb|doc/configOptions.txt| including the default values for all options and their usage in conf files. \todo{ConfigDocumentationGenerator seems partially broken, because it prints things like CLI usage: null = owlAPIReasoner;} - \subsection{Knowledge Sources} +Knowledge sources have a URI and can be included in conf files using \verb|import("$url");|, e.g.~\verb|import("ontology.owl")|. Depending on the file ending, DL-Learner will guess the correct type of knowledge source. If you want to overwrite this, you can use a second parameter with value \verb|OWL|, \verb|KB|, or \verb|SPARQL|, e.g.~\verb|import("ontology.owl","OWL")|. + +\begin{description} + \item[OWL File] DL-Learner supports OWL files in different formats, e.g. RDF/XML or N-Triples. If there is a standard OWL format, you want to use, but is not supported by DL-Learner please let us know. + \item[KB File] KB files are an internal non-standardised knowledge representation format, which corresponds to description logic syntax except that the special symbols have been replaced by ASCII strings, e.g.~\verb|AND| instead of $\sqcap$. You can find several KB files in the examples folder. + \item[SPARQL Endpoint] DL-Learner allows to use SPARQL endpoints as background knowledge source, which enables the incorporation of very large knowledge bases, e.g. DBpedia\cite{2008_dbpedia}, in DL-Learner. This works by using a set of start instances, which usually correspond to the examples in a learning problem, and then retrieving knowledge about these instances via SPARQL queries. The obtained knowledge base fragment can be converted to OWL and consumed by a reasoner later since it is now sufficiently to be processed in reasonable time. Please see \cite{2009_ijswis} for details. Some options of the SPARQL component are: +\begin{itemize} + \item instances: Set of individuals to use for starting the knowledge fragment extraction. Example use in conf file: \begin{verbatim}sparql.instances = {"http://dbpedia.org/resource/Matt_Stone", + "http://dbpedia.org/resource/Sarah_Silverman"};\end{verbatim} + \item recursionDepth: Maximum distance of an extracted individual from a start individual. This influences the size of the extracted fragment and depends on the maximum property depth you want the learned class expression to have. Example use in conf file: \verb|sparql.recursionDepth = 3;|. +\end{itemize} + Many further options allow to modify the extracted fragment on the fly or fine-tune the extraction process. +\end{description} + \subsection{Reasoner Components} +Several reasoner components are implemented, which can be interfaces to concrete reasoner implementations. To select a component in a conf file, use \verb|reasoner=$value;|, where \verb|$value| is one of \verb|digReasoner|, \verb|fastInstanceChecker|, or \verb|owlAPIReasoner|, which are explained below. + +\begin{description} + \item[OWL API] The OWL API\footnote{\owlapi} reasoner interface can be used in conjunction with the Pellet and FaCT++ reasoners. The only option allows to switch between both: + \begin{itemize} + \item reasonerType: Selects the desired reasoner. By default, Pellet is used. Usage: \verb|owlAPIReasoner.reasonerType = fact;|. Note that FaCT++ is written in C++ and we currently ship the 32 bit version of the JNI layer. This may change to 64 bit in the future. + \end{itemize} + \item[DIG] DIG 1.1\footnote{\dig} is an interface to description logic reasoners and supported by a large variety of reasoners including Pellet, FaCT++, KAON2, and Racer Pro. The major drawback is that the current version DIG 1.1 is not aligned with the OWL specification and therefore lacks several features, which are crucial to the more recent learning algorithms in DL-Learner. If you still want to use the DIG interface, you have to download a DIG capable reasoner and start the DIG server there. DL-Learner communicates with the reasoner using the XML based protocol over HTTP. + \item[Fast Instance Checker] Instance checks, i.e.~testing whether an individual is inst... [truncated message content] |
From: <jen...@us...> - 2009-02-12 13:04:41
|
Revision: 1595 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1595&view=rev Author: jenslehmann Date: 2009-02-12 13:04:36 +0000 (Thu, 12 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/doc/manual/manual.tex Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 12:39:45 UTC (rev 1594) +++ trunk/doc/manual/manual.tex 2009-02-12 13:04:36 UTC (rev 1595) @@ -160,31 +160,52 @@ \section{Extending DL-Learner} \label{sec:developing} -\todo{example code of a simple component} +DL-Learner is open source and component based. If you want to develop a specific part or extension of a class expression learning algorithm for OWL, then you are invited to use DL-Learner as a base. This allows you to focus on the part you want to implement while being able to use DL-Learner as a library and access it through one of the interfaces. In a first step, you have to decide which type of component you want to create. To implement a concrete component, you have to subclass one of the following classes and implement their abstract methods: -Each component can specify its own configuration options. Currently, the following configuration option types exist (new ones can be implemented if necessary): +\begin{itemize} + \item org.dllearner.core.KnowledgeSource + \item org.dllearner.core.ReasonerComponent + \item org.dllearner.core.LearningProblem + \item org.dllearner.core.LearningAlgorithm +\end{itemize} +You then have to add your component to \verb|lib/components.ini| such that it is registered in the component manager when DL-Learner starts up. If you want to use configuration options in your component, you need to create a static method as follows: + +\begin{verbatim} +public static Collection<ConfigOption<?>> createConfigOptions() { + List<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); + options.add(new IntegerConfigOption("maxDepth", + "maximum depth of generated concepts/trees", 5)); + return options; +} +\end{verbatim} + +This creates an option with name \verb|maxDepth|, the given description, and a default value of 5. To add further options, simply add more of them to the collection. Running \verb|org.dllearner.scripts.ConfigJavaGenerator| generates a file for you in package \verb|org.dllearner.configurators| to access the options of your component programmatically if desired. Currently, the following configuration option types exist (new ones can be implemented if necessary): + \begin{itemize} - \item boolean - \item string (a set of allowed strings can be specified) - \item int (min and max value can be specifified) - \item double (min and max value can be specifified) - \item set of strings - \item list of string tuples + \item boolean, e.g. \verb|useCache| + \item string (a set of allowed strings can be specified), e.g. \verb|cacheDir| + \item URL, e.g. \verb|reasonerURL| + \item int (min and max value can be specifified), e.g. \verb|maxDepth| + \item double (min and max value can be specifified), e.g. \verb|noisePercentage| + \item set of strings, e.g. \verb|positiveExamples| + \item list of string tuples, e.g. \verb|replaceObject| \end{itemize} -Although, we loose the ability to use arbitrary argument types in components, this gives us the possibility to build very flexible user interfaces. Whenever, a new component or a new configuration option for a component is added, the current user interfaces (GUI, web service, commandline) will automatically support it without any need for code changes. +Although, we loose the ability to use arbitrary argument types as options in components, this gives us the possibility to build very flexible user interfaces. Whenever, a new component or a new configuration option for a component is added, the current user interfaces (GUI, web service, commandline) will automatically support it without any or only minimal code changes. +This quick introduction only serves as an entry point to get you started. For more detailed questions about how to extend DL-Learner, please drop us a message in the DL-Learner mailing list. + \section{General Information} \label{sec:general} \label{sec:contact} \begin{itemize} \item Homepage: \url{http://dl-learner.org} - \item Contact: le...@in... \item Sourceforge.net project page: \url{http://sourceforge.net/projects/dl-learner/} \item Tracker (bugs, features): \url{http://sourceforge.net/tracker/?group_id=203619} \item Mailing Lists: \url{http://sourceforge.net/mail/?group_id=203619} + \item Contact: le...@in... (please use the mailing list if possible) \item Latest Release: \url{http://sourceforge.net/project/showfiles.php?group_id=203619} \end{itemize} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 12:39:48
|
Revision: 1594 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1594&view=rev Author: jenslehmann Date: 2009-02-12 12:39:45 +0000 (Thu, 12 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/doc/manual/manual.tex Added Paths: ----------- trunk/resources/screenshots/gui_algorithm.png Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-12 08:57:36 UTC (rev 1593) +++ trunk/doc/manual/manual.tex 2009-02-12 12:39:45 UTC (rev 1594) @@ -17,6 +17,9 @@ \urldef{\carc}{\url}{http://dl-learner.org/wiki/Carcinogenesis} \urldef{\dldownload}{\url}{http://sourceforge.net/project/showfiles.php?group_id=203619} \urldef{\mos}{\url}{http://www.co-ode.org/resources/reference/manchester_syntax/} +\urldef{\wsjavadoc}{\url}{http://dl-learner.org/javadoc/org/dllearner/server/DLLearnerWS.html} +\urldef{\wsphpexamples}{\url}{http://dl-learner.svn.sourceforge.net/viewvc/dl-learner/trunk/src/php-examples/} +\urldef{\wikiprotplugin}{\url}{http://dl-learner.org/wiki/ProtegePlugin} \title{DL-Learner Manual [Draft]} \author{Jens Lehmann} @@ -51,6 +54,7 @@ As an example, consider the problem to find out whether a chemical compound can cause cancer\footnote{see \carc{} for a more detailed description}. In this case, the background knowledge contains information about chemical compounds in general and certain compounds we are interested in. The positive examples are those compounds causing cancer, whereas the negative examples are those compounds not causing cancer. The prediction for the examples is likely to have been obtained from experiments and long-term research trials in this case. Of course, all examples have to be present in the considered background knowledge. A learning algorithm can now derive a class expression from examples and background knowledge, e.g.~this class expression in natural language could be ``chemical compounds containing a phosphorus atom''. (Of course, in practice the expression will be more complex to obtain a reasonable accuracy.) Using this class expression, we can no classify unseen chemical compounds. \section{Getting Started} +\label{sec:start} DL-Learner is written in Java, i.e.~it can be used on all platforms supporting Java. Currently, Java 6 or higher is required. To install the latest release, please visit the download page\footnote{\dldownload} and extract the file on your harddisk. In the top level directory, you will notice several executables. Those files ending with \verb|bat| are Windows executables, whereas the corresponding files without file extension are the Non-Windows (e.g.~Linux, Mac) executables. To test whether DL-Learner works, please run the following on the command line depending on your operating system: @@ -92,17 +96,14 @@ overall algorithm runtime: 26ms \end{verbatim} -\todo{Use Manchester OWL Syntax for output.} -\todo{Suppress http://localhost/foo in output.} -\todo{empty line after init; empty line after algorithm finished} -\todo{replace ``node'' by ``class expression''} +\todo{display accuracy of solutions} \todo{find out why algorithm continues after finding EXISTS hasChild.TOP} The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. The last part of the output contains some runtime statistics. \section{DL-Learner Architecture} -DL-Learner consists of core functionality, which provides Machine Learning algorithms for solving the learning problem, support for different knowledge base formats, an OWL library, and reasoner interfaces. There are several interfaces for accessing this functionality, a couple of tools which use the DL-Learner algorithms, and a set of convenience scripts. The general structure is illustrated in the following \ref{fig:structure}. +DL-Learner consists of core functionality, which provides Machine Learning algorithms for solving the learning problem, support for different knowledge base formats, an OWL library, and reasoner interfaces. There are several interfaces for accessing this functionality, a couple of tools which use the DL-Learner algorithms, and a set of convenience scripts. The general structure is illustrated in Figure \ref{fig:structure}. \begin{figure} \includegraphics[width=\textwidth]{../../resources/structure_print} @@ -110,9 +111,9 @@ \label{fig:structure} \end{figure} -To be flexible in integrating new learning algorithms, new kinds of learning problems, new knowledge bases, and new reasoner implementations, DL-Learner uses a component based model. Adding a component is as easy as subclassing the appropriate class and adding the name of the new class to the “components.ini” file (more on that in Section \ref{sec:developing}). +To be flexible in integrating new learning algorithms, new kinds of learning problems, new knowledge bases, and new reasoner implementations, DL-Learner uses a component based model. Adding a component can be done by subclassing the appropriate class and adding the name of the new class to the “components.ini” file (more on that in Section \ref{sec:developing}). -In DL-Learner, there are four types of components (knowledge source, reasoning service, learning problem, learning algorithm). There are several components of each type and each component can have its own configuration options as illustrated in Figure \ref{fig:components}. +There are four types of components (knowledge source, reasoning service, learning problem, learning algorithm). For each type, there are several implemented components and each component can have its own configuration options as illustrated in Figure \ref{fig:components}. Configuration options can be used to change parameters/settings of a component. In Section \ref{sec:components}, we describe the components in DL-Learner and their configuration options. \begin{figure} \includegraphics[width=\textwidth]{../../resources/components_print} @@ -123,6 +124,8 @@ \section{DL-Learner Components} \label{sec:components} + + \subsection{Knowledge Sources} \subsection{Reasoner Components} @@ -131,8 +134,29 @@ \subsection{Learning Algorithms} + + \section{DL-Learner Interfaces} +One interface you have already used in Section \ref{sec:start} is the command line. There are two executables, which can be used for starting DL-Learner on the commandline: \verb|dl-learner| and \verb|quickstart|. The first one takes a conf file as argument, whereas the latter one lists all conf files in the examples folder and allows you to select one of those. + +\begin{figure} + \centering + \includegraphics[width=.9\textwidth]{../../resources/screenshots/gui_algorithm} + \caption{GUI screenshot showing the learning algorithm tab. The UI allows you to set different options and then proceed to the next tab and execute the algorithm.} + \label{fig:gui} +\end{figure} + +Apart from the command line, there is also a prototypical graphical interface. You can use \verb|gui| (or \verb|gui.bat|) to start it. You can optionally pass it a conf file as argument. The main GUI window has four tabs corresponding to the four different types of components and a run tab to execute the learning algorithm. Using the GUI, you can assemble the desired combination of components and options. The \verb|File| menu allows you to load a conf file or save the current configuration to a conf file. The GUI implementation is currently prototypical, so please report any bugs or feature requests you have (see Section \ref{sec:contact}). Since the GUI uses the component manager, it will automatically evolve when new components and options are added. + +A third interface through which DL-Learner can be accessed programmatically is a web service. You can execute \verb|ws| (or \verb|ws.bat|) to start the web service. It is based on the Java API for XML Web Services (JAX-WS), which is included in Java 6 or higher. Executing the command will start a web server on port 8181 of your local machine. The WSDL can be accessed via \url{http://localhost:8181/services?wsdl}. You can use a WSDL viewer to see the supported operation +or view the JavaDoc of the corresponding Java file\footnote{viewable online at \wsjavadoc}. +Some examples for calling the web service from PHP can be found in the DL-Learner subversion +repository\footnote{in the directory src/php-examples/:\\ \wsphpexamples}. +\todo{Javadoc of web service needs to be improved (almost undocumented)} + +Another means to access DL-Learner, in particular for ontology engineering, is to use the OntoWiki and Protégé plugins. The OntoWiki plugin is not officially released yet, but can be used in the SVN version of OntoWiki. The Protégé 4 plugin can be installed either by downloading it from the DL-Learner download page or directly within Protégé 4 by clicking on ``File'', ``Preferences'', ``Plugins'', ``Check for Downloads'' now and selecting the DL-Learner plugin. For more information and a screencast see the Protégé plugin wiki page \footnote{\wikiprotplugin}. + \section{Extending DL-Learner} \label{sec:developing} @@ -151,6 +175,19 @@ Although, we loose the ability to use arbitrary argument types in components, this gives us the possibility to build very flexible user interfaces. Whenever, a new component or a new configuration option for a component is added, the current user interfaces (GUI, web service, commandline) will automatically support it without any need for code changes. +\section{General Information} +\label{sec:general} +\label{sec:contact} + +\begin{itemize} + \item Homepage: \url{http://dl-learner.org} + \item Contact: le...@in... + \item Sourceforge.net project page: \url{http://sourceforge.net/projects/dl-learner/} + \item Tracker (bugs, features): \url{http://sourceforge.net/tracker/?group_id=203619} + \item Mailing Lists: \url{http://sourceforge.net/mail/?group_id=203619} + \item Latest Release: \url{http://sourceforge.net/project/showfiles.php?group_id=203619} +\end{itemize} + \bibliographystyle{apalike} \bibliography{bibliography} Added: trunk/resources/screenshots/gui_algorithm.png =================================================================== (Binary files differ) Property changes on: trunk/resources/screenshots/gui_algorithm.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-12 08:57:43
|
Revision: 1593 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1593&view=rev Author: jenslehmann Date: 2009-02-12 08:57:36 +0000 (Thu, 12 Feb 2009) Log Message: ----------- small CLI improvements 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/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-11 16:58:59 UTC (rev 1592) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-12 08:57:36 UTC (rev 1593) @@ -423,7 +423,7 @@ } public static String getName() { - return "example driven refinement operator based learning algorithm"; + return "refinement operator based learning algorithm II"; } public static String getUsage() { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-11 16:58:59 UTC (rev 1592) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-12 08:57:36 UTC (rev 1593) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007-2008, Jens Lehmann + * Copyright (C) 2007-2009, Jens Lehmann * * This file is part of DL-Learner. * @@ -57,17 +57,8 @@ import com.jamonapi.Monitor; /** - * Implements the example based refinement operator learning approach. + * Implements the 2nd version of the refinement operator based learning approach. * - * TODO: Solve subsumption problems. It is easy to implement approximate fast - * instance checks. However, subsumption is difficult to optimise. It should by - * analysed whether it is reasonable to perform instance comparisions instead of - * subsumption checks, e.g. a concept is only included in the search tree when - * it covers strictly less examples than its parent. Note, that this does not - * mean that concepts not bearing an advantage in classification are thrown - * away. They are just handled like improper refinements. [TODO: How does this - * differ from not checking subsumption at all?] - * * @author Jens Lehmann * */ @@ -403,6 +394,8 @@ ExampleBasedNode bestNode = startNode; ExampleBasedNode bestNodeStable = startNode; + logger.info("starting top down refinement with: " + startNode.getConcept().toManchesterSyntaxString(baseURI, prefixes) + " (" + df.format(100*startNode.getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples)) + "% accuracy)"); + int loop = 0; algorithmStartTime = System.nanoTime(); @@ -446,7 +439,7 @@ .getCovPosMinusCovNeg()) { String acc = new DecimalFormat( ".00%" ).format((candidatesStable.last().getAccuracy(nrOfPositiveExamples, nrOfNegativeExamples))); // no handling needed, it will just look ugly in the output - logger.info("more accurate ("+acc+") node found: " + candidatesStable.last()); + logger.info("more accurate ("+acc+") class expression found: " + candidatesStable.last().getConcept().toManchesterSyntaxString(baseURI, prefixes)); bestNodeStable = candidatesStable.last(); } @@ -524,17 +517,18 @@ if (solutionFound) { int solutionLimit = 20; - logger.info("best node " - + candidatesStable.last().getShortDescription(nrOfPositiveExamples, - nrOfNegativeExamples, baseURI)); + // we do not need to print the best node if we display the top 20 solutions below anyway +// logger.info("best node " +// + candidatesStable.last().getShortDescription(nrOfPositiveExamples, +// nrOfNegativeExamples, baseURI)); logger.info("solutions (at most " + solutionLimit + " are shown):"); int show = 1; String manchester = "MANCHESTER:\n"; String kbSyntax = "KBSyntax:\n"; for (Description c : solutions) { - logger.info(show + ": " + c.toString(baseURI, null) + " (length " + c.getLength() + logger.info(show + ": " + c.toManchesterSyntaxString(baseURI, prefixes) + " (length " + c.getLength() + ", depth " + c.getDepth() + ")"); - manchester += show + ": " + c.toManchesterSyntaxString(baseURI, prefixes) + "\n"; +// manchester += show + ": " + c.toManchesterSyntaxString(baseURI, prefixes) + "\n"; kbSyntax += show + ": " + c.toKBSyntaxString() + "\n"; if (show >= solutionLimit) { break; @@ -551,10 +545,11 @@ printStatistics(true); - if (stop) - logger.info("Algorithm stopped."); - else - logger.info("Algorithm terminated succesfully."); + if (stop) { + logger.info("Algorithm stopped.\n"); + } else { + logger.info("Algorithm terminated succesfully.\n"); + } totalLearningTime.stop(); isRunning = false; Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-11 16:58:59 UTC (rev 1592) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-12 08:57:36 UTC (rev 1593) @@ -329,6 +329,11 @@ // handle any CLI options processCLIOptions(cm, parser, rc, lp); + + // newline to separate init phase from learning phase + if(logger.isInfoEnabled()) { + System.out.println(""); + } } public void start(boolean inQueryMode) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-11 16:59:04
|
Revision: 1592 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1592&view=rev Author: jenslehmann Date: 2009-02-11 16:58:59 +0000 (Wed, 11 Feb 2009) Log Message: ----------- manual continued Modified Paths: -------------- trunk/build.xml trunk/doc/manual/manual.tex trunk/examples/father.conf Added Paths: ----------- trunk/examples/father.owl Removed Paths: ------------- trunk/examples/father.kb Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/build.xml 2009-02-11 16:58:59 UTC (rev 1592) @@ -4,7 +4,7 @@ <!-- directory settings --> <property name="lib_dir" value="lib" /> <property name="source_dir" value="src/dl-learner" /> - <property name="protege_dir" value="C:/Programme/Protege_4.0_beta/plugins" /> + <property name="protege_dir" value="/home/jl/programme/Protege_4.0_beta/plugins" /> <property name="class_dir" value="classes" /> <property name="php_client_dir" value="src/php-client" /> Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/doc/manual/manual.tex 2009-02-11 16:58:59 UTC (rev 1592) @@ -15,6 +15,8 @@ \urldef{\owl}{\url}{http://www.w3.org/2004/OWL/} \urldef{\owlce}{\url}{http://www.w3.org/TR/2008/WD-owl2-syntax-20081202/#Class_Expressions} \urldef{\carc}{\url}{http://dl-learner.org/wiki/Carcinogenesis} +\urldef{\dldownload}{\url}{http://sourceforge.net/project/showfiles.php?group_id=203619} +\urldef{\mos}{\url}{http://www.co-ode.org/resources/reference/manchester_syntax/} \title{DL-Learner Manual [Draft]} \author{Jens Lehmann} @@ -50,6 +52,54 @@ \section{Getting Started} +DL-Learner is written in Java, i.e.~it can be used on all platforms supporting Java. Currently, Java 6 or higher is required. To install the latest release, please visit the download page\footnote{\dldownload} and extract the file on your harddisk. In the top level directory, you will notice several executables. Those files ending with \verb|bat| are Windows executables, whereas the corresponding files without file extension are the Non-Windows (e.g.~Linux, Mac) executables. To test whether DL-Learner works, please run the following on the command line depending on your operating system: + +\begin{verbatim} +dllearner examples/father.conf (Non-Windows Operating System) +dllearner.bat examples/father.conf (Windows Operating System) +\end{verbatim} + +\emph{Conf files}, e.g. \verb|examples/father.conf| in this case, describe the learning problem and specify which algorithm you want to use to solve it. In the simples case they just say where to find the background knowledge to use (in the OWL file \verb|examples/father.owl| in this case) and the positive and negative examples (marked by ``+'' and ``-'', respectively). When running the above command, you should get something similar to the following: + +\begin{verbatim} +DL-Learner 2008-10-13 command line interface +starting component manager ... OK (201ms) +initialising component "OWL file" ... OK (0ms) +initialising component "fast instance checker" ... OK (839ms) +initialising component "two valued definition learning problem" +... OK (0ms) +initialising component "example driven refinement operator based +learning algorithm" ... OK (14ms) + +more accurate (83,33%) node found: http://example.com/father#male +[q:1, he:0, children:0] +more accurate (100,00%) node found: (http://example.com/father#male +AND EXISTS http://example.com/father#hasChild.TOP) +[q:0, he:4, children:0] +best node (male AND EXISTS hasChild.TOP) [acc:100% h:0,962 q:0p-0n +(REASONER), he:7 c:12] +solutions (at most 20 are shown): +1: (male AND EXISTS hasChild.TOP) (length 5, depth 3) +2: (male AND EXISTS hasChild.ALL hasChild.TOP) (length 7, depth 4) +3: (male AND EXISTS hasChild.(female OR male)) (length 7, depth 4) +Algorithm terminated succesfully. + +number of retrievals: 4 +retrieval reasoning time: 0ms ( 0ms per retrieval) +number of instance checks: 194 (0 multiple) +instance check reasoning time: 3ms ( 0ms per instance check) +overall reasoning time: 3ms (13,901% of overall runtime) +overall algorithm runtime: 26ms +\end{verbatim} + +\todo{Use Manchester OWL Syntax for output.} +\todo{Suppress http://localhost/foo in output.} +\todo{empty line after init; empty line after algorithm finished} +\todo{replace ``node'' by ``class expression''} +\todo{find out why algorithm continues after finding EXISTS hasChild.TOP} + +The first part of the output tells you which components are used (more on this in Section \ref{sec:components}). In the second part you see output coming from the used learning algorithm, i.e.~it can print information while running (``more accurate (83,33\%) class description found'') and the final solutions, it computed. The results are displayed in Manchester OWL Syntax\footnote{\mos}. There can be several solutions, in which case they are ordered with the most promising one in the first position. The last part of the output contains some runtime statistics. + \section{DL-Learner Architecture} DL-Learner consists of core functionality, which provides Machine Learning algorithms for solving the learning problem, support for different knowledge base formats, an OWL library, and reasoner interfaces. There are several interfaces for accessing this functionality, a couple of tools which use the DL-Learner algorithms, and a set of convenience scripts. The general structure is illustrated in the following \ref{fig:structure}. @@ -70,9 +120,8 @@ \label{fig:components} \end{figure} - - \section{DL-Learner Components} +\label{sec:components} \subsection{Knowledge Sources} Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/examples/father.conf 2009-02-11 16:58:59 UTC (rev 1592) @@ -1,23 +1,19 @@ /** * Father Example * - * possible solution: + * possible solution: * male AND EXISTS hasChild.TOP * * Copyright (C) 2007, Jens Lehmann */ -/** settings **/ +// background knowledge +import("father.owl"); - -import("father.kb"); -// reasoner = dig; - -/** examples **/ -+stefan -+markus -+bernd --heinz --anna --gabi --michelle +// examples ++"http://example.com/father#stefan" ++"http://example.com/father#markus" ++"http://example.com/father#martin" +-"http://example.com/father#heinz" +-"http://example.com/father#anna" +-"http://example.com/father#michelle" Deleted: trunk/examples/father.kb =================================================================== --- trunk/examples/father.kb 2009-02-09 16:41:44 UTC (rev 1591) +++ trunk/examples/father.kb 2009-02-11 16:58:59 UTC (rev 1592) @@ -1,16 +0,0 @@ -BOTTOM = (male AND female). - -// persons -male(markus). -male(stefan). -male(heinz). -male(bernd). -female(anna). -female(gabi). -female(michelle). - -// children -hasChild(stefan,markus). -hasChild(markus,anna). -hasChild(bernd,gabi). -hasChild(anna,heinz). Added: trunk/examples/father.owl =================================================================== --- trunk/examples/father.owl (rev 0) +++ trunk/examples/father.owl 2009-02-11 16:58:59 UTC (rev 1592) @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<rdf:RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns="http://example.com/father#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xml:base="http://example.com/father"> + <owl:Ontology rdf:about=""/> + <owl:Class rdf:ID="female"/> + <owl:Class rdf:ID="male"> + <owl:equivalentClass> + <owl:Class> + <owl:complementOf rdf:resource="#female"/> + </owl:Class> + </owl:equivalentClass> + </owl:Class> + <owl:ObjectProperty rdf:ID="hasChild"/> + <male rdf:ID="markus"> + <hasChild> + <female rdf:ID="anna"> + <hasChild> + <male rdf:ID="heinz"/> + </hasChild> + </female> + </hasChild> + </male> + <male rdf:ID="stefan"> + <hasChild rdf:resource="#markus"/> + </male> + <female rdf:ID="michelle"/> + <male rdf:ID="martin"> + <hasChild rdf:resource="#heinz"/> + </male> +</rdf:RDF> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-09 16:41:51
|
Revision: 1591 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1591&view=rev Author: jenslehmann Date: 2009-02-09 16:41:44 +0000 (Mon, 09 Feb 2009) Log Message: ----------- refactored Score and EvaluatedDescription such that a broader range of learning problems can be implemented (DL-Learner core makes less restrictions) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java trunk/src/dl-learner/org/dllearner/algorithms/gp/Program.java trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 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/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/core/LearningProblem.java trunk/src/dl-learner/org/dllearner/core/Score.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLPStrict.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/ScoreThreeValued.java trunk/src/dl-learner/org/dllearner/learningproblems/ScoreTwoValued.java trunk/src/dl-learner/org/dllearner/scripts/DumbLPFinder.java trunk/src/dl-learner/org/dllearner/scripts/NewSample.java trunk/src/dl-learner/org/dllearner/scripts/Sample.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBibleComparison.java trunk/src/dl-learner/org/dllearner/scripts/TestValidation.java trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/src/dl-learner/org/dllearner/scripts/improveWikipedia/ConceptSPARQLReEvaluator.java trunk/src/dl-learner/org/dllearner/scripts/improveWikipedia/ConceptSelector.java trunk/src/dl-learner/org/dllearner/scripts/improveWikipedia/WikipediaCategoryTasks.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionComparator.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionSet.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java trunk/src/dl-learner/org/dllearner/learningproblems/ScorePosNeg.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionPosNegComparator.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -26,11 +26,9 @@ import java.util.List; import java.util.Map; -import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.BruteForceLearnerConfigurator; import org.dllearner.core.options.CommonConfigOptions; import org.dllearner.core.options.ConfigEntry; @@ -47,6 +45,7 @@ import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.Union; +import org.dllearner.learningproblems.ScorePosNeg; /** * A brute force learning algorithm. @@ -70,7 +69,7 @@ private ReasonerComponent rs; private Description bestDefinition; - private Score bestScore; + private ScorePosNeg bestScore; //changing this wont have any effect any more private Integer maxLength = 7; @@ -173,7 +172,7 @@ double bestScorePoints = Double.NEGATIVE_INFINITY; int overallCount = 0; int count = 0; - Score tmp; + ScorePosNeg tmp; double score; for(int i=1; i<=maxLength && !stop; i++) { @@ -193,8 +192,8 @@ } else newRoot = program; - tmp = learningProblem.computeScore(newRoot); - score = tmp.getScore(); + tmp = (ScorePosNeg) learningProblem.computeScore(newRoot); + score = tmp.getScoreValue(); // TODO: find termination criterion if(score > bestScorePoints) { @@ -288,7 +287,7 @@ } // @Override - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { return bestScore; } @@ -298,8 +297,8 @@ } @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescription(bestDefinition,bestScore); + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { + return new EvaluatedDescriptionPosNeg(bestDefinition,bestScore); } @Override Modified: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -29,7 +29,6 @@ import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.ComponentFactory; import org.dllearner.core.configurators.DBpediaNavigationSuggestorConfigurator; import org.dllearner.core.options.BooleanConfigOption; @@ -43,6 +42,7 @@ import org.dllearner.learningproblems.PosNegDefinitionLP; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.ScorePosNeg; /** * The DBpedia Navigation suggestor takes a knowledge fragment extracted @@ -51,6 +51,9 @@ * implement a completely new learning algorithm itself, but uses the * example based refinement operator learning algorithm. * + * TODO: This should not be implemented as a learning algorithm (as it does + * almost nothing by itself) and maybe can be completely deleted. + * * @author Jens Lehmann * */ @@ -180,17 +183,17 @@ } @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { return learner.getCurrentlyBestEvaluatedDescription(); } @Override - public List<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions){ + public List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions){ return learner.getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, accuracyThreshold, filterNonMinimalDescriptions); } // @Override - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { return learner.getSolutionScore(); } Copied: trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java (from rev 1590, trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -0,0 +1,168 @@ +/** + * 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.algorithms; + +import java.util.Set; + +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.Score; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.learningproblems.ScorePosNeg; +import org.dllearner.learningproblems.ScoreTwoValued; +import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; +import org.dllearner.utilities.owl.OWLAPIRenderers; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.semanticweb.owl.model.OWLDescription; + +/** + * This represents a class description, which has been + * evaluated by the learning algorithm, i.e. it has been checked + * which examples it covers. It can be used as return value for + * learning algorithms to make it easier for applications to + * assess how good an offered class description is and how it + * classifies particular examples. + * + * @author Jens Lehmann + * + */ +public class EvaluatedDescriptionPosNeg extends EvaluatedDescription { + + private ScorePosNeg score2; + + /** + * Constructs an evaluated description using its score. + * @param description The description, which was evaluated. + * @param score The score of the description. + */ + public EvaluatedDescriptionPosNeg(Description description, ScorePosNeg score) { + super(description, score); + score2 = (ScorePosNeg) score; + } + + /** + * Constructs an evaluated description using example coverage. + * @param description The description, which was evaluated. + * @param posAsPos Positive examples classified as positive by (i.e. instance of) the description. + * @param posAsNeg Positive examples classified as negative by (i.e. not instance of) the description. + * @param negAsPos Negative examples classified as positive by (i.e. instance of) the description. + * @param negAsNeg Negative examples classified as negative by (i.e. not instance of) the description. + */ + public EvaluatedDescriptionPosNeg(Description description, Set<Individual> posAsPos, Set<Individual> posAsNeg, Set<Individual> negAsPos, Set<Individual> negAsNeg) { + // usually core methods should not depend on methods outside of the core package (except utilities) + // in this case, this is just a convenience constructor + super(description, new ScoreTwoValued(posAsPos, posAsNeg, negAsPos, negAsNeg)); + score2 = (ScorePosNeg) score; + } + + /** + * @see org.dllearner.learningproblems.ScorePosNeg#getAccuracy() + * @return Accuracy of the description. + */ + public double getAccuracy() { + return score2.getAccuracy(); + } + + /** + * Gets the score of this description. This can be used to get + * further statistical values. + * @see org.dllearner.learningproblems.ScorePosNeg + * @return The score object associated with this evaluated description. + */ + public ScorePosNeg getScore() { + return score2; + } + + /** + * @see org.dllearner.learningproblems.ScorePosNeg#getCoveredNegatives() + * @return Negative examples covered by the description. + */ + public Set<Individual> getCoveredNegatives() { + return score2.getCoveredNegatives(); + } + + /** + * @see org.dllearner.learningproblems.ScorePosNeg#getCoveredPositives() + * @return Positive examples covered by the description. + */ + public Set<Individual> getCoveredPositives() { + return score2.getCoveredPositives(); + } + + /** + * @see org.dllearner.learningproblems.ScorePosNeg#getNotCoveredNegatives() + * @return Negative examples not covered by the description. + */ + public Set<Individual> getNotCoveredNegatives() { + return score2.getNotCoveredNegatives(); + } + + /** + * @see org.dllearner.learningproblems.ScorePosNeg#getNotCoveredPositives() + * @return Positive examples not covered by the description. + */ + public Set<Individual> getNotCoveredPositives() { + return score2.getNotCoveredPositives(); + } + + /** + * This convenience method can be used to store and exchange evaluated + * descriptions by transforming them to a JSON string. + * @return A JSON representation of an evaluated description. + */ + @Override + public String asJSON() { + JSONObject object = new JSONObject(); + try { + object.put("descriptionManchesterSyntax", description.toManchesterSyntaxString(null, null)); + OWLDescription d = OWLAPIDescriptionConvertVisitor.getOWLDescription(description); + object.put("descriptionOWLXML", OWLAPIRenderers.toOWLXMLSyntax(d)); + object.put("descriptionKBSyntax", description.toKBSyntaxString()); + object.put("accuracy", score2.getAccuracy()); + object.put("coveredPositives", getJSONArray(score2.getCoveredPositives())); + object.put("coveredNegatives", getJSONArray(score2.getCoveredNegatives())); + object.put("notCoveredPositives", getJSONArray(score2.getNotCoveredPositives())); + object.put("notCoveredNegatives", getJSONArray(score2.getNotCoveredNegatives())); + return object.toString(3); + } catch (JSONException e) { + e.printStackTrace(); + return null; + } + } + + @Override + public String toString() { + return description.toString() + "(accuracy: " + getAccuracy() + ")"; + } + + // 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) { + JSONArray j = new JSONArray(); + for(Individual i : individuals) { + j.put(i.getName()); + } + return j; + } + +} Property changes on: trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -25,17 +25,16 @@ import org.apache.log4j.Logger; import org.dllearner.algorithms.gp.GPUtilities; import org.dllearner.algorithms.gp.Program; -import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.RandomGuesserConfigurator; import org.dllearner.core.options.ConfigEntry; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.IntegerConfigOption; import org.dllearner.core.options.InvalidConfigOptionValueException; import org.dllearner.core.owl.Description; +import org.dllearner.learningproblems.ScorePosNeg; public class RandomGuesser extends LearningAlgorithm { @@ -46,7 +45,7 @@ } private Description bestDefinition = null; - private Score bestScore; + private ScorePosNeg bestScore; private double bestFitness = Double.NEGATIVE_INFINITY; private int numberOfTrees; @@ -121,7 +120,7 @@ } // @Override - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { return bestScore; } @@ -131,8 +130,8 @@ } @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescription(bestDefinition,bestScore); + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { + return new EvaluatedDescriptionPosNeg(bestDefinition,bestScore); } @Override Modified: trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -23,10 +23,8 @@ import java.util.List; import java.util.Set; -import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.SimpleSuggestionLearningAlgorithmConfigurator; import org.dllearner.core.options.ConfigEntry; import org.dllearner.core.owl.Description; @@ -34,6 +32,7 @@ import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Thing; +import org.dllearner.learningproblems.ScorePosNeg; /** * Algorithm for getting "simple" suggestions, e.g. it tests some of the most likely candidates on whether @@ -51,7 +50,7 @@ } // private boolean stop = false; - private Score solutionScore; + private ScorePosNeg solutionScore; private Description bestSollution; private Set<Description> simpleSuggestions; @@ -66,8 +65,8 @@ } @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescription(bestSollution, solutionScore); + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { + return new EvaluatedDescriptionPosNeg(bestSollution, solutionScore); } public static String getName() { @@ -95,7 +94,7 @@ } // @Override - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { return solutionScore; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -19,8 +19,8 @@ */ package org.dllearner.algorithms.celoe; +import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.Configurator; @@ -54,7 +54,7 @@ * @see org.dllearner.core.LearningAlgorithm#getCurrentlyBestEvaluatedDescription() */ @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { // TODO Auto-generated method stub return null; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -26,17 +26,18 @@ import java.util.TreeSet; import org.apache.log4j.Logger; +import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.Configurator; import org.dllearner.core.configurators.ELLearningAlgorithmConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.ELDown2; import org.dllearner.utilities.owl.EvaluatedDescriptionSet; @@ -168,8 +169,8 @@ // at least as high accuracy - if not we can save the reasoner calls // for fully computing the evaluated description if(bestEvaluatedDescriptions.size() == 0 || bestEvaluatedDescriptions.getWorst().getCoveredNegatives().size() >= node.getCoveredNegatives()) { - Score score = learningProblem.computeScore(description); - EvaluatedDescription ed = new EvaluatedDescription(description, score); + ScorePosNeg score = (ScorePosNeg) learningProblem.computeScore(description); + EvaluatedDescriptionPosNeg ed = new EvaluatedDescriptionPosNeg(description, score); bestEvaluatedDescriptions.add(ed); } @@ -216,7 +217,7 @@ } @Override - public SortedSet<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public SortedSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { return bestEvaluatedDescriptions.getSet(); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -29,12 +29,11 @@ import java.util.Set; import java.util.Map.Entry; +import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.algorithms.hybridgp.Psi; -import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.GPConfigurator; import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.ConfigEntry; @@ -46,6 +45,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.utilities.Helper; /** @@ -126,7 +126,7 @@ private long startTime; - private Score bestScore; + private ScorePosNeg bestScore; private Description bestConcept; // private GeneticRefinementOperator psi; @@ -532,19 +532,19 @@ // nachschauen, ob ev. noch bessere Konzepte im Psi-Cache sind boolean betterValueFoundInPsiCache = false; - double bestValue = bestScore.getScore(); + double bestValue = bestScore.getScoreValue(); if(refinementProbability > 0) { // das Problem ist hier, dass die gecachte Score nicht unbedingt // der echten Score entsprechen muss, d.h. hier muss die // Konzeptlänge mit einberechnet werden => deswegen werden // neue Score-Objekte generiert - Set<Entry<Description,Score>> entrySet = psi.evalCache.entrySet(); - for(Entry<Description,Score> entry : entrySet) { - Score tmpScore = entry.getValue(); + Set<Entry<Description,ScorePosNeg>> entrySet = psi.evalCache.entrySet(); + for(Entry<Description,ScorePosNeg> entry : entrySet) { + ScorePosNeg tmpScore = entry.getValue(); Description c = entry.getKey(); tmpScore = tmpScore.getModifiedLengthScore(c.getLength()); - double tmpScoreValue = tmpScore.getScore(); + double tmpScoreValue = tmpScore.getScoreValue(); if(tmpScoreValue>bestValue) { bestValue = tmpScoreValue; betterValueFoundInPsiCache = true; @@ -947,7 +947,7 @@ } // @Override - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { return bestScore; } @@ -957,9 +957,9 @@ } @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { // return fittestIndividual.getTree(); - return new EvaluatedDescription(bestConcept,bestScore); + return new EvaluatedDescriptionPosNeg(bestConcept,bestScore); } @Override Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -10,7 +10,6 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningMethodUnsupportedException; -import org.dllearner.core.Score; import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Nothing; @@ -24,6 +23,7 @@ import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.PosNegDefinitionLPStrict; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.learningproblems.ScoreThreeValued; import org.dllearner.reasoning.FastRetrieval; import org.dllearner.reasoning.ReasonerType; @@ -54,7 +54,7 @@ private static Random rand = new Random(); - private static Score calculateFitness(LearningProblem learningProblem, Description hypothesis) { + private static ScorePosNeg calculateFitness(LearningProblem learningProblem, Description hypothesis) { return calculateFitness(learningProblem, hypothesis, null); } @@ -63,7 +63,7 @@ // (macht aber nicht so viel Sinn, da man das bei richtigen Reasoning-Algorithmen // ohnehin mit einer Erweiterung der Wissensbasis um die Inklusion Target SUBSETOF ReturnType // erschlagen kann) - private static Score calculateFitness(LearningProblem learningProblem, Description hypothesis, Description adc) { + private static ScorePosNeg calculateFitness(LearningProblem learningProblem, Description hypothesis, Description adc) { Description extendedHypothesis; // return type temporarily disabled @@ -87,13 +87,13 @@ // } else extendedHypothesis = hypothesis; - Score score; + ScorePosNeg score; if(adc != null) // TODO: ADC-Support // score = learningProblem.computeScore(extendedHypothesis, adc); throw new RuntimeException("ADC not supported"); else - score = learningProblem.computeScore(extendedHypothesis); + score = (ScorePosNeg) learningProblem.computeScore(extendedHypothesis); // System.out.println(hypothesis); // System.out.println(score.getScore()); @@ -143,18 +143,18 @@ if(Math.random()<0.5) { Description mainTree = mutation(learningProblem, rs, p.getTree(),true); Description adc = p.getAdc(); - Score score = calculateFitness(learningProblem,mainTree,adc); + ScorePosNeg score = calculateFitness(learningProblem,mainTree,adc); return new Program(score, mainTree, adc); } else { Description mainTree = p.getTree(); Description adc = mutation(learningProblem, rs, p.getAdc(),false); - Score score = calculateFitness(learningProblem,mainTree,adc); + ScorePosNeg score = calculateFitness(learningProblem,mainTree,adc); return new Program(score, mainTree, adc); } } else { Description tree = mutation(learningProblem, rs,p.getTree(),false); - Score score = calculateFitness(learningProblem, tree); + ScorePosNeg score = calculateFitness(learningProblem, tree); return new Program(score, tree); } } @@ -340,7 +340,7 @@ // double bestScore = score.getScore()+Config.accuracyPenalty/2; double bestScore = 0; Map<Integer,List<String>> bestNeighbours = new TreeMap<Integer,List<String>>(); - Score tmpScore; + ScorePosNeg tmpScore; SortedSetTuple<String> tmp, tmp2; // FlatABox abox = ((FastRetrievalReasoner)learningProblem.getReasoner().getFastRetrieval().getAbox(); // FlatABox abox = Main.getFlatAbox(); @@ -363,16 +363,16 @@ tmp2 = FastRetrieval.calculateDisjunctionSets(stringTuple, tmp); tmpScore = getScore(node.getLength()+2, learningProblem, rs, Helper.getIndividualSet(tmp2.getPosSet()),Helper.getIndividualSet(tmp2.getNegSet())); - if(tmpScore.getScore()==bestScore) + if(tmpScore.getScoreValue()==bestScore) bestNeighbours = updateMap(bestNeighbours,1,concept,false); - else if(tmpScore.getScore()>bestScore) + else if(tmpScore.getScoreValue()>bestScore) bestNeighbours = updateMap(bestNeighbours,1,concept,true); tmp2 = FastRetrieval.calculateConjunctionSets(stringTuple, tmp); tmpScore = getScore(node.getLength()+2,learningProblem, rs, Helper.getIndividualSet(tmp2.getPosSet()),Helper.getIndividualSet(tmp2.getNegSet())); - if(tmpScore.getScore()==bestScore) + if(tmpScore.getScoreValue()==bestScore) bestNeighbours = updateMap(bestNeighbours,2,concept,false); - else if(tmpScore.getScore()>bestScore) + else if(tmpScore.getScoreValue()>bestScore) bestNeighbours = updateMap(bestNeighbours,2,concept,true); } @@ -380,16 +380,16 @@ for(String role : abox.roles) { tmp = FastRetrieval.calculateAllSet(abox,role,stringTuple); tmpScore = getScore(node.getLength()+2,learningProblem, rs, Helper.getIndividualSet(tmp.getPosSet()),Helper.getIndividualSet(tmp.getNegSet())); - if(tmpScore.getScore()==bestScore) + if(tmpScore.getScoreValue()==bestScore) bestNeighbours = updateMap(bestNeighbours,3,role,false); - else if(tmpScore.getScore()>bestScore) + else if(tmpScore.getScoreValue()>bestScore) bestNeighbours = updateMap(bestNeighbours,3,role,true); tmp = FastRetrieval.calculateExistsSet(abox,role,stringTuple); tmpScore = getScore(node.getLength()+2,learningProblem, rs, Helper.getIndividualSet(tmp.getPosSet()),Helper.getIndividualSet(tmp.getNegSet())); - if(tmpScore.getScore()==bestScore) + if(tmpScore.getScoreValue()==bestScore) bestNeighbours = updateMap(bestNeighbours,4,role,false); - else if(tmpScore.getScore()>bestScore) + else if(tmpScore.getScoreValue()>bestScore) bestNeighbours = updateMap(bestNeighbours,4,role,true); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/Program.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/Program.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/Program.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -20,8 +20,8 @@ package org.dllearner.algorithms.gp; -import org.dllearner.core.Score; import org.dllearner.core.owl.Description; +import org.dllearner.learningproblems.ScorePosNeg; /** * This class represents a program, i.e. an individual. @@ -39,7 +39,7 @@ private Description adc; - private Score score; + private ScorePosNeg score; // private Score scoreAdc; @@ -51,11 +51,11 @@ * Create a new program. * */ - public Program(Score score, Description hypothesis) { + public Program(ScorePosNeg score, Description hypothesis) { this(score, hypothesis, null); } - public Program(Score score, Description hypothesis, Description adc) { + public Program(ScorePosNeg score, Description hypothesis, Description adc) { // this.learningProblem = learningProblem; this.score = score; this.hypothesis = hypothesis; @@ -64,7 +64,7 @@ // Implementierung falsch !! // fitness = score.getScore() - hypothesis.getLength() * Config.percentPerLengthUnit; // => in getScore() ist jetzt schon der length penalty integriert - fitness = score.getScore(); + fitness = score.getScoreValue(); // fitnessEvaluations++; // System.out.println("new program: " + hypothesis); @@ -128,7 +128,7 @@ return hypothesis; } - public Score getScore() { + public ScorePosNeg getScore() { return score; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -7,9 +7,9 @@ import org.dllearner.algorithms.gp.Program; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.owl.Description; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.PsiDown; import org.dllearner.refinementoperators.PsiUp; import org.dllearner.utilities.owl.ConceptComparator; @@ -26,7 +26,7 @@ // Cache, damit keine Konzepte doppelt ausgewertet werden ConceptComparator conceptComparator = new ConceptComparator(); - public SortedMap<Description,Score> evalCache = new TreeMap<Description,Score>(conceptComparator); + public SortedMap<Description,ScorePosNeg> evalCache = new TreeMap<Description,ScorePosNeg>(conceptComparator); // Cache, damit PsiDown bzw. PsiUp nicht mehrfach für gleiches Konzept // aufgerufen werden @@ -190,7 +190,7 @@ Description conceptModForCache = ConceptTransformation.applyEquivalenceRules(conceptMod); ConceptTransformation.transformToOrderedForm(conceptModForCache, conceptComparator); - Score score = program.getScore(); + ScorePosNeg score = program.getScore(); // Eval-Cache füllen evalCache.put(conceptModForCache, score); @@ -214,11 +214,11 @@ // versuchen Reasoner-Cache zu treffen // Problem: Score hängt von Konzeptlänge ab!! => muss hier explizit // reingerechnet werden - Score newScore = evalCache.get(newConceptMod); + ScorePosNeg newScore = evalCache.get(newConceptMod); if(newScore==null) { psiReasoningStartTime = System.nanoTime(); - newScore = learningProblem.computeScore(newConcept); + newScore = (ScorePosNeg) learningProblem.computeScore(newConcept); psiReasoningTimeNs += System.nanoTime() - psiReasoningStartTime; evalCache.put(newConceptMod, newScore); Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -29,12 +29,11 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; +import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.CommonConfigMappings; @@ -52,6 +51,7 @@ import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.learningproblems.PosOnlyLP; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.reasoning.ReasonerType; import org.dllearner.refinementoperators.RhoDRDown; import org.dllearner.utilities.Files; @@ -436,7 +436,7 @@ } // @Override - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { return algorithm.getSolutionScore(); } @@ -451,12 +451,12 @@ } @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescription(algorithm.getBestSolution(),algorithm.getSolutionScore()); + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { + return new EvaluatedDescriptionPosNeg(algorithm.getBestSolution(),algorithm.getSolutionScore()); } @Override - public synchronized SortedSet<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public synchronized SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { return algorithm.getCurrentlyBestEvaluatedDescriptions(); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -33,10 +33,9 @@ import java.util.concurrent.ConcurrentSkipListSet; import org.apache.log4j.Logger; -import org.dllearner.core.EvaluatedDescription; +import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; @@ -45,6 +44,7 @@ import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.RefinementOperator; import org.dllearner.refinementoperators.RhoDRDown; import org.dllearner.utilities.Files; @@ -52,7 +52,7 @@ import org.dllearner.utilities.JamonMonitorLogger; import org.dllearner.utilities.owl.ConceptComparator; import org.dllearner.utilities.owl.ConceptTransformation; -import org.dllearner.utilities.owl.EvaluatedDescriptionComparator; +import org.dllearner.utilities.owl.EvaluatedDescriptionPosNegComparator; import com.jamonapi.Monitor; @@ -184,7 +184,7 @@ // comparator used to create ordered sets of concepts private ConceptComparator conceptComparator = new ConceptComparator(); // comparator for evaluated descriptions - private EvaluatedDescriptionComparator edComparator = new EvaluatedDescriptionComparator(); + private EvaluatedDescriptionPosNegComparator edComparator = new EvaluatedDescriptionPosNegComparator(); // utility variables private DecimalFormat df = new DecimalFormat(); @@ -1255,13 +1255,13 @@ return best; } - public SortedSet<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { Iterator<ExampleBasedNode> it = candidatesStable.descendingIterator(); int count = 0; - SortedSet<EvaluatedDescription> cbd = new TreeSet<EvaluatedDescription>(edComparator); + SortedSet<EvaluatedDescriptionPosNeg> cbd = new TreeSet<EvaluatedDescriptionPosNeg>(edComparator); while(it.hasNext()) { ExampleBasedNode eb = it.next(); - cbd.add(new EvaluatedDescription(eb.getConcept(), getScore(eb.getConcept()))); + cbd.add(new EvaluatedDescriptionPosNeg(eb.getConcept(), getScore(eb.getConcept()))); // return a maximum of 200 elements (we need a maximum, because the // candidate set can be very large) if (count > 200) @@ -1304,18 +1304,18 @@ } - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { if (posOnly) return posOnlyLearningProblem.computeScore(getBestSolution()); else - return learningProblem.computeScore(getBestSolution()); + return (ScorePosNeg) learningProblem.computeScore(getBestSolution()); } - private Score getScore(Description d) { + private ScorePosNeg getScore(Description d) { if (posOnly) return posOnlyLearningProblem.computeScore(d); else - return learningProblem.computeScore(d); + return (ScorePosNeg) learningProblem.computeScore(d); } public ExampleBasedNode getStartNode() { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -14,11 +14,10 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; -import org.dllearner.core.EvaluatedDescription; +import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.configurators.ROLearnerConfigurator; import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.CommonConfigMappings; @@ -36,12 +35,13 @@ import org.dllearner.core.owl.Union; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.refinementoperators.RhoDown; 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.EvaluatedDescriptionComparator; +import org.dllearner.utilities.owl.EvaluatedDescriptionPosNegComparator; public class ROLearner extends LearningAlgorithm { @@ -107,7 +107,7 @@ private NodeComparatorStable nodeComparatorStable = new NodeComparatorStable(); private ConceptComparator conceptComparator = new ConceptComparator(); // comparator for evaluated descriptions - private EvaluatedDescriptionComparator edComparator = new EvaluatedDescriptionComparator(); + private EvaluatedDescriptionPosNegComparator edComparator = new EvaluatedDescriptionPosNegComparator(); DecimalFormat df = new DecimalFormat(); private PosNegLP learningProblem; @@ -1054,17 +1054,17 @@ } @Override - public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { - return new EvaluatedDescription(candidatesStable.last().getConcept(), getSolutionScore()); + public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription() { + return new EvaluatedDescriptionPosNeg(candidatesStable.last().getConcept(), getSolutionScore()); } @Override - public SortedSet<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { int count = 0; SortedSet<Node> rev = candidatesStable.descendingSet(); - SortedSet<EvaluatedDescription> cbd = new TreeSet<EvaluatedDescription>(edComparator); + SortedSet<EvaluatedDescriptionPosNeg> cbd = new TreeSet<EvaluatedDescriptionPosNeg>(edComparator); for(Node eb : rev) { - cbd.add(new EvaluatedDescription(eb.getConcept(), getSolutionScore(eb.getConcept()))); + cbd.add(new EvaluatedDescriptionPosNeg(eb.getConcept(), getSolutionScore(eb.getConcept()))); // return a maximum of 200 elements (we need a maximum, because the // candidate set can be very large) if(count > 200) @@ -1100,19 +1100,19 @@ } // @Override - public Score getSolutionScore() { + public ScorePosNeg getSolutionScore() { if(posOnly) return posOnlyLearningProblem.computeScore(getCurrentlyBestDescription()); else - return learningProblem.computeScore(getCurrentlyBestDescription()); + return (ScorePosNeg) learningProblem.computeScore(getCurrentlyBestDescription()); } - public Score getSolutionScore(Description d) { + public ScorePosNeg getSolutionScore(Description d) { if(posOnly) return posOnlyLearningProblem.computeScore(d); else - return learningProblem.computeScore(d); + return (ScorePosNeg) learningProblem.computeScore(d); } @Override Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -57,7 +57,6 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.OntologyFormat; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.Score; import org.dllearner.core.options.BooleanConfigOption; import org.dllearner.core.options.ConfigEntry; import org.dllearner.core.options.ConfigOption; @@ -77,6 +76,7 @@ import org.dllearner.learningproblems.PosNegDefinitionLP; import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.parser.ConfParser; import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; @@ -840,7 +840,7 @@ logger.info("retrieval result (" + result.size() + "): " + result); - Score score = lp.computeScore(concept); + ScorePosNeg score = (ScorePosNeg) lp.computeScore(concept); logger.info(score); } Modified: trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/core/EvaluatedDescription.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007-2008, Jens Lehmann + * Copyright (C) 2007-2009, Jens Lehmann * * This file is part of DL-Learner. * @@ -19,34 +19,25 @@ */ package org.dllearner.core; -import java.util.Set; - import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; import org.dllearner.kb.sparql.SparqlQueryDescriptionConvertVisitor; -import org.dllearner.learningproblems.ScoreTwoValued; import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; import org.dllearner.utilities.owl.OWLAPIRenderers; -import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.semanticweb.owl.model.OWLDescription; /** - * This represents a class description, which has been - * evaluated by the learning algorithm, i.e. it has been checked - * which examples it covers. It can be used as return value for - * learning algorithms to make it easier for applications to - * assess how good an offered class description is and how it - * classifies particular examples. + * An evaluated description is a description and its score (with some + * convenience method and serialisation formats). * * @author Jens Lehmann * */ public class EvaluatedDescription { - private Description description; - private Score score; + protected Description description; + protected Score score; /** * Constructs an evaluated description using its score. @@ -59,21 +50,6 @@ } /** - * Constructs an evaluated description using example coverage. - * @param description The description, which was evaluated. - * @param posAsPos Positive examples classified as positive by (i.e. instance of) the description. - * @param posAsNeg Positive examples classified as negative by (i.e. not instance of) the description. - * @param negAsPos Negative examples classified as positive by (i.e. instance of) the description. - * @param negAsNeg Negative examples classified as negative by (i.e. not instance of) the description. - */ - public EvaluatedDescription(Description description, Set<Individual> posAsPos, Set<Individual> posAsNeg, Set<Individual> negAsPos, Set<Individual> negAsNeg) { - this.description = description; - // usually core methods should not depend on methods outside of the core package (except utilities) - // in this case, this is just a convenience constructor - score = new ScoreTwoValued(posAsPos, posAsNeg, negAsPos, negAsNeg); - } - - /** * Gets the description, which was evaluated. * @return The underlying description. */ @@ -107,56 +83,14 @@ } /** - * @see org.dllearner.core.Score#getAccuracy() - * @return Accuracy of the description. + * @see org.dllearner.core.Score#getScoreValue() + * @return Value in this score system. */ - public double getAccuracy() { - return score.getAccuracy(); + public double getScoreValue() { + return score.getScoreValue(); } /** - * Gets the score of this description. This can be used to get - * further statistical values. - * @see org.dllearner.core.Score - * @return The score object associated with this evaluated description. - */ - public Score getScore() { - return score; - } - - /** - * @see org.dllearner.core.Score#getCoveredNegatives() - * @return Negative examples covered by the description. - */ - public Set<Individual> getCoveredNegatives() { - return score.getCoveredNegatives(); - } - - /** - * @see org.dllearner.core.Score#getCoveredPositives() - * @return Positive examples covered by the description. - */ - public Set<Individual> getCoveredPositives() { - return score.getCoveredPositives(); - } - - /** - * @see org.dllearner.core.Score#getNotCoveredNegatives() - * @return Negative examples not covered by the description. - */ - public Set<Individual> getNotCoveredNegatives() { - return score.getNotCoveredNegatives(); - } - - /** - * @see org.dllearner.core.Score#getNotCoveredPositives() - * @return Positive examples not covered by the description. - */ - public Set<Individual> getNotCoveredPositives() { - return score.getNotCoveredPositives(); - } - - /** * Returns a SPARQL query to get instances of this description * from a SPARQL endpoint. Of course, results may be incomplete, * because no inference is done. The SPARQL query is a straightforward @@ -169,7 +103,7 @@ */ public String getSparqlQuery(int limit) { return SparqlQueryDescriptionConvertVisitor.getSparqlQuery(description, limit); - } + } /** * This convenience method can be used to store and exchange evaluated @@ -183,32 +117,12 @@ OWLDescription d = OWLAPIDescriptionConvertVisitor.getOWLDescription(description); object.put("descriptionOWLXML", OWLAPIRenderers.toOWLXMLSyntax(d)); object.put("descriptionKBSyntax", description.toKBSyntaxString()); - object.put("accuracy", score.getAccuracy()); - object.put("coveredPositives", getJSONArray(score.getCoveredPositives())); - object.put("coveredNegatives", getJSONArray(score.getCoveredNegatives())); - object.put("notCoveredPositives", getJSONArray(score.getNotCoveredPositives())); - object.put("notCoveredNegatives", getJSONArray(score.getNotCoveredNegatives())); + object.put("scoreValue", score.getScoreValue()); return object.toString(3); } catch (JSONException e) { e.printStackTrace(); return null; } - } - - @Override - public String toString() { - return description.toString() + "(accuracy: " + getAccuracy() + ")"; - } - - // 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) { - JSONArray j = new JSONArray(); - for(Individual i : individuals) { - j.put(i.getName()); - } - return j; - } + } } Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -207,7 +207,7 @@ * first. * @return Best class descriptions found so far. */ - public SortedSet<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public SortedSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { TreeSet<EvaluatedDescription> ds = new TreeSet<EvaluatedDescription>(); ds.add(getCurrentlyBestEvaluatedDescription()); return ds; @@ -231,14 +231,15 @@ * * @return A list of currently best class descriptions. */ - public synchronized List<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions) { - SortedSet<EvaluatedDescription> currentlyBest = getCurrentlyBestEvaluatedDescriptions(); + public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions) { + SortedSet<? extends EvaluatedDescription> currentlyBest = getCurrentlyBestEvaluatedDescriptions(); List<EvaluatedDescription> returnList = new LinkedList<EvaluatedDescription>(); for(EvaluatedDescription ed : currentlyBest) { // 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) { + if(ed.getScoreValue() < accuracyThreshold) { return returnList; } @@ -270,7 +271,7 @@ * @param nrOfDescriptions Maximum number of descriptions returned. * @return Return value is getCurrentlyBestDescriptions(nrOfDescriptions, 0.0, false). */ - public synchronized List<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions) { + public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions) { return getCurrentlyBestEvaluatedDescriptions(nrOfDescriptions, 0.0, false); } @@ -279,7 +280,7 @@ * @param accuracyThreshold Only return solutions with this accuracy or higher. * @return Return value is getCurrentlyBestDescriptions(Integer.MAX_VALUE, accuracyThreshold, false). */ - public synchronized List<EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(double accuracyThreshold) { + public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(double accuracyThreshold) { return getCurrentlyBestEvaluatedDescriptions(Integer.MAX_VALUE, accuracyThreshold, false); } Modified: trunk/src/dl-learner/org/dllearner/core/LearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -20,6 +20,7 @@ package org.dllearner.core; import org.dllearner.core.owl.Description; +import org.dllearner.learningproblems.ScorePosNeg; /** * Base class for all learning problems. Modified: trunk/src/dl-learner/org/dllearner/core/Score.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007-2008, Jens Lehmann + * Copyright (C) 2007-2009, Jens Lehmann * * This file is part of DL-Learner. * @@ -17,48 +17,28 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ - package org.dllearner.core; -import java.util.Set; - -import org.dllearner.core.owl.Individual; - /** * The score class is used to store how well a class description did - * on a learning problem. + * on a learning problem. Depending on the learning problem at hand, + * different criteria can be used. (Similar learning problems probably + * score class descriptions/hypothesis in a similar way.) * - * TODO: If possible this class should be abstracted further. The current - * implementation requires positive and negative examples, i.e. does not - * allow arbitrary learning problems. - * * @author Jens Lehmann * */ public abstract class Score { - - // accuracy - public abstract double getAccuracy(); - - // example coverage - public abstract Set<Individual> getCoveredPositives(); - public abstract Set<Individual> getCoveredNegatives(); - public abstract Set<Individual> getNotCoveredPositives(); - public abstract Set<Individual> getNotCoveredNegatives(); - - // older methods (not frequently used anymore) - public abstract double getScore(); + /** - * The score of a concept depends on how good it classifies the - * examples of a learning problem and the length of the concept - * itself. If a given concept is known to have equal classification - * properties than the concept this score object is based on, then - * this method can be used to calculate its score value by using the - * length of this concept as parameter. + * This method returns a value, which indicates how well a + * class description solves a learning problem. Different implementations + * of scoring systems can implement this differently. Higher values + * are better and it is recommended to assign a score value in + * the closed interval from 0 to 1 if possible. * - * @param newLength Length of the concept. - * @return Score. + * @return A value indicating the quality (of a class description). */ - public abstract Score getModifiedLengthScore(int newLength); + public abstract double getScoreValue(); } Modified: trunk/src/dl-learner/org/dllearner/gui/RunPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2009-02-09 12:39:09 UTC (rev 1590) +++ trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2009-02-09 16:41:44 UTC (rev 1591) @@ -48,6 +48,7 @@ import javax.swing.*; +import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.core.EvaluatedDescription; import org.dllearner.learningproblems.PosNegDefinitionLP; @@ -377,12 +378,12 @@ gbc.weighty = wy; } - private String getSolutionString(List<EvaluatedDescription> solutions) { + private String getSolutionString(List<? extends EvaluatedDescription> solutions) { String baseURI = config.getReasoner().getBaseURI(); Map<String,String> prefixes = conf... [truncated message content] |
From: <jen...@us...> - 2009-02-09 12:39:13
|
Revision: 1590 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1590&view=rev Author: jenslehmann Date: 2009-02-09 12:39:09 +0000 (Mon, 09 Feb 2009) Log Message: ----------- continued manual Modified Paths: -------------- trunk/doc/manual/manual.tex Added Paths: ----------- trunk/doc/manual/bibliography.bib Property Changed: ---------------- trunk/doc/manual/ Property changes on: trunk/doc/manual ___________________________________________________________________ Added: svn:ignore + manual.aux manual.toc manual.log manual.out manual.pdf manual.blg manual.bbl Added: trunk/doc/manual/bibliography.bib =================================================================== --- trunk/doc/manual/bibliography.bib (rev 0) +++ trunk/doc/manual/bibliography.bib 2009-02-09 12:39:09 UTC (rev 1590) @@ -0,0 +1,7 @@ +@proceedings{dlhb, + title = {The Description Logic Handbook: Theory, Implementation, and Applications}, + year = {2007}, + editor = {Franz Baader and Diego Calvanese and Deborah L. McGuinness and Daniele Nardi and Peter F. Patel-Schneider}, + publisher = {Cambridge University Press}, + isbn = {0-521-78176-0}, +} Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-02-09 09:59:48 UTC (rev 1589) +++ trunk/doc/manual/manual.tex 2009-02-09 12:39:09 UTC (rev 1590) @@ -6,30 +6,72 @@ \usepackage{amsmath,amssymb} \usepackage{verbatim} \usepackage{color,graphicx} -\usepackage{hyperref} +% \usepackage{hyperref} +% define common URLs +\usepackage{url} +\urlstyle{tt} +\urldef{\wwwc}{\url}{http://www.w3.org} +\urldef{\owl}{\url}{http://www.w3.org/2004/OWL/} +\urldef{\owlce}{\url}{http://www.w3.org/TR/2008/WD-owl2-syntax-20081202/#Class_Expressions} +\urldef{\carc}{\url}{http://dl-learner.org/wiki/Carcinogenesis} + \title{DL-Learner Manual [Draft]} \author{Jens Lehmann} \pagestyle{scrheadings} \automark{section} +\newcommand{\todo}[1]{\textbf{[ToDo: #1]}} + \begin{document} \maketitle \begin{abstract} -The DL-Learner software learns concepts in Description Logics (DLs) from user-provided examples. Equivalently, it can be used to learn classes in OWL ontologies from selected objects. It extends Inductive Logic Programming to Descriptions Logics and the Semantic Web. The goal of DL-Learner is to provide a DL/OWL based machine learning tool to solve supervised learnings tasks and support knowledge engineers in constructing knowledge and learning about the data they created. +DL-Learner is a machine learning framework for OWL and description logics. It includes several learning algorithms and is easy to extend. DL-Learner widens the scope of Inductive Logic Programming to Descriptions Logics and the Semantic Web. This manual provides the entry point to using DL-Learner and explains its basic concepts. \end{abstract} \tableofcontents +\clearpage + \section{What is DL-Learner?} +DL-Learner is an open source framework for (supervised) machine learning in OWL and Description Logics (from instance data). We further detail what this means: + +\emph{OWL} stands for ``Web Ontology Language''. In 2004, it became the W3C\footnote{\wwwc} standard ontology language\footnote{\owl}. As such it is one of the fundamental building blocks in the Semantic Web and has been used in several scenarios on and off the web. OWL is based on \emph{description logics} (DLs), which are a family of knowledge representation languages. We refer to \cite{dlhb} for an introduction to description logics. Since OWL formally builds on description logics, we can apply DL-Learner to knowledge bases in OWL or a variety of description languages. + +\emph{Machine Learning} is a subfield of Artificial Intelligence, which focuses on detecting patterns, rules, models etc.~in data. Often, this involves a training process on the input data. In \emph{Supervised} learning, this data is labelled, i.e.~we are given a number of input-output mappings. Those mappings are also called \emph{examples}. If the output is binary, then we distinguish positive and negative examples. DL-Learner as a framework is not restricted to supervised learning, but all algorithms currently build into it, are supervised. + +In the most common scenario we consider, supervised learning in OWL/DLs, means that we have a background knowledge base in OWL/DLs. Additionally, we are given positive and negative examples. Each example is an individual in our knowledge base. The goal is to find an OWL \emph{class expression}\footnote{\owlce} such that all/many of the positive examples are \emph{instances} of this expression and none/few of the negative examples are instances of it. The primary purpose of learning is to find a class expression, which can classify unseen individuals (i.e.~not belonging to the examples) correctly. It is also important that the obtained class expression is easy to understand for a domain expert. We call these criteria \emph{accuracy} and \emph{readability}. + +As an example, consider the problem to find out whether a chemical compound can cause cancer\footnote{see \carc{} for a more detailed description}. In this case, the background knowledge contains information about chemical compounds in general and certain compounds we are interested in. The positive examples are those compounds causing cancer, whereas the negative examples are those compounds not causing cancer. The prediction for the examples is likely to have been obtained from experiments and long-term research trials in this case. Of course, all examples have to be present in the considered background knowledge. A learning algorithm can now derive a class expression from examples and background knowledge, e.g.~this class expression in natural language could be ``chemical compounds containing a phosphorus atom''. (Of course, in practice the expression will be more complex to obtain a reasonable accuracy.) Using this class expression, we can no classify unseen chemical compounds. + \section{Getting Started} \section{DL-Learner Architecture} +DL-Learner consists of core functionality, which provides Machine Learning algorithms for solving the learning problem, support for different knowledge base formats, an OWL library, and reasoner interfaces. There are several interfaces for accessing this functionality, a couple of tools which use the DL-Learner algorithms, and a set of convenience scripts. The general structure is illustrated in the following \ref{fig:structure}. + +\begin{figure} + \includegraphics[width=\textwidth]{../../resources/structure_print} + \caption{Overall structure of the DL-Learner software.} + \label{fig:structure} +\end{figure} + +To be flexible in integrating new learning algorithms, new kinds of learning problems, new knowledge bases, and new reasoner implementations, DL-Learner uses a component based model. Adding a component is as easy as subclassing the appropriate class and adding the name of the new class to the “components.ini” file (more on that in Section \ref{sec:developing}). + +In DL-Learner, there are four types of components (knowledge source, reasoning service, learning problem, learning algorithm). There are several components of each type and each component can have its own configuration options as illustrated in Figure \ref{fig:components}. + +\begin{figure} + \includegraphics[width=\textwidth]{../../resources/components_print} + \caption{The architecture of DL-Learner is based on four component types, which can each have their own configuration options. DL-Learner uses a component manager to organise all components.} + \label{fig:components} +\end{figure} + + + \section{DL-Learner Components} \subsection{Knowledge Sources} @@ -43,6 +85,25 @@ \section{DL-Learner Interfaces} \section{Extending DL-Learner} +\label{sec:developing} +\todo{example code of a simple component} + +Each component can specify its own configuration options. Currently, the following configuration option types exist (new ones can be implemented if necessary): + +\begin{itemize} + \item boolean + \item string (a set of allowed strings can be specified) + \item int (min and max value can be specifified) + \item double (min and max value can be specifified) + \item set of strings + \item list of string tuples +\end{itemize} + +Although, we loose the ability to use arbitrary argument types in components, this gives us the possibility to build very flexible user interfaces. Whenever, a new component or a new configuration option for a component is added, the current user interfaces (GUI, web service, commandline) will automatically support it without any need for code changes. + +\bibliographystyle{apalike} +\bibliography{bibliography} + \end{document} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-09 09:59:54
|
Revision: 1589 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1589&view=rev Author: jenslehmann Date: 2009-02-09 09:59:48 +0000 (Mon, 09 Feb 2009) Log Message: ----------- created PDF/printer friendly slightly modified versions of images Modified Paths: -------------- trunk/resources/structure.svg Added Paths: ----------- trunk/resources/components.png trunk/resources/components_print.pdf trunk/resources/components_print.svg trunk/resources/structure_print.pdf trunk/resources/structure_print.svg Added: trunk/resources/components.png =================================================================== (Binary files differ) Property changes on: trunk/resources/components.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/resources/components_print.pdf =================================================================== --- trunk/resources/components_print.pdf (rev 0) +++ trunk/resources/components_print.pdf 2009-02-09 09:59:48 UTC (rev 1589) @@ -0,0 +1,311 @@ +%PDF-1.4 +%\xB5\xED\xAE\xFB +3 0 obj +<< /Length 4 0 R + /Filter /FlateDecode +>> +stream +x\x9C\xB5Yˎ7\xDD\xFB+\xBCF\xBA\xC6工\xA8HQ$\xA4,Hf7b1ܙ!X\x90,\xF8\xFD\x9C\xF2\xABݏ\xC9 \xE8\xB6\xC7.\xD7\xE3ԩr\xCFAR\xAB\xAC)~\xF1\xF5\xE5\xAF\xF7\xF2坖\xEF\xFFZ\xF2\xDF?~\x93\xA4\xB4\xD3)F\xF9s\xAF\xF1}\x8BZ\xDE'\x97_$\x95\xA5~x\xE3\xE4\xF5\xB3\x80<#\xCB\x9F\xA5\xF5\xA4\\xAA\xA3O}D\xB1<>\xD5\xE9\x{DA2D}\xFC\xB0\x91\xF2\xEA\x85|\xD3t\x82\x8E\xAFneeʰ\xBC\x90V&\xF9h\x93t\xD9*\xE3#\xF9,o>\x8B\x97\x8F}\xC1y\xF3(n\xD1Z\xD3r\xA1\xC8/fq\xFC\xB0\x8B\xD1\xFCtK\x99\xF5\x95aX\x88\xF8\x97ďT\x8AY\x83\xA7\xD0y!\xCFwubHy\xB7X~\\x97K\xE0\xE7\xFD\x92붷7\xAFT\xB4\xE5t\xBE\xB9\xAF\xDAt9\xD0*̂\xA1\xA9\xAEg\xF7\xA9\xA6p\x89\x8Al\x98I\xDD\xCC\xCBz\xD0\xC5(?\xE5\xBEn\xBCT v\xA9g\xBA~8\x8Co\xFA^\xC8U\xEB\xDBK*\xA7p\x8C\xE1\xDB!q\xAC\xCB\xD5Nx#\xD6\xD5j\xEE\xA8G\xB6\x9F\xC3-d7r\xF9h_<z\xBF\fQ}\xC5c[1\xEBR\xA5\xC3?\xF5I-f\xFDb\x88%\xD3=\xA0\xF6\xEAvV\x84\xE3Fv\xB9Z +\xBC\xB4\x953ɵs\xFCx-!\xEAQjf\x8A\xE4joC\xE3\xDC4~\xE89z\xF2\xCC߶\xA1%\xF4mU.|gәg\x86"t\xD70\xD4 +#V\xD7rү7O\xB1\xC1\xA0\x81\xB34\xF71L)\x9AM\x9C\xBD\x8DFj\xB7\xB5\xFBqY-8۷\xC9w\x9F\xB5B\xBE\x93\x8DHx\xA3\xE3;\x9D%< PS\xB4\xE5.B\x9E\x9A'&@\x8C\xF3\x94c-\xDD[v"\xF0\x953\xC4\xD8\xD5rPH5q\xF2t'/\xF66\xE4m\x80w\xCC\xF3\x85j\xC0f\xB1S\xAA\x9B:\xB4O\xA7:\xC3uN\xF3C\x9E\x8C\xA0O\xE9\x98N`4\xF2h$%\xD4\xCA3\x8C}\xFEc\xDCA5\xE0\xDC.\xFA\x9Cp\xC5s\xEF\xCE>\xF2\x91\xAE\xE5d^Y}_\xB6x\x98뢇\x9D\x9A\x9D\\xE8\xB1&,6\x9F)\xB3\xCFҕ-\x86}{\x83\xCD걲\xD7Zf\x977O\xC2\xD5y6\xE3Y9Q\xA6,\x9A\x91\xD5m6wӺG\xFA܅\xE2\xD2D\xFE\xEF>Т+\xBF\xB2z\xA3\xB9\xAE\x941u<\x883\xF6P@,\xC5a\x921Q\xE7.㪣o>~/\xBB&\xB2\xDElژ6\x8D\x8C7vj]\xB6\xA3\xB6V\x8C^f\xFB\xB6n&zI\x8ET$gɞ\x92[l\x84\xB1%7\xA4m[\xF2 +$'F/\xD3\x8C\xC6u\x80@˖\xB6\xFD~\xB4Hg\xF7\xB3:\x9A\xCD\xF5\x8Afl\xE1F3\x903^\xBE\xB59\xA3\xED\xE9\xEDIg\x9B\xF3\xA6\xE7\xD96j\xF4M.Tt\xA7\x9A\x89g\xFB\xA6\xCD\xF2Ӛ\x8D\xDCϣ\xCD\xC8U\x9A +5$&\x9F\xD0!S\x85ߦ\xD8A\xA1\x91\xC1]\xD6!/W~8$\xA4vB\x9C@\xB2\x8BM\xF9\x8F5!#\xB7Z\xE31\xB5\x8DGj\xB6\xF5\xFB\xB1>D>$\x8EC4\x96\xF3U\x97fD\x87\x9FՌ\xDC\xC1w\xA9\xE3VO\xEC\xDA\xE3\x85U +|\xDBY\xBE\xEAcJ̻\xA0\xFC\xAC\xCCmm\x9A\x94\xB0QVd\x8D\xEFd\xA3\xD7{@ӻ!\xB0Uҵ y\xB8\xC6\xE4mA\xEA\xB5qݑOk\xEA\xD0r\xA0\xFF\xBASw\x94\xC75Ś\xBA#-D%v:ا\x8B\xEE\xBA\xE8\xE1 ~hi\xA3w\x9FC\xDF/ +/\xF6\xBD\xD3Ud\xF7Żs߸A5g\xB2\x9B;\xDD봽Ď \xD2\xF0F\xADЇf\xE4\xF1\xFC\xB3\xE6\xFF\xF4сr\xCEDV\xF9\x9C\xA35\xE3\xE5\xAD\xE4\x8Fgd2ʥ\x97PiHH݈j\x9A\x9D\xB2\xD9#\xB3\xFF\x9C\xD38\xE5\x96RP \xF8\xE4\xA5 +\x86co9\xCBcT:\x96\xA1l\x8FV\xE5\xC8YiOg\xF1\xBC\xE01i\xBFx\x91\xCEx|\xB1\xDA\xF8\x9FK\x84H\xDA9\xA3\x85\xA8\xE4\xF9\xDE\xCA\xC9^\xD9`\xF7\xE6%\x95ae\xBDJв\xAFϐ\x80\xF2rt*E_\x96\xC46\xE1\x890\x93`y\x92\xE5T\x97C\x99 }'\x94M<\x9C3\x9B\x88\x89\x92.ߎn\xA5Ɲ\x81\xB5\xFD\xE5ik}\xB0\xC56@\xA7\x81\xAD\xB5\xC1)\xBB\x9DO*\xB56f\xE5S1\xEAG(\xEB\xC17Y\x86\xEE^\xB5\x95|\xFDtT&\x82\xCA6\xC9\x8B?\x8F\xD9 |
From: <jen...@us...> - 2009-02-09 08:42:08
|
Revision: 1588 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1588&view=rev Author: jenslehmann Date: 2009-02-09 08:42:03 +0000 (Mon, 09 Feb 2009) Log Message: ----------- DL-Learner manual started Added Paths: ----------- trunk/doc/manual/ trunk/doc/manual/manual.tex Added: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex (rev 0) +++ trunk/doc/manual/manual.tex 2009-02-09 08:42:03 UTC (rev 1588) @@ -0,0 +1,48 @@ +\documentclass[a4paper,12pt]{scrartcl} + +\usepackage[utf8]{inputenc} +\usepackage[english]{babel} +\usepackage{scrpage2} +\usepackage{amsmath,amssymb} +\usepackage{verbatim} +\usepackage{color,graphicx} +\usepackage{hyperref} + +\title{DL-Learner Manual [Draft]} +\author{Jens Lehmann} + +\pagestyle{scrheadings} +\automark{section} + +\begin{document} + +\maketitle + +\begin{abstract} +The DL-Learner software learns concepts in Description Logics (DLs) from user-provided examples. Equivalently, it can be used to learn classes in OWL ontologies from selected objects. It extends Inductive Logic Programming to Descriptions Logics and the Semantic Web. The goal of DL-Learner is to provide a DL/OWL based machine learning tool to solve supervised learnings tasks and support knowledge engineers in constructing knowledge and learning about the data they created. +\end{abstract} + +\tableofcontents + +\section{What is DL-Learner?} + +\section{Getting Started} + +\section{DL-Learner Architecture} + +\section{DL-Learner Components} + +\subsection{Knowledge Sources} + +\subsection{Reasoner Components} + +\subsection{Learning Problems} + +\subsection{Learning Algorithms} + +\section{DL-Learner Interfaces} + +\section{Extending DL-Learner} + +\end{document} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-06 16:00:18
|
Revision: 1587 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1587&view=rev Author: jenslehmann Date: 2009-02-06 16:00:14 +0000 (Fri, 06 Feb 2009) Log Message: ----------- learning algorithm for ontology engineering started Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/core/Score.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/lib/components.ini 2009-02-06 16:00:14 UTC (rev 1587) @@ -16,6 +16,7 @@ org.dllearner.learningproblems.PosNegInclusionLP org.dllearner.learningproblems.PosOnlyDefinitionLP org.dllearner.learningproblems.PosOnlyInclusionLP +org.dllearner.learningproblems.ClassLearningProblem # learning algorithms org.dllearner.algorithms.RandomGuesser org.dllearner.algorithms.BruteForceLearner @@ -24,4 +25,5 @@ org.dllearner.algorithms.gp.GP org.dllearner.algorithms.DBpediaNavigationSuggestor org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm -org.dllearner.algorithms.el.ELLearningAlgorithm \ No newline at end of file +org.dllearner.algorithms.el.ELLearningAlgorithm +org.dllearner.algorithms.celoe.CELOE Added: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,107 @@ +/** + * 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.celoe; + +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.Configurator; +import org.dllearner.core.owl.Description; +import org.dllearner.learningproblems.ClassLearningProblem; + +/** + * 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 CELOE extends LearningAlgorithm { + + public CELOE(ClassLearningProblem problem, ReasonerComponent reasoner) { + super(problem, reasoner); + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#getCurrentlyBestDescription() + */ + @Override + public Description getCurrentlyBestDescription() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#getCurrentlyBestEvaluatedDescription() + */ + @Override + public EvaluatedDescription getCurrentlyBestEvaluatedDescription() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#isRunning() + */ + @Override + public boolean isRunning() { + // TODO Auto-generated method stub + return false; + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#start() + */ + @Override + public void start() { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.LearningAlgorithm#stop() + */ + @Override + public void stop() { + // TODO Auto-generated method stub + + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#getConfigurator() + */ + @Override + public Configurator getConfigurator() { + // TODO Auto-generated method stub + return null; + } + + /* (non-Javadoc) + * @see org.dllearner.core.Component#init() + */ + @Override + public void init() throws ComponentInitException { + // TODO Auto-generated method stub + + } + +} Added: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,30 @@ +/** + * 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.celoe; + +/** + * A node in the search tree of the ontology engineering algorithm. + * + * @author Jens Lehmann + * + */ +public class OENode { + +} Modified: trunk/src/dl-learner/org/dllearner/core/Score.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/core/Score.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -28,6 +28,10 @@ * The score class is used to store how well a class description did * on a learning problem. * + * TODO: If possible this class should be abstracted further. The current + * implementation requires positive and negative examples, i.e. does not + * allow arbitrary learning problems. + * * @author Jens Lehmann * */ Added: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,69 @@ +/** + * 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.celoe.CELOE; +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 CELOEConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private CELOE cELOE; + +/** +* @param cELOE see CELOE +**/ +public CELOEConfigurator(CELOE cELOE){ +this.cELOE = cELOE; +} + +/** +* @param reasoningService see reasoningService +* @param learningProblem see learningProblem +* @throws LearningProblemUnsupportedException see +* @return CELOE +**/ +public static CELOE getCELOE(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException{ +CELOE component = ComponentManager.getInstance().learningAlgorithm(CELOE.class, learningProblem, reasoningService); +return component; +} + + + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,102 @@ +/** + * 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.core.ComponentManager; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.learningproblems.ClassLearningProblem; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class ClassLearningProblemConfigurator implements Configurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private ClassLearningProblem classLearningProblem; + +/** +* @param classLearningProblem see ClassLearningProblem +**/ +public ClassLearningProblemConfigurator(ClassLearningProblem classLearningProblem){ +this.classLearningProblem = classLearningProblem; +} + +/** +* @param reasoningService see reasoningService +* @param classToDescribe class of which a description should be learned +* @return ClassLearningProblem +**/ +public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, String classToDescribe) { +ClassLearningProblem component = ComponentManager.getInstance().learningProblem(ClassLearningProblem.class, reasoningService); +ComponentManager.getInstance().applyConfigEntry(component, "classToDescribe", classToDescribe); +return component; +} + +/** +* classToDescribe class of which a description should be learned. +* mandatory: true| reinit necessary: false +* default value: null +* @return String +**/ +public String getClassToDescribe() { +return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "classToDescribe") ; +} +/** +* type Whether to learn an equivalence class or super class axiom.. +* mandatory: false| reinit necessary: true +* default value: equivalence +* @return String +**/ +public String getType() { +return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "type") ; +} + +/** +* @param classToDescribe class of which a description should be learned. +* mandatory: true| reinit necessary: false +* default value: null +**/ +public void setClassToDescribe(String classToDescribe) { +ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "classToDescribe", classToDescribe); +} +/** +* @param type Whether to learn an equivalence class or super class axiom.. +* mandatory: false| reinit necessary: true +* default value: equivalence +**/ +public void setType(String type) { +ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "type", type); +reinitNecessary = true; +} + +/** +* true, if this component needs reinitializsation. +* @return boolean +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -26,6 +26,7 @@ import org.dllearner.algorithms.DBpediaNavigationSuggestor; import org.dllearner.algorithms.RandomGuesser; import org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; @@ -38,6 +39,7 @@ import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegDefinitionLP; import org.dllearner.learningproblems.PosNegDefinitionLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; @@ -120,6 +122,15 @@ } /** +* @param classToDescribe class of which a description should be learned +* @param reasoningService see ReasoningService +* @return a component ready for initialization ClassLearningProblem +**/ +public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, String classToDescribe) { +return ClassLearningProblemConfigurator.getClassLearningProblem(reasoningService, classToDescribe); +} + +/** * @param positiveExamples positive examples * @param negativeExamples negative examples * @param reasoningService see ReasoningService @@ -211,6 +222,16 @@ * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see +* @return a component ready for initialization CELOE +**/ +public static CELOE getCELOE(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { +return CELOEConfigurator.getCELOE(learningProblem, reasoningService); +} + +/** +* @param learningProblem see LearningProblem +* @param reasoningService see ReasoningService +* @throws LearningProblemUnsupportedException see * @return a component ready for initialization ELLearningAlgorithm **/ public static ELLearningAlgorithm getELLearningAlgorithm(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -26,13 +26,13 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; -import org.dllearner.utilities.Files; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; /** * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class ROLearnerConfigurator extends Files implements Configurator { +public class ROLearnerConfigurator extends RefinementOperatorConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Added: trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/RefinementOperatorConfigurator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,32 @@ +/** + * 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.core.configurators; + +/** + * Common options of refinement operators. + * + * @author Jens Lehmann + * + */ +public abstract class RefinementOperatorConfigurator { + + + +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,114 @@ +/** + * 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.learningproblems; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.Set; + +import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.ClassLearningProblemConfigurator; +import org.dllearner.core.options.ConfigOption; +import org.dllearner.core.options.StringConfigOption; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.NamedClass; + +/** + * The problem of learning the description of an existing class + * in an OWL ontology. + * + * @author Jens Lehmann + * + */ +public class ClassLearningProblem extends LearningProblem { + + private NamedClass classToDescribe; + private Set<Individual> classInstances; + private boolean equivalence = true; + private ClassLearningProblemConfigurator configurator; + + @Override + public ClassLearningProblemConfigurator getConfigurator(){ + return configurator; + } + + public ClassLearningProblem(ReasonerComponent reasoner) { + super(reasoner); + } + + public static Collection<ConfigOption<?>> createConfigOptions() { + Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); + options.add(new StringConfigOption("classToDescribe", "class of which a description should be learned", null, true, false)); + StringConfigOption type = new StringConfigOption("type", "Whether to learn an equivalence class or super class axiom.","equivalence"); + type.setAllowedValues(new String[] {"equivalence", "superClass"}); + options.add(type); + return options; + } + + @Override + public void init() { + classToDescribe = new NamedClass(configurator.getClassToDescribe()); + classInstances = reasoner.getIndividuals(classToDescribe); + equivalence = (configurator.getType().equals("equivalence")); + } + + /** + * Computes the fraction of the instances of the class to learn, which + * is covered by the given description. + * @param description The description for which to compute coverage. + * @return The class coverage (between 0 and 1). + */ +// public double getCoverage(Description description) { +// int instancesCovered = 0; +// for(Individual instance : classInstances) { +// if(reasoner.hasType(description, instance)) { +// instancesCovered++; +// } +// } +// return instancesCovered/(double)classInstances.size(); +// } + + @Override + public ClassScore computeScore(Description description) { + Set<Individual> retrieval = reasoner.getIndividuals(description); + + int instancesCovered = 0; + int instancesProtused = 0; + + for(Individual ind : retrieval) { + if(classInstances.contains(ind)) { + instancesCovered++; + } else { + instancesProtused++; + } + } + + double coverage = instancesCovered/(double)classInstances.size(); + double protusion = instancesCovered/(double)(instancesCovered + instancesProtused); + + return new ClassScore(coverage, protusion); + } + + public boolean isEquivalenceProblem() { + return equivalence; + } +} Added: trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -0,0 +1,94 @@ +/** + * 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.learningproblems; + +import java.util.Set; + +import org.dllearner.core.Score; +import org.dllearner.core.owl.Individual; + +/** + * The score of a class in ontology engineering. + * + * @author Jens Lehmann + * + */ +public class ClassScore extends Score { + + private double coverage; + private double protusion; + + public ClassScore(double coverage, double protusion) { + this.coverage = coverage; + this.protusion = protusion; + } + + /** + * @return the coverage + */ + public double getCoverage() { + return coverage; + } + + /** + * @return the protusion + */ + public double getProtusion() { + return protusion; + } + + // methods required by score class (not used in this context) + + @Override + public double getAccuracy() { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getCoveredNegatives() { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getCoveredPositives() { + throw new UnsupportedOperationException(); + } + + @Override + public Score getModifiedLengthScore(int newLength) { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getNotCoveredNegatives() { + throw new UnsupportedOperationException(); + } + + @Override + public Set<Individual> getNotCoveredPositives() { + throw new UnsupportedOperationException(); + } + + @Override + public double getScore() { + throw new UnsupportedOperationException(); + } + +} Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -36,6 +36,7 @@ import org.apache.log4j.Logger; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ExampleBasedROLComponentConfigurator; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; import org.dllearner.core.options.CommonConfigOptions; import org.dllearner.core.owl.BooleanValueRestriction; import org.dllearner.core.owl.DataRange; @@ -186,6 +187,12 @@ this.rs = reasoningService; } + public RhoDRDown(ReasonerComponent reasoner, ClassHierarchy subHierarchy, RefinementOperatorConfigurator configurator) { + this.rs = reasoner; + this.subHierarchy = subHierarchy; + // TODO add more options from configurator object + } + // TODO constructor which takes a RhoDRDownConfigurator object; // this should be an interface implemented e.g. by ExampleBasedROLComponentConfigurator; // the goal is to use the configurator system while still being flexible enough to Modified: trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -31,6 +31,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.core.Component; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; @@ -39,6 +40,7 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.configurators.ROLearnerConfigurator; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; import org.dllearner.core.options.ConfigOption; import org.dllearner.utilities.Files; @@ -56,18 +58,18 @@ private static final SortedSet<String> DONOTDELETE = new TreeSet<String>(Arrays.asList(new String[]{ ".svn", - ".svn", + "RefinementOperatorConfigurator.java", })); // currently it targets the configurators for private static final SortedSet<String> EXTENDSREFINEMENTOPERATOR = new TreeSet<String>(Arrays.asList(new String[]{ ROLearnerConfigurator.class.getSimpleName(), - ROLearnerConfigurator.class.getSimpleName(), + CELOE.class.getSimpleName(), })); @SuppressWarnings("unchecked") - private static final Class EXTENDSREFINEMENTOPERATORCLASS = Files.class; + private static final Class EXTENDSREFINEMENTOPERATORCLASS = RefinementOperatorConfigurator.class; private static final boolean INCLUDE_UNUSED = false; Modified: trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-02-06 10:21:58 UTC (rev 1586) +++ trunk/src/dl-learner/org/dllearner/scripts/evaluation/ELOperatorBenchmark.java 2009-02-06 16:00:14 UTC (rev 1587) @@ -80,6 +80,7 @@ // real world ontology tests // String base = "/home/jl/promotion/ontologien/el_benchmark/"; String[] onts = new String[] { + "go", // is ok at length 10 "galen2", // is ok at length 8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-02-06 10:22:02
|
Revision: 1586 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1586&view=rev Author: kurzum Date: 2009-02-06 10:21:58 +0000 (Fri, 06 Feb 2009) Log Message: ----------- configurator adaption Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/DBpediaNavigationSuggestorConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java trunk/src/dl-learner/org/dllearner/utilities/Files.java Property Changed: ---------------- trunk/src/dl-learner/org/dllearner/utilities/ Modified: trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -30,7 +30,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class BruteForceLearnerConfigurator implements Configurator { +public class BruteForceLearnerConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/DBpediaNavigationSuggestorConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/DBpediaNavigationSuggestorConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/DBpediaNavigationSuggestorConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -31,7 +31,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class DBpediaNavigationSuggestorConfigurator implements Configurator { +public class DBpediaNavigationSuggestorConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class DIGReasonerConfigurator implements Configurator { +public class DIGReasonerConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -30,7 +30,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class ELLearningAlgorithmConfigurator implements Configurator { +public class ELLearningAlgorithmConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -31,7 +31,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class ExampleBasedROLComponentConfigurator implements Configurator { +public class ExampleBasedROLComponentConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class FastInstanceCheckerConfigurator implements Configurator { +public class FastInstanceCheckerConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class FastRetrievalReasonerConfigurator implements Configurator { +public class FastRetrievalReasonerConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -30,7 +30,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class GPConfigurator implements Configurator { +public class GPConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -28,7 +28,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class KBFileConfigurator implements Configurator { +public class KBFileConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -27,7 +27,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class OWLAPIOntologyConfigurator implements Configurator { +public class OWLAPIOntologyConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class OWLAPIReasonerConfigurator implements Configurator { +public class OWLAPIReasonerConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -28,7 +28,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class OWLFileConfigurator implements Configurator { +public class OWLFileConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class PosNegDefinitionLPConfigurator implements Configurator { +public class PosNegDefinitionLPConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class PosNegDefinitionLPStrictConfigurator implements Configurator { +public class PosNegDefinitionLPStrictConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class PosNegInclusionLPConfigurator implements Configurator { +public class PosNegInclusionLPConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class PosOnlyDefinitionLPConfigurator implements Configurator { +public class PosOnlyDefinitionLPConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -29,7 +29,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class PosOnlyInclusionLPConfigurator implements Configurator { +public class PosOnlyInclusionLPConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -26,12 +26,13 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; +import org.dllearner.utilities.Files; /** * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class ROLearnerConfigurator implements Configurator { +public class ROLearnerConfigurator extends Files implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -30,7 +30,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class RandomGuesserConfigurator implements Configurator { +public class RandomGuesserConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -30,7 +30,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class SimpleSuggestionLearningAlgorithmConfigurator implements Configurator { +public class SimpleSuggestionLearningAlgorithmConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -31,7 +31,7 @@ * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class SparqlKnowledgeSourceConfigurator implements Configurator { +public class SparqlKnowledgeSourceConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") Modified: trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -21,6 +21,7 @@ import java.io.File; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.LinkedHashMap; import java.util.LinkedList; @@ -37,6 +38,7 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.ROLearnerConfigurator; import org.dllearner.core.options.ConfigOption; import org.dllearner.utilities.Files; @@ -50,6 +52,22 @@ * */ public final class ConfigJavaGenerator { + + private static final SortedSet<String> DONOTDELETE = + new TreeSet<String>(Arrays.asList(new String[]{ + ".svn", + ".svn", + })); + + // currently it targets the configurators for + private static final SortedSet<String> EXTENDSREFINEMENTOPERATOR = + new TreeSet<String>(Arrays.asList(new String[]{ + ROLearnerConfigurator.class.getSimpleName(), + ROLearnerConfigurator.class.getSimpleName(), + })); + + @SuppressWarnings("unchecked") + private static final Class EXTENDSREFINEMENTOPERATORCLASS = Files.class; private static final boolean INCLUDE_UNUSED = false; @@ -89,6 +107,10 @@ private String className; private String componentType; + + private String extendS = ""; + + //private String implementS = ""; private List<String> body = new ArrayList<String>(); @@ -118,7 +140,21 @@ Files.backupDirectory(TARGET_DIR); System.out.println("previous classes were backupped to tmp/+System.currentTimeMillis()"); - Files.deleteDir(TARGET_DIR); + String[] files = Files.listDir(TARGET_DIR); + + for (String file : files){ + //System.out.println(DONOTDELETE); + + if(DONOTDELETE.contains(file)){ + continue; + } + //System.out.println(file); + String todelete = TARGET_DIR + File.separator + file; + Files.deleteFile(todelete); + + } + //System.exit(0); + //Files.deleteDir(TARGET_DIR); ComponentManager cm = ComponentManager.getInstance(); COMPONENT_FACTORY_IMPORTS.add(KnowledgeSource.class.getCanonicalName()); @@ -200,10 +236,12 @@ System.out.println("Done"); } + + private ConfigJavaGenerator(Class<? extends Component> component, String componentType) { - className = component.getSimpleName(); + this.className = component.getSimpleName(); this.component = component; this.componentType = componentType; imports.add(component.getCanonicalName()); @@ -211,9 +249,14 @@ // imports.add(Configurator.class.getCanonicalName()); // imports.add(ConfigEntry.class.getCanonicalName()); - vars - .add("private " + className + " " + deCapitalize(className) + vars.add("private " + className + " " + deCapitalize(className) + ";\n"); + + if(EXTENDSREFINEMENTOPERATOR.contains(this.className+CONFIGURATOR)){ + this.extendS = EXTENDSREFINEMENTOPERATORCLASS.getSimpleName(); + this.imports.add(EXTENDSREFINEMENTOPERATORCLASS.getCanonicalName()); + } + } @@ -265,7 +308,7 @@ TARGET_PACKAGE, importtmp, className + CONFIGURATOR, - "", + extendS, bodytmp , "", CONFIGURATOR); @@ -494,8 +537,8 @@ ret += fillJavaDocComment(CLASS_COMMENT); ret += (INCLUDE_UNUSED) ? UNUSED : ""; ret += "public "+classModifier+" class " + className + " " - + ((extendS.length() > 0) ? "extends " + extendS : "") - + ((implementS.length() > 0) ? "implements " + implementS : "") + + ((extendS.length() > 0) ? " extends " + extendS : "") + + ((implementS.length() > 0) ? " implements " + implementS : "") + " {\n\n"; ret += body + "\n"; ret += "}\n"; Property changes on: trunk/src/dl-learner/org/dllearner/utilities ___________________________________________________________________ Added: svn:ignore + oaiWikipediaReader Modified: trunk/src/dl-learner/org/dllearner/utilities/Files.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Files.java 2009-02-04 12:38:28 UTC (rev 1585) +++ trunk/src/dl-learner/org/dllearner/utilities/Files.java 2009-02-06 10:21:58 UTC (rev 1586) @@ -188,6 +188,11 @@ } } + + public static void deleteFile(String file) { + deleteFile(new File(file)); + } + public static void deleteFile(File file) { try{ @@ -234,6 +239,27 @@ } /** + * lists all files in a directory + * + * + * @param dir without a separator e.g. tmp/dir + * @return a string array with filenames + */ + public static String[] listDir(String dir) { + + File f = new File(dir); + + if(debug){ + System.out.println(dir); + System.exit(0); + } + + return f.list(); + + + } + + /** * copies all files in dir to "tmp/"+System.currentTimeMillis() * @param dir the dir to be backupped */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-02-04 12:38:34
|
Revision: 1585 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1585&view=rev Author: jenslehmann Date: 2009-02-04 12:38:28 +0000 (Wed, 04 Feb 2009) Log Message: ----------- added EPC examples Added Paths: ----------- trunk/examples/epc/ trunk/examples/epc/rs002.conf trunk/examples/epc/rs004.conf trunk/examples/epc/rs005.conf trunk/examples/epc/rs006.conf trunk/examples/epc/sap_epc.owl Added: trunk/examples/epc/rs002.conf =================================================================== --- trunk/examples/epc/rs002.conf (rev 0) +++ trunk/examples/epc/rs002.conf 2009-02-04 12:38:28 UTC (rev 1585) @@ -0,0 +1,564 @@ +import("sap_epc.owl"); + +refexamples.startClass = "http://localhost/aris/sap_model.owl#EPC"; +// this enforces a breadth like search +refexamples.expansionPenaltyFactor = 0.5; + ++"http://localhost/aris/sap_model.owl#bsj0__6_____u__" ++"http://localhost/aris/sap_model.owl#fa6v__6_____u__" ++"http://localhost/aris/sap_model.owl#8kx7__6_____u__" +-"http://localhost/aris/sap_model.owl#50ni__6_____u__" +-"http://localhost/aris/sap_model.owl#516w__6_____u__" +-"http://localhost/aris/sap_model.owl#50uc__6_____u__" +-"http://localhost/aris/sap_model.owl#51b6__6_____u__" +-"http://localhost/aris/sap_model.owl#507i__6_____u__" +-"http://localhost/aris/sap_model.owl#5085__6_____u__" +-"http://localhost/aris/sap_model.owl#g3ck__6_____u__" +-"http://localhost/aris/sap_model.owl#63c3__6_____u__" +-"http://localhost/aris/sap_model.owl#61eo__6_____u__" +-"http://localhost/aris/sap_model.owl#61hp__6_____u__" +-"http://localhost/aris/sap_model.owl#5vor__6_____u__" +-"http://localhost/aris/sap_model.owl#5z4t__6_____u__" +-"http://localhost/aris/sap_model.owl#5xci__6_____u__" +-"http://localhost/aris/sap_model.owl#5ybj__6_____u__" +-"http://localhost/aris/sap_model.owl#5yqw__6_____u__" +-"http://localhost/aris/sap_model.owl#6ovg__6_____u__" +-"http://localhost/aris/sap_model.owl#6kzx__6_____u__" +-"http://localhost/aris/sap_model.owl#6kjs__6_____u__" +-"http://localhost/aris/sap_model.owl#6oqu__6_____u__" +-"http://localhost/aris/sap_model.owl#6kw0__6_____u__" +-"http://localhost/aris/sap_model.owl#6oil__6_____u__" +-"http://localhost/aris/sap_model.owl#6kyy__6_____u__" +-"http://localhost/aris/sap_model.owl#6l2h__6_____u__" +-"http://localhost/aris/sap_model.owl#6kxi__6_____u__" +-"http://localhost/aris/sap_model.owl#6911__6_____u__" +-"http://localhost/aris/sap_model.owl#68kr__6_____u__" +-"http://localhost/aris/sap_model.owl#66np__6_____u__" +-"http://localhost/aris/sap_model.owl#6ag9__6_____u__" +-"http://localhost/aris/sap_model.owl#61op__6_____u__" +-"http://localhost/aris/sap_model.owl#65ec__6_____u__" +-"http://localhost/aris/sap_model.owl#69z8__6_____u__" +-"http://localhost/aris/sap_model.owl#6arq__6_____u__" +-"http://localhost/aris/sap_model.owl#6att__6_____u__" +-"http://localhost/aris/sap_model.owl#6auj__6_____u__" +-"http://localhost/aris/sap_model.owl#6bgn__6_____u__" +-"http://localhost/aris/sap_model.owl#6bp9__6_____u__" +-"http://localhost/aris/sap_model.owl#6bj9__6_____u__" +-"http://localhost/aris/sap_model.owl#6kn7__6_____u__" +-"http://localhost/aris/sap_model.owl#6dua__6_____u__" +-"http://localhost/aris/sap_model.owl#6d0p__6_____u__" +-"http://localhost/aris/sap_model.owl#6jls__6_____u__" +-"http://localhost/aris/sap_model.owl#6gcc__6_____u__" +-"http://localhost/aris/sap_model.owl#6d1r__6_____u__" +-"http://localhost/aris/sap_model.owl#6fc3__6_____u__" +-"http://localhost/aris/sap_model.owl#8n3o__6_____u__" +-"http://localhost/aris/sap_model.owl#8n7u__6_____u__" +-"http://localhost/aris/sap_model.owl#8lj0__6_____u__" +-"http://localhost/aris/sap_model.owl#8ipa__6_____u__" +-"http://localhost/aris/sap_model.owl#8iaj__6_____u__" +-"http://localhost/aris/sap_model.owl#8ge4__6_____u__" +-"http://localhost/aris/sap_model.owl#8gur__6_____u__" +-"http://localhost/aris/sap_model.owl#84bz__6_____u__" +-"http://localhost/aris/sap_model.owl#889d__6_____u__" +-"http://localhost/aris/sap_model.owl#7zjv__6_____u__" +-"http://localhost/aris/sap_model.owl#8hyg__6_____u__" +-"http://localhost/aris/sap_model.owl#855w__6_____u__" +-"http://localhost/aris/sap_model.owl#7zox__6_____u__" +-"http://localhost/aris/sap_model.owl#7wqf__6_____u__" +-"http://localhost/aris/sap_model.owl#7ycv__6_____u__" +-"http://localhost/aris/sap_model.owl#7uzb__6_____u__" +-"http://localhost/aris/sap_model.owl#7wix__6_____u__" +-"http://localhost/aris/sap_model.owl#7z58__6_____u__" +-"http://localhost/aris/sap_model.owl#c7ds__6_____u__" +-"http://localhost/aris/sap_model.owl#c6yt__6_____u__" +-"http://localhost/aris/sap_model.owl#c71n__6_____u__" +-"http://localhost/aris/sap_model.owl#c7cn__6_____u__" +-"http://localhost/aris/sap_model.owl#dqj1__6_____u__" +-"http://localhost/aris/sap_model.owl#dimh__6_____u__" +-"http://localhost/aris/sap_model.owl#dnbu__6_____u__" +-"http://localhost/aris/sap_model.owl#dj9i__6_____u__" +-"http://localhost/aris/sap_model.owl#dker__6_____u__" +-"http://localhost/aris/sap_model.owl#dlp9__6_____u__" +-"http://localhost/aris/sap_model.owl#dj4q__6_____u__" +-"http://localhost/aris/sap_model.owl#dmai__6_____u__" +-"http://localhost/aris/sap_model.owl#dru2__6_____u__" +-"http://localhost/aris/sap_model.owl#dkg5__6_____u__" +-"http://localhost/aris/sap_model.owl#dln6__6_____u__" +-"http://localhost/aris/sap_model.owl#ducq__6_____u__" +-"http://localhost/aris/sap_model.owl#drx7__6_____u__" +-"http://localhost/aris/sap_model.owl#duf5__6_____u__" +-"http://localhost/aris/sap_model.owl#dujr__6_____u__" +-"http://localhost/aris/sap_model.owl#dt8o__6_____u__" +-"http://localhost/aris/sap_model.owl#dqry__6_____u__" +-"http://localhost/aris/sap_model.owl#dqy6__6_____u__" +-"http://localhost/aris/sap_model.owl#drmj__6_____u__" +-"http://localhost/aris/sap_model.owl#dql9__6_____u__" +-"http://localhost/aris/sap_model.owl#dbat__6_____u__" +-"http://localhost/aris/sap_model.owl#dcra__6_____u__" +-"http://localhost/aris/sap_model.owl#dhk7__6_____u__" +-"http://localhost/aris/sap_model.owl#dcsd__6_____u__" +-"http://localhost/aris/sap_model.owl#dc13__6_____u__" +-"http://localhost/aris/sap_model.owl#dg96__6_____u__" +-"http://localhost/aris/sap_model.owl#ch2j__6_____u__" +-"http://localhost/aris/sap_model.owl#chl5__6_____u__" +-"http://localhost/aris/sap_model.owl#cgv0__6_____u__" +-"http://localhost/aris/sap_model.owl#chp0__6_____u__" +-"http://localhost/aris/sap_model.owl#cgos__6_____u__" +-"http://localhost/aris/sap_model.owl#cho1__6_____u__" +-"http://localhost/aris/sap_model.owl#cg1a__6_____u__" +-"http://localhost/aris/sap_model.owl#cgyi__6_____u__" +-"http://localhost/aris/sap_model.owl#cfrg__6_____u__" +-"http://localhost/aris/sap_model.owl#cg2c__6_____u__" +-"http://localhost/aris/sap_model.owl#cgeu__6_____u__" +-"http://localhost/aris/sap_model.owl#cgpi__6_____u__" +-"http://localhost/aris/sap_model.owl#c9qp__6_____u__" +-"http://localhost/aris/sap_model.owl#c8oi__6_____u__" +-"http://localhost/aris/sap_model.owl#c95g__6_____u__" +-"http://localhost/aris/sap_model.owl#c9cx__6_____u__" +-"http://localhost/aris/sap_model.owl#c9er__6_____u__" +-"http://localhost/aris/sap_model.owl#c8vk__6_____u__" +-"http://localhost/aris/sap_model.owl#c9on__6_____u__" +-"http://localhost/aris/sap_model.owl#c8wu__6_____u__" +-"http://localhost/aris/sap_model.owl#c8n6__6_____u__" +-"http://localhost/aris/sap_model.owl#ccir__6_____u__" +-"http://localhost/aris/sap_model.owl#cbf8__6_____u__" +-"http://localhost/aris/sap_model.owl#ccql__6_____u__" +-"http://localhost/aris/sap_model.owl#cbef__6_____u__" +-"http://localhost/aris/sap_model.owl#ccdu__6_____u__" +-"http://localhost/aris/sap_model.owl#cd7p__6_____u__" +-"http://localhost/aris/sap_model.owl#ccg2__6_____u__" +-"http://localhost/aris/sap_model.owl#cbkc__6_____u__" +-"http://localhost/aris/sap_model.owl#cd0q__6_____u__" +-"http://localhost/aris/sap_model.owl#ccvp__6_____u__" +-"http://localhost/aris/sap_model.owl#akp2__6_____u__" +-"http://localhost/aris/sap_model.owl#aj3r__6_____u__" +-"http://localhost/aris/sap_model.owl#ajhu__6_____u__" +-"http://localhost/aris/sap_model.owl#ajyf__6_____u__" +-"http://localhost/aris/sap_model.owl#aij8__6_____u__" +-"http://localhost/aris/sap_model.owl#akxt__6_____u__" +-"http://localhost/aris/sap_model.owl#aiy4__6_____u__" +-"http://localhost/aris/sap_model.owl#ahni__6_____u__" +-"http://localhost/aris/sap_model.owl#af08__6_____u__" +-"http://localhost/aris/sap_model.owl#adbo__6_____u__" +-"http://localhost/aris/sap_model.owl#aigh__6_____u__" +-"http://localhost/aris/sap_model.owl#afzd__6_____u__" +-"http://localhost/aris/sap_model.owl#afp9__6_____u__" +-"http://localhost/aris/sap_model.owl#afho__6_____u__" +-"http://localhost/aris/sap_model.owl#aefa__6_____u__" +-"http://localhost/aris/sap_model.owl#ahd4__6_____u__" +-"http://localhost/aris/sap_model.owl#aeha__6_____u__" +-"http://localhost/aris/sap_model.owl#acyq__6_____u__" +-"http://localhost/aris/sap_model.owl#abfq__6_____u__" +-"http://localhost/aris/sap_model.owl#aa1t__6_____u__" +-"http://localhost/aris/sap_model.owl#aasl__6_____u__" +-"http://localhost/aris/sap_model.owl#a9bp__6_____u__" +-"http://localhost/aris/sap_model.owl#ach1__6_____u__" +-"http://localhost/aris/sap_model.owl#a8go__6_____u__" +-"http://localhost/aris/sap_model.owl#aa6t__6_____u__" +-"http://localhost/aris/sap_model.owl#ab0h__6_____u__" +-"http://localhost/aris/sap_model.owl#a8yv__6_____u__" +-"http://localhost/aris/sap_model.owl#a4v3__6_____u__" +-"http://localhost/aris/sap_model.owl#a6dy__6_____u__" +-"http://localhost/aris/sap_model.owl#a5x8__6_____u__" +-"http://localhost/aris/sap_model.owl#a6j4__6_____u__" +-"http://localhost/aris/sap_model.owl#a581__6_____u__" +-"http://localhost/aris/sap_model.owl#a6fe__6_____u__" +-"http://localhost/aris/sap_model.owl#a71i__6_____u__" +-"http://localhost/aris/sap_model.owl#aah7__6_____u__" +-"http://localhost/aris/sap_model.owl#gg1j__6_____u__" +-"http://localhost/aris/sap_model.owl#ggr0__6_____u__" +-"http://localhost/aris/sap_model.owl#gglw__6_____u__" +-"http://localhost/aris/sap_model.owl#geuv__6_____u__" +-"http://localhost/aris/sap_model.owl#gfe6__6_____u__" +-"http://localhost/aris/sap_model.owl#gp4y__6_____u__" +-"http://localhost/aris/sap_model.owl#gpjp__6_____u__" +-"http://localhost/aris/sap_model.owl#gpcp__6_____u__" +-"http://localhost/aris/sap_model.owl#gjto__6_____u__" +-"http://localhost/aris/sap_model.owl#gnef__6_____u__" +-"http://localhost/aris/sap_model.owl#gip6__6_____u__" +-"http://localhost/aris/sap_model.owl#ggjx__6_____u__" +-"http://localhost/aris/sap_model.owl#gt4o__6_____u__" +-"http://localhost/aris/sap_model.owl#gtgq__6_____u__" +-"http://localhost/aris/sap_model.owl#gt8e__6_____u__" +-"http://localhost/aris/sap_model.owl#grmz__6_____u__" +-"http://localhost/aris/sap_model.owl#gexk__6_____u__" +-"http://localhost/aris/sap_model.owl#gebx__6_____u__" +-"http://localhost/aris/sap_model.owl#gf0e__6_____u__" +-"http://localhost/aris/sap_model.owl#gdfs__6_____u__" +-"http://localhost/aris/sap_model.owl#gcw4__6_____u__" +-"http://localhost/aris/sap_model.owl#ge1x__6_____u__" +-"http://localhost/aris/sap_model.owl#9h55__6_____u__" +-"http://localhost/aris/sap_model.owl#9fin__6_____u__" +-"http://localhost/aris/sap_model.owl#9gsz__6_____u__" +-"http://localhost/aris/sap_model.owl#9hya__6_____u__" +-"http://localhost/aris/sap_model.owl#9evo__6_____u__" +-"http://localhost/aris/sap_model.owl#9f4c__6_____u__" +-"http://localhost/aris/sap_model.owl#9ggc__6_____u__" +-"http://localhost/aris/sap_model.owl#9fxy__6_____u__" +-"http://localhost/aris/sap_model.owl#9fvu__6_____u__" +-"http://localhost/aris/sap_model.owl#9hu2__6_____u__" +-"http://localhost/aris/sap_model.owl#99br__6_____u__" +-"http://localhost/aris/sap_model.owl#99ha__6_____u__" +-"http://localhost/aris/sap_model.owl#972n__6_____u__" +-"http://localhost/aris/sap_model.owl#991g__6_____u__" +-"http://localhost/aris/sap_model.owl#997a__6_____u__" +-"http://localhost/aris/sap_model.owl#995e__6_____u__" +-"http://localhost/aris/sap_model.owl#983c__6_____u__" +-"http://localhost/aris/sap_model.owl#9j00__6_____u__" +-"http://localhost/aris/sap_model.owl#9jpf__6_____u__" +-"http://localhost/aris/sap_model.owl#9jja__6_____u__" +-"http://localhost/aris/sap_model.owl#9h2r__6_____u__" +-"http://localhost/aris/sap_model.owl#9how__6_____u__" +-"http://localhost/aris/sap_model.owl#9hcr__6_____u__" +-"http://localhost/aris/sap_model.owl#96xz__6_____u__" +-"http://localhost/aris/sap_model.owl#95zq__6_____u__" +-"http://localhost/aris/sap_model.owl#96gk__6_____u__" +-"http://localhost/aris/sap_model.owl#96ru__6_____u__" +-"http://localhost/aris/sap_model.owl#976n__6_____u__" +-"http://localhost/aris/sap_model.owl#9eke__6_____u__" +-"http://localhost/aris/sap_model.owl#9e21__6_____u__" +-"http://localhost/aris/sap_model.owl#9dro__6_____u__" +-"http://localhost/aris/sap_model.owl#9frs__6_____u__" +-"http://localhost/aris/sap_model.owl#9ep8__6_____u__" +-"http://localhost/aris/sap_model.owl#9e0n__6_____u__" +-"http://localhost/aris/sap_model.owl#9d5x__6_____u__" +-"http://localhost/aris/sap_model.owl#9dzw__6_____u__" +-"http://localhost/aris/sap_model.owl#9d7v__6_____u__" +-"http://localhost/aris/sap_model.owl#9bil__6_____u__" +-"http://localhost/aris/sap_model.owl#992a__6_____u__" +-"http://localhost/aris/sap_model.owl#9a0x__6_____u__" +-"http://localhost/aris/sap_model.owl#99u1__6_____u__" +-"http://localhost/aris/sap_model.owl#9anc__6_____u__" +-"http://localhost/aris/sap_model.owl#9a96__6_____u__" +-"http://localhost/aris/sap_model.owl#9aan__6_____u__" +-"http://localhost/aris/sap_model.owl#99i2__6_____u__" +-"http://localhost/aris/sap_model.owl#9aph__6_____u__" +-"http://localhost/aris/sap_model.owl#99x2__6_____u__" +-"http://localhost/aris/sap_model.owl#98q5__6_____u__" +-"http://localhost/aris/sap_model.owl#9cv7__6_____u__" +-"http://localhost/aris/sap_model.owl#9c3q__6_____u__" +-"http://localhost/aris/sap_model.owl#9b2c__6_____u__" +-"http://localhost/aris/sap_model.owl#9b87__6_____u__" +-"http://localhost/aris/sap_model.owl#9cad__6_____u__" +-"http://localhost/aris/sap_model.owl#9avk__6_____u__" +-"http://localhost/aris/sap_model.owl#9rj5__6_____u__" +-"http://localhost/aris/sap_model.owl#9q92__6_____u__" +-"http://localhost/aris/sap_model.owl#9p75__6_____u__" +-"http://localhost/aris/sap_model.owl#9nou__6_____u__" +-"http://localhost/aris/sap_model.owl#9px6__6_____u__" +-"http://localhost/aris/sap_model.owl#9r57__6_____u__" +-"http://localhost/aris/sap_model.owl#gxta__6_____u__" +-"http://localhost/aris/sap_model.owl#gxc0__6_____u__" +-"http://localhost/aris/sap_model.owl#gyaq__6_____u__" +-"http://localhost/aris/sap_model.owl#gxya__6_____u__" +-"http://localhost/aris/sap_model.owl#gybj__6_____u__" +-"http://localhost/aris/sap_model.owl#gw9r__6_____u__" +-"http://localhost/aris/sap_model.owl#gvxf__6_____u__" +-"http://localhost/aris/sap_model.owl#gvzc__6_____u__" +-"http://localhost/aris/sap_model.owl#gw8a__6_____u__" +-"http://localhost/aris/sap_model.owl#gw0q__6_____u__" +-"http://localhost/aris/sap_model.owl#gwwg__6_____u__" +-"http://localhost/aris/sap_model.owl#gw53__6_____u__" +-"http://localhost/aris/sap_model.owl#kkdc__6_____u__" +-"http://localhost/aris/sap_model.owl#baed__6_____u__" +-"http://localhost/aris/sap_model.owl#ba5l__6_____u__" +-"http://localhost/aris/sap_model.owl#b9k4__6_____u__" +-"http://localhost/aris/sap_model.owl#baoa__6_____u__" +-"http://localhost/aris/sap_model.owl#babp__6_____u__" +-"http://localhost/aris/sap_model.owl#ba62__6_____u__" +-"http://localhost/aris/sap_model.owl#bb49__6_____u__" +-"http://localhost/aris/sap_model.owl#baaw__6_____u__" +-"http://localhost/aris/sap_model.owl#b5n1__6_____u__" +-"http://localhost/aris/sap_model.owl#b4t3__6_____u__" +-"http://localhost/aris/sap_model.owl#b56l__6_____u__" +-"http://localhost/aris/sap_model.owl#b729__6_____u__" +-"http://localhost/aris/sap_model.owl#b2pa__6_____u__" +-"http://localhost/aris/sap_model.owl#b2e5__6_____u__" +-"http://localhost/aris/sap_model.owl#b958__6_____u__" +-"http://localhost/aris/sap_model.owl#b805__6_____u__" +-"http://localhost/aris/sap_model.owl#b77x__6_____u__" +-"http://localhost/aris/sap_model.owl#b1yd__6_____u__" +-"http://localhost/aris/sap_model.owl#b590__6_____u__" +-"http://localhost/aris/sap_model.owl#bia3__6_____u__" +-"http://localhost/aris/sap_model.owl#bdy4__6_____u__" +-"http://localhost/aris/sap_model.owl#biwd__6_____u__" +-"http://localhost/aris/sap_model.owl#bhbt__6_____u__" +-"http://localhost/aris/sap_model.owl#benb__6_____u__" +-"http://localhost/aris/sap_model.owl#bila__6_____u__" +-"http://localhost/aris/sap_model.owl#bcel__6_____u__" +-"http://localhost/aris/sap_model.owl#bcbw__6_____u__" +-"http://localhost/aris/sap_model.owl#bi3j__6_____u__" +-"http://localhost/aris/sap_model.owl#bde7__6_____u__" +-"http://localhost/aris/sap_model.owl#be59__6_____u__" +-"http://localhost/aris/sap_model.owl#bcuz__6_____u__" +-"http://localhost/aris/sap_model.owl#bc04__6_____u__" +-"http://localhost/aris/sap_model.owl#blwc__6_____u__" +-"http://localhost/aris/sap_model.owl#bnwq__6_____u__" +-"http://localhost/aris/sap_model.owl#blmd__6_____u__" +-"http://localhost/aris/sap_model.owl#bk60__6_____u__" +-"http://localhost/aris/sap_model.owl#bnyd__6_____u__" +-"http://localhost/aris/sap_model.owl#blgf__6_____u__" +-"http://localhost/aris/sap_model.owl#bnac__6_____u__" +-"http://localhost/aris/sap_model.owl#bm2d__6_____u__" +-"http://localhost/aris/sap_model.owl#bpgp__6_____u__" +-"http://localhost/aris/sap_model.owl#egwi__6_____u__" +-"http://localhost/aris/sap_model.owl#ehnl__6_____u__" +-"http://localhost/aris/sap_model.owl#ehp0__6_____u__" +-"http://localhost/aris/sap_model.owl#eowm__6_____u__" +-"http://localhost/aris/sap_model.owl#ep24__6_____u__" +-"http://localhost/aris/sap_model.owl#enzz__6_____u__" +-"http://localhost/aris/sap_model.owl#ekxh__6_____u__" +-"http://localhost/aris/sap_model.owl#ej9p__6_____u__" +-"http://localhost/aris/sap_model.owl#ej2o__6_____u__" +-"http://localhost/aris/sap_model.owl#ejoi__6_____u__" +-"http://localhost/aris/sap_model.owl#el9e__6_____u__" +-"http://localhost/aris/sap_model.owl#emxa__6_____u__" +-"http://localhost/aris/sap_model.owl#em1u__6_____u__" +-"http://localhost/aris/sap_model.owl#em4i__6_____u__" +-"http://localhost/aris/sap_model.owl#ekzl__6_____u__" +-"http://localhost/aris/sap_model.owl#emfr__6_____u__" +-"http://localhost/aris/sap_model.owl#em9e__6_____u__" +-"http://localhost/aris/sap_model.owl#4yg7__6_____u__" +-"http://localhost/aris/sap_model.owl#4xi8__6_____u__" +-"http://localhost/aris/sap_model.owl#4vfd__6_____u__" +-"http://localhost/aris/sap_model.owl#4wuf__6_____u__" +-"http://localhost/aris/sap_model.owl#4uwz__6_____u__" +-"http://localhost/aris/sap_model.owl#4x3d__6_____u__" +-"http://localhost/aris/sap_model.owl#4ykg__6_____u__" +-"http://localhost/aris/sap_model.owl#4xn9__6_____u__" +-"http://localhost/aris/sap_model.owl#4l8l__6_____u__" +-"http://localhost/aris/sap_model.owl#4jnk__6_____u__" +-"http://localhost/aris/sap_model.owl#4i9n__6_____u__" +-"http://localhost/aris/sap_model.owl#4i4i__6_____u__" +-"http://localhost/aris/sap_model.owl#4ht3__6_____u__" +-"http://localhost/aris/sap_model.owl#4ipr__6_____u__" +-"http://localhost/aris/sap_model.owl#4lfa__6_____u__" +-"http://localhost/aris/sap_model.owl#4j9j__6_____u__" +-"http://localhost/aris/sap_model.owl#4j34__6_____u__" +-"http://localhost/aris/sap_model.owl#4i08__6_____u__" +-"http://localhost/aris/sap_model.owl#4uy4__6_____u__" +-"http://localhost/aris/sap_model.owl#4r9c__6_____u__" +-"http://localhost/aris/sap_model.owl#4tyc__6_____u__" +-"http://localhost/aris/sap_model.owl#4v31__6_____u__" +-"http://localhost/aris/sap_model.owl#4t2o__6_____u__" +-"http://localhost/aris/sap_model.owl#4v8t__6_____u__" +-"http://localhost/aris/sap_model.owl#4w1p__6_____u__" +-"http://localhost/aris/sap_model.owl#4sv1__6_____u__" +-"http://localhost/aris/sap_model.owl#4qxb__6_____u__" +-"http://localhost/aris/sap_model.owl#4obf__6_____u__" +-"http://localhost/aris/sap_model.owl#4mh7__6_____u__" +-"http://localhost/aris/sap_model.owl#4n80__6_____u__" +-"http://localhost/aris/sap_model.owl#4qkx__6_____u__" +-"http://localhost/aris/sap_model.owl#4q6d__6_____u__" +-"http://localhost/aris/sap_model.owl#4r5j__6_____u__" +-"http://localhost/aris/sap_model.owl#4o9a__6_____u__" +-"http://localhost/aris/sap_model.owl#4sga__6_____u__" +-"http://localhost/aris/sap_model.owl#4ro2__6_____u__" +-"http://localhost/aris/sap_model.owl#4sjf__6_____u__" +-"http://localhost/aris/sap_model.owl#4rm0__6_____u__" +-"http://localhost/aris/sap_model.owl#4rjd__6_____u__" +-"http://localhost/aris/sap_model.owl#4vqy__6_____u__" +-"http://localhost/aris/sap_model.owl#4vnd__6_____u__" +-"http://localhost/aris/sap_model.owl#4w4p__6_____u__" +-"http://localhost/aris/sap_model.owl#4vgc__6_____u__" +-"http://localhost/aris/sap_model.owl#4voc__6_____u__" +-"http://localhost/aris/sap_model.owl#hjxq__6_____u__" +-"http://localhost/aris/sap_model.owl#homv__6_____u__" +-"http://localhost/aris/sap_model.owl#hmx6__6_____u__" +-"http://localhost/aris/sap_model.owl#hmzz__6_____u__" +-"http://localhost/aris/sap_model.owl#hkex__6_____u__" +-"http://localhost/aris/sap_model.owl#igdo__6_____u__" +-"http://localhost/aris/sap_model.owl#id60__6_____u__" +-"http://localhost/aris/sap_model.owl#iizc__6_____u__" +-"http://localhost/aris/sap_model.owl#ijew__6_____u__" +-"http://localhost/aris/sap_model.owl#ijqf__6_____u__" +-"http://localhost/aris/sap_model.owl#igxm__6_____u__" +-"http://localhost/aris/sap_model.owl#ihvs__6_____u__" +-"http://localhost/aris/sap_model.owl#iepe__6_____u__" +-"http://localhost/aris/sap_model.owl#iboq__6_____u__" +-"http://localhost/aris/sap_model.owl#ihc5__6_____u__" +-"http://localhost/aris/sap_model.owl#hvec__6_____u__" +-"http://localhost/aris/sap_model.owl#hx2y__6_____u__" +-"http://localhost/aris/sap_model.owl#hqla__6_____u__" +-"http://localhost/aris/sap_model.owl#hr3q__6_____u__" +-"http://localhost/aris/sap_model.owl#hpu9__6_____u__" +-"http://localhost/aris/sap_model.owl#hr6q__6_____u__" +-"http://localhost/aris/sap_model.owl#hsjg__6_____u__" +-"http://localhost/aris/sap_model.owl#hvbv__6_____u__" +-"http://localhost/aris/sap_model.owl#hxhi__6_____u__" +-"http://localhost/aris/sap_model.owl#huso__6_____u__" +-"http://localhost/aris/sap_model.owl#i8c9__6_____u__" +-"http://localhost/aris/sap_model.owl#i9c3__6_____u__" +-"http://localhost/aris/sap_model.owl#i8fl__6_____u__" +-"http://localhost/aris/sap_model.owl#i790__6_____u__" +-"http://localhost/aris/sap_model.owl#i88u__6_____u__" +-"http://localhost/aris/sap_model.owl#i8bc__6_____u__" +-"http://localhost/aris/sap_model.owl#j6qh__6_____u__" +-"http://localhost/aris/sap_model.owl#ixva__6_____u__" +-"http://localhost/aris/sap_model.owl#j2ut__6_____u__" +-"http://localhost/aris/sap_model.owl#ixwi__6_____u__" +-"http://localhost/aris/sap_model.owl#iscv__6_____u__" +-"http://localhost/aris/sap_model.owl#iyd1__6_____u__" +-"http://localhost/aris/sap_model.owl#jnbo__6_____u__" +-"http://localhost/aris/sap_model.owl#ji50__6_____u__" +-"http://localhost/aris/sap_model.owl#jeat__6_____u__" +-"http://localhost/aris/sap_model.owl#jh8f__6_____u__" +-"http://localhost/aris/sap_model.owl#jlhu__6_____u__" +-"http://localhost/aris/sap_model.owl#jhka__6_____u__" +-"http://localhost/aris/sap_model.owl#j7i2__6_____u__" +-"http://localhost/aris/sap_model.owl#jb85__6_____u__" +-"http://localhost/aris/sap_model.owl#j5cv__6_____u__" +-"http://localhost/aris/sap_model.owl#jb3d__6_____u__" +-"http://localhost/aris/sap_model.owl#j9qt__6_____u__" +-"http://localhost/aris/sap_model.owl#ja1v__6_____u__" +-"http://localhost/aris/sap_model.owl#j8db__6_____u__" +-"http://localhost/aris/sap_model.owl#jetm__6_____u__" +-"http://localhost/aris/sap_model.owl#i4dv__6_____u__" +-"http://localhost/aris/sap_model.owl#i5b6__6_____u__" +-"http://localhost/aris/sap_model.owl#i0mk__6_____u__" +-"http://localhost/aris/sap_model.owl#i4ho__6_____u__" +-"http://localhost/aris/sap_model.owl#i2tc__6_____u__" +-"http://localhost/aris/sap_model.owl#i2ou__6_____u__" +-"http://localhost/aris/sap_model.owl#i4h1__6_____u__" +-"http://localhost/aris/sap_model.owl#hzj0__6_____u__" +-"http://localhost/aris/sap_model.owl#j5et__6_____u__" +-"http://localhost/aris/sap_model.owl#j4al__6_____u__" +-"http://localhost/aris/sap_model.owl#j6p6__6_____u__" +-"http://localhost/aris/sap_model.owl#i8hi__6_____u__" +-"http://localhost/aris/sap_model.owl#i81h__6_____u__" +-"http://localhost/aris/sap_model.owl#i49h__6_____u__" +-"http://localhost/aris/sap_model.owl#islm__6_____u__" +-"http://localhost/aris/sap_model.owl#irlg__6_____u__" +-"http://localhost/aris/sap_model.owl#iu8y__6_____u__" +-"http://localhost/aris/sap_model.owl#iumo__6_____u__" +-"http://localhost/aris/sap_model.owl#iu5h__6_____u__" +-"http://localhost/aris/sap_model.owl#iown__6_____u__" +-"http://localhost/aris/sap_model.owl#ik0f__6_____u__" +-"http://localhost/aris/sap_model.owl#io1e__6_____u__" +-"http://localhost/aris/sap_model.owl#ik2h__6_____u__" +-"http://localhost/aris/sap_model.owl#ijvc__6_____u__" +-"http://localhost/aris/sap_model.owl#iqgz__6_____u__" +-"http://localhost/aris/sap_model.owl#h1eg__6_____u__" +-"http://localhost/aris/sap_model.owl#h1i2__6_____u__" +-"http://localhost/aris/sap_model.owl#h1bl__6_____u__" +-"http://localhost/aris/sap_model.owl#h0w8__6_____u__" +-"http://localhost/aris/sap_model.owl#h18q__6_____u__" +-"http://localhost/aris/sap_model.owl#h10g__6_____u__" +-"http://localhost/aris/sap_model.owl#h0gk__6_____u__" +-"http://localhost/aris/sap_model.owl#h19w__6_____u__" +-"http://localhost/aris/sap_model.owl#h0eo__6_____u__" +-"http://localhost/aris/sap_model.owl#h0aw__6_____u__" +-"http://localhost/aris/sap_model.owl#h02z__6_____u__" +-"http://localhost/aris/sap_model.owl#h14u__6_____u__" +-"http://localhost/aris/sap_model.owl#h0kc__6_____u__" +-"http://localhost/aris/sap_model.owl#h01s__6_____u__" +-"http://localhost/aris/sap_model.owl#h1mi__6_____u__" +-"http://localhost/aris/sap_model.owl#h1p7__6_____u__" +-"http://localhost/aris/sap_model.owl#h1kp__6_____u__" +-"http://localhost/aris/sap_model.owl#h1wt__6_____u__" +-"http://localhost/aris/sap_model.owl#78j5__6_____u__" +-"http://localhost/aris/sap_model.owl#77fr__6_____u__" +-"http://localhost/aris/sap_model.owl#77ha__6_____u__" +-"http://localhost/aris/sap_model.owl#76j9__6_____u__" +-"http://localhost/aris/sap_model.owl#76dm__6_____u__" +-"http://localhost/aris/sap_model.owl#771m__6_____u__" +-"http://localhost/aris/sap_model.owl#75u8__6_____u__" +-"http://localhost/aris/sap_model.owl#778f__6_____u__" +-"http://localhost/aris/sap_model.owl#77sm__6_____u__" +-"http://localhost/aris/sap_model.owl#78gl__6_____u__" +-"http://localhost/aris/sap_model.owl#77rn__6_____u__" +-"http://localhost/aris/sap_model.owl#77dc__6_____u__" +-"http://localhost/aris/sap_model.owl#77kf__6_____u__" +-"http://localhost/aris/sap_model.owl#78kg__6_____u__" +-"http://localhost/aris/sap_model.owl#76kd__6_____u__" +-"http://localhost/aris/sap_model.owl#760b__6_____u__" +-"http://localhost/aris/sap_model.owl#76ii__6_____u__" +-"http://localhost/aris/sap_model.owl#7736__6_____u__" +-"http://localhost/aris/sap_model.owl#76ck__6_____u__" +-"http://localhost/aris/sap_model.owl#c1pu__6_____u__" +-"http://localhost/aris/sap_model.owl#c1g6__6_____u__" +-"http://localhost/aris/sap_model.owl#c1bw__6_____u__" +-"http://localhost/aris/sap_model.owl#c1kv__6_____u__" +-"http://localhost/aris/sap_model.owl#c0x2__6_____u__" +-"http://localhost/aris/sap_model.owl#c0y6__6_____u__" +-"http://localhost/aris/sap_model.owl#c151__6_____u__" +-"http://localhost/aris/sap_model.owl#fsgs__6_____u__" +-"http://localhost/aris/sap_model.owl#fmkt__6_____u__" +-"http://localhost/aris/sap_model.owl#fqrn__6_____u__" +-"http://localhost/aris/sap_model.owl#fnho__6_____u__" +-"http://localhost/aris/sap_model.owl#ft1j__6_____u__" +-"http://localhost/aris/sap_model.owl#fv3w__6_____u__" +-"http://localhost/aris/sap_model.owl#frz4__6_____u__" +-"http://localhost/aris/sap_model.owl#fpnp__6_____u__" +-"http://localhost/aris/sap_model.owl#fv39__6_____u__" +-"http://localhost/aris/sap_model.owl#fwtp__6_____u__" +-"http://localhost/aris/sap_model.owl#fp95__6_____u__" +-"http://localhost/aris/sap_model.owl#fkox__6_____u__" +-"http://localhost/aris/sap_model.owl#fm7t__6_____u__" +-"http://localhost/aris/sap_model.owl#flr4__6_____u__" +-"http://localhost/aris/sap_model.owl#fo3a__6_____u__" +-"http://localhost/aris/sap_model.owl#fxwe__6_____u__" +-"http://localhost/aris/sap_model.owl#fx5n__6_____u__" +-"http://localhost/aris/sap_model.owl#fxqy__6_____u__" +-"http://localhost/aris/sap_model.owl#furr__6_____u__" +-"http://localhost/aris/sap_model.owl#ftgq__6_____u__" +-"http://localhost/aris/sap_model.owl#e32o__6_____u__" +-"http://localhost/aris/sap_model.owl#e4j0__6_____u__" +-"http://localhost/aris/sap_model.owl#e316__6_____u__" +-"http://localhost/aris/sap_model.owl#e4lg__6_____u__" +-"http://localhost/aris/sap_model.owl#e26q__6_____u__" +-"http://localhost/aris/sap_model.owl#dzmt__6_____u__" +-"http://localhost/aris/sap_model.owl#e1g3__6_____u__" +-"http://localhost/aris/sap_model.owl#e1qq__6_____u__" +-"http://localhost/aris/sap_model.owl#e7o0__6_____u__" +-"http://localhost/aris/sap_model.owl#e6ho__6_____u__" +-"http://localhost/aris/sap_model.owl#e5ek__6_____u__" +-"http://localhost/aris/sap_model.owl#e3fm__6_____u__" +-"http://localhost/aris/sap_model.owl#e98x__6_____u__" +-"http://localhost/aris/sap_model.owl#e58d__6_____u__" +-"http://localhost/aris/sap_model.owl#eaxm__6_____u__" +-"http://localhost/aris/sap_model.owl#e90r__6_____u__" +-"http://localhost/aris/sap_model.owl#ebci__6_____u__" +-"http://localhost/aris/sap_model.owl#e9be__6_____u__" +-"http://localhost/aris/sap_model.owl#bth2__6_____u__" +-"http://localhost/aris/sap_model.owl#bsmj__6_____u__" +-"http://localhost/aris/sap_model.owl#btkk__6_____u__" +-"http://localhost/aris/sap_model.owl#bt9b__6_____u__" +-"http://localhost/aris/sap_model.owl#6z59__6_____u__" +-"http://localhost/aris/sap_model.owl#6v5t__6_____u__" +-"http://localhost/aris/sap_model.owl#70n8__6_____u__" +-"http://localhost/aris/sap_model.owl#f1v1__6_____u__" +-"http://localhost/aris/sap_model.owl#f1o2__6_____u__" +-"http://localhost/aris/sap_model.owl#f20d__6_____u__" +-"http://localhost/aris/sap_model.owl#f0j9__6_____u__" +-"http://localhost/aris/sap_model.owl#ewxa__6_____u__" +-"http://localhost/aris/sap_model.owl#evs9__6_____u__" +-"http://localhost/aris/sap_model.owl#exb2__6_____u__" +-"http://localhost/aris/sap_model.owl#ez6u__6_____u__" +-"http://localhost/aris/sap_model.owl#f0tz__6_____u__" +-"http://localhost/aris/sap_model.owl#ey81__6_____u__" +-"http://localhost/aris/sap_model.owl#eypi__6_____u__" +-"http://localhost/aris/sap_model.owl#exc0__6_____u__" +-"http://localhost/aris/sap_model.owl#evzb__6_____u__" +-"http://localhost/aris/sap_model.owl#ezxm__6_____u__" +-"http://localhost/aris/sap_model.owl#exvu__6_____u__" +-"http://localhost/aris/sap_model.owl#ey67__6_____u__" +-"http://localhost/aris/sap_model.owl#f5v9__6_____u__" +-"http://localhost/aris/sap_model.owl#f2g1__6_____u__" +-"http://localhost/aris/sap_model.owl#f2xt__6_____u__" +-"http://localhost/aris/sap_model.owl#f246__6_____u__" +-"http://localhost/aris/sap_model.owl#f5nz__6_____u__" +-"http://localhost/aris/sap_model.owl#f02l__6_____u__" +-"http://localhost/aris/sap_model.owl#f8jj__6_____u__" +-"http://localhost/aris/sap_model.owl#f4z3__6_____u__" +-"http://localhost/aris/sap_model.owl#f46s__6_____u__" +-"http://localhost/aris/sap_model.owl#f9gr__6_____u__" +-"http://localhost/aris/sap_model.owl#f7ab__6_____u__" +-"http://localhost/aris/sap_model.owl#f7tj__6_____u__" +-"http://localhost/aris/sap_model.owl#f86h__6_____u__" +-"http://localhost/aris/sap_model.owl#f4b5__6_____u__" +-"http://localhost/aris/sap_model.owl#f4xj__6_____u__" +-"http://localhost/aris/sap_model.owl#fc08__6_____u__" +-"http://localhost/aris/sap_model.owl#fa54__6_____u__" +-"http://localhost/aris/sap_model.owl#fa2t__6_____u__" +-"http://localhost/aris/sap_model.owl#fbg0__6_____u__" Added: trunk/examples/epc/rs004.conf =================================================================== --- trunk/examples/epc/rs004.conf (rev 0) +++ trunk/examples/epc/rs004.conf 2009-02-04 12:38:28 UTC (rev 1585) @@ -0,0 +1,563 @@ +import("sap_epc.owl"); + +refexamples.startClass = "http://localhost/aris/sap_model.owl#EPC"; +refexamples.expansionPenaltyFactor = 0.5; + ++"http://localhost/aris/sap_model.owl#4vqy__6_____u__" ++"http://localhost/aris/sap_model.owl#ab0h__6_____u__" ++"http://localhost/aris/sap_model.owl#9p75__6_____u__" ++"http://localhost/aris/sap_model.owl#kkdc__6_____u__" ++"http://localhost/aris/sap_model.owl#iscv__6_____u__" ++"http://localhost/aris/sap_model.owl#i4dv__6_____u__" +-"http://localhost/aris/sap_model.owl#50ni__6_____u__" +-"http://localhost/aris/sap_model.owl#516w__6_____u__" +-"http://localhost/aris/sap_model.owl#50uc__6_____u__" +-"http://localhost/aris/sap_model.owl#51b6__6_____u__" +-"http://localhost/aris/sap_model.owl#507i__6_____u__" +-"http://localhost/aris/sap_model.owl#5085__6_____u__" +-"http://localhost/aris/sap_model.owl#g3ck__6_____u__" +-"http://localhost/aris/sap_model.owl#63c3__6_____u__" +-"http://localhost/aris/sap_model.owl#61eo__6_____u__" +-"http://localhost/aris/sap_model.owl#61hp__6_____u__" +-"http://localhost/aris/sap_model.owl#5vor__6_____u__" +-"http://localhost/aris/sap_model.owl#5z4t__6_____u__" +-"http://localhost/aris/sap_model.owl#5xci__6_____u__" +-"http://localhost/aris/sap_model.owl#5ybj__6_____u__" +-"http://localhost/aris/sap_model.owl#5yqw__6_____u__" +-"http://localhost/aris/sap_model.owl#6ovg__6_____u__" +-"http://localhost/aris/sap_model.owl#6kzx__6_____u__" +-"http://localhost/aris/sap_model.owl#6kjs__6_____u__" +-"http://localhost/aris/sap_model.owl#6oqu__6_____u__" +-"http://localhost/aris/sap_model.owl#6kw0__6_____u__" +-"http://localhost/aris/sap_model.owl#6oil__6_____u__" +-"http://localhost/aris/sap_model.owl#6kyy__6_____u__" +-"http://localhost/aris/sap_model.owl#6l2h__6_____u__" +-"http://localhost/aris/sap_model.owl#6kxi__6_____u__" +-"http://localhost/aris/sap_model.owl#6911__6_____u__" +-"http://localhost/aris/sap_model.owl#68kr__6_____u__" +-"http://localhost/aris/sap_model.owl#66np__6_____u__" +-"http://localhost/aris/sap_model.owl#6ag9__6_____u__" +-"http://localhost/aris/sap_model.owl#61op__6_____u__" +-"http://localhost/aris/sap_model.owl#65ec__6_____u__" +-"http://localhost/aris/sap_model.owl#69z8__6_____u__" +-"http://localhost/aris/sap_model.owl#6arq__6_____u__" +-"http://localhost/aris/sap_model.owl#6att__6_____u__" +-"http://localhost/aris/sap_model.owl#6auj__6_____u__" +-"http://localhost/aris/sap_model.owl#6bgn__6_____u__" +-"http://localhost/aris/sap_model.owl#6bp9__6_____u__" +-"http://localhost/aris/sap_model.owl#6bj9__6_____u__" +-"http://localhost/aris/sap_model.owl#6kn7__6_____u__" +-"http://localhost/aris/sap_model.owl#6dua__6_____u__" +-"http://localhost/aris/sap_model.owl#6d0p__6_____u__" +-"http://localhost/aris/sap_model.owl#6jls__6_____u__" +-"http://localhost/aris/sap_model.owl#6gcc__6_____u__" +-"http://localhost/aris/sap_model.owl#6d1r__6_____u__" +-"http://localhost/aris/sap_model.owl#6fc3__6_____u__" +-"http://localhost/aris/sap_model.owl#8n3o__6_____u__" +-"http://localhost/aris/sap_model.owl#8kx7__6_____u__" +-"http://localhost/aris/sap_model.owl#8n7u__6_____u__" +-"http://localhost/aris/sap_model.owl#8lj0__6_____u__" +-"http://localhost/aris/sap_model.owl#8ipa__6_____u__" +-"http://localhost/aris/sap_model.owl#8iaj__6_____u__" +-"http://localhost/aris/sap_model.owl#8ge4__6_____u__" +-"http://localhost/aris/sap_model.owl#8gur__6_____u__" +-"http://localhost/aris/sap_model.owl#84bz__6_____u__" +-"http://localhost/aris/sap_model.owl#889d__6_____u__" +-"http://localhost/aris/sap_model.owl#7zjv__6_____u__" +-"http://localhost/aris/sap_model.owl#8hyg__6_____u__" +-"http://localhost/aris/sap_model.owl#855w__6_____u__" +-"http://localhost/aris/sap_model.owl#7zox__6_____u__" +-"http://localhost/aris/sap_model.owl#7wqf__6_____u__" +-"http://localhost/aris/sap_model.owl#7ycv__6_____u__" +-"http://localhost/aris/sap_model.owl#7uzb__6_____u__" +-"http://localhost/aris/sap_model.owl#7wix__6_____u__" +-"http://localhost/aris/sap_model.owl#7z58__6_____u__" +-"http://localhost/aris/sap_model.owl#c7ds__6_____u__" +-"http://localhost/aris/sap_model.owl#c6yt__6_____u__" +-"http://localhost/aris/sap_model.owl#c71n__6_____u__" +-"http://localhost/aris/sap_model.owl#c7cn__6_____u__" +-"http://localhost/aris/sap_model.owl#dqj1__6_____u__" +-"http://localhost/aris/sap_model.owl#dimh__6_____u__" +-"http://localhost/aris/sap_model.owl#dnbu__6_____u__" +-"http://localhost/aris/sap_model.owl#dj9i__6_____u__" +-"http://localhost/aris/sap_model.owl#dker__6_____u__" +-"http://localhost/aris/sap_model.owl#dlp9__6_____u__" +-"http://localhost/aris/sap_model.owl#dj4q__6_____u__" +-"http://localhost/aris/sap_model.owl#dmai__6_____u__" +-"http://localhost/aris/sap_model.owl#dru2__6_____u__" +-"http://localhost/aris/sap_model.owl#dkg5__6_____u__" +-"http://localhost/aris/sap_model.owl#dln6__6_____u__" +-"http://localhost/aris/sap_model.owl#ducq__6_____u__" +-"http://localhost/aris/sap_model.owl#drx7__6_____u__" +-"http://localhost/aris/sap_model.owl#duf5__6_____u__" +-"http://localhost/aris/sap_model.owl#dujr__6_____u__" +-"http://localhost/aris/sap_model.owl#dt8o__6_____u__" +-"http://localhost/aris/sap_model.owl#dqry__6_____u__" +-"http://localhost/aris/sap_model.owl#dqy6__6_____u__" +-"http://localhost/aris/sap_model.owl#drmj__6_____u__" +-"http://localhost/aris/sap_model.owl#dql9__6_____u__" +-"http://localhost/aris/sap_model.owl#dbat__6_____u__" +-"http://localhost/aris/sap_model.owl#dcra__6_____u__" +-"http://localhost/aris/sap_model.owl#dhk7__6_____u__" +-"http://localhost/aris/sap_model.owl#dcsd__6_____u__" +-"http://localhost/aris/sap_model.owl#dc13__6_____u__" +-"http://localhost/aris/sap_model.owl#dg96__6_____u__" +-"http://localhost/aris/sap_model.owl#ch2j__6_____u__" +-"http://localhost/aris/sap_model.owl#chl5__6_____u__" +-"http://localhost/aris/sap_model.owl#cgv0__6_____u__" +-"http://localhost/aris/sap_model.owl#chp0__6_____u__" +-"http://localhost/aris/sap_model.owl#cgos__6_____u__" +-"http://localhost/aris/sap_model.owl#cho1__6_____u__" +-"http://localhost/aris/sap_model.owl#cg1a__6_____u__" +-"http://localhost/aris/sap_model.owl#cgyi__6_____u__" +-"http://localhost/aris/sap_model.owl#cfrg__6_____u__" +-"http://localhost/aris/sap_model.owl#cg2c__6_____u__" +-"http://localhost/aris/sap_model.owl#cgeu__6_____u__" +-"http://localhost/aris/sap_model.owl#cgpi__6_____u__" +-"http://localhost/aris/sap_model.owl#c9qp__6_____u__" +-"http://localhost/aris/sap_model.owl#c8oi__6_____u__" +-"http://localhost/aris/sap_model.owl#c95g__6_____u__" +-"http://localhost/aris/sap_model.owl#c9cx__6_____u__" +-"http://localhost/aris/sap_model.owl#c9er__6_____u__" +-"http://localhost/aris/sap_model.owl#c8vk__6_____u__" +-"http://localhost/aris/sap_model.owl#c9on__6_____u__" +-"http://localhost/aris/sap_model.owl#c8wu__6_____u__" +-"http://localhost/aris/sap_model.owl#c8n6__6_____u__" +-"http://localhost/aris/sap_model.owl#ccir__6_____u__" +-"http://localhost/aris/sap_model.owl#cbf8__6_____u__" +-"http://localhost/aris/sap_model.owl#ccql__6_____u__" +-"http://localhost/aris/sap_model.owl#cbef__6_____u__" +-"http://localhost/aris/sap_model.owl#ccdu__6_____u__" +-"http://localhost/aris/sap_model.owl#cd7p__6_____u__" +-"http://localhost/aris/sap_model.owl#ccg2__6_____u__" +-"http://localhost/aris/sap_model.owl#cbkc__6_____u__" +-"http://localhost/aris/sap_model.owl#cd0q__6_____u__" +-"http://localhost/aris/sap_model.owl#ccvp__6_____u__" +-"http://localhost/aris/sap_model.owl#akp2__6_____u__" +-"http://localhost/aris/sap_model.owl#aj3r__6_____u__" +-"http://localhost/aris/sap_model.owl#ajhu__6_____u__" +-"http://localhost/aris/sap_model.owl#ajyf__6_____u__" +-"http://localhost/aris/sap_model.owl#aij8__6_____u__" +-"http://localhost/aris/sap_model.owl#akxt__6_____u__" +-"http://localhost/aris/sap_model.owl#aiy4__6_____u__" +-"http://localhost/aris/sap_model.owl#ahni__6_____u__" +-"http://localhost/aris/sap_model.owl#af08__6_____u__" +-"http://localhost/aris/sap_model.owl#adbo__6_____u__" +-"http://localhost/aris/sap_model.owl#aigh__6_____u__" +-"http://localhost/aris/sap_model.owl#afzd__6_____u__" +-"http://localhost/aris/sap_model.owl#afp9__6_____u__" +-"http://localhost/aris/sap_model.owl#afho__6_____u__" +-"http://localhost/aris/sap_model.owl#aefa__6_____u__" +-"http://localhost/aris/sap_model.owl#ahd4__6_____u__" +-"http://localhost/aris/sap_model.owl#aeha__6_____u__" +-"http://localhost/aris/sap_model.owl#acyq__6_____u__" +-"http://localhost/aris/sap_model.owl#abfq__6_____u__" +-"http://localhost/aris/sap_model.owl#aa1t__6_____u__" +-"http://localhost/aris/sap_model.owl#aasl__6_____u__" +-"http://localhost/aris/sap_model.owl#a9bp__6_____u__" +-"http://localhost/aris/sap_model.owl#ach1__6_____u__" +-"http://localhost/aris/sap_model.owl#a8go__6_____u__" +-"http://localhost/aris/sap_model.owl#aa6t__6_____u__" +-"http://localhost/aris/sap_model.owl#a8yv__6_____u__" +-"http://localhost/aris/sap_model.owl#a4v3__6_____u__" +-"http://localhost/aris/sap_model.owl#a6dy__6_____u__" +-"http://localhost/aris/sap_model.owl#a5x8__6_____u__" +-"http://localhost/aris/sap_model.owl#a6j4__6_____u__" +-"http://localhost/aris/sap_model.owl#a581__6_____u__" +-"http://localhost/aris/sap_model.owl#a6fe__6_____u__" +-"http://localhost/aris/sap_model.owl#a71i__6_____u__" +-"http://localhost/aris/sap_model.owl#aah7__6_____u__" +-"http://localhost/aris/sap_model.owl#gg1j__6_____u__" +-"http://localhost/aris/sap_model.owl#ggr0__6_____u__" +-"http://localhost/aris/sap_model.owl#gglw__6_____u__" +-"http://localhost/aris/sap_model.owl#geuv__6_____u__" +-"http://localhost/aris/sap_model.owl#gfe6__6_____u__" +-"http://localhost/aris/sap_model.owl#gp4y__6_____u__" +-"http://localhost/aris/sap_model.owl#gpjp__6_____u__" +-"http://localhost/aris/sap_model.owl#gpcp__6_____u__" +-"http://localhost/aris/sap_model.owl#gjto__6_____u__" +-"http://localhost/aris/sap_model.owl#gnef__6_____u__" +-"http://localhost/aris/sap_model.owl#gip6__6_____u__" +-"http://localhost/aris/sap_model.owl#ggjx__6_____u__" +-"http://localhost/aris/sap_model.owl#gt4o__6_____u__" +-"http://localhost/aris/sap_model.owl#gtgq__6_____u__" +-"http://localhost/aris/sap_model.owl#gt8e__6_____u__" +-"http://localhost/aris/sap_model.owl#grmz__6_____u__" +-"http://localhost/aris/sap_model.owl#gexk__6_____u__" +-"http://localhost/aris/sap_model.owl#gebx__6_____u__" +-"http://localhost/aris/sap_model.owl#gf0e__6_____u__" +-"http://localhost/aris/sap_model.owl#gdfs__6_____u__" +-"http://localhost/aris/sap_model.owl#gcw4__6_____u__" +-"http://localhost/aris/sap_model.owl#ge1x__6_____u__" +-"http://localhost/aris/sap_model.owl#9h55__6_____u__" +-"http://localhost/aris/sap_model.owl#9fin__6_____u__" +-"http://localhost/aris/sap_model.owl#9gsz__6_____u__" +-"http://localhost/aris/sap_model.owl#9hya__6_____u__" +-"http://localhost/aris/sap_model.owl#9evo__6_____u__" +-"http://localhost/aris/sap_model.owl#9f4c__6_____u__" +-"http://localhost/aris/sap_model.owl#9ggc__6_____u__" +-"http://localhost/aris/sap_model.owl#9fxy__6_____u__" +-"http://localhost/aris/sap_model.owl#9fvu__6_____u__" +-"http://localhost/aris/sap_model.owl#9hu2__6_____u__" +-"http://localhost/aris/sap_model.owl#99br__6_____u__" +-"http://localhost/aris/sap_model.owl#99ha__6_____u__" +-"http://localhost/aris/sap_model.owl#972n__6_____u__" +-"http://localhost/aris/sap_model.owl#991g__6_____u__" +-"http://localhost/aris/sap_model.owl#997a__6_____u__" +-"http://localhost/aris/sap_model.owl#995e__6_____u__" +-"http://localhost/aris/sap_model.owl#983c__6_____u__" +-"http://localhost/aris/sap_model.owl#9j00__6_____u__" +-"http://localhost/aris/sap_model.owl#9jpf__6_____u__" +-"http://localhost/aris/sap_model.owl#9jja__6_____u__" +-"http://localhost/aris/sap_model.owl#9h2r__6_____u__" +-"http://localhost/aris/sap_model.owl#9how__6_____u__" +-"http://localhost/aris/sap_model.owl#9hcr__6_____u__" +-"http://localhost/aris/sap_model.owl#96xz__6_____u__" +-"http://localhost/aris/sap_model.owl#95zq__6_____u__" +-"http://localhost/aris/sap_model.owl#96gk__6_____u__" +-"http://localhost/aris/sap_model.owl#96ru__6_____u__" +-"http://localhost/aris/sap_model.owl#976n__6_____u__" +-"http://localhost/aris/sap_model.owl#9eke__6_____u__" +-"http://localhost/aris/sap_model.owl#9e21__6_____u__" +-"http://localhost/aris/sap_model.owl#9dro__6_____u__" +-"http://localhost/aris/sap_model.owl#9frs__6_____u__" +-"http://localhost/aris/sap_model.owl#9ep8__6_____u__" +-"http://localhost/aris/sap_model.owl#9e0n__6_____u__" +-"http://localhost/aris/sap_model.owl#9d5x__6_____u__" +-"http://localhost/aris/sap_model.owl#9dzw__6_____u__" +-"http://localhost/aris/sap_model.owl#9d7v__6_____u__" +-"http://localhost/aris/sap_model.owl#9bil__6_____u__" +-"http://localhost/aris/sap_model.owl#992a__6_____u__" +-"http://localhost/aris/sap_model.owl#9a0x__6_____u__" +-"http://localhost/aris/sap_model.owl#99u1__6_____u__" +-"http://localhost/aris/sap_model.owl#9anc__6_____u__" +-"http://localhost/aris/sap_model.owl#9a96__6_____u__" +-"http://localhost/aris/sap_model.owl#9aan__6_____u__" +-"http://localhost/aris/sap_model.owl#99i2__6_____u__" +-"http://localhost/aris/sap_model.owl#9aph__6_____u__" +-"http://localhost/aris/sap_model.owl#99x2__6_____u__" +-"http://localhost/aris/sap_model.owl#98q5__6_____u__" +-"http://localhost/aris/sap_model.owl#9cv7__6_____u__" +-"http://localhost/aris/sap_model.owl#9c3q__6_____u__" +-"http://localhost/aris/sap_model.owl#9b2c__6_____u__" +-"http://localhost/aris/sap_model.owl#9b87__6_____u__" +-"http://localhost/aris/sap_model.owl#9cad__6_____u__" +-"http://localhost/aris/sap_model.owl#9avk__6_____u__" +-"http://localhost/aris/sap_model.owl#9rj5__6_____u__" +-"http://localhost/aris/sap_model.owl#9q92__6_____u__" +-"http://localhost/aris/sap_model.owl#9nou__6_____u__" +-"http://localhost/aris/sap_model.owl#9px6__6_____u__" +-"http://localhost/aris/sap_model.owl#9r57__6_____u__" +-"http://localhost/aris/sap_model.owl#gxta__6_____u__" +-"http://localhost/aris/sap_model.owl#gxc0__6_____u__" +-"http://localhost/aris/sap_model.owl#gyaq__6_____u__" +-"http://localhost/aris/sap_model.owl#gxya__6_____u__" +-"http://localhost/aris/sap_model.owl#gybj__6_____u__" +-"http://localhost/aris/sap_model.owl#gw9r__6_____u__" +-"http://localhost/aris/sap_model.owl#gvxf__6_____u__" +-"http://localhost/aris/sap_model.owl#gvzc__6_____u__" +-"http://localhost/aris/sap_model.owl#gw8a__6_____u__" +-"http://localhost/aris/sap_model.owl#gw0q__6_____u__" +-"http://localhost/aris/sap_model.owl#gwwg__6_____u__" +-"http://localhost/aris/sap_model.owl#gw53__6_____u__" +-"http://localhost/aris/sap_model.owl#baed__6_____u__" +-"http://localhost/aris/sap_model.owl#ba5l__6_____u__" +-"http://localhost/aris/sap_model.owl#b9k4__6_____u__" +-"http://localhost/aris/sap_model.owl#baoa__6_____u__" +-"http://localhost/aris/sap_model.owl#babp__6_____u__" +-"http://localhost/aris/sap_model.owl#ba62__6_____u__" +-"http://localhost/aris/sap_model.owl#bb49__6_____u__" +-"http://localhost/aris/sap_model.owl#baaw__6_____u__" +-"http://localhost/aris/sap_model.owl#b5n1__6_____u__" +-"http://localhost/aris/sap_model.owl#b4t3__6_____u__" +-"http://localhost/aris/sap_model.owl#b56l__6_____u__" +-"http://localhost/aris/sap_model.owl#b729__6_____u__" +-"http://localhost/aris/sap_model.owl#b2pa__6_____u__" +-"http://localhost/aris/sap_model.owl#b2e5__6_____u__" +-"http://localhost/aris/sap_model.owl#b958__6_____u__" +-"http://localhost/aris/sap_model.owl#b805__6_____u__" +-"http://localhost/aris/sap_model.owl#b77x__6_____u__" +-"http://localhost/aris/sap_model.owl#b1yd__6_____u__" +-"http://localhost/aris/sap_model.owl#b590__6_____u__" +-"http://localhost/aris/sap_model.owl#bia3__6_____u__" +-"http://localhost/aris/sap_model.owl#bdy4__6_____u__" +-"http://localhost/aris/sap_model.owl#biwd__6_____u__" +-"http://localhost/aris/sap_model.owl#bhbt__6_____u__" +-"http://localhost/aris/sap_model.owl#benb__6_____u__" +-"http://localhost/aris/sap_model.owl#bila__6_____u__" +-"http://localhost/aris/sap_model.owl#bcel__6_____u__" +-"http://localhost/aris/sap_model.owl#bcbw__6_____u__" +-"http://localhost/aris/sap_model.owl#bi3j__6_____u__" +-"http://localhost/aris/sap_model.owl#bde7__6_____u__" +-"http://localhost/aris/sap_model.owl#be59__6_____u__" +-"http://localhost/aris/sap_model.owl#bcuz__6_____u__" +-"http://localhost/aris/sap_model.owl#bc04__6_____u__" +-"http://localhost/aris/sap_model.owl#blwc__6_____u__" +-"http://localhost/aris/sap_model.owl#bnwq__6_____u__" +-"http://localhost/aris/sap_model.owl#blmd__6_____u__" +-"http://localhost/aris/sap_model.owl#bk60__6_____u__" +-"http://localhost/aris/sap_model.owl#bnyd__6_____u__" +-"http://localhost/aris/sap_model.owl#blgf__6_____u__" +-"http://localhost/aris/sap_model.owl#bnac__6_____u__" +-"http://localhost/aris/sap_model.owl#bm2d__6_____u__" +-"http://localhost/aris/sap_model.owl#bpgp__6_____u__" +-"http://localhost/aris/sap_model.owl#egwi__6_____u__" +-"http://localhost/aris/sap_model.owl#ehnl__6_____u__" +-"http://localhost/aris/sap_model.owl#ehp0__6_____u__" +-"http://localhost/aris/sap_model.owl#eowm__6_____u__" +-"http://localhost/aris/sap_model.owl#ep24__6_____u__" +-"http://localhost/aris/sap_model.owl#enzz__6_____u__" +-"http://localhost/aris/sap_model.owl#ekxh__6_____u__" +-"http://localhost/aris/sap_model.owl#ej9p__6_____u__" +-"http://localhost/aris/sap_model.owl#ej2o__6_____u__" +-"http://localhost/aris/sap_model.owl#ejoi__6_____u__" +-"http://localhost/aris/sap_model.owl#el9e__6_____u__" +-"http://localhost/aris/sap_model.owl#emxa__6_____u__" +-"http://localhost/aris/sap_model.owl#em1u__6_____u__" +-"http://localhost/aris/sap_model.owl#em4i__6_____u__" +-"http://localhost/aris/sap_model.owl#ekzl__6_____u__" +-"http://localhost/aris/sap_model.owl#emfr__6_____u__" +-"http://localhost/aris/sap_model.owl#em9e__6_____u__" +-"http://localhost/aris/sap_model.owl#4yg7__6_____u__" +-"http://localhost/aris/sap_model.owl#4xi8__6_____u__" +-"http://localhost/aris/sap_model.owl#4vfd__6_____u__" +-"http://localhost/aris/sap_model.owl#4wuf__6_____u__" +-"http://localhost/aris/sap_model.owl#4uwz__6_____u__" +-"http://localhost/aris/sap_model.owl#4x3d__6_____u__" +-"http://localhost/aris/sap_model.owl#4ykg__6_____u__" +-"http://localhost/aris/sap_model.owl#4xn9__6_____u__" +-"http://localhost/aris/sap_model.owl#4l8l__6_____u__" +-"http://localhost/aris/sap_model.owl#4jnk__6_____u__" +-"http://localhost/aris/sap_model.owl#4i9n__6_____u__" +-"http://localhost/aris/sap_model.owl#4i4i__6_____u__" +-"http://localhost/aris/sap_model.owl#4ht3__6_____u__" +-"http://localhost/aris/sap_model.owl#4ipr__6_____u__" +-"http://localhost/aris/sap_model.owl#4lfa__6_____u__" +-"http://localhost/aris/sap_model.owl#4j9j__6_____u__" +-"http://localhost/aris/sap_model.owl#4j34__6_____u__" +-"http://localhost/aris/sap_model.owl#4i08__6_____u__" +-"http://localhost/aris/sap_model.owl#4uy4__6_____u__" +-"http://localhost/aris/sap_model.owl#4r9c__6_____u__" +-"http://localhost/aris/sap_model.owl#4tyc__6_____u__" +-"http://localhost/aris/sap_model.owl#4v31__6_____u__" +-"http://localhost/aris/sap_model.owl#4t2o__6_____u__" +-"http://localhost/aris/sap_model.owl#4v8t__6_____u__" +-"http://localhost/aris/sap_model.owl#4w1p__6_____u__" +-"http://localhost/aris/sap_model.owl#4sv1__6_____u__" +-"http://localhost/aris/sap_model.owl#4qxb__6_____u__" +-"http://localhost/aris/sap_model.owl#4obf__6_____u__" +-"http://localhost/aris/sap_model.owl#4mh7__6_____u__" +-"http://localhost/aris/sap_model.owl#4n80__6_____u__" +-"http://localhost/aris/sap_model.owl#4qkx__6_____u__" +-"http://localhost/aris/sap_model.owl#4q6d__6_____u__" +-"http://localhost/aris/sap_model.owl#4r5j__6_____u__" +-"http://localhost/aris/sap_model.owl#4o9a__6_____u__" +-"http://localhost/aris/sap_model.owl#4sga__6_____u__" +-"http://localhost/aris/sap_model.owl#4ro2__6_____u__" +-"http://localhost/aris/sap_model.owl#4sjf__6_____u__" +-"http://localhost/aris/sap_model.owl#4rm0__6_____u__" +-"http://localhost/aris/sap_model.owl#4rjd__6_____u__" +-"http://localhost/aris/sap_model.owl#4vnd__6_____u__" +-"http://localhost/aris/sap_model.owl#4w4p__6_____u__" +-"http://localhost/aris/sap_model.owl#4vgc__6_____u__" +-"http://localhost/aris/sap_model.owl#4voc__6_____u__" +-"http://localhost/aris/sap_model.owl#hjxq__6_____u__" +-"http://localhost/aris/sap_model.owl#homv__6_____u__" +-"http://localhost/aris/sap_model.owl#hmx6__6_____u__" +-"http://localhost/aris/sap_model.owl#hmzz__6_____u__" +-"http://localhost/aris/sap_model.owl#hkex__6_____u__" +-"http://localhost/aris/sap_model.owl#igdo__6_____u__" +-"http://localhost/aris/sap_model.owl#id60__6_____u__" +-"http://localhost/aris/sap_model.owl#iizc__6_____u__" +-"http://localhost/aris/sap_model.owl#ijew__6_____u__" +-"http://localhost/aris/sap_model.owl#ijqf__6_____u__" +-"http://localhost/aris/sap_model.owl#igxm__6_____u__" +-"http://localhost/aris/sap_model.owl#ihvs__6_____u__" +-"http://localhost/aris/sap_model.owl#iepe__6_____u__" +-"http://localhost/aris/sap_model.owl#iboq__6_____u__" +-"http://localhost/aris/sap_model.owl#ihc5__6_____u__" +-"http://localhost/aris/sap_model.owl#hvec__6_____u__" +-"http://localhost/aris/sap_model.owl#hx2y__6_____u__" +-"http://localhost/aris/sap_model.owl#hqla__6_____u__" +-"http://localhost/aris/sap_model.owl#hr3q__6_____u__" +-"http://localhost/aris/sap_model.owl#hpu9__6_____u__" +-"http://localhost/aris/sap_model.owl#hr6q__6_____u__" +-"http://localhost/aris/sap_model.owl#hsjg__6_____u__" +-"http://localhost/aris/sap_model.owl#hvbv__6_____u__" +-"http://localhost/aris/sap_model.owl#hxhi__6_____u__" +-"http://localhost/aris/sap_model.owl#huso__6_____u__" +-"http://localhost/aris/sap_model.owl#i8c9__6_____u__" +-"http://localhost/aris/sap_model.owl#i9c3__6_____u__" +-"http://localhost/aris/sap_model.owl#i8fl__6_____u__" +-"http://localhost/aris/sap_model.owl#i790__6_____u__" +-"http://localhost/aris/sap_model.owl#i88u__6_____u__" +-"http://localhost/aris/sap_model.owl#i8bc__6_____u__" +-"http://localhost/aris/sap_model.owl#j6qh__6_____u__" +-"http://localhost/aris/sap_model.owl#ixva__6_____u__" +-"http://localhost/aris/sap_model.owl#j2ut__6_____u__" +-"http://localhost/aris/sap_model.owl#ixwi__6_____u__" +-"http://localhost/aris/sap_model.owl#iyd1__6_____u__" +-"http://localhost/aris/sap_model.owl#jnbo__6_____u__" +-"http://localhost/aris/sap_model.owl#ji50__6_____u__" +-"http://localhost/aris/sap_model.owl#jeat__6_____u__" +-"http://localhost/aris/sap_model.owl#jh8f__6_____u__" +-"http://localhost/aris/sap_model.owl#jlhu__6_____u__" +-"http://localhost/aris/sap_model.owl#jhka__6_____u__" +-"http://localhost/aris/sap_model.owl#j7i2__6_____u__" +-"http://localhost/aris/sap_model.owl#jb85__6_____u__" +-"http://localhost/aris/sap_model.owl#j5cv__6_____u__" +-"http://localhost/aris/sap_model.owl#jb3d__6_____u__" +-"http://localhost/aris/sap_model.owl#j9qt__6_____u__" +-"http://localhost/aris/sap_model.owl#ja1v__6_____u__" +-"http://localhost/aris/sap_model.owl#j8db__6_____u__" +-"http://localhost/aris/sap_model.owl#jetm__6_____u__" +-"http://localhost/aris/sap_model.owl#i5b6__6_____u__" +-"http://localhost/aris/sap_model.owl#i0mk__6_____u__" +-"http://localhost/aris/sap_model.owl#i4ho__6_____u__" +-"http://localhost/aris/sap_model.owl#i2tc__6_____u__" +-"http://localhost/aris/sap_model.owl#i2ou__6_____u__" +-"http://localhost/aris/sap_model.owl#i4h1__6_____u__" +-"http://localhost/aris/sap_model.owl#hzj0__6_____u__" +-"http://localhost/aris/sap_model.owl#j5et__6_____u__" +-"http://localhost/aris/sap_model.owl#j4al__6_____u__" +-"http://localhost/aris/sap_model.owl#j6p6__6_____u__" +-"http://localhost/aris/sap_model.owl#i8hi__6_____u__" +-"http://localhost/aris/sap_model.owl#i81h__6_____u__" +-"http://localhost/aris/sap_model.owl#i49h__6_____u__" +-"http://localhost/aris/sap_model.owl#islm__6_____u__" +-"http://localhost/aris/sap_model.owl#irlg__6_____u__" +-"http://localhost/aris/sap_model.owl#iu8y__6_____u__" +-"http://localhost/aris/sap_model.owl#iumo__6_____u__" +-"http://localhost/aris/sap_model.owl#iu5h__6_____u__" +-"http://localhost/aris/sap_model.owl#iown__6_____u__" +-"http://localhost/aris/sap_model.owl#ik0f__6_____u__" +-"http://localhost/aris/sap_model.owl#io1e__6_____u__" +-"http://localhost/aris/sap_model.owl#ik2h__6_____u__" +-"http://localhost/aris/sap_model.owl#ijvc__6_____u__" +-"http://localhost/aris/sap_model.owl#iqgz__6_____u__" +-"http://localhost/aris/sap_model.owl#h1eg__6_____u__" +-"http://localhost/aris/sap_model.owl#h1i2__6_____u__" +-"http://localhost/aris/sap_model.owl#h1bl__6_____u__" +-"http://localhost/aris/sap_model.owl#h0w8__6_____u__" +-"http://localhost/aris/sap_model.owl#h18q__6_____u__" +-"http://localhost/aris/sap_model.owl#h10g__6_____u__" +-"http://localhost/aris/sap_model.owl#h0gk__6_____u__" +-"http://localhost/aris/sap_model.owl#h19w__6_____u__" +-"http://localhost/aris/sap_model.owl#h0eo__6_____u__" +-"http://localhost/aris/sap_model.owl#h0aw__6_____u__" +-"http://localhost/aris/sap_model.owl#h02z__6_____u__" +-"http://localhost/aris/sap_model.owl#h14u__6_____u__" +-"http://localhost/aris/sap_model.owl#h0kc__6_____u__" +-"http://localhost/aris/sap_model.owl#h01s__6_____u__" +-"http://localhost/aris/sap_model.owl#h1mi__6_____u__" +-"http://localhost/aris/sap_model.owl#h1p7__6_____u__" +-"http://localhost/aris/sap_model.owl#h1kp__6_____u__" +-"http://localhost/aris/sap_model.owl#h1wt__6_____u__" +-"http://localhost/aris/sap_model.owl#78j5__6_____u__" +-"http://localhost/aris/sap_model.owl#77fr__6_____u__" +-"http://localhost/aris/sap_model.owl#77ha__6_____u__" +-"http://localhost/aris/sap_model.owl#76j9__6_____u__" +-"http://localhost/aris/sap_model.owl#76dm__6_____u__" +-"http://localhost/aris/sap_model.owl#771m__6_____u__" +-"http://localhost/aris/sap_model.owl#75u8__6_____u__" +-"http://localhost/aris/sap_model.owl#778f__6_____u__" +-"http://localhost/aris/sap_model.owl#77sm__6_____u__" +-"http://localhost/aris/sap_model.owl#78gl__6_____u__" +-"http://localhost/aris/sap_model.owl#77rn__6_____u__" +-"http://localhost/aris/sap_model.owl#77dc__6_____u__" +-"http://localhost/aris/sap_model.owl#77kf__6_____u__" +-"http://localhost/aris/sap_model.owl#78kg__6_____u__" +-"http://localhost/aris/sap_model.owl#76kd__6_____u__" +-"http://localhost/aris/sap_model.owl#760b__6_____u__" +-"http://localhost/aris/sap_model.owl#76ii__6_____u__" +-"http://localhost/aris/sap_model.owl#7736__6_____u__" +-"http://localhost/aris/sap_model.owl#76ck__6_____u__" +-"http://localhost/aris/sap_model.owl#c1pu__6_____u__" +-"http://localhost/aris/sap_model.owl#c1g6__6_____u__" +-"http://localhost/aris/sap_model.owl#c1bw__6_____u__" +-"http://localhost/aris/sap_model.owl#c1kv__6_____u__" +-"http://localhost/aris/sap_model.owl#c0x2__6_____u__" +-"http://localhost/aris/sap_model.owl#c0y6__6_____u__" +-"http://localhost/aris/sap_model.owl#c151__6_____u__" +-"http://localhost/aris/sap_model.owl#fsgs__6_____u__" +-"http://localhost/aris/sap_model.owl#fmkt__6_____u__" +-"http://localhost/aris/sap_model.owl#fqrn__6_____u__" +-"http://localhost/aris/sap_model.owl#fnho__6_____u__" +-"http://localhost/aris/sap_model.owl#ft1j__6_____u__" +-"http://localhost/aris/sap_model.owl#fv3w__6_____u__" +-"http://localhost/aris/sap_model.owl#frz4__6_____u__" +-"http://localhost/aris/sap_model.owl#fpnp__6_____u__" +-"http://localhost/aris/sap_model.owl#fv39__6_____u__" +-"http://localhost/aris/sap_model.owl#fwtp__6_____u__" +-"http://localhost/aris/sap_model.owl#fp95__6_____u__" +-"http://localhost/aris/sap_model.owl#fkox__6_____u__" +-"http://localhost/aris/sap_model.owl#fm7t__6_____u__" +-"http://localhost/aris/sap_model.owl#flr4__6_____u__" +-"http://localhost/aris/sap_model.owl#fo3a__6_____u__" +-"http://localhost/aris/sap_model.owl#fxwe__6_____u__" +-"http://localhost/aris/sap_model.owl#fx5n__6_____u__" +-"http://localhost/aris/sap_model.owl#fxqy__6_____u__" +-"http://localhost/aris/sap_model.owl#furr__6_____u__" +-"http://localhost/aris/sap_model.owl#ftgq__6_____u__" +-"http://localhost/aris/sap_model.owl#e32o__6_____u__" +-"http://localhost/aris/sap_model.owl#e4j0__6_____u__" +-"http://localhost/aris/sap_model.owl#e316__6_____u__" +-"http://localhost/aris/sap_model.owl#e4lg__6_____u__" +-"http://localhost/aris/sap_model.owl#e26q__6_____u__" +-"http://localhost/aris/sap_model.owl#dzmt__6_____u__" +-"http://localhost/aris/sap_model.owl#e1g3__6_____u__" +-"http://localhost/aris/sap_m... [truncated message content] |
From: <hee...@us...> - 2009-02-03 12:22:17
|
Revision: 1584 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1584&view=rev Author: heeroyuy Date: 2009-02-03 11:35:36 +0000 (Tue, 03 Feb 2009) Log Message: ----------- -started graphical display for coverage of learned concept -started own thread for selecting positive and negative examples Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/IndividualObject.java trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-01-26 11:55:26 UTC (rev 1583) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -84,8 +84,7 @@ * DLlearner tab * @param i * id if it is a subclass or an equivalent class - * @param editor - * OWLEditorKit + * */ public ActionHandler(ActionHandler a, DLLearnerModel m, OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view, @@ -302,7 +301,13 @@ private Thread dlLearner; private DefaultListModel dm = new DefaultListModel(); + /** + * Errorlogger. + */ Logger logger = Logger.getLogger(SuggestionRetriever.class); + /** + * Errorlogger. + */ Logger rootLogger = Logger.getRootLogger(); @SuppressWarnings("unchecked") @@ -391,11 +396,11 @@ for(String ontology : ont) { if(eval.getDescription().toString().contains(ontology)) { if(model.isConsistent(eval)) { - dm.add(i, new SuggestListItem(colorGreen, eval.getDescription().toManchesterSyntaxString(ontology, null),eval.getAccuracy()*100)); + dm.add(i, new SuggestListItem(colorGreen, eval.getDescription().toManchesterSyntaxString(ontology, null), eval.getAccuracy()*100)); i++; break; } else { - dm.add(i, new SuggestListItem(colorRed, eval.getDescription().toManchesterSyntaxString(ontology, null),eval.getAccuracy()*100)); + dm.add(i, new SuggestListItem(colorRed, eval.getDescription().toManchesterSyntaxString(ontology, null), eval.getAccuracy()*100)); i++; view.setIsInconsistent(true); break; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-01-26 11:55:26 UTC (rev 1583) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -38,7 +38,6 @@ import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.ReasonerComponent; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; @@ -48,7 +47,6 @@ import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.utilities.owl.OWLAPIDescriptionConvertVisitor; -import org.jdesktop.swingx.JXTaskPane; import org.mindswap.pellet.exceptions.InconsistentOntologyException; import org.protege.editor.owl.OWLEditorKit; import org.protege.editor.owl.ui.frame.OWLFrame; @@ -90,7 +88,7 @@ // The Reasoning Service for the Reasoner - private ReasonerComponent rs; + //private ReasonerComponent rs; private static final String EQUIVALENT_CLASS_AXIOM_STRING = "Suggest equivalent class"; private static final String SUPER_CLASS_AXIOM_STRING = "Suggest super class"; @@ -102,7 +100,7 @@ // A Array of Concepts which the DL-Learner suggested - private Description[] description; + //private Description[] description; // The Learning problem that is used to learn new concepts @@ -114,7 +112,7 @@ // The Ontology which is currently used - private OWLOntology ontology; + //private OWLOntology ontology; // This is the learning algorithm @@ -182,7 +180,7 @@ // This is necessary to get the details of the suggested concept - private JXTaskPane detailPane; + //private JXTaskPane detailPane; private DefaultListModel posListModel; private DefaultListModel negListModel; private Set<KnowledgeSource> sources; @@ -225,8 +223,8 @@ ds = new HashSet<OWLDescription>(); suggestModel = new DefaultListModel(); ontologieURI = new HashSet<String>(); - detailPane = new JXTaskPane(); - detailPane.setTitle("Details"); + //detailPane = new JXTaskPane(); + //detailPane.setTitle("Details"); sources = new HashSet<KnowledgeSource>(); } @@ -272,10 +270,10 @@ * This method returns an array of descriptions learned by the DL-Learner. * * @return Array of descriptions learned by the DL-Learner. - */ + public Description[] getDescriptions() { return description; - } + }*/ /** * This Method returns a List of evaluated descriptions suggested by the @@ -292,8 +290,8 @@ * OWLAPIOntology will be available. */ public void setKnowledgeSource() { - Set<OWLOntology> ontologies = editor.getModelManager().getActiveOntologies(); - for(OWLOntology onto : ontologies) { + Set<OWLOntology> ontologieSet = editor.getModelManager().getActiveOntologies(); + for(OWLOntology onto : ontologieSet) { sources.add(new OWLAPIOntology(onto)); } } @@ -318,8 +316,19 @@ // rs = cm.reasoningService(reasoner); } - + + public FastInstanceChecker getReasoner() { + return reasoner; + } + /** + * This method returns the current concept. + * @return current concept + */ + public NamedClass getCurrentConcept() { + return currentConcept; + } + /** * This method sets the Learning problem for the learning process. * PosNegDefinitonLp for equivalent classes and PosNegInclusionLP for super * classes. @@ -361,7 +370,7 @@ Set<String> ignore = new TreeSet<String>(); ignore.add(currentConcept.toString()); if(id.equals(SUPER_CLASS_AXIOM_STRING)) { - Description currentClass = (Description)currentConcept; + Description currentClass = (Description) currentConcept; while(!(currentClass instanceof Thing)) { SortedSet<Description> superClasses = reasoner.getSuperClasses(currentClass); for(Description ignoredClass : superClasses) { @@ -393,10 +402,11 @@ * This method returns the Concepts from the DL-Learner. * * @return Array of learned Concepts. - */ + public Description[] getSolutions() { return description; - } + }*/ + /** * Starts the learning algorithm. */ @@ -499,8 +509,24 @@ individual = reasoner.getIndividuals(); } } - + /** + * This method sets the positive examples for learning. + * @param ind + */ + public void setIndividuals(Set<Individual> ind) { + this.individual = ind; + } + + /** + * This method sets the uri sting for the currently used + * for learning. + * @param uri + */ + public void setOntologyURIString(Set<String> uri) { + this.ontologieURI = uri; + } + /** * This Method checks if the selected class has any individuals. * * @return boolean hasIndividuals @@ -508,6 +534,14 @@ public boolean hasIndividuals() { return hasIndividuals; } + + /** + * Sets if the ontology has individuals. + * @param has + */ + public void setHasIndividuals(boolean has) { + this.hasIndividuals = has; + } /** * This method gets an Individual and checks if this individual belongs to @@ -517,7 +551,7 @@ * Individual to check if it belongs to the chosen concept * @return is Individual belongs to the concept which is chosen in protege. */ - public boolean setPositivExamplesChecked(String indi) { + private boolean setPositivExamplesChecked(String indi) { boolean isChecked = false; // checks if individuals are not empty if (individual != null) { @@ -548,10 +582,10 @@ * * @param list * Array of concepts from DL-Learner - */ + public void setDescriptionList(Description[] list) { description = list; - } + }*/ /** * This method returns the PosListModel. @@ -584,12 +618,12 @@ /** * This method resets the array of concepts from the DL_Learner. It is * called after the DL-Learner tab is closed. - */ + public void resetSuggestionList() { for (int i = 0; i < description.length; i++) { description[i] = null; } - } + }*/ /** * This method resets the model for the suggest panel. It is called befor @@ -617,10 +651,10 @@ * This method returns the current OWLOntology that is loaded in protege. * * @return current ontology - */ + public OWLOntology getOWLOntology() { return ontology; - } + } */ /** * This method returns a set of concepts that are learned by the DL-Learner. @@ -639,6 +673,8 @@ * @return Old Concept in OWLDescription format. */ public OWLDescription getOldConceptOWLAPI() { + oldConceptOWLAPI = OWLAPIDescriptionConvertVisitor + .getOWLDescription(currentConcept); return oldConceptOWLAPI; } @@ -714,10 +750,10 @@ * This method returns the currently used reasoning service. * * @return current reasoning service - */ + public ReasonerComponent getReasonerComponent() { return rs; - } + }*/ /** * This method gets the status if the DL-Learner has already learned. It is @@ -778,7 +814,7 @@ * This method returns the currently used ontoloies including importet * ontologies. * - * @return Set<OWLAPIOntology> ontologies + * @return Set of OWLAPI ontologies */ public Set<OWLAPIOntology> getOWLOntologies() { return ontologies; @@ -786,7 +822,7 @@ /** * This method returns the Knowledgesources currenty used. - * @return Set<KnowledgSource> + * @return Set of Knowledgesources */ public Set<KnowledgeSource> getKnowledgeSources() { return sources; @@ -822,12 +858,45 @@ return ontologieURI; } /** - * This method reutrns a bollean if an ontology is inconsistent. + * This method returns a boolean if an ontology is inconsistent. * @return ontologyInconsistent */ public boolean getOntologyConsistent() { return ontologyConsistent; } + + /** + * Sets the positive examples. + * @param list + */ + public void setPosListModel(DefaultListModel list) { + this.posListModel = list; + } + + /** + * Sets the negative examples. + * @param list + */ + public void setNegListModel(DefaultListModel list) { + this.negListModel = list; + } + + /** + * Sets the individual vector. + * @param indi + */ + public void setIndividualVector(Vector<IndividualObject> indi) { + this.individualVector = indi; + } + + /** + * This sets the current concept. + * @param current + */ + public void setCurrentConcept(NamedClass current) { + this.currentConcept = current; + } +} -} + Added: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -0,0 +1,204 @@ +package org.dllearner.tools.protege; + +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.geom.Ellipse2D; +import java.util.Set; +import java.util.Vector; + +import javax.swing.JButton; +import javax.swing.JPanel; + +import org.dllearner.core.EvaluatedDescription; +import org.dllearner.core.owl.Individual; + +public class GraphicalCoveragePanel extends JPanel { + + private static final long serialVersionUID = 855436961912515267L; + private static final int height =250; + private static final int width = 250; + private static final int maxNumberOfIndividualPoints = 20; + private static final int gap = 20; + private int shiftXAxis; + private int distortion; + private Ellipse2D oldConcept; + private Ellipse2D newConcept; + + private EvaluatedDescription eval; + private DLLearnerModel model; + private String conceptNew; + private Vector<IndividualPoint> posCovIndVector; + private Vector<IndividualPoint> posNotCovIndVector; + private Vector<IndividualPoint> negCovIndVector; + private JButton allPositiveIndividuals; + private JButton allNegativeIndividuals; + + /** + * This is the constructor for the GraphicalCoveragePanel. + */ + public GraphicalCoveragePanel(EvaluatedDescription desc, DLLearnerModel m, String concept, int w, int h) { + setPreferredSize(new Dimension(width, height)); + setVisible(true); + setForeground(Color.GREEN); + repaint(); + eval = desc; + model = m; + conceptNew = concept; + posCovIndVector = new Vector<IndividualPoint>(); + posNotCovIndVector = new Vector<IndividualPoint>(); + negCovIndVector = new Vector<IndividualPoint>(); + this.computeGraphics(); + oldConcept = new Ellipse2D.Float(5, 25, 250, 250); + newConcept = new Ellipse2D .Float(5+shiftXAxis, 25, width+distortion, height+distortion); + allPositiveIndividuals = new JButton(); + //immer in der mitte und unten rauszubekommen mittels getMittelpunkt fuer x + //und getMaxY fuer y. + //allPositiveIndividuals.setBounds(arg0, arg1, arg2, arg3); + allNegativeIndividuals = new JButton(); + //allNegativeIndividuals.setBounds(arg0, arg1, arg2, arg3); + this.computeIndividualPoints(); + } + + public void drawCoverageForLearnedClassDescription( + Set<Individual> posCovInd, Set<Individual> posNotCovInd, + Set<Individual> negCovInd) { + + + } + + protected void paintComponent(Graphics g) { + g.setColor(Color.RED); + g.drawOval((5+shiftXAxis), 25, width+distortion, height+distortion); + g.drawString(conceptNew, 10 + width, 15); + g.setColor(Color.GREEN); + g.drawOval(5, 25, 250, 250); + g.drawString(model.getOldConceptOWLAPI().toString(), 10, 15); + + for(int i = 0; i < posCovIndVector.size(); i++) { + g.setColor(Color.BLACK); + g.drawString(posCovIndVector.get(i).getPoint(), posCovIndVector.get(i).getXAxis(), posCovIndVector.get(i).getYAxis()); + } + + for(int i = 0; i < posNotCovIndVector.size(); i++) { + g.setColor(Color.BLACK); + g.drawString(posNotCovIndVector.get(i).getPoint(), posNotCovIndVector.get(i).getXAxis(), posNotCovIndVector.get(i).getYAxis()); + } + + for(int i = 0; i < negCovIndVector.size(); i++) { + g.setColor(Color.BLACK); + g.drawString(negCovIndVector.get(i).getPoint(), negCovIndVector.get(i).getXAxis(), negCovIndVector.get(i).getYAxis()); + } + + } + + private void computeGraphics(){ + int posGes = model.getPosListModel().size(); + int notCovPos = eval.getNotCoveredPositives().size(); + int covNeg = eval.getCoveredNegatives().size(); + int negGes = model.getNegListModel().size(); + double notCov = notCovPos; + float shift = (float) (width*(notCov/posGes)); + shiftXAxis = Math.round(shift); + distortion = 0; + if(shiftXAxis == 0) { + distortion = Math.round((width*(covNeg/negGes))/4); + } + + } + + private void computeIndividualPoints() { + Set<Individual> posInd = eval.getCoveredPositives(); + int i = 0; + double x = 20; + double y = 20; + for(Individual ind : posInd) { + if(i<maxNumberOfIndividualPoints) { + i++; + if(x >= oldConcept.getMaxX()) { + x = (int) oldConcept.getMinX(); + y = y + gap; + } + + if(y >= oldConcept.getMaxY()) { + y = (int) oldConcept.getMinY(); + } + + if(x >= newConcept.getMaxX()) { + x = (int) newConcept.getMinX(); + y = y + gap; + } + + if(y >= newConcept.getMaxY()) { + y = (int) newConcept.getMinY(); + } + + while(x < newConcept.getMaxX()) { + + if(newConcept.contains(x, y) && oldConcept.contains(x, y)) { + posCovIndVector.add(new IndividualPoint("+",(int)x,(int)y,ind.toString())); + x = x + gap; + break; + } else { + x = x + gap; + } + } + } + } + + Set<Individual> posNotCovInd = eval.getNotCoveredPositives(); + int j = 0; + for(Individual ind : posNotCovInd) { + if(j<maxNumberOfIndividualPoints) { + j++; + if(x >= oldConcept.getMaxX()) { + x = (int) oldConcept.getMinX(); + y = y + gap; + } + + if(y >= oldConcept.getMaxY()) { + y = (int) oldConcept.getMinY(); + } + + while(x < oldConcept.getMaxX()) { + + if(oldConcept.contains(x, y)&&!newConcept.contains(x, y)) { + posNotCovIndVector.add(new IndividualPoint("-",(int)x,(int)y,ind.toString())); + x = x + gap; + break; + } else { + x = x + gap; + } + } + } + } + + Set<Individual> negCovInd = eval.getCoveredNegatives(); + int k = 0; + for(Individual ind : negCovInd) { + if(k<maxNumberOfIndividualPoints) { + k++; + if(x >= newConcept.getMaxX()) { + x = (int) newConcept.getMinX(); + y = y + gap; + } + + if(y >= newConcept.getMaxY()) { + y = (int) newConcept.getMinY(); + } + + while(x < newConcept.getMaxX()) { + if(newConcept.contains(x, y) && !oldConcept.contains(x, y)) { + negCovIndVector.add(new IndividualPoint("o",(int)x,(int)y,ind.toString())); + x = x + gap; + break; + } else { + x = x + gap; + } + } + } + } + } + + +} Added: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -0,0 +1,6 @@ +package org.dllearner.tools.protege; + +//hier irgendwie umsetzen das wenn ueber individual fahre das name angezeigt wird. +public class GraphicalCoveragePanelHandler { + +} Modified: trunk/src/dl-learner/org/dllearner/tools/protege/IndividualObject.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/IndividualObject.java 2009-01-26 11:55:26 UTC (rev 1583) +++ trunk/src/dl-learner/org/dllearner/tools/protege/IndividualObject.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -55,7 +55,7 @@ } /** - * This method sets the example positive or negative if changed to the othe list. + * This method sets the example positive or negative if changed to the other list. * @param pos boolean */ public void setExamplePositive(boolean pos) { Added: trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -0,0 +1,59 @@ +package org.dllearner.tools.protege; + +public class IndividualPoint { + + private String point; + private int xAxis; + private int yAxis; + private String individual; + + public IndividualPoint(String p, int x, int y, String ind) { + this.point = p; + this.xAxis = x; + this.yAxis = y; + this.individual = ind; + } + + /** + * @param point the point to set + */ + public void setPoint(String point) { + this.point = point; + } + + /** + * @return the point + */ + public String getPoint() { + return point; + } + + /** + * @param xAxis the xAxis to set + */ + public void setXAxis(int xAxis) { + this.xAxis = xAxis; + } + + /** + * @return the xAxis + */ + public int getXAxis() { + return xAxis; + } + + /** + * @param yAxis the yAxis to set + */ + public void setYAxis(int yAxis) { + this.yAxis = yAxis; + } + + /** + * @return the yAxis + */ + public int getYAxis() { + return yAxis; + } + +} Modified: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-01-26 11:55:26 UTC (rev 1583) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -37,11 +37,12 @@ /** * This class shows more details of the suggested concepts. It shows the positive and negative examples - * that are covered and that are not covered by the suggested concepts. It also shows the accuracya of the + * that are covered and that are not covered by the suggested concepts. It also shows the accuracy of the * selected concept. * @author Christian Koetteritzsch * */ + public class MoreDetailForSuggestedConceptsPanel extends JPanel { private static final long serialVersionUID = 785272797932584581L; @@ -113,6 +114,9 @@ private JTextArea conceptText; private final Color colorRed = new Color(139, 0, 0); private final Color colorGreen = new Color(0, 139, 0); + private static final int height = 500; + private static final int width = 600; + private GraphicalCoveragePanel p; /** * This is the constructor for the Panel. * @param model DLLearnerModel @@ -120,7 +124,7 @@ public MoreDetailForSuggestedConceptsPanel(DLLearnerModel model) { super(); setLayout(null); - setPreferredSize(new Dimension(600, 500)); + setPreferredSize(new Dimension(width, height)); this.model = model; @@ -150,6 +154,7 @@ negNotCoveredScroll.setBounds(300, 325, 280, 140); eval = desc; concept = new JTextArea("Class Description:"); + concept.setEditable(false); coveredPositiveExamples = new JLabel("Covered Positive Examples:"); coveredPositiveExamples.setForeground(colorGreen); @@ -168,7 +173,7 @@ conceptPanel.setBounds(5, 0, 600, 50); accuracyPanel = new JPanel(new GridLayout(0, 1)); accuracyPanel.setBounds(5, 60, 600, 50); - + posCoveredPanel = new JPanel(new GridLayout(0, 1)); posNotCoveredPanel = new JPanel(new GridLayout(0, 1)); negCoveredPanel = new JPanel(new GridLayout(0, 1)); @@ -199,8 +204,10 @@ //panel for the informations of the selected concept //this method adds the informations for the selected concept to the panel setInformation(); + p = new GraphicalCoveragePanel(eval, model, conceptText.getText(), width, height); + p.setBounds(5, 110, 600, 650); detailPopup = new JDialog(); - detailPopup.setSize(600, 500); + detailPopup.setSize(width, height); //window will be disposed if the x button is pressed detailPopup.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); detailPopup.setVisible(true); @@ -219,6 +226,8 @@ add(conceptPanel); add(accuracyPanel); + add(p); + /* add(coveredPositiveExamples); add(notCoveredPositiveExamples); add(coveredNegativeExamples); @@ -226,7 +235,7 @@ add(posCoveredScroll); add(posNotCoveredScroll); add(negCoveredScroll); - add(negNotCoveredScroll); + add(negNotCoveredScroll);*/ detailPopup.add(this); } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2009-01-26 11:55:26 UTC (rev 1583) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OWLClassDescriptionEditorWithDLLearnerTab.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -360,6 +360,7 @@ // This is the Panel for more details of the suggested concept private MoreDetailForSuggestedConceptsPanel detail; private OWLFrame<OWLClass> frame; + private ReadingOntologyThread readThread; /** * The constructor for the DL-Learner tab in the class description @@ -437,26 +438,10 @@ model.clearVector(); hint.setText("To get suggestions for class descriptions, please click the button above."); isInconsistent = false; - model.unsetListModel(); - model.initReasoner(); - if(!isInconsistent) { - - model.checkURI(); - model.setPosVector(); - if (model.hasIndividuals()) { - run.setEnabled(true); - } else { - run.setEnabled(false); - hint.setVisible(false); - String message ="There are no Instances for "+ frame.getRootObject()+" available. Please insert some Instances."; - renderErrorMessage(message); - } - posPanel.setExampleList(model.getPosListModel(), model.getNegListModel()); - } else { - hint.setForeground(Color.RED); - run.setEnabled(false); - hint.setText("The ontology is inconsistent and suggestions for class descriptions can only \nbe computed on consistent ontologies. Please repair the ontology first"); - } + readThread = new ReadingOntologyThread(editorKit, frame, this, model); + readThread.start(); + //TODO: runbutton wird auf enable gesetzt obwohl keine instanzdaten vorhanden sind. + hint.setVisible(true); advanced.setIcon(icon); accept.setEnabled(false); @@ -512,7 +497,9 @@ public void setHintMessage(String message) { hint.setText(message); } - + public JTextArea getHintPanel() { + return hint; + } /** * This Method returns the DL_Learner tab. * @return JComponent @@ -604,6 +591,10 @@ return run; } + /** + * This method sets if ontology is inconsistent or not. + * @param isIncon boolean if ontology is consisten + */ public void setIsInconsistent(boolean isIncon) { this.isInconsistent = isIncon; } Added: trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -0,0 +1,215 @@ +package org.dllearner.tools.protege; + +import java.awt.Color; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.SortedSet; +import java.util.Vector; + +import javax.swing.DefaultListModel; + +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Thing; +import org.dllearner.reasoning.FastInstanceChecker; +import org.protege.editor.owl.OWLEditorKit; +import org.protege.editor.owl.ui.frame.OWLFrame; +import org.semanticweb.owl.model.OWLClass; +import org.semanticweb.owl.model.OWLOntology; + +public class ReadingOntologyThread extends Thread { + + + private boolean hasIndividuals; + private OWLFrame<OWLClass> current; + private FastInstanceChecker reasoner; + private NamedClass currentConcept; + private Set<Individual> individual; + private Set<String> ontologieURI; + private OWLEditorKit editor; + private DefaultListModel posListModel; + private DefaultListModel negListModel; + private DLLearnerModel model; + private boolean isInconsistent; + private OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView view; + private Vector<IndividualObject> individualVector; + + public ReadingOntologyThread(OWLEditorKit editorKit, OWLFrame<OWLClass> h, OWLClassDescriptionEditorWithDLLearnerTab.DLLearnerView v, DLLearnerModel m) { + posListModel = new DefaultListModel(); + negListModel = new DefaultListModel(); + ontologieURI = new HashSet<String>(); + individualVector = new Vector<IndividualObject>(); + this.editor = editorKit; + this.current = h; + this.view = v; + this.model = m; + + } + /** + * This method sets the individuals that belong to the concept which is + * chosen in protege. + */ + private void setPositiveConcept() { + SortedSet<Individual> individuals = null; + hasIndividuals = false; + // checks if selected concept is thing when yes then it selects all + // individuals + if (!(current.getRootObject() instanceof Thing)) { + List<NamedClass> classList = reasoner.getAtomicConceptsList(); + for(NamedClass concept : classList) { + // if individuals is null + if (individuals == null) { + // checks if the concept is the selected concept in protege + for(String onto : ontologieURI) { + if (concept.toString().contains(onto)) { + if (concept.toString().equals( + onto + current.getRootObject().toString())) { + // if individuals is not null it gets all + // individuals of + // the concept + currentConcept = concept; + if (reasoner.getIndividuals(concept) != null) { + if (reasoner.getIndividuals(concept).size() > 0) { + hasIndividuals = true; + } + individual = reasoner.getIndividuals(concept); + model.setIndividuals(individual); + model.setCurrentConcept(currentConcept); + break; + } + } + } + } + } + } + } else { + if (reasoner.getIndividuals().size() > 0) { + hasIndividuals = true; + + } + individual = reasoner.getIndividuals(); + model.setIndividuals(individual); + model.setHasIndividuals(hasIndividuals); + } + } + + /** + * This Method checks if the selected class has any individuals. + * + * @return boolean hasIndividuals + */ + public boolean hasIndividuals() { + return hasIndividuals; + } + + /** + * Checks the URI if a "#" is in it. + */ + private void checkURI() { + Set<OWLOntology> ont = editor.getModelManager().getActiveOntologies(); + Set<Individual> indi = reasoner.getIndividuals(); + for(OWLOntology onto : ont) { + String ontURI = onto.getURI().toString(); + for(Individual ind : indi) { + if(ind.toString().contains(ontURI)) { + if(ind.toString().contains("#")) { + ontologieURI.add(onto.getURI().toString()+"#"); + break; + } else { + ontologieURI.add(onto.getURI().toString()); + break; + } + } + } + } + model.setOntologyURIString(ontologieURI); + } + + /** + * This method sets the check boxes for the positive check boxes checked if + * the individuals matches the concept that is chosen in protege. + */ + private void setPosVector() { + setPositiveConcept(); + SortedSet<Individual> reasonerIndi = reasoner.getIndividuals(); + for(Individual ind : reasonerIndi) { + Set<String> onto = ontologieURI; + for(String ont : onto) { + String indiv = ind.toString(); + // checks if individual belongs to the selected concept + if (setPositivExamplesChecked(indiv)) { + if (indiv.contains(ont)) { + // when yes then it sets the positive example checked + + // OWLExpressionCheckerFactory + posListModel.add(0, ind.toManchesterSyntaxString(ont, null)); + individualVector.add(new IndividualObject(indiv, true)); + break; + } + + } else { + // When no it unchecks the positive example + if (indiv.contains(ont)) { + individualVector + .add(new IndividualObject(indiv, false)); + negListModel.add(0, ind.toManchesterSyntaxString(ont, null)); + break; + } + } + } + } + view.getPosAndNegSelectPanel().setExampleList(posListModel, negListModel); + model.setPosListModel(posListModel); + model.setNegListModel(negListModel); + model.setIndividualVector(individualVector); + } + + /** + * This method gets an Individual and checks if this individual belongs to + * the concept chosen in protege. + * + * @param indi + * Individual to check if it belongs to the chosen concept + * @return is Individual belongs to the concept which is chosen in protege. + */ + private boolean setPositivExamplesChecked(String indi) { + boolean isChecked = false; + // checks if individuals are not empty + if (individual != null) { + // checks if the delivered individual belongs to the individuals of + // the selected concept + if (individual.toString().contains(indi)) { + isChecked = true; + } + } + return isChecked; + + } + + public void run() { + model.unsetListModel(); + model.initReasoner(); + reasoner = model.getReasoner(); + isInconsistent = false; + if(!isInconsistent) { + + this.checkURI(); + this.setPositiveConcept(); + this.setPosVector(); + if (this.hasIndividuals()) { + view.getRunButton().setEnabled(true); + } else { + view.getRunButton().setEnabled(false); + view.getHintPanel().setVisible(false); + String message ="There are no Instances for "+ current.getRootObject()+" available. Please insert some Instances."; + view.renderErrorMessage(message); + } + view.getPosAndNegSelectPanel().setExampleList(model.getPosListModel(), model.getNegListModel()); + } else { + view.getHintPanel().setForeground(Color.RED); + view.getRunButton().setEnabled(false); + view.setHintMessage("The ontology is inconsistent and suggestions for class descriptions can only \nbe computed on consistent ontologies. Please repair the ontology first"); + } + } +} Modified: trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java 2009-01-26 11:55:26 UTC (rev 1583) +++ trunk/src/dl-learner/org/dllearner/tools/protege/SuggestListItem.java 2009-02-03 11:35:36 UTC (rev 1584) @@ -34,6 +34,7 @@ * Constructor for the SuggestListItem. * @param c Color Color in which the text is painted. * @param s String text that is shown. + * @param acc Accuracy of the concept */ public SuggestListItem( Color c, String s, double acc) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |