From: <jen...@us...> - 2008-05-19 12:57:41
|
Revision: 900 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=900&view=rev Author: jenslehmann Date: 2008-05-19 05:57:31 -0700 (Mon, 19 May 2008) Log Message: ----------- moved some classes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/FlexibleHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/LexicographicHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/Node.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator2.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparatorStable.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/config/CommonConfigMappings.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDown.java trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java trunk/src/dl-learner/org/dllearner/scripts/SPARQLExtractionEvaluation.java trunk/src/dl-learner/org/dllearner/scripts/SPARQLMassLearning.java trunk/src/dl-learner/org/dllearner/test/SparqlEndpointTest.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticExampleFinderRolesSPARQL.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticExampleFinderSKOSSPARQL.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticExampleFinderSPARQL.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/scripts/TestValidation.java trunk/src/dl-learner/org/dllearner/utilities/Logging.java trunk/src/dl-learner/org/dllearner/utilities/datastructures/JenaResultSetConvenience.java trunk/src/dl-learner/org/dllearner/utilities/owl/ConceptComparator.java trunk/src/dl-learner/org/dllearner/utilities/owl/ConceptTransformation.java trunk/src/dl-learner/org/dllearner/utilities/owl/ManchesterOWLSyntaxParser.java trunk/src/dl-learner/org/dllearner/utilities/owl/RoleComparator.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/utilities/ConceptComparator.java trunk/src/dl-learner/org/dllearner/utilities/ConceptTransformation.java trunk/src/dl-learner/org/dllearner/utilities/JenaResultSetConvenience.java trunk/src/dl-learner/org/dllearner/utilities/ManchesterOWLSyntaxParser.java trunk/src/dl-learner/org/dllearner/utilities/RoleComparator.java trunk/src/dl-learner/org/dllearner/utilities/statistics/Logging.java trunk/src/dl-learner/org/dllearner/utilities/statistics/TestValidation.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2008-05-19 12:57:31 UTC (rev 900) @@ -11,8 +11,8 @@ import org.dllearner.learningproblems.PosNegLP; import org.dllearner.refinementoperators.PsiDown; import org.dllearner.refinementoperators.PsiUp; -import org.dllearner.utilities.ConceptComparator; -import org.dllearner.utilities.ConceptTransformation; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.ConceptTransformation; public class Psi implements GeneticRefinementOperator { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedNode.java 2008-05-19 12:57:31 UTC (rev 900) @@ -27,7 +27,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-05-19 12:57:31 UTC (rev 900) @@ -44,10 +44,10 @@ import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.refinementoperators.RhoDRDown; -import org.dllearner.utilities.ConceptComparator; -import org.dllearner.utilities.ConceptTransformation; import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.ConceptTransformation; /** * Implements the example based refinement operator learning Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/FlexibleHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/FlexibleHeuristic.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/FlexibleHeuristic.java 2008-05-19 12:57:31 UTC (rev 900) @@ -20,7 +20,7 @@ package org.dllearner.algorithms.refexamples; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * This heuristic compares two nodes by computing a score Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/LexicographicHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/LexicographicHeuristic.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/LexicographicHeuristic.java 2008-05-19 12:57:31 UTC (rev 900) @@ -20,7 +20,7 @@ package org.dllearner.algorithms.refexamples; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; public class LexicographicHeuristic implements ExampleBasedHeuristic { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/MultiHeuristic.java 2008-05-19 12:57:31 UTC (rev 900) @@ -24,7 +24,7 @@ import org.dllearner.core.owl.DatatypeSomeRestriction; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Thing; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * This heuristic combines the following criteria to assign a Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/NodeComparatorStable.java 2008-05-19 12:57:31 UTC (rev 900) @@ -22,7 +22,7 @@ import java.util.Comparator; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * This comparator is stable, because it only takes covered examples, concept Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java 2008-05-19 12:57:31 UTC (rev 900) @@ -4,7 +4,7 @@ import org.dllearner.core.ReasoningService; import org.dllearner.core.owl.Description; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; public class SubsumptionComparator implements Comparator<Description> { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/Node.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/Node.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/Node.java 2008-05-19 12:57:31 UTC (rev 900) @@ -4,7 +4,7 @@ import java.util.TreeSet; import org.dllearner.core.owl.Description; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; public class Node { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator.java 2008-05-19 12:57:31 UTC (rev 900) @@ -1,6 +1,6 @@ package org.dllearner.algorithms.refinement; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; public class NodeComparator implements Heuristic { Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator2.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparator2.java 2008-05-19 12:57:31 UTC (rev 900) @@ -20,7 +20,7 @@ package org.dllearner.algorithms.refinement; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * This heuristic compares two nodes by computing a score Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparatorStable.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparatorStable.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/NodeComparatorStable.java 2008-05-19 12:57:31 UTC (rev 900) @@ -2,7 +2,7 @@ import java.util.Comparator; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * Der Comparator ist stable, weil er nur nach covered negatives, Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-05-19 12:57:31 UTC (rev 900) @@ -35,10 +35,10 @@ import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.refinementoperators.RhoDown; -import org.dllearner.utilities.ConceptComparator; -import org.dllearner.utilities.ConceptTransformation; import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.ConceptTransformation; public class ROLearner extends LearningAlgorithm { Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-05-19 12:57:31 UTC (rev 900) @@ -83,11 +83,11 @@ import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; import org.dllearner.reasoning.OWLAPIReasoner; -import org.dllearner.utilities.ConceptComparator; import org.dllearner.utilities.Helper; -import org.dllearner.utilities.RoleComparator; import org.dllearner.utilities.datastructures.Datastructures; import org.dllearner.utilities.datastructures.StringTuple; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.RoleComparator; /** * Startup file for Command Line Interface. Modified: trunk/src/dl-learner/org/dllearner/core/config/CommonConfigMappings.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/CommonConfigMappings.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/core/config/CommonConfigMappings.java 2008-05-19 12:57:31 UTC (rev 900) @@ -26,7 +26,7 @@ import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.ObjectProperty; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * @author Jens Lehmann Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypePropertyHierarchy.java 2008-05-19 12:57:31 UTC (rev 900) @@ -24,7 +24,7 @@ import java.util.TreeMap; import java.util.TreeSet; -import org.dllearner.utilities.RoleComparator; +import org.dllearner.utilities.owl.RoleComparator; /** * Represents a hierarchy of datatype properties. Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectPropertyHierarchy.java 2008-05-19 12:57:31 UTC (rev 900) @@ -24,7 +24,7 @@ import java.util.TreeMap; import java.util.TreeSet; -import org.dllearner.utilities.RoleComparator; +import org.dllearner.utilities.owl.RoleComparator; /** * Represents a hierarchy of roles. Modified: trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/core/owl/SubsumptionHierarchy.java 2008-05-19 12:57:31 UTC (rev 900) @@ -24,7 +24,7 @@ import java.util.TreeMap; import java.util.TreeSet; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * Represents a subsumption hierarchy (ignoring equivalent concepts). Modified: trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/learningproblems/EvaluationCache.java 2008-05-19 12:57:31 UTC (rev 900) @@ -27,9 +27,9 @@ import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.Union; -import org.dllearner.utilities.ConceptComparator; import org.dllearner.utilities.Helper; import org.dllearner.utilities.datastructures.SortedSetTuple; +import org.dllearner.utilities.owl.ConceptComparator; /** * Caches results of previous concept evaluation to speed up Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-05-19 12:57:31 UTC (rev 900) @@ -54,10 +54,10 @@ import org.dllearner.core.owl.ObjectPropertyHierarchy; import org.dllearner.core.owl.SubsumptionHierarchy; import org.dllearner.core.owl.Thing; -import org.dllearner.utilities.ConceptComparator; import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; -import org.dllearner.utilities.RoleComparator; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.RoleComparator; import org.kr.dl.dig.v1_1.Concepts; import org.kr.dl.dig.v1_1.Csynonyms; import org.kr.dl.dig.v1_1.IdType; Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-05-19 12:57:31 UTC (rev 900) @@ -59,8 +59,8 @@ import org.dllearner.core.owl.UntypedConstant; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; -import org.dllearner.utilities.ConceptComparator; -import org.dllearner.utilities.RoleComparator; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.RoleComparator; import org.semanticweb.owl.apibinding.OWLManager; import org.semanticweb.owl.inference.OWLReasoner; import org.semanticweb.owl.inference.OWLReasonerException; Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/MathOperations.java 2008-05-19 12:57:31 UTC (rev 900) @@ -28,7 +28,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Union; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * Math operations related to refinement operators. Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java 2008-05-19 12:57:31 UTC (rev 900) @@ -21,7 +21,7 @@ import org.dllearner.core.owl.ObjectQuantorRestriction; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; /** * Operatoren Psi-Down und Psi-Up müssen noch so umgeschrieben werden, dass sie Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java 2008-05-19 12:57:31 UTC (rev 900) @@ -21,7 +21,7 @@ import org.dllearner.core.owl.ObjectQuantorRestriction; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.PosNegLP; -import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.owl.ConceptComparator; public class PsiUp implements RefinementOperator { Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-05-19 12:57:31 UTC (rev 900) @@ -58,9 +58,9 @@ import org.dllearner.core.owl.SubsumptionHierarchy; import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.Union; -import org.dllearner.utilities.ConceptComparator; -import org.dllearner.utilities.ConceptTransformation; import org.dllearner.utilities.Helper; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.ConceptTransformation; /** * A downward refinement operator, which makes use of domains Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDown.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDown.java 2008-05-19 12:57:31 UTC (rev 900) @@ -46,8 +46,8 @@ import org.dllearner.core.owl.ObjectQuantorRestriction; import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.ValueRestriction; -import org.dllearner.utilities.ConceptComparator; -import org.dllearner.utilities.ConceptTransformation; +import org.dllearner.utilities.owl.ConceptComparator; +import org.dllearner.utilities.owl.ConceptTransformation; /** * Implementation of the downward refinement operator in the DL-Learner refinement Modified: trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/scripts/SKOS7030.java 2008-05-19 12:57:31 UTC (rev 900) @@ -17,7 +17,7 @@ import org.dllearner.kb.sparql.Cache; import org.dllearner.kb.sparql.SparqlEndpoint; import org.dllearner.kb.sparql.SparqlQuery; -import org.dllearner.utilities.JenaResultSetConvenience; +import org.dllearner.utilities.datastructures.JenaResultSetConvenience; import org.dllearner.utilities.datastructures.SetManipulation; import org.dllearner.utilities.examples.AutomaticExampleFinderSKOSSPARQL; import org.dllearner.utilities.learn.LearnSparql; Modified: trunk/src/dl-learner/org/dllearner/scripts/SPARQLExtractionEvaluation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SPARQLExtractionEvaluation.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/scripts/SPARQLExtractionEvaluation.java 2008-05-19 12:57:31 UTC (rev 900) @@ -14,7 +14,7 @@ import org.dllearner.kb.sparql.Cache; import org.dllearner.kb.sparql.SparqlEndpoint; import org.dllearner.kb.sparql.SparqlQuery; -import org.dllearner.utilities.JenaResultSetConvenience; +import org.dllearner.utilities.datastructures.JenaResultSetConvenience; import org.dllearner.utilities.datastructures.SetManipulation; import org.dllearner.utilities.examples.AutomaticExampleFinderSPARQL; import org.dllearner.utilities.learn.LearnSparql; Modified: trunk/src/dl-learner/org/dllearner/scripts/SPARQLMassLearning.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/SPARQLMassLearning.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/scripts/SPARQLMassLearning.java 2008-05-19 12:57:31 UTC (rev 900) @@ -13,7 +13,7 @@ import org.dllearner.kb.sparql.SparqlEndpoint; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.kb.sparql.SparqlQuery; -import org.dllearner.utilities.JenaResultSetConvenience; +import org.dllearner.utilities.datastructures.JenaResultSetConvenience; import org.dllearner.utilities.datastructures.SetManipulation; import org.dllearner.utilities.examples.AutomaticExampleFinderRolesSPARQL; import org.dllearner.utilities.examples.AutomaticExampleFinderSPARQL; Copied: trunk/src/dl-learner/org/dllearner/scripts/TestValidation.java (from rev 899, trunk/src/dl-learner/org/dllearner/utilities/statistics/TestValidation.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/TestValidation.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/TestValidation.java 2008-05-19 12:57:31 UTC (rev 900) @@ -0,0 +1,75 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.scripts; + +import java.io.File; +import java.util.Set; + +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.apache.log4j.SimpleLayout; +import org.dllearner.cli.Start; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.Score; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; + +/** + * @author Jens Lehmann + * + */ +public class TestValidation { + + private static Logger logger = Logger.getRootLogger(); + + public static void main(String args[]) throws ComponentInitException { + + // create logger (a simple logger which outputs + // its messages to the console) + SimpleLayout layout = new SimpleLayout(); + ConsoleAppender consoleAppender = new ConsoleAppender(layout); + logger.removeAllAppenders(); + logger.addAppender(consoleAppender); + logger.setLevel(Level.DEBUG); + + String filenameTrain = args[0]; + String filenameTest = args[1]; + + Start start = new Start(new File(filenameTrain)); + start.start(false); + Description solution = start.getLearningAlgorithm().getBestSolution(); + + logger.setLevel(Level.WARN); + + Start startTest = new Start(new File(filenameTest)); + ReasoningService rs = startTest.getReasoningService(); + LearningProblem lp = startTest.getLearningProblem(); + + Set<Individual> result = rs.retrieval(solution); + System.out.println("retrieval result: " + result); + + Score score = lp.computeScore(solution); + System.out.println(score); + } + +} Modified: trunk/src/dl-learner/org/dllearner/test/SparqlEndpointTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/SparqlEndpointTest.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/test/SparqlEndpointTest.java 2008-05-19 12:57:31 UTC (rev 900) @@ -12,7 +12,7 @@ import org.dllearner.kb.sparql.SparqlEndpoint; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.kb.sparql.SparqlQuery; -import org.dllearner.utilities.JenaResultSetConvenience; +import org.dllearner.utilities.datastructures.JenaResultSetConvenience; import org.dllearner.utilities.statistics.SimpleClock; import com.hp.hpl.jena.query.ResultSet; Deleted: trunk/src/dl-learner/org/dllearner/utilities/ConceptComparator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/ConceptComparator.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/utilities/ConceptComparator.java 2008-05-19 12:57:31 UTC (rev 900) @@ -1,273 +0,0 @@ -package org.dllearner.utilities; - -import java.util.Comparator; -import java.util.Set; - -import org.dllearner.core.owl.BooleanValueRestriction; -import org.dllearner.core.owl.DatatypeProperty; -import org.dllearner.core.owl.DatatypeSomeRestriction; -import org.dllearner.core.owl.DoubleMaxValue; -import org.dllearner.core.owl.DoubleMinValue; -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Nothing; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ObjectCardinalityRestriction; -import org.dllearner.core.owl.ObjectMaxCardinalityRestriction; -import org.dllearner.core.owl.ObjectMinCardinalityRestriction; -import org.dllearner.core.owl.ObjectSomeRestriction; -import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.SimpleDoubleDataRange; -import org.dllearner.core.owl.Union; -import org.dllearner.core.owl.Negation; -import org.dllearner.core.owl.ObjectQuantorRestriction; -import org.dllearner.core.owl.Thing; - -// Comparator ist momentan inkonsistent mit equals für Konzepte, d.h. es kann sein, dass -// zwei Konzepte nicht als gleich deklariert werden (momentan gelten Konzepte immer als -// unterschiedlich, wenn sie nicht das gleiche Objekt im Speicher sind), aber in der -// compare-Funktion trotzdem 0 zurückgegeben wird -public class ConceptComparator implements Comparator<Description> { - - RoleComparator rc = new RoleComparator(); - - // private List<AtomicConcept> atomicConcepts = new LinkedList<AtomicConcept>(); - - public ConceptComparator() { - - } - - // Liste von atomaren Konzepten wird übergeben, damit eine Ordnung - // auf atomaren Konzepten festgelegt werden kann; also keine Stringvergleiche - // auf diesen Konzepten notwendig sind - // TODO: erstmal nur mit Stringvergleichen, da diese bei atomaren Konzepten - // schnell sein könnten, und dann testen, ob vorgegebene Ordnung Geschwindigkeitsvorteile - // bringt - public ConceptComparator(Set<NamedClass> atomicConcepts) { - - } - - // es werden Annahmen über Konzepte gemacht: - // 1. bestehen aus Top, Bottom, AtomicConcept, Negation, MultiConjunction, MultiDisjunction, - // Exists, All - // 2. MultiConjunction und MultiDisjunction haben min. 2 Kinder - // - // beachte: z.B. (male AND female) und (female AND male) sind ungleich; sie sind aber - // gleich, wenn sie vorher in ordered negation normal form umgewandelt worden, da - // dadurch die Anordnung der Kinder festgelegt wird - // 1: Konzept 1 ist größer - // - // Ordnung für atomare Konzepte: Stringvergleich - // Ordnung für atomare Rollen: Stringvergleich - public int compare(Description concept1, Description concept2) { - // classes higher up are in the source code have lower value - // (they appear first in class descriptions, because sorted sets - // usually use an ascending order) - if(concept1 instanceof Nothing) { - if(concept2 instanceof Nothing) - return 0; - else - return -1; - } else if(concept1 instanceof NamedClass) { - if(concept2 instanceof Nothing) - return 1; - else if(concept2 instanceof NamedClass) - return ((NamedClass)concept1).getName().compareTo(((NamedClass)concept2).getName()); - else - return -1; - } else if(concept1 instanceof BooleanValueRestriction) { - if(concept2 instanceof Nothing || concept2 instanceof NamedClass) { - return 1; - } else if(concept2 instanceof BooleanValueRestriction) { - // first criterion: name of the properties - int cmp = rc.compare(((BooleanValueRestriction)concept1).getRestrictedPropertyExpresssion(), ((BooleanValueRestriction)concept2).getRestrictedPropertyExpresssion()); - - // second criterion: value of the properties (it should rarely happen that - // both boolean values are present since this is a contradiction or superfluous) - if(cmp == 0) { - boolean val1 = ((BooleanValueRestriction)concept1).getBooleanValue(); - boolean val2 = ((BooleanValueRestriction)concept2).getBooleanValue(); - if(val1) { - if(val2) - return 0; - else - return 1; - } else { - if(val2) - return -1; - else - return 0; - } - } else - return cmp; - } else - return -1; - } else if(concept1 instanceof DatatypeSomeRestriction) { - if(concept2 instanceof Nothing || concept2 instanceof NamedClass || concept2 instanceof BooleanValueRestriction) { - return 1; - } else if(concept2 instanceof DatatypeSomeRestriction) { - DatatypeSomeRestriction dsr = (DatatypeSomeRestriction) concept1; - DatatypeProperty dp = (DatatypeProperty) dsr.getRestrictedPropertyExpression(); - DatatypeSomeRestriction dsr2 = (DatatypeSomeRestriction) concept2; - DatatypeProperty dp2 = (DatatypeProperty) dsr2.getRestrictedPropertyExpression(); - - // first criterion: name of the properties - int cmp = rc.compare(dp, dp2); - - if(cmp == 0) { - SimpleDoubleDataRange dr = (SimpleDoubleDataRange) dsr.getDataRange(); - SimpleDoubleDataRange dr2 = (SimpleDoubleDataRange) dsr2.getDataRange(); - - // equal classes - if((dr instanceof DoubleMaxValue && dr2 instanceof DoubleMaxValue) - || (dr instanceof DoubleMinValue && dr2 instanceof DoubleMinValue)) { - double val1 = dr.getValue(); - double val2 = dr2.getValue(); - if(val1 > val2) - return 1; - else if(val1 == val2) - return 0; - else - return -1; - - } else if(dr instanceof DoubleMaxValue) - return 1; - else - return -1; - } else - return cmp; - } else - return -1; - } else if(concept1 instanceof Thing) { - if(concept2 instanceof Nothing || concept2 instanceof NamedClass || concept2 instanceof BooleanValueRestriction || concept2 instanceof DatatypeSomeRestriction) - return 1; - else if(concept2 instanceof Thing) - return 0; - else - return -1; - } else if(concept1 instanceof Negation) { - if(concept2.getChildren().size()<1) - return 1; - else if(concept2 instanceof Negation) - return compare(concept1.getChild(0), concept2.getChild(0)); - else - return -1; - } else if(concept1 instanceof ObjectSomeRestriction) { - if(concept2.getChildren().size()<1 || concept2 instanceof Negation) - return 1; - else if(concept2 instanceof ObjectSomeRestriction) { - int roleCompare = rc.compare(((ObjectQuantorRestriction)concept1).getRole(), ((ObjectQuantorRestriction)concept2).getRole()); - if(roleCompare == 0) - return compare(concept1.getChild(0), concept2.getChild(0)); - else - return roleCompare; - } - else - return -1; - } else if(concept1 instanceof ObjectAllRestriction) { - if(concept2.getChildren().size()<1 || concept2 instanceof Negation || concept2 instanceof ObjectSomeRestriction) - return 1; - else if(concept2 instanceof ObjectAllRestriction) { - int roleCompare = rc.compare(((ObjectQuantorRestriction)concept1).getRole(), ((ObjectQuantorRestriction)concept2).getRole()); - if(roleCompare == 0) - return compare(concept1.getChild(0), concept2.getChild(0)); - else - return roleCompare; - } else - return -1; - } else if(concept1 instanceof ObjectMinCardinalityRestriction) { - if(concept2.getChildren().size()<1 || concept2 instanceof Negation || concept2 instanceof ObjectQuantorRestriction) - return 1; - // first criterion: object property - // second criterion: number - // third criterion: children - else if(concept2 instanceof ObjectMinCardinalityRestriction) { - int roleCompare = rc.compare(((ObjectCardinalityRestriction)concept1).getRole(), ((ObjectCardinalityRestriction)concept2).getRole()); - if(roleCompare == 0) { - Integer number1 = ((ObjectCardinalityRestriction)concept1).getNumber(); - Integer number2 = ((ObjectCardinalityRestriction)concept2).getNumber(); - int numberCompare = number1.compareTo(number2); - if(numberCompare == 0) - return compare(concept1.getChild(0), concept2.getChild(0)); - else - return numberCompare; - } else - return roleCompare; - } else - return -1; - } else if(concept1 instanceof ObjectMaxCardinalityRestriction) { - if(concept2.getChildren().size()<1 || concept2 instanceof Negation || concept2 instanceof ObjectQuantorRestriction || concept2 instanceof ObjectMinCardinalityRestriction) - return 1; - // first criterion: object property - // second criterion: number - // third criterion: children - else if(concept2 instanceof ObjectMaxCardinalityRestriction) { - int roleCompare = rc.compare(((ObjectCardinalityRestriction)concept1).getRole(), ((ObjectCardinalityRestriction)concept2).getRole()); - if(roleCompare == 0) { - Integer number1 = ((ObjectCardinalityRestriction)concept1).getNumber(); - Integer number2 = ((ObjectCardinalityRestriction)concept2).getNumber(); - int numberCompare = number1.compareTo(number2); - if(numberCompare == 0) - return compare(concept1.getChild(0), concept2.getChild(0)); - else - return numberCompare; - } else - return roleCompare; - } else - return -1; - } else if(concept1 instanceof Intersection) { - if(concept2.getChildren().size()<2) - return 1; - else if(concept2 instanceof Intersection) { - int nrOfChildrenConcept1 = concept1.getChildren().size(); - int nrOfChildrenConcept2 = concept2.getChildren().size(); - - if(nrOfChildrenConcept1>nrOfChildrenConcept2) - return 1; - else if(nrOfChildrenConcept1==nrOfChildrenConcept2) { - for(int i=0; i<nrOfChildrenConcept1; i++) { - int compareValue = compare(concept1.getChild(i),concept2.getChild(i)); - if(compareValue>0) - return 1; - else if(compareValue<0) - return -1; - } - return 0; - } else - return -1; - } else - return -1; - } else if(concept1 instanceof Union) { - if(concept2.getChildren().size()<2 || concept2 instanceof Intersection) - return 1; - else if(concept2 instanceof Union) { - int nrOfChildrenConcept1 = concept1.getChildren().size(); - int nrOfChildrenConcept2 = concept2.getChildren().size(); - - if(nrOfChildrenConcept1>nrOfChildrenConcept2) - return 1; - else if(nrOfChildrenConcept1==nrOfChildrenConcept2) { - for(int i=0; i<nrOfChildrenConcept1; i++) { - int compareValue = compare(concept1.getChild(i),concept2.getChild(i)); - if(compareValue>0) - return 1; - else if(compareValue<0) - return -1; - } - return 0; - } else - return -1; - } else - return -1; - } else - throw new RuntimeException(concept1.toString()); - } - - // TODO: Vergleich zwischen ConceptComparators: immer identisch - // (testen, ob das bessere Performance bringt) - @Override - public boolean equals(Object o) { - return (o instanceof ConceptComparator); - } - -} Deleted: trunk/src/dl-learner/org/dllearner/utilities/ConceptTransformation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/ConceptTransformation.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/utilities/ConceptTransformation.java 2008-05-19 12:57:31 UTC (rev 900) @@ -1,389 +0,0 @@ -package org.dllearner.utilities; - -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.dllearner.core.owl.ObjectAllRestriction; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Nothing; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.ObjectSomeRestriction; -import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; -import org.dllearner.core.owl.Negation; -import org.dllearner.core.owl.ObjectPropertyExpression; -import org.dllearner.core.owl.ObjectQuantorRestriction; -import org.dllearner.core.owl.Thing; - -// ev. kann man diese Klasse später in ein anderes Paket ziehen, da sie nicht direkt mit -// refinement zu tun hat -public class ConceptTransformation { - - public static long cleaningTimeNs = 0; - private static long cleaningTimeNsStart = 0; - public static long onnfTimeNs = 0; - private static long onnfTimeNsStart = 0; - public static long shorteningTimeNs = 0; - private static long shorteningTimeNsStart = 0; - - public static void cleanConceptNonRecursive(Description concept) { - // cleaningTimeNsStart = System.nanoTime(); - - if(concept instanceof Intersection || concept instanceof Union) { - - List<Description> deleteChilds = new LinkedList<Description>(); - - for(Description child : concept.getChildren()) { - if((concept instanceof Intersection && child instanceof Intersection) - || (concept instanceof Union && child instanceof Union)) { - deleteChilds.add(child); - } - } - - for(Description dc : deleteChilds) { - // alle Kinder des zu löschenden Konzeptes hinzufügen - for(Description dcChild : dc.getChildren()) { - concept.addChild(dcChild); - } - // Konzept selber löschen - concept.removeChild(dc); - } - - } - - // cleaningTimeNs += System.nanoTime() - cleaningTimeNsStart; - } - - - - // eliminiert Disjunktionen in Disjunktionen bzw. Konjunktionen in Konjunktionen - public static void cleanConcept(Description concept) { - - // Rekursion (verändert Eingabekonzept) - for(Description child : concept.getChildren()) { - cleanConcept(child); - } - - cleaningTimeNsStart = System.nanoTime(); - /* - if(concept instanceof Bottom || concept instanceof Top || concept instanceof AtomicConcept) - return concept; - else if(concept instanceof Negation) - return new Negation(concept.getChild(0)); - else if(concept instanceof Exists) - return new Exists(((Quantification)concept).getRole(),cleanConcept(concept.getChild(0))); - else if(concept instanceof All) - return new All(((Quantification)concept).getRole(),cleanConcept(concept.getChild(0))); - */ - if(concept instanceof Intersection || concept instanceof Union) { - - List<Description> deleteChilds = new LinkedList<Description>(); - - for(Description child : concept.getChildren()) { - if((concept instanceof Intersection && child instanceof Intersection) - || (concept instanceof Union && child instanceof Union)) { - deleteChilds.add(child); - } - } - - for(Description dc : deleteChilds) { - // alle Kinder des zu löschenden Konzeptes hinzufügen - for(Description dcChild : dc.getChildren()) { - concept.addChild(dcChild); - } - // Konzept selber löschen - concept.removeChild(dc); - } - - } - cleaningTimeNs += System.nanoTime() - cleaningTimeNsStart; - - } - - // wandelt ein Konzept in Negationsnormalform um - public static Description transformToNegationNormalForm(Description concept) { - if(concept instanceof Negation) { - Description child = concept.getChild(0); - - if(child.getChildren().size()==0) { - // NOT TOP = BOTTOM - if(child instanceof Thing) - return new Nothing(); - // NOT BOTTOM = TOP - else if(child instanceof Nothing) - return new Thing(); - // atomares Konzept: NOT A wird zurückgegeben - else if(child instanceof NamedClass) - return concept; - else - throw new RuntimeException("Conversion to negation normal form not supported for " + concept); - } else { - if(child instanceof Negation) { - // doppelte Negation hebt sich auf - return transformToNegationNormalForm(child.getChild(0)); - } else if(child instanceof ObjectQuantorRestriction) { - ObjectPropertyExpression r = ((ObjectQuantorRestriction)child).getRole(); - // Negation nach innen - Description c = new Negation(child.getChild(0)); - // Exists - if(child instanceof ObjectSomeRestriction) - return new ObjectAllRestriction(r,transformToNegationNormalForm(c)); - // All - else - return new ObjectSomeRestriction(r,transformToNegationNormalForm(c)); - } else if(child instanceof Intersection) { - // wg. Negation wird Konjunktion zu Disjunktion - Union md = new Union(); - for(Description c : child.getChildren()) { - md.addChild(transformToNegationNormalForm(new Negation(c))); - } - return md; - } else if(child instanceof Union) { - Intersection mc = new Intersection(); - for(Description c : child.getChildren()) { - mc.addChild(transformToNegationNormalForm(new Negation(c))); - } - return mc; - } else - throw new RuntimeException("Conversion to negation normal form not supported for " + concept); - } - // keine Negation - } else { - - Description conceptClone = (Description) concept.clone(); - conceptClone.getChildren().clear(); - - for(Description c : concept.getChildren()) { - conceptClone.addChild(transformToNegationNormalForm(c)); - } - - return conceptClone; - } - } - - - @SuppressWarnings("unused") - private boolean containsTop(Description concept) { - for(Description c : concept.getChildren()) { - if(c instanceof Thing) - return true; - } - return false; - } - - @SuppressWarnings("unused") - private boolean containsBottom(Description concept) { - for(Description c : concept.getChildren()) { - if(c instanceof Nothing) - return true; - } - return false; - } - - // nimmt Konzept in Negationsnormalform und wendet äquivalenzerhaltende - // Regeln an, die TOP und BOTTOM aus Disjunktion/Konjunktion entfernen - public static Description applyEquivalenceRules(Description concept) { - - Description conceptClone = (Description) concept.clone(); - conceptClone.getChildren().clear(); - - for(Description c : concept.getChildren()) { - conceptClone.addChild(applyEquivalenceRules(c)); - } - - // return conceptClone; - - // TOP, BOTTOM in Disjunktion entfernen - if(concept instanceof Union) { - Iterator<Description> it = conceptClone.getChildren().iterator(); - while(it.hasNext()) { - Description c = it.next(); - // for(Concept c : concept.getChildren()) { - // TOP in Disjunktion => ganze Disjunktion äquivalent zu Top - if(c instanceof Thing) - return new Thing(); - // BOTTOM in Disjunktion => entfernen - else if(c instanceof Nothing) - it.remove(); - - } - - // falls nur noch ein Kind übrig bleibt, dann entfällt - // MultiDisjunction - if(conceptClone.getChildren().size()==1) - return conceptClone.getChild(0); - - // falls keine Kinder übrig bleiben, dann war das letzte Kind - // BOTTOM - if(conceptClone.getChildren().size()==0) - return new Nothing(); - - } else if(concept instanceof Intersection) { - Iterator<Description> it = conceptClone.getChildren().iterator(); - while(it.hasNext()) { - Description c = it.next(); - // TOP in Konjunktion => entfernen - if(c instanceof Thing) - it.remove(); - // BOTTOM in Konjunktion => alles äquivalent zu BOTTOM - else if(c instanceof Nothing) - return new Nothing(); - } - - if(conceptClone.getChildren().size()==1) - return conceptClone.getChild(0); - - // falls keine Kinder übrig bleiben, dann war das letzte Kind - // TOP - if(conceptClone.getChildren().size()==0) - return new Thing(); - } - - return conceptClone; - } - - // TODO: aus Effizienzgründen könnte man noch eine nicht-rekursive Methode entwickeln, die - // nur die obere Ebene umwandelt - public static void transformToOrderedNegationNormalFormNonRecursive(Description concept, Comparator<Description> conceptComparator) { - // onnfTimeNsStart = System.nanoTime(); - - // Liste der Kinder sortieren - Collections.sort(concept.getChildren(), conceptComparator); - - // onnfTimeNs += System.nanoTime() - onnfTimeNsStart; - } - - // wandelt ein Konzept in geordnete Negationsnormalform um; - // es wird angenommen, dass das Eingabekonzept in Negationsnormalform und - // "sauber" ist - public static void transformToOrderedNegationNormalForm(Description concept, Comparator<Description> conceptComparator) { - - // alle Kinderkonzepte in geordnete Negationsnormalform bringen - for(Description child : concept.getChildren()) { - transformToOrderedNegationNormalForm(child, conceptComparator); - } - - onnfTimeNsStart = System.nanoTime(); - // Liste der Kinder sortieren - Collections.sort(concept.getChildren(), conceptComparator); - - // Konvertierung von Liste in Array => Array sortieren => Rekonvertierung in Liste - // List<Concept> childList = concept.getChildren(); - // Concept[] childArray = (Concept[]) childList.toArray(); - // Arrays.sort(childArray, conceptComparator); - // childList = Arrays.asList(childArray); - onnfTimeNs += System.nanoTime() - onnfTimeNsStart; - } - /* - public static Description transformToMultiClean(Description concept) { - concept = transformToMulti(concept); - cleanConcept(concept); - return concept; - } - - // ersetzt einfache Disjunktionen/Konjunktionen durch Multi - public static Description transformToMulti(Description concept) { - // alle Kinderkonzepte in geordnete Negationsnormalform bringen - List<Description> multiChildren = new LinkedList<Description>(); - - // es müssen veränderte Kinder entfernt und neu hinzugefügt werden - // (einfache Zuweisung mit = funktioniert nicht, da die Pointer die gleichen - // bleiben) - Iterator<Description> it = concept.getChildren().iterator(); - while(it.hasNext()) { - Description child = it.next(); - multiChildren.add(transformToMulti(child)); - it.remove(); - } - - for(Description multiChild : multiChildren) - concept.addChild(multiChild); - - if(concept instanceof Disjunction) - return new MultiDisjunction(concept.getChildren()); - - if(concept instanceof Conjunction) - return new MultiConjunction(concept.getChildren()); - - return concept; - } - */ - // liefert ein ev. verkürztes Konzept, wenn in Disjunktionen bzw. - // Konjunktionen Elemente mehrfach vorkommen - // (erstmal nicht-rekursiv implementiert) - public static Description getShortConceptNonRecursive(Description concept, ConceptComparator conceptComparator) { - if(concept instanceof Union || concept instanceof Intersection) { - // Verkürzung geschieht einfach durch einfügen in eine geordnete Menge - Set<Description> newChildren = new TreeSet<Description>(conceptComparator); - newChildren.addAll(concept.getChildren()); - // ev. geht das noch effizienter, wenn man keine neue Liste erstellen - // muss(?) => Listen erstellen dürfte allerdings sehr schnell gehen - if(concept instanceof Intersection) - return new Intersection(new LinkedList<Description>(newChildren)); - else - return new Union(new LinkedList<Description>(newChildren)); - } else - return concept; - } - - public static Description getShortConcept(Description concept, ConceptComparator conceptComparator) { - shorteningTimeNsStart = System.nanoTime(); - // deep copy des Konzepts, da es nicht verändert werden darf - // (Nachteil ist, dass auch Konzepte kopiert werden, bei denen sich gar - // nichts ändert) - Description clone = (Description) concept.clone(); - clone = getShortConcept(clone, conceptComparator, 0); - // return getShortConcept(concept, conceptComparator, 0); - shorteningTimeNs += System.nanoTime() - shorteningTimeNsStart; - return clone; - } - - // das Eingabekonzept darf nicht modifiziert werden - private static Description getShortConcept(Description concept, ConceptComparator conceptComparator, int recDepth) { - - //if(recDepth==0) - // System.out.println(concept); - - // Kinder schrittweise ersetzen - // TODO: effizienter wäre nur zu ersetzen, wenn sich etwas geändert hat - List<Description> tmp = new LinkedList<Description>(); - Iterator<Description> it = concept.getChildren().iterator(); - while(it.hasNext()) { - Description c = it.next(); - // concept.addChild(getShortConcept(c, conceptComparator)); - Description newChild = getShortConcept(c, conceptComparator,recDepth+1); - // Vergleich, ob es sich genau um die gleichen Objekte handelt - // (es wird explizit == statt equals verwendet) - if(c != newChild) { - tmp.add(newChild); - it.remove(); - } - } - for(Description child : tmp) - concept.addChild(child); - - if(concept instanceof Union || concept instanceof Intersection) { - // Verkürzung geschieht einfach durch einfügen in eine geordnete Menge - SortedSet<Description> newChildren = new TreeSet<Description>(conceptComparator); - newChildren.addAll(concept.getChildren()); - // falls sich Kinderliste auf ein Element reduziert hat, dann gebe nur - // dieses Element zurück (umschließende Konjunktion/Disjunktion entfällt) - if(newChildren.size()==1) - return newChildren.first(); - // ev. geht das noch effizienter, wenn man keine neue Liste erstellen - // muss(?) => Listen erstellen dürfte allerdings sehr schnell gehen - if(concept instanceof Intersection) - return new Intersection(new LinkedList<Description>(newChildren)); - else - return new Union(new LinkedList<Description>(newChildren)); - } else - return concept; - } - -} Deleted: trunk/src/dl-learner/org/dllearner/utilities/JenaResultSetConvenience.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/JenaResultSetConvenience.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/utilities/JenaResultSetConvenience.java 2008-05-19 12:57:31 UTC (rev 900) @@ -1,37 +0,0 @@ -package org.dllearner.utilities; - -import java.util.List; -import java.util.SortedSet; -import java.util.TreeSet; - -import com.hp.hpl.jena.query.ResultSet; -import com.hp.hpl.jena.query.ResultSetFormatter; -import com.hp.hpl.jena.sparql.core.ResultBinding; - -public class JenaResultSetConvenience { - ResultSet rs; - - public JenaResultSetConvenience(ResultSet rs) { - super(); - this.rs = rs; - } - - @SuppressWarnings("unchecked") - public SortedSet<String> getStringListForVariable(String var){ - SortedSet<String> result = new TreeSet<String>(); - - //String s=ResultSetFormatter.asXMLString(this.rs); - List<ResultBinding> l = ResultSetFormatter.toList(this.rs); - - for (ResultBinding resultBinding : l) { - - result.add(resultBinding.get(var).toString()); - - } - - return result; - - } - - -} Copied: trunk/src/dl-learner/org/dllearner/utilities/Logging.java (from rev 899, trunk/src/dl-learner/org/dllearner/utilities/statistics/Logging.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Logging.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/Logging.java 2008-05-19 12:57:31 UTC (rev 900) @@ -0,0 +1,61 @@ +/** + * 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.utilities; + +import java.util.Enumeration; + +import org.apache.log4j.Appender; +import org.apache.log4j.Level; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.apache.log4j.spi.LoggerRepository; + +/** + * Logging centered utility class. + * + * @author Jens Lehmann + * + */ +public class Logging { + + /** + * Prints the currently available log4j loggers to system out. + */ + @SuppressWarnings({"unchecked"}) + public static void printCurrentLoggers() { + LoggerRepository rep = LogManager.getLoggerRepository(); + Enumeration<Logger> e = rep.getCurrentLoggers(); + while(e.hasMoreElements()) { + Logger l = e.nextElement(); + String name = l.getName(); + Level level = l.getLevel(); + Enumeration<Appender> appenders = l.getAllAppenders(); + + if(appenders.hasMoreElements()) + System.out.println("APPENDER: " + appenders.nextElement()); + + System.out.println("name : " + name); + System.out.println("level: " + level); + System.out.println("appenders: " + appenders); + System.out.println(); + } + } + +} Deleted: trunk/src/dl-learner/org/dllearner/utilities/ManchesterOWLSyntaxParser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/ManchesterOWLSyntaxParser.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/utilities/ManchesterOWLSyntaxParser.java 2008-05-19 12:57:31 UTC (rev 900) @@ -1,48 +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.utilities; - -import org.coode.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser; -import org.semanticweb.owl.apibinding.OWLManager; -import org.semanticweb.owl.expression.ParserException; -import org.semanticweb.owl.model.OWLDescription; -import org.semanticweb.owl.model.OWLOntologyManager; - -/** - * Parser for Manchester Syntax strings (interface to OWL API parser). - * TODO: Currently, this outputs an OWL API OWLDescription, but there - * is no converter from OWL API descriptions to DL-Learner descriptions - * at the moment. - * - * @author Jens Lehmann - * - */ -public class ManchesterOWLSyntaxParser { - - public OWLDescription getDescription(String manchesterSyntaxDescription) throws ParserException { - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - - ManchesterOWLSyntaxEditorParser parser = new - ManchesterOWLSyntaxEditorParser(manager.getOWLDataFactory(), manchesterSyntaxDescription); - - return parser.parseDescription(); - } - -} Deleted: trunk/src/dl-learner/org/dllearner/utilities/RoleComparator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/RoleComparator.java 2008-05-19 12:28:20 UTC (rev 899) +++ trunk/src/dl-learner/org/dllearner/utilities/RoleComparator.java 2008-05-19 12:57:31 UTC (rev 900) @@ -1,69 +0,0 @@ -/** - * Copyright (C) 2007-2008, Jens Lehmann - * - * This fi... [truncated message content] |