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: <jen...@us...> - 2008-02-18 14:50:29
|
Revision: 602 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=602&view=rev Author: jenslehmann Date: 2008-02-18 06:50:24 -0800 (Mon, 18 Feb 2008) Log Message: ----------- fixed typo Modified Paths: -------------- trunk/build.xml Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2008-02-18 14:41:34 UTC (rev 601) +++ trunk/build.xml 2008-02-18 14:50:24 UTC (rev 602) @@ -61,7 +61,7 @@ </copy> <!-- create file containing the build info --> - <echo file="${release_tmp_dir}/build.txt" append="false">DL-Leaner Build ${today}</echo> + <echo file="${release_tmp_dir}/build.txt" append="false">DL-Learner Build ${today}</echo> <!-- create empty log directory for release --> <mkdir dir="${release_tmp_dir}/log" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-18 14:41:43
|
Revision: 601 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=601&view=rev Author: jenslehmann Date: 2008-02-18 06:41:34 -0800 (Mon, 18 Feb 2008) Log Message: ----------- updated documentation for configuration options (file generated automatically) Modified Paths: -------------- trunk/doc/configOptions.txt Modified: trunk/doc/configOptions.txt =================================================================== --- trunk/doc/configOptions.txt 2008-02-18 14:26:58 UTC (rev 600) +++ trunk/doc/configOptions.txt 2008-02-18 14:41:34 UTC (rev 601) @@ -9,12 +9,12 @@ option name: filename description: pointer to the KB file on local file system -values: none +values: class org.dllearner.core.config.StringConfigOption default value: null option name: url description: URL pointer to the KB file -values: none +values: class org.dllearner.core.config.StringConfigOption default value: null component: OWL file (org.dllearner.kb.OWLFile) @@ -22,57 +22,137 @@ option name: url description: URL pointing to the OWL file -values: none +values: class org.dllearner.core.config.StringConfigOption default value: null -component: SPARQL Endpoint (org.dllearner.kb.SparqlEndpoint) -============================================================ +component: SPARQL Endpoint (org.dllearner.kb.sparql.SparqlKnowledgeSource) +========================================================================== option name: url description: URL of SPARQL Endpoint -values: none +values: class org.dllearner.core.config.StringConfigOption default value: null option name: instances description: relevant instances e.g. positive and negative examples in a learning problem -values: none +values: class org.dllearner.core.config.StringSetConfigOption default value: null -option name: numberOfRecursions -description: number of Recursions, the Sparql-Endpoint is asked -values: none +option name: recursionDepth +description: recursion depth of KB fragment selection +values: class org.dllearner.core.config.IntegerConfigOption +default value: 2 + +option name: predefinedFilter +description: the mode of the SPARQL Filter +values: class org.dllearner.core.config.IntegerConfigOption default value: null -option name: filterMode +option name: predefinedEndpoint description: the mode of the SPARQL Filter -values: none +values: class org.dllearner.core.config.IntegerConfigOption default value: null option name: predList -description: a predicate list -values: none +description: list of all ignored roles +values: class org.dllearner.core.config.StringSetConfigOption default value: null option name: objList -description: an object list -values: none +description: list of all ignored objects +values: class org.dllearner.core.config.StringSetConfigOption default value: null option name: classList -description: a class list -values: none +description: list of all ignored classes +values: class org.dllearner.core.config.StringSetConfigOption default value: null option name: format description: N-TRIPLES or KB format -values: none -default value: null +values: class org.dllearner.core.config.StringConfigOption +default value: N-TRIPLES option name: dumpToFile -description: wether Ontology from DBPedia is written to a file or not -values: none +description: Specifies whether the extracted ontology is written to a file or not. +values: class org.dllearner.core.config.BooleanConfigOption +default value: true + +option name: useLits +description: use Literals in SPARQL query +values: class org.dllearner.core.config.BooleanConfigOption default value: null +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 +default value: true + +option name: learnDomain +description: learns the Domain for a Role +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: learnRange +description: learns the Range for a Role +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: role +description: role to learn Domain/Range from +values: class org.dllearner.core.config.StringConfigOption +default value: null + +option name: blankNodeIdentifier +description: used to identify blanknodes in Tripels +values: class org.dllearner.core.config.StringConfigOption +default value: null + +option name: example +description: example +values: class org.dllearner.core.config.StringTupleListConfigOption +default value: null + +option name: replacePredicate +description: rule for replacing predicates +values: class org.dllearner.core.config.StringTupleListConfigOption +default value: null + +option name: replaceObject +description: rule for replacing predicates +values: class org.dllearner.core.config.StringTupleListConfigOption +default value: null + +option name: breakSuperClassRetrievalAfter +description: stops a cyclic hierarchy after specified number of classes +values: class org.dllearner.core.config.IntegerConfigOption +default value: null + +option name: numberOfInstancesUsedForRoleLearning +description: +values: class org.dllearner.core.config.IntegerConfigOption +default value: null + +option name: closeAfterRecursion +description: gets all classes for all instances +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: verbosity +description: control verbosity of output for this component +values: class org.dllearner.core.config.StringConfigOption +default value: warning + +option name: defaultGraphURIs +description: a list of all default Graph URIs +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: namedGraphURIs +description: a list of all named Graph URIs +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + ************* * Reasoners * ************* @@ -82,29 +162,29 @@ option name: reasonerUrl description: URL of the DIG reasoner -values: none +values: class org.dllearner.core.config.StringConfigOption default value: null option name: writeDIGProtocol description: specifies whether or not to write a protocoll of send and received DIG requests -values: none +values: class org.dllearner.core.config.BooleanConfigOption default value: false option name: digProtocolFile description: the file to store the DIG protocol -values: none +values: class org.dllearner.core.config.StringConfigOption default value: log/digProtocol.txt -component: unnamed component (org.dllearner.reasoning.FastRetrievalReasoner) -============================================================================ +component: fast retrieval reasoner (org.dllearner.reasoning.FastRetrievalReasoner) +================================================================================== -component: unnamed component (org.dllearner.reasoning.KAON2Reasoner) +component: OWL API reasoner (org.dllearner.reasoning.OWLAPIReasoner) ==================================================================== -option name: una -description: unique names assumption -values: none -default value: false +option name: reasonerType +description: FaCT++ or Pellet +values: class org.dllearner.core.config.StringConfigOption +default value: pellet ********************* * Learning Problems * @@ -115,90 +195,371 @@ option name: positiveExamples description: positive examples -values: none +values: class org.dllearner.core.config.StringSetConfigOption default value: null option name: negativeExamples description: negative examples -values: none +values: class org.dllearner.core.config.StringSetConfigOption default value: null option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: none +values: class org.dllearner.core.config.BooleanConfigOption default value: null 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: none +values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 default value: 0.05 +option name: useMultiInstanceChecks +description: See UseMultiInstanceChecks enum. +values: class org.dllearner.core.config.StringConfigOption +default value: null + component: inclusion learning problem (org.dllearner.learningproblems.PosNegInclusionLP) ======================================================================================== option name: positiveExamples description: positive examples -values: none +values: class org.dllearner.core.config.StringSetConfigOption default value: null option name: negativeExamples description: negative examples -values: none +values: class org.dllearner.core.config.StringSetConfigOption default value: null option name: useRetrievalForClassficiation description: Specifies whether to use retrieval or instance checks for testing a concept. -values: none +values: class org.dllearner.core.config.BooleanConfigOption default value: null +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 +default value: 0.05 + +option name: useMultiInstanceChecks +description: See UseMultiInstanceChecks enum. +values: class org.dllearner.core.config.StringConfigOption +default value: null + +component: positive only definition learning problem (org.dllearner.learningproblems.PosOnlyDefinitionLP) +========================================================================================================= + +option name: positiveExamples +description: positive examples +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + *********************** * Learning Algorithms * *********************** -component: unnamed component (org.dllearner.algorithms.BruteForceLearner) -========================================================================= +component: brute force learning algorithm (org.dllearner.algorithms.BruteForceLearner) +====================================================================================== option name: maxLength description: maximum length of generated concepts -values: none +values: class org.dllearner.core.config.IntegerConfigOption default value: null 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: none +values: class org.dllearner.core.config.StringConfigOption default value: null -component: unnamed component (org.dllearner.algorithms.RandomGuesser) -===================================================================== +component: random guesser learning algorithm (org.dllearner.algorithms.RandomGuesser) +===================================================================================== option name: numberOfTrees description: number of randomly generated concepts/trees -values: none +values: class org.dllearner.core.config.IntegerConfigOption default value: null option name: maxDepth description: maximum depth of generated concepts/trees -values: none +values: class org.dllearner.core.config.IntegerConfigOption default value: null -component: unnamed component (org.dllearner.algorithms.gp.GP) -============================================================= +component: genetic programming learning algorithm (org.dllearner.algorithms.gp.GP) +================================================================================== +option name: selectionType +description: selection type +values: class org.dllearner.core.config.StringConfigOption +default value: rankSelection + +option name: tournamentSize +description: tournament size (applies only to tournament selection) +values: class org.dllearner.core.config.IntegerConfigOption min 2 max 20 +default value: 3 + +option name: elitism +description: specifies whether to use elitism in selection +values: class org.dllearner.core.config.BooleanConfigOption +default value: true + +option name: mutationProbablitiy +description: mutation probability +values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +default value: 0.03 + +option name: crossoverProbablitiy +description: crossover probability +values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +default value: 0.95 + +option name: hillClimbingProbablitiy +description: hill climbing probability +values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +default value: 0.0 + +option name: refinementProbablitiy +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 +default value: 0.0 + +option name: numberOfIndividuals +description: number of individuals +values: class org.dllearner.core.config.IntegerConfigOption min 1 +default value: 100 + +option name: numberOfSelectedIndividuals +description: number of selected individuals +values: class org.dllearner.core.config.IntegerConfigOption min 1 +default value: 92 + +option name: useFixedNumberOfGenerations +description: specifies whether to use a fixed number of generations +values: class org.dllearner.core.config.BooleanConfigOption +default value: 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 +default value: 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 +default value: 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 +default value: false + +option name: initMinDepth +description: minimum depth to use when creating the initial population +values: class org.dllearner.core.config.IntegerConfigOption min 1 +default value: 4 + +option name: initMaxDepth +description: maximum depth to use when creating the initial population +values: class org.dllearner.core.config.IntegerConfigOption min 1 +default value: 6 + +option name: maxConceptLength +description: maximum concept length (higher length means lowest possible fitness) +values: class org.dllearner.core.config.IntegerConfigOption min 1 +default value: 75 + +component: example driven refinement operator based learning algorithm (org.dllearner.algorithms.refexamples.ExampleBasedROLComponent) +====================================================================================================================================== + +option name: writeSearchTree +description: specifies whether to write a search tree +values: class org.dllearner.core.config.BooleanConfigOption +default value: false + +option name: searchTreeFile +description: file to use for the search tree +values: class org.dllearner.core.config.StringConfigOption +default value: 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 +default value: false + +option name: heuristic +description: specifiy the heuristic to use +values: class org.dllearner.core.config.StringConfigOption +default value: 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 +default value: 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 +default value: 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 +default value: true + +option name: useOverlyGeneralList +description: try to find overly general concept without sending them to the reasoner +values: class org.dllearner.core.config.BooleanConfigOption +default value: true + +option name: useShortConceptConstruction +description: shorten concept to see whether they already exist +values: class org.dllearner.core.config.BooleanConfigOption +default value: 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 +default value: 0.6 + +option name: improveSubsumptionHierarchy +description: simplify subsumption hierarchy to reduce search space (see publication for description) +values: class org.dllearner.core.config.BooleanConfigOption +default value: true + +option name: allowedConcepts +description: concepts the algorithm is allowed to use +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: ignoredConcepts +description: concepts the algorithm must ignore +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: allowedRoles +description: roles the algorithm is allowed to use +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: ignoredRoles +description: roles the algorithm must ignore +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: useAllConstructor +description: specifies whether to universal concept constructor is used in the learning algorothm +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: useExistsConstructor +description: specifies whether to existential concept constructor is used in the learning algorothm +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: useNegation +description: specifies whether negation is used in the learning algorothm +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: noisePercentage +description: the (approximated) percentage of noise within the examples +values: class org.dllearner.core.config.DoubleConfigOption min 0.0 max 1.0 +default value: null + component: refinement operator based learning algorithm (org.dllearner.algorithms.refinement.ROLearner) ======================================================================================================= option name: writeSearchTree description: specifies whether to write a search tree -values: none +values: class org.dllearner.core.config.BooleanConfigOption default value: false option name: searchTreeFile description: file to use for the search tree -values: none +values: class org.dllearner.core.config.StringConfigOption default value: 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 +default value: false + option name: heuristic description: specifiy the heuristic to use -values: none +values: class org.dllearner.core.config.StringConfigOption default value: 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 +default value: 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 +default value: 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 +default value: true + +option name: useOverlyGeneralList +description: try to find overly general concept without sending them to the reasoner +values: class org.dllearner.core.config.BooleanConfigOption +default value: true + +option name: useShortConceptConstruction +description: shorten concept to see whether they already exist +values: class org.dllearner.core.config.BooleanConfigOption +default value: 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 +default value: 0.6 + +option name: improveSubsumptionHierarchy +description: simplify subsumption hierarchy to reduce search space (see publication for description) +values: class org.dllearner.core.config.BooleanConfigOption +default value: true + +option name: quiet +description: may be deprecated soon +values: class org.dllearner.core.config.BooleanConfigOption +default value: false + +option name: allowedConcepts +description: concepts the algorithm is allowed to use +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: ignoredConcepts +description: concepts the algorithm must ignore +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: allowedRoles +description: roles the algorithm is allowed to use +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: ignoredRoles +description: roles the algorithm must ignore +values: class org.dllearner.core.config.StringSetConfigOption +default value: null + +option name: useAllConstructor +description: specifies whether to universal concept constructor is used in the learning algorothm +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: useExistsConstructor +description: specifies whether to existential concept constructor is used in the learning algorothm +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + +option name: useNegation +description: specifies whether negation is used in the learning algorothm +values: class org.dllearner.core.config.BooleanConfigOption +default value: null + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-02-18 14:27:09
|
Revision: 600 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=600&view=rev Author: kurzum Date: 2008-02-18 06:26:58 -0800 (Mon, 18 Feb 2008) Log Message: ----------- fixed examples (header lymphography, some readmes) Modified Paths: -------------- trunk/examples/lymphography/lymphography_Class1.conf trunk/examples/lymphography/lymphography_Class2.conf trunk/examples/lymphography/lymphography_Class3.conf trunk/examples/lymphography/lymphography_Class4.conf trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java Added Paths: ----------- trunk/examples/sparql/README.txt trunk/examples/sparql/roles_notworking/README.txt Removed Paths: ------------- trunk/examples/sparql/config.owl Modified: trunk/examples/lymphography/lymphography_Class1.conf =================================================================== --- trunk/examples/lymphography/lymphography_Class1.conf 2008-02-18 12:35:49 UTC (rev 599) +++ trunk/examples/lymphography/lymphography_Class1.conf 2008-02-18 14:26:58 UTC (rev 600) @@ -1,4 +1,31 @@ +/* +Converted form the UCI Machine Learning Repository at: +http://archive.ics.uci.edu/ml/datasets/Lymphography +Files: +lymphography_Class1.conf +lymphography_Class2.conf +lymphography_Class3.conf +lymphography_Class4.conf + +A solution ist found relatively fast for example 1 and 4. +Because of the increasing length of concepts for example 2 and 4, +it will need a lot of time to find a solution, in case it exists at all. +Mainly used as a test case for improving the algorithms (example 4 uses +a new experimental version of the refinement algorithm) + + +*/ + + +reasoner = dig; +//reasoner = fastRetrieval; + +algorithm = refinement; +//refinement.heuristic = flexible; +//algorithm = refexamples; + + refinement.ignoredConcepts = { "http://www.example.org/lymphography#Target1_NormalFind", "http://www.example.org/lymphography#Target2_Metastases", Modified: trunk/examples/lymphography/lymphography_Class2.conf =================================================================== --- trunk/examples/lymphography/lymphography_Class2.conf 2008-02-18 12:35:49 UTC (rev 599) +++ trunk/examples/lymphography/lymphography_Class2.conf 2008-02-18 14:26:58 UTC (rev 600) @@ -1,3 +1,28 @@ +/* +Converted form the UCI Machine Learning Repository at: +http://archive.ics.uci.edu/ml/datasets/Lymphography + +Files: +lymphography_Class1.conf +lymphography_Class2.conf +lymphography_Class3.conf +lymphography_Class4.conf + +A solution ist found relatively fast for example 1 and 4. +Because of the increasing length of concepts for example 2 and 4, +it will need a lot of time to find a solution, in case it exists at all. +Mainly used as a test case for improving the algorithms (example 4 uses +a new experimental version of the refinement algorithm) + + +*/ +reasoner = dig; +//reasoner = fastRetrieval; + +algorithm = refinement; +//refinement.heuristic = flexible; +//algorithm = refexamples; + refinement.ignoredConcepts = { "http://www.example.org/lymphography#Target1_NormalFind", "http://www.example.org/lymphography#Target2_Metastases", @@ -6,6 +31,8 @@ }; + + refinement.useAllConstructor = false; refinement.useExistsConstructor = true; refinement.useNegation = false; Modified: trunk/examples/lymphography/lymphography_Class3.conf =================================================================== --- trunk/examples/lymphography/lymphography_Class3.conf 2008-02-18 12:35:49 UTC (rev 599) +++ trunk/examples/lymphography/lymphography_Class3.conf 2008-02-18 14:26:58 UTC (rev 600) @@ -1,3 +1,31 @@ +/* +Converted form the UCI Machine Learning Repository at: +http://archive.ics.uci.edu/ml/datasets/Lymphography + +Files: +lymphography_Class1.conf +lymphography_Class2.conf +lymphography_Class3.conf +lymphography_Class4.conf + +A solution ist found relatively fast for example 1 and 4. +Because of the increasing length of concepts for example 2 and 4, +it will need a lot of time to find a solution, in case it exists at all. +Mainly used as a test case for improving the algorithms (example 4 uses +a new experimental version of the refinement algorithm) + + +*/ + + + +reasoner = dig; +//reasoner = fastRetrieval; + +algorithm = refinement; +//refinement.heuristic = flexible; +//algorithm = refexamples; + refinement.ignoredConcepts = { "http://www.example.org/lymphography#Target1_NormalFind", "http://www.example.org/lymphography#Target2_Metastases", Modified: trunk/examples/lymphography/lymphography_Class4.conf =================================================================== --- trunk/examples/lymphography/lymphography_Class4.conf 2008-02-18 12:35:49 UTC (rev 599) +++ trunk/examples/lymphography/lymphography_Class4.conf 2008-02-18 14:26:58 UTC (rev 600) @@ -1,6 +1,28 @@ +/* +Converted form the UCI Machine Learning Repository at: +http://archive.ics.uci.edu/ml/datasets/Lymphography +Files: +lymphography_Class1.conf +lymphography_Class2.conf +lymphography_Class3.conf +lymphography_Class4.conf + +A solution ist found relatively fast for example 1 and 4. +Because of the increasing length of concepts for example 2 and 4, +it will need a lot of time to find a solution, in case it exists at all. +Mainly used as a test case for improving the algorithms (example 4 uses +a new experimental version of the refinement algorithm) + + +*/ + + +//reasoner = dig; reasoner = fastRetrieval; +//algorithm = refinement; +//refinement.heuristic = flexible; algorithm = refexamples; refexamples.ignoredConcepts = { Added: trunk/examples/sparql/README.txt =================================================================== --- trunk/examples/sparql/README.txt (rev 0) +++ trunk/examples/sparql/README.txt 2008-02-18 14:26:58 UTC (rev 600) @@ -0,0 +1,7 @@ + +Note: DBpedia is always subject to change, solutions will change over time + +After using the SPARQL Component, a n-triple file is created at: +examples/../cache/ or root/cache +Which contains the used knowledge base. + Deleted: trunk/examples/sparql/config.owl =================================================================== --- trunk/examples/sparql/config.owl 2008-02-18 12:35:49 UTC (rev 599) +++ trunk/examples/sparql/config.owl 2008-02-18 14:26:58 UTC (rev 600) @@ -1,172 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE rdf:RDF [ - <!ENTITY config "http://www.extraction.org/config#"> - <!ENTITY owl "http://www.w3.org/2002/07/owl#"> - <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#"> - <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#"> -]> -<rdf:RDF xml:base="http://www.extraction.org/config" xmlns:config="http://www.extraction.org/config#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> - <!-- Ontology Information --> - <owl:Ontology rdf:about=""> - <owl:versionInfo xml:lang="en">version 0.1</owl:versionInfo> - </owl:Ontology> - <!-- Classes --> - <owl:Class rdf:about="#Configuration"/> - <owl:Class rdf:about="#FilterSet"/> - <owl:Class rdf:about="#GETParameter"/> - <owl:Class rdf:about="#ObjectFilterSet"> - <rdfs:subClassOf rdf:resource="#FilterSet"/> - </owl:Class> - <owl:Class rdf:about="#PredicateFilterSet"> - <rdfs:subClassOf rdf:resource="#FilterSet"/> - </owl:Class> - <owl:Class rdf:about="#SparqlEndpoint"/> - <owl:Class rdf:about="#TypedQuery"/> - <!-- Annotation Properties --> - <owl:AnnotationProperty rdf:about="&rdfs;comment"/> - <owl:AnnotationProperty rdf:about="&owl;versionInfo"/> - <!-- Datatype Properties --> - <owl:DatatypeProperty rdf:about="#filtersURI"> - <rdfs:domain rdf:resource="#ObjectFilterSet"/> - <rdfs:domain rdf:resource="#PredicateFilterSet"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasAfterGET"> - <rdfs:domain rdf:resource="#SparqlEndpoint"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasHost"> - <rdfs:domain rdf:resource="#SparqlEndpoint"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasMode"> - <rdfs:domain rdf:resource="#TypedQuery"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasParameterContent"> - <rdfs:domain rdf:resource="#GETParameter"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasParameterName"> - <rdfs:domain rdf:resource="#GETParameter"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasPort"> - <rdfs:domain rdf:resource="#SparqlEndpoint"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasQueryParameter"> - <rdfs:domain rdf:resource="#SparqlEndpoint"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#hasRecursionDepth"> - <rdfs:domain rdf:resource="#Configuration"/> - </owl:DatatypeProperty> - <owl:DatatypeProperty rdf:about="#usesLiterals"> - <rdfs:domain rdf:resource="#TypedQuery"/> - </owl:DatatypeProperty> - <!-- Object Properties --> - <owl:ObjectProperty rdf:about="#hasGETParameter"> - <rdfs:domain rdf:resource="#SparqlEndpoint"/> - <rdfs:range rdf:resource="#GETParameter"/> - </owl:ObjectProperty> - <owl:ObjectProperty rdf:about="#hasObjectFilterSet"> - <rdfs:domain rdf:resource="#TypedQuery"/> - <rdfs:range rdf:resource="#ObjectFilterSet"/> - </owl:ObjectProperty> - <owl:ObjectProperty rdf:about="#hasPredicateFilterSet"> - <rdfs:domain rdf:resource="#TypedQuery"/> - <rdfs:range rdf:resource="#PredicateFilterSet"/> - </owl:ObjectProperty> - <owl:ObjectProperty rdf:about="#hasSparqlEndpoint"> - <rdfs:domain rdf:resource="#Configuration"/> - <rdfs:range rdf:resource="#SparqlEndpoint"/> - </owl:ObjectProperty> - <owl:ObjectProperty rdf:about="#hasTypedQuery"> - <rdfs:domain rdf:resource="#Configuration"/> - <rdfs:range rdf:resource="#TypedQuery"/> - </owl:ObjectProperty> - <!-- Instances --> - <config:SparqlEndpoint rdf:about="#dbpediaEndpoint"> - <config:hasAfterGET rdf:datatype="&xsd;string">/sparql</config:hasAfterGET> - <config:hasGETParameter rdf:resource="#defaultgraphuri"/> - <config:hasGETParameter rdf:resource="#format"/> - <config:hasHost rdf:datatype="&xsd;string">dbpedia.openlinksw.com</config:hasHost> - <config:hasPort rdf:datatype="&xsd;string">80</config:hasPort> - <config:hasQueryParameter rdf:datatype="&xsd;string">query</config:hasQueryParameter> - <config:hasURL>dbpedia.openlinksw.com:80/sparql</config:hasURL> - </config:SparqlEndpoint> - <config:ObjectFilterSet rdf:about="#dbpediaGeneralObjectFilter"> - <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Articles_</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Wikipedia_</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://upload.wikimedia.org/wikipedia/commons</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://upload.wikimedia.org/wikipedia</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://www.geonames.org</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://www.w3.org/2006/03/wn/wn20/instances/synset</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://www4.wiwiss.fu-berlin.de/flickrwrappr</config:filtersURI> - </config:ObjectFilterSet> - <config:PredicateFilterSet rdf:about="#dbpediaGeneralPredicateFilter"> - <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/property/reference</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/property/website</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/property/wikipage-</config:filtersURI> - </config:PredicateFilterSet> - <config:TypedQuery rdf:about="#dbpediaYago"> - <config:hasMode rdf:datatype="&xsd;string">forbid</config:hasMode> - <config:hasObjectFilterSet rdf:resource="#dbpediaGeneralObjectFilter"/> - <config:hasObjectFilterSet rdf:resource="#foafObjectFilter"/> - <config:hasObjectFilterSet rdf:resource="#yagoObjectFilter"/> - <config:hasPredicateFilterSet rdf:resource="#dbpediaGeneralPredicateFilter"/> - <config:hasPredicateFilterSet rdf:resource="#foafPredicateFilter"/> - <config:hasPredicateFilterSet rdf:resource="#sameAsFilter"/> - <config:hasPredicateFilterSet rdf:resource="#yagoPredicateFilter"/> - <config:usesLiterals rdf:datatype="&xsd;string">false</config:usesLiterals> - </config:TypedQuery> - <config:Configuration rdf:about="#dbpediatest" rdfs:comment="for first test"> - <config:hasRecursionDepth rdf:datatype="&xsd;string">2</config:hasRecursionDepth> - <config:hasSparqlEndpoint rdf:resource="#dbpediaEndpoint"/> - <config:hasTypedQuery rdf:resource="#dbpediaYago"/> - </config:Configuration> - <config:GETParameter rdf:about="#defaultgraphuri"> - <config:hasParameterContent rdf:datatype="&xsd;string">http://dbpedia.org</config:hasParameterContent> - <config:hasParameterName rdf:datatype="&xsd;string">default-graph-uri</config:hasParameterName> - </config:GETParameter> - <config:ObjectFilterSet rdf:about="#foafObjectFilter"> - <config:filtersURI rdf:datatype="&xsd;string">http://xmlns.com/foaf/0.1/</config:filtersURI> - </config:ObjectFilterSet> - <config:PredicateFilterSet rdf:about="#foafPredicateFilter"> - <config:filtersURI rdf:datatype="&xsd;string">http://xmlns.com/foaf/0.1/</config:filtersURI> - </config:PredicateFilterSet> - <config:GETParameter rdf:about="#format"> - <config:hasParameterContent rdf:datatype="&xsd;string">application/sparql-results.xml</config:hasParameterContent> - <config:hasParameterName rdf:datatype="&xsd;string">format</config:hasParameterName> - </config:GETParameter> - <config:Configuration rdf:about="#localjoseki"> - <config:hasRecursionDepth rdf:datatype="&xsd;string">2</config:hasRecursionDepth> - <config:hasSparqlEndpoint rdf:resource="#localjosekiendpoint"/> - <config:hasTypedQuery rdf:resource="#localjosekitypedquery"/> - </config:Configuration> - <config:SparqlEndpoint rdf:about="#localjosekiendpoint"> - <config:hasAfterGET rdf:datatype="&xsd;string">/books</config:hasAfterGET> - <config:hasHost rdf:datatype="http://www.w3.org/2001/XMLSchema#string">localhost</config:hasHost> - <config:hasPort rdf:datatype="&xsd;string">2020</config:hasPort> - <config:hasQueryParameter rdf:datatype="&xsd;string">query</config:hasQueryParameter> - <config:hasURL>localhost:2020/books</config:hasURL> - </config:SparqlEndpoint> - <config:TypedQuery rdf:about="#localjosekitypedquery"> - <config:hasMode rdf:datatype="&xsd;string">forbid</config:hasMode> - <config:hasObjectFilterSet rdf:resource="#dbpediaGeneralObjectFilter"/> - <config:hasPredicateFilterSet rdf:resource="#dbpediaGeneralPredicateFilter"/> - <config:usesLiterals rdf:datatype="&xsd;string">false</config:usesLiterals> - </config:TypedQuery> - <config:PredicateFilterSet rdf:about="#sameAsFilter"> - <config:filtersURI rdf:datatype="&xsd;string">http://www.w3.org/2002/07/owl#sameAs</config:filtersURI> - </config:PredicateFilterSet> - <config:ObjectFilterSet rdf:about="#yagoObjectFilter"> - <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Articles_</config:filtersURI> - <config:filtersURI rdf:datatype="&xsd;string">http://dbpedia.org/resource/Category:Wikipedia_</config:filtersURI> - </config:ObjectFilterSet> - <config:PredicateFilterSet rdf:about="#yagoPredicateFilter"> - <config:filtersURI rdf:datatype="&xsd;string">http://www.w3.org/2004/02/skos/core</config:filtersURI> - </config:PredicateFilterSet> - <rdf:Description rdf:about="#hasURL"> - <rdf:type> - <rdf:Description rdf:about="http://www.w3.org/2002/07/owl#DatatypeProperty"/> - </rdf:type> - <rdfs:domain> - <rdf:Description rdf:about="#SparqlEndpoint"/> - </rdfs:domain> - </rdf:Description> -</rdf:RDF> Added: trunk/examples/sparql/roles_notworking/README.txt =================================================================== --- trunk/examples/sparql/roles_notworking/README.txt (rev 0) +++ trunk/examples/sparql/roles_notworking/README.txt 2008-02-18 14:26:58 UTC (rev 600) @@ -0,0 +1,4 @@ + +The learning of domain/range for roles has been deactivated for this release, +because it involved several manual steps, which were not supported by a gui +or a dialog system. We try to automate this process for the next release. \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java 2008-02-18 12:35:49 UTC (rev 599) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java 2008-02-18 14:26:58 UTC (rev 600) @@ -83,6 +83,7 @@ } logger.info("query SPARQL server"); try{ + //TODO after overnext Jena release HttpQuery.urlLimit = 3*1024 ; rs = queryExecution.execSelect(); logger.info(rs.getResultVars().toString()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-18 12:35:53
|
Revision: 599 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=599&view=rev Author: jenslehmann Date: 2008-02-18 04:35:49 -0800 (Mon, 18 Feb 2008) Log Message: ----------- added cli.logLevel option (allowed values: trace, debug, info [default], warn, error, fatal, off) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-18 12:32:36 UTC (rev 598) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-18 12:35:49 UTC (rev 599) @@ -118,7 +118,7 @@ ConsoleAppender consoleAppender = new ConsoleAppender(layout); logger.removeAllAppenders(); logger.addAppender(consoleAppender); - logger.setLevel(Level.INFO); + logger.setLevel(Level.DEBUG); Start start = null; start = new Start(file); @@ -541,6 +541,22 @@ if (!satisfiable) System.exit(0); } + } else if( name.equals("logLevel")) { + String level = cliOption.getStringValue(); + if(level.equals("off")) + logger.setLevel(Level.OFF); + else if(level.equals("trace")) + logger.setLevel(Level.TRACE); + else if(level.equals("info")) + logger.setLevel(Level.INFO); + else if(level.equals("debug")) + logger.setLevel(Level.DEBUG); + else if(level.equals("warn")) + logger.setLevel(Level.WARN); + else if(level.equals("error")) + logger.setLevel(Level.ERROR); + else if(level.equals("fatal")) + logger.setLevel(Level.FATAL); } else handleError("Unknown CLI option \"" + name + "\"."); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-02-18 12:32:42
|
Revision: 598 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=598&view=rev Author: kurzum Date: 2008-02-18 04:32:36 -0800 (Mon, 18 Feb 2008) Log Message: ----------- sparql examples fixed Modified Paths: -------------- trunk/examples/commandcollection.txt trunk/examples/sparql/Aristotle.conf trunk/examples/sparql/DBPediaYAGOWomanInPolitics.conf trunk/examples/sparql/SilentBobWorking1.conf trunk/examples/sparql/SilentBobWorking2.conf trunk/examples/sparql/difference/DBPediaSKOS_kohl_vs_angela.conf trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary.conf trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary_ignoredConcepts.conf trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela.conf trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela_ignoredConcepts.conf trunk/examples/sparql/hierarchy/Hierarchy0DBPediaYAGOChanBrit_monarch.conf trunk/examples/sparql/hierarchy/Hierarchy1DBPediaYAGOChanBrit_pred_Knight.conf trunk/examples/sparql/navigation/Navigation0DBPediaYAGOAristotle.conf trunk/examples/sparql/navigation/Navigation1DBPediaYAGOAristotle.conf trunk/examples/sparql/navigation/Navigation2DBPediaYAGOAristotle.conf Modified: trunk/examples/commandcollection.txt =================================================================== --- trunk/examples/commandcollection.txt 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/commandcollection.txt 2008-02-18 12:32:36 UTC (rev 598) @@ -51,5 +51,17 @@ sparql.predefinedFilter = 5; sparql.predefinedEndpoint = 1; +//*********SKOS specific +// replace skos with owl properties +sparql.replacePredicate = [ +("http://www.w3.org/2004/02/skos/core#subject","http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), +("http://www.w3.org/2004/02/skos/core#broader","http://www.w3.org/2000/01/rdf-schema#subClassOf")]; + +// because skos is cyclic this stops it +//manually after retrieving the specified amount of classes +sparql.breakSuperClassRetrievalAfter=200; + + import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL"); sparql.instances = {}; + Modified: trunk/examples/sparql/Aristotle.conf =================================================================== --- trunk/examples/sparql/Aristotle.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/Aristotle.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,6 +1,7 @@ /** * Some people from Greece. - * + * Note: DBpedia is always subject to change, solutions will change over time + * Possible Solution: * Theorist OR (Mathematician AND Physicist) * Modified: trunk/examples/sparql/DBPediaYAGOWomanInPolitics.conf =================================================================== --- trunk/examples/sparql/DBPediaYAGOWomanInPolitics.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/DBPediaYAGOWomanInPolitics.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,5 +1,8 @@ /* * Some woman, that are Politicians + + Note: DBpedia is always subject to change, solutions will change over time + Solution http://dbpedia.org/class/yago/Executive110069645 (length 1, depth 1) http://dbpedia.org/class/yago/CorporateExecutive109966255 (length 1, depth 1) Modified: trunk/examples/sparql/SilentBobWorking1.conf =================================================================== --- trunk/examples/sparql/SilentBobWorking1.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/SilentBobWorking1.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,4 +1,6 @@ +// Note: DBpedia is always subject to change, solutions will change over time + refinement.useAllConstructor = false; refinement.useExistsConstructor = true; refinement.useNegation = false; Modified: trunk/examples/sparql/SilentBobWorking2.conf =================================================================== --- trunk/examples/sparql/SilentBobWorking2.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/SilentBobWorking2.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,3 +1,4 @@ +//Note: DBpedia is always subject to change, solutions will change over time refinement.useAllConstructor = false; Modified: trunk/examples/sparql/difference/DBPediaSKOS_kohl_vs_angela.conf =================================================================== --- trunk/examples/sparql/difference/DBPediaSKOS_kohl_vs_angela.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/difference/DBPediaSKOS_kohl_vs_angela.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,8 +1,9 @@ /** - * Simple example for using a SPARQL Endpoint as background - * knowledge. - * Solutions: +Note: DBpedia is always subject to change, solutions will change over time +Simple example for using a SPARQL Endpoint as background knowledge. +Solutions: + http://dbpedia.org/resource/Helmut_Kohl with 200 classes http://dbpedia.org/resource/Category:Awards (length 1, depth 1) @@ -72,11 +73,11 @@ sparql.predefinedEndpoint = 1; // use DBpedia endpoint -import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL2); +import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL"); // the set of objects as starting point for fragment selection // (should be identical to the set of examples) -sparql2.instances = { +sparql.instances = { "http://dbpedia.org/resource/Angela_Merkel", "http://dbpedia.org/resource/Helmut_Kohl" }; Modified: trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary.conf =================================================================== --- trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,4 +1,5 @@ /** +Note: DBpedia is always subject to change, solutions will change over time * Solutions: http://dbpedia.org/class/yago/Communicator109610660 (length 1, depth 1) @@ -24,7 +25,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; Modified: trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary_ignoredConcepts.conf =================================================================== --- trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary_ignoredConcepts.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/difference/DifferenceDBPediaYAGO_angela_vs_hillary_ignoredConcepts.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,4 +1,5 @@ /** +Note: DBpedia is always subject to change, solutions will change over time * Solutions: http://dbpedia.org/class/yago/Communicator109610660 (length 1, depth 1) @@ -40,7 +41,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; Modified: trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela.conf =================================================================== --- trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,4 +1,5 @@ /** +Note: DBpedia is always subject to change, solutions will change over time * Solutions: http://dbpedia.org/class/yago/Achiever109762821 (length 1, depth 1) @@ -13,7 +14,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; Modified: trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela_ignoredConcepts.conf =================================================================== --- trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela_ignoredConcepts.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/difference/DifferenceDBPediaYAGO_hillary_vs_angela_ignoredConcepts.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,4 +1,5 @@ /** +Note: DBpedia is always subject to change, solutions will change over time * Solutions: http://dbpedia.org/class/yago/Achiever109762821 (length 1, depth 1) @@ -52,7 +53,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; Modified: trunk/examples/sparql/hierarchy/Hierarchy0DBPediaYAGOChanBrit_monarch.conf =================================================================== --- trunk/examples/sparql/hierarchy/Hierarchy0DBPediaYAGOChanBrit_monarch.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/hierarchy/Hierarchy0DBPediaYAGOChanBrit_monarch.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,4 +1,5 @@ /* + Note: DBpedia is always subject to change, solutions will change over time solutions: EXISTS http://dbpedia.org/property/monarch.TOP (length 3, depth 2) @@ -19,9 +20,7 @@ // SPARQL options -import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL2"); - refinement.useAllConstructor = false; //refinement.useExistsConstructor = true; refinement.useNegation = false; @@ -32,7 +31,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; Modified: trunk/examples/sparql/hierarchy/Hierarchy1DBPediaYAGOChanBrit_pred_Knight.conf =================================================================== --- trunk/examples/sparql/hierarchy/Hierarchy1DBPediaYAGOChanBrit_pred_Knight.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/hierarchy/Hierarchy1DBPediaYAGOChanBrit_pred_Knight.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,4 +1,5 @@ /* +Note: DBpedia is always subject to change, solutions will change over time @@ -7,8 +8,6 @@ // SPARQL options -import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL2"); - refinement.heuristic = flexible; refinement.useAllConstructor = false; @@ -23,7 +22,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; import("http://dbpedia.openlinksw.com:8890/sparql","SPARQL"); Modified: trunk/examples/sparql/navigation/Navigation0DBPediaYAGOAristotle.conf =================================================================== --- trunk/examples/sparql/navigation/Navigation0DBPediaYAGOAristotle.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/navigation/Navigation0DBPediaYAGOAristotle.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,6 +1,7 @@ /** * Some people from Greece. - * + * Note: DBpedia is always subject to change, solutions will change over time + solutions: http://dbpedia.org/class/yago/Mathematician110301261 (length 1, depth 1) horizontal expansion: 0 to 1 @@ -25,7 +26,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; Modified: trunk/examples/sparql/navigation/Navigation1DBPediaYAGOAristotle.conf =================================================================== --- trunk/examples/sparql/navigation/Navigation1DBPediaYAGOAristotle.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/navigation/Navigation1DBPediaYAGOAristotle.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,6 +1,7 @@ /** * Some people from Greece. - * + * Note: DBpedia is always subject to change, solutions will change over time + solutions: (http://dbpedia.org/class/yago/Theorist110706812 OR (http://dbpedia.org/class/yago/Mathematician110301261 AND http://dbpedia.org/class/yago/Physicist110428004)) (length 5, depth 3) horizontal expansion: 3 to 5 @@ -24,7 +25,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; Modified: trunk/examples/sparql/navigation/Navigation2DBPediaYAGOAristotle.conf =================================================================== --- trunk/examples/sparql/navigation/Navigation2DBPediaYAGOAristotle.conf 2008-02-18 10:32:27 UTC (rev 597) +++ trunk/examples/sparql/navigation/Navigation2DBPediaYAGOAristotle.conf 2008-02-18 12:32:36 UTC (rev 598) @@ -1,6 +1,7 @@ /** * Some people from Greece. - * + * Note: DBpedia is always subject to change, solutions will change over time + * Possible Solution: * (http://dbpedia.org/class/yago/Theorist110706812 OR (http://dbpedia.org/class/yago/Mathematician110301261 AND http://dbpedia.org/class/yago/Physicist110428004)) * @@ -13,7 +14,7 @@ //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = 5; +sparql.predefinedFilter = 1; sparql.predefinedEndpoint = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-18 10:32:31
|
Revision: 597 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=597&view=rev Author: jenslehmann Date: 2008-02-18 02:32:27 -0800 (Mon, 18 Feb 2008) Log Message: ----------- added getStartNode method such that the root of the search tree can be obtained Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-17 23:38:43 UTC (rev 596) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-18 10:32:27 UTC (rev 597) @@ -119,6 +119,11 @@ // detect whether a new best node has been found since the last time // statistics were printed) private Node previousBestNode; + + // record start node such that other applications can + // get information about the search tree + private Node startNode; + // boolean createTreeString = false; // String searchTree = new String(); TreeSet<Node> expandedNodes = new TreeSet<Node>(nodeComparatorStable); @@ -348,6 +353,7 @@ // der Länge 1 untersucht wurden candidates.add(topNode); candidatesStable.add(topNode); + startNode = topNode; // Abbruchvariable => beachten, dass bereits TOP eine Lösung sein kann solutionFound = (coveredNegativeExamples == 0); solutions = new LinkedList<Description>(); @@ -987,4 +993,11 @@ stop = true; } + /** + * @return the startNode + */ + public Node getStartNode() { + return startNode; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-02-17 23:38:50
|
Revision: 596 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=596&view=rev Author: kurzum Date: 2008-02-17 15:38:43 -0800 (Sun, 17 Feb 2008) Log Message: ----------- fixed bug #1878069 Modified Paths: -------------- trunk/examples/commandcollection.txt trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java Modified: trunk/examples/commandcollection.txt =================================================================== --- trunk/examples/commandcollection.txt 2008-02-17 18:28:38 UTC (rev 595) +++ trunk/examples/commandcollection.txt 2008-02-17 23:38:43 UTC (rev 596) @@ -19,6 +19,7 @@ // algorithm settings algorithm = refinement; +algorithm = refexamples refinement.horizontalExpansionFactor = 0.6; refinement.quiet = false; refinement.useTooWeakList = true; Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java 2008-02-17 18:28:38 UTC (rev 595) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlQuery.java 2008-02-17 23:38:43 UTC (rev 596) @@ -32,6 +32,7 @@ import com.hp.hpl.jena.query.ResultSetFactory; import com.hp.hpl.jena.query.ResultSetFormatter; import com.hp.hpl.jena.sparql.core.ResultBinding; +import com.hp.hpl.jena.sparql.engine.http.HttpQuery; import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; /** @@ -82,6 +83,7 @@ } logger.info("query SPARQL server"); try{ + HttpQuery.urlLimit = 3*1024 ; rs = queryExecution.execSelect(); logger.info(rs.getResultVars().toString()); } catch (Exception e){ Modified: trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java 2008-02-17 18:28:38 UTC (rev 595) +++ trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java 2008-02-17 23:38:43 UTC (rev 596) @@ -2,6 +2,7 @@ import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.query.ResultSetFormatter; +import com.hp.hpl.jena.sparql.engine.http.HttpQuery; import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; @@ -63,6 +64,7 @@ ResultSet rs; String xml; QueryEngineHTTP queryExecution; + HttpQuery.urlLimit = 3*1024 ; queryExecution = new QueryEngineHTTP(url, shortQuery); queryExecution.addDefaultGraph(defaultgraph); rs = queryExecution.execSelect(); @@ -72,14 +74,17 @@ try{ queryExecution=new QueryEngineHTTP(url,longQuery); queryExecution.addDefaultGraph(defaultgraph); + + //queryExecution.getContext(). rs = queryExecution.execSelect(); xml = ResultSetFormatter.asXMLString(rs); System.out.println("Long Query ResultSet length: "+xml.length()+"\n"); System.out.println("Long query XML: "+xml); }catch (Exception e) {e.printStackTrace();} + // String queryWithIncreasingLength=""; - for (int i = 0; i < 30; i++) { + for (int i = 0; i < 100; i++) { queryWithIncreasingLength = makeQueryString ( i); queryExecution=new QueryEngineHTTP(url,queryWithIncreasingLength); queryExecution.addDefaultGraph(defaultgraph); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 18:28:52
|
Revision: 595 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=595&view=rev Author: jenslehmann Date: 2008-02-17 10:28:38 -0800 (Sun, 17 Feb 2008) Log Message: ----------- fixed bug in build script Modified Paths: -------------- trunk/bin/dllearner trunk/build.xml trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java Modified: trunk/bin/dllearner =================================================================== --- trunk/bin/dllearner 2008-02-17 18:14:40 UTC (rev 594) +++ trunk/bin/dllearner 2008-02-17 18:28:38 UTC (rev 595) @@ -1 +1 @@ -java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCT++OWLAPI-v1.1.10+.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.1.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/json.jar:./lib/jena/xercesImpl.jar:./lib/junit-4.4.jar:./lib/log4j.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.start $@ \ No newline at end of file +java -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCT++OWLAPI-v1.1.10+.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.1.jar:./lib/jena/concurrent.jar:./lib/jena/icu4j_3_4.jar:./lib/jena/iri.jar:./lib/jena/jena.jar:./lib/jena/json.jar:./lib/jena/xercesImpl.jar:./lib/junit-4.4.jar:./lib/log4j.jar:./lib/owlapi/antlr-runtime-3.0.jar:./lib/owlapi/commons-lang-2.2.jar:./lib/owlapi/owlapi-api.jar:./lib/owlapi/owlapi-apibinding.jar:./lib/owlapi/owlapi-change.jar:./lib/owlapi/owlapi-debugging.jar:./lib/owlapi/owlapi-dig1_1.jar:./lib/owlapi/owlapi-functionalparser.jar:./lib/owlapi/owlapi-functionalrenderer.jar:./lib/owlapi/owlapi-impl.jar:./lib/owlapi/owlapi-krssparser.jar:./lib/owlapi/owlapi-mansyntaxparser.jar:./lib/owlapi/owlapi-mansyntaxrenderer.jar:./lib/owlapi/owlapi-metrics.jar:./lib/owlapi/owlapi-oboparser.jar:./lib/owlapi/owlapi-owlxmlparser.jar:./lib/owlapi/owlapi-owlxmlrenderer.jar:./lib/owlapi/owlapi-rdfapi.jar:./lib/owlapi/owlapi-rdfxmlparser.jar:./lib/owlapi/owlapi-rdfxmlrenderer.jar:./lib/owlapi/owlapi-util.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.Start $@ \ No newline at end of file Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2008-02-17 18:14:40 UTC (rev 594) +++ trunk/build.xml 2008-02-17 18:28:38 UTC (rev 595) @@ -181,7 +181,7 @@ <echo file="bin/dllearner.bat" message="java -cp ${pathStringWin} org.dllearner.cli.Start %*"/> <echo file="bin/ws.bat" message="java -cp ${pathStringWin} org.dllearner.server.DLLearnerWSStart %*"/> <echo file="bin/quickstart" message="java -cp ${pathStringUnix} org.dllearner.cli.QuickStart"/> - <echo file="bin/dllearner" message="java -cp ${pathStringUnix} org.dllearner.cli.start $@"/> + <echo file="bin/dllearner" message="java -cp ${pathStringUnix} org.dllearner.cli.Start $@"/> <echo file="bin/ws" message="java -cp ${pathStringUnix} org.dllearner.server.DLLearnerWSStart $@"/> </target> Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java 2008-02-17 18:14:40 UTC (rev 594) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWSStart.java 2008-02-17 18:28:38 UTC (rev 595) @@ -66,7 +66,7 @@ server.setExecutor(threads); server.start(); - System.out.println("Starting DL-Learner web service at http://" + isa.getHostName() + ":" + System.out.print("Starting DL-Learner web service at http://" + isa.getHostName() + ":" + isa.getPort() + "/services ... "); Endpoint endpoint = Endpoint.create(new DLLearnerWS()); // Endpoint endpoint = Endpoint.create(new CustomDataClass()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 18:14:55
|
Revision: 594 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=594&view=rev Author: jenslehmann Date: 2008-02-17 10:14:40 -0800 (Sun, 17 Feb 2008) Log Message: ----------- added beans for new exceptions in web service Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/server/jaxws/SparqlQueryExceptionBean.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/server/jaxws/ComponentInitExceptionBean.java trunk/src/dl-learner/org/dllearner/server/jaxws/LearningProblemUnsupportedExceptionBean.java Added: trunk/src/dl-learner/org/dllearner/server/jaxws/ComponentInitExceptionBean.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/jaxws/ComponentInitExceptionBean.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/jaxws/ComponentInitExceptionBean.java 2008-02-17 18:14:40 UTC (rev 594) @@ -0,0 +1,41 @@ + +package org.dllearner.server.jaxws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_02-b08-fcs + * Generated source version: 2.0_02 + * + */ +@XmlRootElement(name = "ComponentInitException", namespace = "http://server.dllearner.org/") +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ComponentInitException", namespace = "http://server.dllearner.org/") +public class ComponentInitExceptionBean { + + private String message; + + /** + * + * @return + * returns String + */ + public String getMessage() { + return this.message; + } + + /** + * + * @param message + * the value for the message property + */ + public void setMessage(String message) { + this.message = message; + } + +} Added: trunk/src/dl-learner/org/dllearner/server/jaxws/LearningProblemUnsupportedExceptionBean.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/jaxws/LearningProblemUnsupportedExceptionBean.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/server/jaxws/LearningProblemUnsupportedExceptionBean.java 2008-02-17 18:14:40 UTC (rev 594) @@ -0,0 +1,41 @@ + +package org.dllearner.server.jaxws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_02-b08-fcs + * Generated source version: 2.0_02 + * + */ +@XmlRootElement(name = "LearningProblemUnsupportedException", namespace = "http://server.dllearner.org/") +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "LearningProblemUnsupportedException", namespace = "http://server.dllearner.org/") +public class LearningProblemUnsupportedExceptionBean { + + private String message; + + /** + * + * @return + * returns String + */ + public String getMessage() { + return this.message; + } + + /** + * + * @param message + * the value for the message property + */ + public void setMessage(String message) { + this.message = message; + } + +} Modified: trunk/src/dl-learner/org/dllearner/server/jaxws/SparqlQueryExceptionBean.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/jaxws/SparqlQueryExceptionBean.java 2008-02-17 18:09:32 UTC (rev 593) +++ trunk/src/dl-learner/org/dllearner/server/jaxws/SparqlQueryExceptionBean.java 2008-02-17 18:14:40 UTC (rev 594) @@ -1,38 +1,41 @@ -package org.dllearner.server.jaxws; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - * This class was generated by the JAXWS SI. - * JAX-WS RI 2.0_02-b08-fcs - * Generated source version: 2.0_02 - * - */ -@XmlRootElement(name = "SparqlQueryException", namespace = "http://server.dllearner.org/") -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "SparqlQueryException", namespace = "http://server.dllearner.org/") -public class SparqlQueryExceptionBean { - - private String message; - - /** - * - * @return - * returns String - */ - public String getMessage() { - return this.message; - } - - /** - * - * @param message - * the value for the message property - */ - public void setMessage(String message) { - this.message = message; - } -} + +package org.dllearner.server.jaxws; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +/** + * This class was generated by the JAXWS SI. + * JAX-WS RI 2.0_02-b08-fcs + * Generated source version: 2.0_02 + * + */ +@XmlRootElement(name = "SparqlQueryException", namespace = "http://server.dllearner.org/") +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SparqlQueryException", namespace = "http://server.dllearner.org/") +public class SparqlQueryExceptionBean { + + private String message; + + /** + * + * @return + * returns String + */ + public String getMessage() { + return this.message; + } + + /** + * + * @param message + * the value for the message property + */ + public void setMessage(String message) { + this.message = message; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 18:09:40
|
Revision: 593 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=593&view=rev Author: jenslehmann Date: 2008-02-17 10:09:32 -0800 (Sun, 17 Feb 2008) Log Message: ----------- minor output changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/cli/Start.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-17 17:30:58 UTC (rev 592) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-17 18:09:32 UTC (rev 593) @@ -115,6 +115,10 @@ // Variablen zur Einstellung der Protokollierung // boolean quiet = false; boolean showBenchmarkInformation = false; + // the previous best node (used only for logging, such that we can + // detect whether a new best node has been found since the last time + // statistics were printed) + private Node previousBestNode; // boolean createTreeString = false; // String searchTree = new String(); TreeSet<Node> expandedNodes = new TreeSet<Node>(nodeComparatorStable); @@ -865,10 +869,20 @@ long algorithmRuntime = System.nanoTime() - algorithmStartTime; if(!finalStats) { + Node bestNode = candidatesStable.last(); + boolean newBestNodeFound = false; + if(!bestNode.equals(previousBestNode)) { + newBestNodeFound = true; + previousBestNode = bestNode; + } + if(newBestNodeFound) + logger.info("currently best node: " + bestNode); + // Refinementoperator auf Konzept anwenden String bestNodeString = "currently best node: " + candidatesStable.last(); // searchTree += bestNodeString + "\n"; - logger.info(bestNodeString); + if(!newBestNodeFound) + logger.debug(bestNodeString); String expandedNodeString = "next expanded node: " + candidates.last(); // searchTree += expandedNodeString + "\n"; logger.debug(expandedNodeString); Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 17:30:58 UTC (rev 592) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 18:09:32 UTC (rev 593) @@ -231,27 +231,8 @@ // perform file exports performExports(parser, baseDir, sources, rs); - // show examples (display each one if they do not take up much space, - // otherwise just show the number of examples) - boolean oneLineExampleInfo = true; - int maxExampleStringLength = Math.max(posExamples.toString().length(), negExamples - .toString().length()); - if (maxExampleStringLength > 100) - oneLineExampleInfo = false; - if (oneLineExampleInfo) { - System.out.println("positive examples[" + posExamples.size() + "]: " + posExamples); - System.out.println("negative examples[" + negExamples.size() + "]: " + negExamples); - } else { - System.out.println("positive examples[" + posExamples.size() + "]: "); - for (String ex : posExamples) - System.out.println(" " + ex); - System.out.println("negative examples[" + negExamples.size() + "]: "); - for (String ex : negExamples) - System.out.println(" " + ex); - } - // handle any CLI options - processCLIOptions(cm, parser, rs); + processCLIOptions(cm, parser, rs, lp); } public void start(boolean inQueryMode) { @@ -479,7 +460,7 @@ } private static void processCLIOptions(ComponentManager cm, ConfParser parser, - ReasoningService rs) { + ReasoningService rs, LearningProblem lp) { // CLI options (i.e. options which are related to the CLI // user interface but not to one of the components) List<ConfFileOption> cliOptions = parser.getConfOptionsByPrefix("cli"); @@ -487,7 +468,28 @@ int maxLineLength = 100; for (ConfFileOption cliOption : cliOptions) { String name = cliOption.getSubOption(); - if (name.equals("showIndividuals")) { + if (name.equals("showExamples")) { + // show examples (display each one if they do not take up much space, + // otherwise just show the number of examples) + SortedSet<String> posExamples = parser.getPositiveExamples(); + SortedSet<String> negExamples = parser.getNegativeExamples(); + boolean oneLineExampleInfo = true; + int maxExampleStringLength = Math.max(posExamples.toString().length(), negExamples + .toString().length()); + if (maxExampleStringLength > 100) + oneLineExampleInfo = false; + if (oneLineExampleInfo) { + System.out.println("positive examples[" + posExamples.size() + "]: " + posExamples); + System.out.println("negative examples[" + negExamples.size() + "]: " + negExamples); + } else { + System.out.println("positive examples[" + posExamples.size() + "]: "); + for (String ex : posExamples) + System.out.println(" " + ex); + System.out.println("negative examples[" + negExamples.size() + "]: "); + for (String ex : negExamples) + System.out.println(" " + ex); + } + } else if (name.equals("showIndividuals")) { if (cliOption.getStringValue().equals("true")) { int stringLength = rs.getIndividuals().toString().length(); if (stringLength > maxLineLength) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 17:31:00
|
Revision: 592 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=592&view=rev Author: jenslehmann Date: 2008-02-17 09:30:58 -0800 (Sun, 17 Feb 2008) Log Message: ----------- fixed @.todo tag problem in build script Modified Paths: -------------- trunk/build.xml trunk/src/dl-learner/org/dllearner/utilities/ToDoTaglet.java Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2008-02-17 15:55:11 UTC (rev 591) +++ trunk/build.xml 2008-02-17 17:30:58 UTC (rev 592) @@ -13,17 +13,11 @@ <property name="release_tmp_dir" value="release/${version_dir}" /> <property name="release_php_client_tmp_dir" value="release/php-client-${today}" /> - <!-- KAON2 must not be distributed with the official release --> - <property name="kaon2" value="${lib_dir}/kaon2.jar"/> - <!-- set up classpath --> <path id="classpath"> <pathelement location="."/> <fileset dir="${lib_dir}"> <include name="**/*.jar"/> - <include name="**/modules/*.jar"/> - <include name="**/jena/*.jar"/> - <include name="**/owlapi/*.jar"/> </fileset> </path> @@ -55,8 +49,7 @@ <!-- copy all other libraries --> <copy toDir="${release_tmp_dir}/lib"> - <!-- KAON2 has to be excluded, because it cannot be freely distributed --> - <fileset dir="${lib_dir}" excludes="${kaon2}" /> + <fileset dir="${lib_dir}" /> </copy> <!-- copy binary files and examples --> @@ -197,7 +190,7 @@ <pathconvert refid="classpath" property="jdocclasspath"/> <javadoc access="public" author="true" - classpath="${jdocclasspath}" + classpath="${jdocclasspath};${java.home}/../lib/tools.jar" destdir="doc/javadoc" doctitle="DL-Learner Javadoc" nodeprecated="false" Modified: trunk/src/dl-learner/org/dllearner/utilities/ToDoTaglet.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/ToDoTaglet.java 2008-02-17 15:55:11 UTC (rev 591) +++ trunk/src/dl-learner/org/dllearner/utilities/ToDoTaglet.java 2008-02-17 17:30:58 UTC (rev 592) @@ -6,16 +6,20 @@ import com.sun.tools.doclets.Taglet; /** - * Small taglet for showing todo-markers in Javadoc-runs. + * Small taglet for showing todo-markers in Javadoc-runs. You can insert + * the following in comments: * - * Parts of the code are taken from the JDK Javadoc. + * @.todo task + * + * (Note the dot, which avoids conflicts with a possible future @todo + * standard tag.) Parts of the code are taken from the JDK Javadoc. * * @author Jens Lehmann * */ public class ToDoTaglet implements Taglet { - private static final String NAME = "todo"; + private static final String NAME = ".todo"; private static final String HEADER = "To Do:"; /** @@ -26,9 +30,9 @@ } /** - * Will return true since <code>@todo</code> + * Will return true since <code>@.todo</code> * can be used in field documentation. - * @return true since <code>@todo</code> + * @return true since <code>@.todo</code> * can be used in field documentation and false * otherwise. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ton...@us...> - 2008-02-17 15:55:17
|
Revision: 591 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=591&view=rev Author: tonytacker Date: 2008-02-17 07:55:11 -0800 (Sun, 17 Feb 2008) Log Message: ----------- try-catch for init Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java Modified: trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-17 13:08:46 UTC (rev 590) +++ trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-17 15:55:11 UTC (rev 591) @@ -59,7 +59,7 @@ this.startGUI = startGUI; sources = config.getComponentManager().getKnowledgeSources(); - setButton = new JButton ("Set"); + setButton = new JButton("Set"); setButton.addActionListener(this); initButton = new JButton("Init KnowledgeSource"); initButton.addActionListener(this); @@ -99,7 +99,7 @@ if (e.getSource() == setButton) setSource(); - + if (e.getSource() == initButton) init(); } @@ -119,14 +119,13 @@ public void init() { if (config.getKnowledgeSource() != null && config.getURI() != null) { try { - config.getKnowledgeSource().init(); - } catch (ComponentInitException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - config.setInitKnowledgeSource(true); - System.out.println("init KnowledgeSource"); - startGUI.updateTabColors(); + config.getKnowledgeSource().init(); + config.setInitKnowledgeSource(true); + System.out.println("init KnowledgeSource"); + startGUI.updateTabColors(); + } catch (ComponentInitException e) { + e.printStackTrace(); + } } } @@ -137,7 +136,7 @@ optionPanel.update(config.getKnowledgeSource(), config .getOldKnowledgeSource(), sources.get(choosenClassIndex)); } - + /** * make init-button red if you have to click */ Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-17 13:08:46 UTC (rev 590) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-17 15:55:11 UTC (rev 591) @@ -110,15 +110,14 @@ if (config.getLearningProblem() != null && config.getReasoningService() != null) { try { - config.setLearningAlgorithm(config.getComponentManager() - .learningAlgorithm(learners.get(choosenClassIndex), - config.getLearningProblem(), - config.getReasoningService())); - } catch (LearningProblemUnsupportedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - updateOptionPanel(); + config.setLearningAlgorithm(config.getComponentManager() + .learningAlgorithm(learners.get(choosenClassIndex), + config.getLearningProblem(), + config.getReasoningService())); + updateOptionPanel(); + } catch (LearningProblemUnsupportedException e) { + e.printStackTrace(); + } } } @@ -129,11 +128,11 @@ setLearningAlgorithm(); if (config.getLearningProblem() != null) { try { - config.getLearningAlgorithm().init(); - } catch (ComponentInitException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + config.getLearningAlgorithm().init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } config.setInitLearningAlgorithm(true); System.out.println("init LearningAlgorithm"); startGUI.updateTabColors(); Modified: trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-02-17 13:08:46 UTC (rev 590) +++ trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-02-17 15:55:11 UTC (rev 591) @@ -124,14 +124,13 @@ setLearningProblem(); if (config.getReasoner() != null && config.getLearningProblem() != null) { try { - config.getLearningProblem().init(); - } catch (ComponentInitException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - config.setInitLearningProblem(true); - System.out.println("init LearningProblem"); - startGUI.updateTabColors(); + config.getLearningProblem().init(); + config.setInitLearningProblem(true); + System.out.println("init LearningProblem"); + startGUI.updateTabColors(); + } catch (ComponentInitException e) { + e.printStackTrace(); + } } } Modified: trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-02-17 13:08:46 UTC (rev 590) +++ trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-02-17 15:55:11 UTC (rev 591) @@ -129,18 +129,18 @@ setReasoner(); if (config.getKnowledgeSource() != null && config.getReasoner() != null) { try { - config.getReasoner().init(); - } catch (ComponentInitException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - System.out.println("init Reasoner"); - // set ReasoningService - config.setReasoningService(config.getComponentManager() - .reasoningService(config.getReasoner())); - System.out.println("init ReasoningService"); - config.setInitReasoner(true); - startGUI.updateTabColors(); + config.getReasoner().init(); + System.out.println("init Reasoner"); + // set ReasoningService + config.setReasoningService(config.getComponentManager() + .reasoningService(config.getReasoner())); + System.out.println("init ReasoningService"); + config.setInitReasoner(true); + startGUI.updateTabColors(); + } catch (ComponentInitException e) { + e.printStackTrace(); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 13:09:05
|
Revision: 590 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=590&view=rev Author: jenslehmann Date: 2008-02-17 05:08:46 -0800 (Sun, 17 Feb 2008) Log Message: ----------- - added toManchester string for all descriptions - fixed toString method for named elements Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/gp/ADC.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeSomeRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/Description.java trunk/src/dl-learner/org/dllearner/core/owl/Individual.java trunk/src/dl-learner/org/dllearner/core/owl/Intersection.java trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java trunk/src/dl-learner/org/dllearner/core/owl/Negation.java trunk/src/dl-learner/org/dllearner/core/owl/Nothing.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectAllRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectSomeRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java trunk/src/dl-learner/org/dllearner/core/owl/Thing.java trunk/src/dl-learner/org/dllearner/core/owl/Union.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/ADC.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/ADC.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/ADC.java 2008-02-17 13:08:46 UTC (rev 590) @@ -27,7 +27,16 @@ return "ADC"; } + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString() + */ @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + // TODO Auto-generated method stub + return null; + } + + @Override public int getArity() { return 0; } @@ -44,4 +53,6 @@ visitor.visit(this); } + + } Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeExactCardinalityRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -52,12 +52,23 @@ return null; } + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString() + */ @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + // TODO Auto-generated method stub + return null; + } + + @Override public void accept(DescriptionVisitor visitor) { visitor.visit(this); } public void accept(KBElementVisitor visitor) { visitor.visit(this); - } + } + + } Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMaxCardinalityRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -60,4 +60,13 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString() + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + // TODO Auto-generated method stub + return null; + } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeMinCardinalityRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -62,5 +62,14 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString() + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + // TODO Auto-generated method stub + return null; } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeProperty.java 2008-02-17 13:08:46 UTC (rev 590) @@ -50,7 +50,7 @@ * @see org.dllearner.core.dl.KBElement#toString(java.lang.String, java.util.Map) */ public String toString(String baseURI, Map<String, String> prefixes) { - return Helper.getAbbreviatedString(name, baseURI, prefixes); + return "\"" + Helper.getAbbreviatedString(name, baseURI, prefixes) + "\""; } public void accept(KBElementVisitor visitor) { Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeSomeRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeSomeRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeSomeRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -69,5 +69,14 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString() + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + // TODO Auto-generated method stub + return null; } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/DatatypeValueRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -19,6 +19,8 @@ */ package org.dllearner.core.owl; +import java.util.Map; + /** * @author Jens Lehmann * @@ -35,5 +37,14 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString() + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + // TODO Auto-generated method stub + return null; } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/Description.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Description.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/Description.java 2008-02-17 13:08:46 UTC (rev 590) @@ -1,3 +1,22 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ package org.dllearner.core.owl; import java.util.LinkedList; @@ -2,8 +21,8 @@ import java.util.List; +import java.util.Map; /** - * TODO: alless was fast retrieval algorithm angeht, sollte - * ausgegliedert werden! + * A class description is sometimes also called "complex class" or "concept". * - * @author jl + * @author Jens Lehmann * @@ -14,74 +33,13 @@ protected Description parent = null; protected List<Description> children = new LinkedList<Description>(); - //protected SortedSet<String> posSet = new TreeSet<String>(); - //protected SortedSet<String> negSet = new TreeSet<String>(); - - /* - public Node(List<Node> children) { - this.children = children; - for(Node n : children) - n.setParent(this); - } - */ - - // TODO: die Methode noch hinzuf�gen + public abstract int getArity(); /** - * Berechnet die + und - Menge. Wenn die Mengen berechnet sind, dann können - * sie über die get-Methoden abgefragt werden. Der Algorithmus ist relativ - * einfach zu implementieren, aber ein großer Teil des Codes wird zum - * vermeiden von Nullpointern (bei unvollständigen Daten) eingesetzt. + * Calculate the number of nodes for this description tree (each + * description can be seen as a tree). * - * Die �bergebenen Mengen - */ - // protected abstract void calculatePosSet(FlatABox abox); - // protected abstract void calculateSets(FlatABox abox, SortedSet<String> adcPosSet, SortedSet<String> adcNegSet); - /* - // Score ohne ADF berechnen - public Score computeScore() { - return computeScore(null,null); - } - */ - - // Score mit ADF berechnen - - //public Score computeScore(SortedSet<String> adcPosSet, SortedSet<String> adcNegSet) { - /* - Set<String> posExamples = null; - Set<String> negExamples = null; - - FlatABox abox = FlatABox.getInstance(); - - // es wird angenommen, dass nur ein Konzept gelernt wird - for(String s : abox.exampleConceptsPos.keySet()) { - posExamples = abox.exampleConceptsPos.get(s); - } - for(String s : abox.exampleConceptsNeg.keySet()) { - negExamples = abox.exampleConceptsNeg.get(s); - } - - // Algorithmus anwenden - calculateSets(abox); - //Set<String> posSet = program.getPosSet(); - //Set<String> negSet = program.getNegSet(); - - // Punktzahl sind die abgedeckten positiven Beispiele + - // die nicht abgedeckten negativen Beispiele - int points = Helper.intersection(posSet,posExamples).size() - + Helper.intersection(negSet,negExamples).size(); - - // besser: Abzüge wenn pos. Beispiel negativ wird bzw. umgekehrt - - return points; - */ - // calculateSets(FlatABox.getInstance(),posSet,negSet); - // return new Score(posSet,negSet); - //} - - /** - * Calculate the number of nodes for this tree. * @return The number of nodes. */ public int getNumberOfNodes() { @@ -90,26 +48,13 @@ sum += child.getNumberOfNodes(); return sum; } - - // protected abstract int getLength(); /** - * Calculate the number of nodes for this tree. - * @return The number of nodes. - */ - /* - public int getConceptLength() { - int length = getLength(); - for (Concept child : children) - length += child.getConceptLength(); - return length; - }*/ - - /** * Selects a sub tree. * @param i A position in the tree. Positions are iteratively given to nodes * by leftmost depth-first search. This allows efficient selection of subtrees. - * (Implementation does not work if any node has more than two children.) + * (TODO: Implementation does not work if any node has more than two children + * like conjunction and disjunction.) * @return The selected subtree. */ public Description getSubtree(int i) { @@ -137,8 +82,8 @@ } /** - * Calculates the tree depth. - * @return The depth of this tree. + * Calculates the description tree depth. + * @return The depth of this description. */ public int getDepth() { // compute the max over all children @@ -154,8 +99,7 @@ } /** - * Returns a clone of this programm tree. Die positiven und negativen Sets - * werden dabei nicht mitgeklont, sondern nur parent und children. + * Returns a clone of this description. */ @SuppressWarnings("unchecked") @Override @@ -164,64 +108,27 @@ try { node = (Description) super.clone(); } catch (CloneNotSupportedException e) { - // this should never happen + // should never happen throw new InternalError(e.toString()); } - // parent kann man ev. auf null setzen bzw. testen, ob er null ist und - // in diesem Fall auf null setzen - // node.parent = (Node) parent.clone(); - // node.parent = null; - // eventuell sollte man jedes einzelne Kind durchgehen und klonen, da die clone() - // Methode von LinkedList nur eine "shallow copy" erzeugt - // node.children = (List<Node>) ((LinkedList)children).clone(); - // List<Node> childList = new LinkedList<Node>(); - - // Die Kopie des Knotens wird folgenderma�en angelegt: Zuerst wird mit - // super.clone() ein Klon des Knotens erstellt. Dabei handelt es sich um - // eine flache Kopie, d.h. bei nichtprimitiven Objekten wird einfach auf - // das gleiche Objekt gezeigt. Bei der Liste von Kindern ist das nicht - // erw�nscht. Es ist auch nicht m�glich nur clone() auf der Kinderliste - // selbst aufzurufen, weil dabei nur die Liste und nich die Elemente der Liste - // geklont werden. Aus dem Grund wird eine komplett neue Kinderliste erzeugt - // und dort die Knoten eingef�gt, die zuvor geklont werden. Durch aufrufen von - // addChild wird auch sichergestellt, dass der parent-Link auf den geklonten - // Knoten zeigt. + + // Create a deep copy, i.e. we iterate over all children and clone them. + // The addChild operation is used to ensure that the parent links are + // correct, i.e. all parent links point to the new clones instead of the + // old descriptions. node.children = new LinkedList<Description>(); for(Description child : children) { Description clonedChild = (Description) child.clone(); node.addChild(clonedChild); } - // Beim durchlaufen des Algorithmus werden posSet und negSet ge�ndert. Es ist - // nicht erw�nscht, dass sich diese Mengen, dann auch in anderen B�umen - // �ndern, da diese mittlerweile durch Crossover, Mutation etc. ge�ndert - // worden sein k�nnten. Momentan ist das nicht von Bedeutung (man k�nnte also - // die beiden folgenden Zeilen auch weglassen), da immer nur eine baumweise - // Abarbeitung des Algorithmus erfolgt und diese Mengen nicht wiederverwendet - // werden. - //node.posSet = new TreeSet<String>(); - //node.negSet = new TreeSet<String>(); return node; } - /* - protected Set<String> getPosSet() { - return posSet; - } - - protected Set<String> getNegSet() { - return negSet; - } - */ - - /* - public Concept getChildren(int index) { - return children.get(index); - } - */ - /** - * Adds child and sets this node as parent. + * Adds a description as child of this one. The parent link + * of the concept will point to this one. + * * @param child * @return */ @@ -231,7 +138,9 @@ } /** - * Adds child and sets this node as parent. + * Adds a child description at the specified index. + * + * @see #addChild(Description) * @param index * @param child */ @@ -240,15 +149,21 @@ children.add(index, child); } - // relativ neue Methode + /** + * Remove the specified child description (its parent link is set + * to null). + * @param child The child to remove. + */ public void removeChild(Description child) { child.setParent(null); children.remove(child); } /** - * Tests if this node is the root of a tree. - * @return True if this node is the root of a program tree, false otherwise. + * Tests whether this description is at the root, i.e. + * does not have a parent. + * + * @return True if this node is the root of a description, false otherwise. */ public boolean isRoot() { return (parent == null); @@ -275,5 +190,14 @@ return toString(null, null); } + /** + * Returns a manchester syntax string of this description. For a + * reference, see + * <a href="http://www.co-ode.org/resources/reference/manchester_syntax">here</a> + * and <a href="http://owl-workshop.man.ac.uk/acceptedLong/submission_9.pdf">here</a> (PDF). + * @return The manchester syntax string for this description. + */ + public abstract String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes); + public abstract void accept(DescriptionVisitor visitor); } Modified: trunk/src/dl-learner/org/dllearner/core/owl/Individual.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Individual.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/Individual.java 2008-02-17 13:08:46 UTC (rev 590) @@ -60,7 +60,7 @@ } public String toString(String baseURI, Map<String,String> prefixes) { - return Helper.getAbbreviatedString(name, baseURI, prefixes); + return "\"" + Helper.getAbbreviatedString(name, baseURI, prefixes) + "\""; } public void accept(KBElementVisitor visitor) { Modified: trunk/src/dl-learner/org/dllearner/core/owl/Intersection.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Intersection.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/Intersection.java 2008-02-17 13:08:46 UTC (rev 590) @@ -46,6 +46,23 @@ return ret; } + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString() + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + if(children.size()==0) + return "EMPTY_AND"; + + String ret = "("; + for(int i=0; i<children.size()-1; i++) { + ret += children.get(i).toManchesterSyntaxString(baseURI, prefixes) + " and "; + } + ret += children.get(children.size()-1).toManchesterSyntaxString(baseURI, prefixes) + ")"; + return ret; + } + + @Deprecated public String toStringOld() { String ret = "MULTI_AND ["; for(Description child : children) { @@ -65,5 +82,7 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); - } + } + + } Modified: trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java 2008-02-17 13:08:46 UTC (rev 590) @@ -57,7 +57,7 @@ } public String toString(String baseURI, Map<String,String> prefixes) { - return Helper.getAbbreviatedString(name, baseURI, prefixes); + return "\"" + Helper.getAbbreviatedString(name, baseURI, prefixes) + "\""; } /* (non-Javadoc) @@ -70,5 +70,13 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString(java.lang.String, java.util.Map) + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return Helper.getAbbreviatedString(name, baseURI, prefixes); } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/Negation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Negation.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/Negation.java 2008-02-17 13:08:46 UTC (rev 590) @@ -41,5 +41,13 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString(java.lang.String, java.util.Map) + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return "(not " +children.get(0).toString(baseURI, prefixes) + ")"; } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/Nothing.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Nothing.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/Nothing.java 2008-02-17 13:08:46 UTC (rev 590) @@ -18,6 +18,15 @@ return "BOTTOM"; } + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString(java.lang.String, java.util.Map) + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + // TODO: check whether this is correct + return "owl:Nothing"; + } + public int getLength() { return 1; } @@ -37,5 +46,7 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); - } + } + + } Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectAllRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectAllRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectAllRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -1,3 +1,22 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ package org.dllearner.core.owl; import java.util.Map; @@ -2,3 +21,9 @@ - +/** + * All quantified restriction on objects, e.g. \forall hasChild.description + * stands for all objects having only children satisfying description. + * + * @author Jens Lehmann + * + */ public class ObjectAllRestriction extends ObjectQuantorRestriction { @@ -8,93 +33,15 @@ public ObjectAllRestriction(ObjectPropertyExpression role, Description c) { super(role, c); } - - /* - public All(String roleName) { - this.roleName = roleName; - } - - public String getRoleName() { - return roleName; - } - */ - - /* - @Override - protected void calculateSets(FlatABox abox, SortedSet<String> adcPosSet, SortedSet<String> adcNegSet) { - children.get(0).calculateSets(abox, posSet, negSet); - - // Daten zu R+ und R- - Map<String, SortedSet<String>> rplus = abox.rolesPos.get(roleName); - Map<String, SortedSet<String>> rminus = abox.rolesNeg.get(roleName); - // Daten zu C und C+ - Set<String> cPlus = children.get(0).posSet; - Set<String> cMinus = children.get(0).negSet; - - // Fallunterscheidungen einbauen, da R+ und R- leer sein können - // und es nicht für jedes a der Domain ein (a,b) \in R+ bzw. R- geben muss; - // man beachte, dass viele Regeln nur gelten, weil als Domain die Menge aller - // Individuen angenommen wird! - - // R- ist leer - if(rminus==null) { - // falls C die ganze Domain umfasst, dann erüllt jedes Individual - // All R.C, ansonsten keines (es muss nichts gemacht werden) - if(cPlus.equals(abox.domain)) - // keine Kopie notwendig, da Domain unveränderlich - posSet = abox.domain; - } else { - for (String a : abox.domain) { - if(!rminus.containsKey(a)) { - // a erfüllt die Bedingung, falls alle b in C+ sind - if(cPlus.equals(abox.domain)) - posSet.add(a); - } - else if (checkAll(Helper.difference(abox.domain, rminus.get(a)), cPlus)) - posSet.add(a); - } - } - - // falls R+ leer ist, dann ist Bedingung nie erfüllt - if(rplus!=null) { - for (String a : rplus.keySet()) { - // falls R+ Schlüssel nicht enthält, ist Bedingung nicht erfüllt - if (rplus.containsKey(a) && checkExist(rplus.get(a), cMinus)) - negSet.add(a); - } - } - - - - } - - // aus Exists-Klasse übernommen - private static boolean checkExist(Set<String> s1, Set<String> s2) { - for (String b : s1) { - if (s2.contains(b)) - return true; - } - return false; - } - - private static boolean checkAll(Set<String> s1, Set<String> s2) { - for (String b : s1) { - if (!s2.contains(b)) - return false; - } - return true; - } - */ - + public String toString(String baseURI, Map<String,String> prefixes) { return "ALL " + role + "." + children.get(0).toString(baseURI, prefixes); } - - /* - public int getLength() { - return 2; - } - */ + + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return role.toString(baseURI, prefixes) + " some " + children.get(0).toManchesterSyntaxString(baseURI, prefixes); + } /* (non-Javadoc) * @see org.dllearner.core.owl.Description#accept(org.dllearner.core.owl.DescriptionVisitor) @@ -106,5 +53,5 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); - } + } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectExactCardinalityRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -40,6 +40,11 @@ return "= " + number + " " + role.toString(baseURI, prefixes) + " " + getChild(0).toString(baseURI, prefixes); } + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return role.toString(baseURI, prefixes) + " exactly " + number + " " + getChild(0).toManchesterSyntaxString(baseURI, prefixes); + } + /* (non-Javadoc) * @see org.dllearner.core.owl.Description#accept(org.dllearner.core.owl.DescriptionVisitor) */ @@ -50,5 +55,6 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); - } + } + } Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectMaxCardinalityRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -17,6 +17,11 @@ return "<= " + number + " " + role.toString(baseURI, prefixes) + " " + getChild(0).toString(baseURI, prefixes); } + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return role.toString(baseURI, prefixes) + " max " + number + " " + getChild(0).toManchesterSyntaxString(baseURI, prefixes); + } + /* (non-Javadoc) * @see org.dllearner.core.owl.Description#accept(org.dllearner.core.owl.DescriptionVisitor) */ Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectMinCardinalityRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -17,6 +17,11 @@ return ">= " + number + " " + role.toString(baseURI, prefixes) + " " + getChild(0).toString(baseURI, prefixes); } + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return role.toString(baseURI, prefixes) + " min " + number + " " + getChild(0).toManchesterSyntaxString(baseURI, prefixes); + } + /* (non-Javadoc) * @see org.dllearner.core.owl.Description#accept(org.dllearner.core.owl.DescriptionVisitor) */ Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectProperty.java 2008-02-17 13:08:46 UTC (rev 590) @@ -44,11 +44,11 @@ public String toString() { return name; } + + public String toString(String baseURI, Map<String,String> prefixes) { + return "\"" + Helper.getAbbreviatedString(name, baseURI, prefixes) + "\""; + } - public String toString(String baseURI, Map<String,String> prefixes) { - return Helper.getAbbreviatedString(name, baseURI, prefixes); - } - public void accept(KBElementVisitor visitor) { visitor.visit(this); } Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectSomeRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectSomeRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectSomeRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -1,3 +1,22 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ package org.dllearner.core.owl; import java.util.Map; @@ -2,3 +21,8 @@ - +/** + * Existantial restriction on objects, e.g. \exists hasChild.Male. + * + * @author Jens Lehmann + * + */ public class ObjectSomeRestriction extends ObjectQuantorRestriction { @@ -9,93 +33,14 @@ super(role,c); } - /* - public Exists(String roleName) { - this.roleName = roleName; - } - - public String getRoleName() { - return roleName; - } - */ - - /* - @Override - protected void calculateSets(FlatABox abox, SortedSet<String> adcPosSet, SortedSet<String> adcNegSet) { - children.get(0).calculateSets(abox, posSet, negSet); - - // Daten zu R+ - Map<String, SortedSet<String>> rplus = abox.rolesPos.get(roleName); - Map<String, SortedSet<String>> rminus = abox.rolesNeg.get(roleName); - // Daten zu C und C+ - Set<String> cPlus = children.get(0).posSet; - Set<String> cMinus = children.get(0).negSet; - - // es wird r(a,b) untersucht und sobald ein b mit b \in C+ gefunden - // wird, wird a in posSet aufgenommen - - if(rplus!=null) { - for (String a : rplus.keySet()) { - if (rplus.containsKey(a) && checkExist(rplus.get(a), cPlus)) - posSet.add(a); - } - } - - - // ich muss über die ganze Domain gehen: selbst wenn für ein a gar kein - // (a,b) in R- existiert, dann kann so ein a trotzdem die Bedingung erfüllen - - if(rminus==null) { - if(cMinus.equals(abox.domain)) - negSet = abox.domain; - } else { - for (String a : abox.domain) { - if(!rminus.containsKey(a)) { - if(cMinus.equals(abox.domain)) - negSet.add(a); - } else - if (checkAll(Helper.difference(abox.domain, rminus.get(a)), cMinus)) - negSet.add(a); - } - } - - } - - // check-Methoden: hier ist s1 jeweils immer die Menge aller b, die für - // ein festes a in den - // Updategleichungen die erste Bedingung erfüllen (z.B. alle b - // mit (a,b) \not\in R-) und s2 die Menge, die die zweite Bedingung erfüllt - - // gibt true zurück, falls es ein b gibt mit b \in s1 und b \in s2, - // ansonsten false - private static boolean checkExist(Set<String> s1, Set<String> s2) { - for (String b : s1) { - if (s2.contains(b)) - return true; - } - return false; - } - - // gibt false zurück, falls für ein b \in s1 gilt b \in s2, - // ansonsten true - private static boolean checkAll(Set<String> s1, Set<String> s2) { - for (String b : s1) { - if (!s2.contains(b)) - return false; - } - return true; - } - */ - public String toString(String baseURI, Map<String,String> prefixes) { return "EXISTS " + role.toString(baseURI, prefixes) + "." + children.get(0).toString(baseURI, prefixes); } - /* - public int getLength() { - return 2; - } - */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return role.toString(baseURI, prefixes) + " only " + children.get(0).toManchesterSyntaxString(baseURI, prefixes); + } /* (non-Javadoc) * @see org.dllearner.core.owl.Description#accept(org.dllearner.core.owl.DescriptionVisitor) Modified: trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/ObjectValueRestriction.java 2008-02-17 13:08:46 UTC (rev 590) @@ -19,6 +19,8 @@ */ package org.dllearner.core.owl; +import java.util.Map; + /** * Restricts the value of an object property to a single individual * (corresponds to owl:hasValue). @@ -38,5 +40,14 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); + } + + /* (non-Javadoc) + * @see org.dllearner.core.owl.Description#toManchesterSyntaxString(java.lang.String, java.util.Map) + */ + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + // TODO Auto-generated method stub + return null; } } Modified: trunk/src/dl-learner/org/dllearner/core/owl/Thing.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Thing.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/Thing.java 2008-02-17 13:08:46 UTC (rev 590) @@ -16,6 +16,11 @@ return "TOP"; } + @Override + public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { + return "owl:Thing"; + } + public int getLength() { return 1; } @@ -35,5 +40,7 @@ public void accept(KBElementVisitor visitor) { visitor.visit(this); - } + } + + } Modified: trunk/src/dl-learner/org/dllearner/core/owl/Union.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Union.java 2008-02-17 11:18:26 UTC (rev 589) +++ trunk/src/dl-learner/org/dllearner/core/owl/Union.java 2008-02-17 13:08:46 UTC (rev 590) @@ -48,6 +48,19 @@ return ret; } + @Override + public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { + if(children.size()==0) + return "EMPTY_OR"; + + String ret = "("; + for(int i=0; i<children.size()-1; i++) { + ret += children.get(i).toManchesterSyntaxString(baseURI, prefixes) + " or "; + } + ret += children.get(children.size()-1).toManchesterSyntaxString(baseURI, prefixes) + ")"; + return ret; + } + public String toStringOld() { String ret = "MULTI_OR ["; for(Description child : children) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 11:18:47
|
Revision: 589 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=589&view=rev Author: jenslehmann Date: 2008-02-17 03:18:26 -0800 (Sun, 17 Feb 2008) Log Message: ----------- - component init exceptions are now thrown when KB or OWL ontologies cannot be read Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/kb/KBFile.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 10:50:06 UTC (rev 588) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 11:18:26 UTC (rev 589) @@ -105,7 +105,7 @@ * * @param args */ - public static void main(String[] args) { + public static void main(String[] args) throws ComponentInitException { File file = new File(args[args.length - 1]); boolean inQueryMode = false; @@ -121,12 +121,7 @@ logger.setLevel(Level.INFO); Start start = null; - try { - start = new Start(file); - } catch (ComponentInitException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + start = new Start(file); start.start(inQueryMode); } Modified: trunk/src/dl-learner/org/dllearner/kb/KBFile.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/KBFile.java 2008-02-17 10:50:06 UTC (rev 588) +++ trunk/src/dl-learner/org/dllearner/kb/KBFile.java 2008-02-17 11:18:26 UTC (rev 589) @@ -27,6 +27,7 @@ import java.util.Collection; import java.util.LinkedList; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.config.ConfigEntry; import org.dllearner.core.config.ConfigOption; @@ -96,13 +97,13 @@ * @see org.dllearner.core.Component#init() */ @Override - public void init() { + public void init() throws ComponentInitException { try { kb = KBParser.parseKBFile(url); } catch (IOException e) { - e.printStackTrace(); + throw new ComponentInitException("KB file " + url + " could not be read.", e); } catch (ParseException e) { - e.printStackTrace(); + throw new ComponentInitException("KB file " + url + " could not be parsed correctly.", e); } } Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-02-17 10:50:06 UTC (rev 588) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-02-17 11:18:26 UTC (rev 589) @@ -154,8 +154,7 @@ try { rd = connector.tells(sb.toString()); } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + throw new ComponentInitException("Could not read knowledge source " + source + ".", e); } if (!rd.getResponse().isSetOk()) { System.err.println("DIG-Reasoner cannot read knowledgebase."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 10:50:18
|
Revision: 588 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=588&view=rev Author: jenslehmann Date: 2008-02-17 02:50:06 -0800 (Sun, 17 Feb 2008) Log Message: ----------- - created ComponentInitException (thrown when exceptions occur during component initialisation) - abstract init method in Component now throws ComponentInitException - @developers: please update your code accordingingly (currently I only added default try-catch-blocks) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/Component.java trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java trunk/src/dl-learner/org/dllearner/reasoning/DIGHTTPConnector.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.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/utilities/CrossValidation.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 10:50:06 UTC (rev 588) @@ -44,6 +44,7 @@ import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.algorithms.refinement.ROLearner; import org.dllearner.core.Component; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; @@ -119,15 +120,22 @@ logger.addAppender(consoleAppender); logger.setLevel(Level.INFO); - Start start = new Start(file); + Start start = null; + try { + start = new Start(file); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } start.start(inQueryMode); } /** * Initialise all components based on conf file. * @param file Conf file to read. + * @throws ComponentInitException */ - public Start(File file) { + public Start(File file) throws ComponentInitException { String baseDir = file.getParentFile().getPath(); // create component manager instance @@ -542,7 +550,7 @@ } } - private static void initComponent(ComponentManager cm, Component component) { + private static void initComponent(ComponentManager cm, Component component) throws ComponentInitException { String startMessage = "initialising component \"" + cm.getComponentName(component.getClass()) + "\" ... "; long initStartTime = System.nanoTime(); Modified: trunk/src/dl-learner/org/dllearner/core/Component.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Component.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/core/Component.java 2008-02-17 10:50:06 UTC (rev 588) @@ -52,7 +52,7 @@ /** * Method to be called after the component has been configured. */ - public abstract void init(); + public abstract void init() throws ComponentInitException; /** * Applies a configuration option to this component. Added: trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/ComponentInitException.java 2008-02-17 10:50:06 UTC (rev 588) @@ -0,0 +1,46 @@ +/** + * 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; + +/** + * Exception which is thrown when a component cannot be intialised, + * e.g. due to bad configuration parameteres or unforeseen + * circumstances unreachable web files. It can encapsulate arbitrary + * exceptions occuring during initialisation. + * + * @author Jens Lehmann + * + */ +public class ComponentInitException extends Exception { + + private static final long serialVersionUID = -3550079897929658317L; + + public ComponentInitException(String message) { + super(message); + } + + public ComponentInitException(Exception exception) { + super(exception); + } + + public ComponentInitException(String message, Exception exception) { + super(message, exception); + } +} Modified: trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/gui/KnowledgeSourcePanel.java 2008-02-17 10:50:06 UTC (rev 588) @@ -26,6 +26,8 @@ import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + +import org.dllearner.core.ComponentInitException; import org.dllearner.core.KnowledgeSource; /** @@ -116,7 +118,12 @@ */ public void init() { if (config.getKnowledgeSource() != null && config.getURI() != null) { - config.getKnowledgeSource().init(); + try { + config.getKnowledgeSource().init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } config.setInitKnowledgeSource(true); System.out.println("init KnowledgeSource"); startGUI.updateTabColors(); Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-17 10:50:06 UTC (rev 588) @@ -27,6 +27,7 @@ import java.awt.event.ActionListener; import java.util.List; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblemUnsupportedException; @@ -127,7 +128,12 @@ public void init() { setLearningAlgorithm(); if (config.getLearningProblem() != null) { - config.getLearningAlgorithm().init(); + try { + config.getLearningAlgorithm().init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } config.setInitLearningAlgorithm(true); System.out.println("init LearningAlgorithm"); startGUI.updateTabColors(); Modified: trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/gui/LearningProblemPanel.java 2008-02-17 10:50:06 UTC (rev 588) @@ -26,6 +26,8 @@ import java.awt.event.ActionListener; import java.util.List; import javax.swing.*; + +import org.dllearner.core.ComponentInitException; import org.dllearner.core.LearningProblem; /** @@ -121,7 +123,12 @@ private void init() { setLearningProblem(); if (config.getReasoner() != null && config.getLearningProblem() != null) { - config.getLearningProblem().init(); + try { + config.getLearningProblem().init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } config.setInitLearningProblem(true); System.out.println("init LearningProblem"); startGUI.updateTabColors(); Modified: trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2008-02-17 10:50:06 UTC (rev 588) @@ -39,6 +39,7 @@ import javax.swing.JTextField; import org.dllearner.algorithms.refinement.ROLearner; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; @@ -134,12 +135,22 @@ // (everything else will cause an exception) KnowledgeSource source = cm.knowledgeSource(OWLFile.class); cm.applyConfigEntry(source, "url", selectedFile.toURI().toString()); - source.init(); + try { + source.init(); + } catch (ComponentInitException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } // use a reasoner to find out which instances exist // in the background knowledge ReasonerComponent reasoner = cm.reasoner(DIGReasoner.class, source); - reasoner.init(); + try { + reasoner.init(); + } catch (ComponentInitException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } rs = cm.reasoningService(reasoner); Set<Individual> individualsSet = rs.getIndividuals(); individuals = new LinkedList<Individual>(individualsSet); @@ -160,7 +171,12 @@ // create a positive only learning problem LearningProblem lp = cm.learningProblem(PosOnlyDefinitionLP.class, rs); cm.applyConfigEntry(lp, "positiveExamples", exampleSet); - lp.init(); + try { + lp.init(); + } catch (ComponentInitException e2) { + // TODO Auto-generated catch block + e2.printStackTrace(); + } // try the refinement operator based learning algorithm to solve // the problem @@ -171,7 +187,12 @@ // TODO Auto-generated catch block e1.printStackTrace(); } - la.init(); + try { + la.init(); + } catch (ComponentInitException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } la.start(); // wait for a solution (note that not all learning problems have a Modified: trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/gui/ReasonerPanel.java 2008-02-17 10:50:06 UTC (rev 588) @@ -28,6 +28,7 @@ import javax.swing.*; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.ReasonerComponent; /** @@ -127,7 +128,12 @@ public void init() { setReasoner(); if (config.getKnowledgeSource() != null && config.getReasoner() != null) { - config.getReasoner().init(); + try { + config.getReasoner().init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } System.out.println("init Reasoner"); // set ReasoningService config.setReasoningService(config.getComponentManager() Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGHTTPConnector.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGHTTPConnector.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGHTTPConnector.java 2008-02-17 10:50:06 UTC (rev 588) @@ -67,7 +67,13 @@ public URI newKB() { NewKBDocument newKB = NewKBDocument.Factory.newInstance(); newKB.addNewNewKB(); - String answer = sendAndReceive(newKB.toString()); + String answer = ""; + try { + answer = sendAndReceive(newKB.toString()); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } ResponseDocument rd = parse(answer); IdRespType rt = rd.getResponse(); @@ -89,15 +95,22 @@ public boolean releaseKB(URI kbURI) { ReleaseKBDocument releaseKB = ReleaseKBDocument.Factory.newInstance(); releaseKB.addNewReleaseKB().setUri(kbURI.toString()); - String answer = sendAndReceive(releaseKB.toString()); + String answer = ""; + try { + answer = sendAndReceive(releaseKB.toString()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } ResponseDocument rd = parse(answer); return rd.getResponse().isSetOk(); } - public String getIdentifier() { + public String getIdentifier() throws IOException { GetIdentifierDocument gid = GetIdentifierDocument.Factory.newInstance(); gid.addNewGetIdentifier(); - String answer = sendAndReceive(gid.toString()); + String answer = ""; + answer = sendAndReceive(gid.toString()); IdentifierDocument id = null; try { id = IdentifierDocument.Factory.parse(answer); @@ -111,7 +124,7 @@ } // tell-Anfrage als XML-String schicken - public ResponseDocument tells(String tells) { + public ResponseDocument tells(String tells) throws IOException { return parse(sendAndReceive(tells)); } @@ -121,7 +134,13 @@ public ResponsesDocument asks(String asks) { askCounter++; - String answer = sendAndReceive(asks); + String answer = ""; + try { + answer = sendAndReceive(asks); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } ResponsesDocument rd = null; try { rd = ResponsesDocument.Factory.parse(answer); @@ -142,13 +161,13 @@ return rd; } - private String sendAndReceive(String send) { + private String sendAndReceive(String send) throws IOException { StringBuilder answer = new StringBuilder(); // String an DIG-Reasoner schicken HttpURLConnection connection; - try { +// try { connection = (HttpURLConnection) url.openConnection(); connection.setDoOutput(true); @@ -174,10 +193,10 @@ br.close(); - } catch (IOException e) { - System.out.println("Communication problem with DIG Reasoner. Please make sure there is a DIG reasoner running at " + url + " and try again."); - System.exit(0); - } +// } catch (IOException e) { +// System.out.println("Communication problem with DIG Reasoner. Please make sure there is a DIG reasoner running at " + url + " and try again."); +// System.exit(0); +// } if(protocolFile != null) Files.appendFile(protocolFile, "DIG code received from reasoner:\n\n"+answer+"\n\n"); Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-02-17 10:50:06 UTC (rev 588) @@ -20,6 +20,7 @@ package org.dllearner.reasoning; import java.io.File; +import java.io.IOException; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; @@ -36,6 +37,7 @@ import javax.xml.namespace.QName; import org.apache.xmlbeans.XmlCursor; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.OntologyFormat; import org.dllearner.core.ReasonerComponent; @@ -112,7 +114,7 @@ } @Override - public void init() { + public void init() throws ComponentInitException { // if a DIG protocol is written clear the file first if(writeDIGProtocol) { if(digProtocolFile == null) @@ -123,7 +125,11 @@ connector = new DIGHTTPConnector(reasonerURL); } - identifier = connector.getIdentifier(); + try { + identifier = connector.getIdentifier(); + } catch (IOException e1) { + throw new ComponentInitException("Communication problem with DIG Reasoner. Please make sure there is a DIG reasoner running at " + reasonerURL + " and try again.", e1); + } kbURI = connector.newKB(); // asks-Prefix entsprechend der KB-URI initialisieren @@ -144,7 +150,13 @@ for (KnowledgeSource source : sources) { sb.append(source.toDIG(kbURI)); - ResponseDocument rd = connector.tells(sb.toString()); + ResponseDocument rd = null; + try { + rd = connector.tells(sb.toString()); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } if (!rd.getResponse().isSetOk()) { System.err.println("DIG-Reasoner cannot read knowledgebase."); System.exit(0); Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java 2008-02-17 10:50:06 UTC (rev 588) @@ -5,6 +5,7 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningMethodUnsupportedException; @@ -36,7 +37,12 @@ public FastRetrievalReasoner(Set<KnowledgeSource> sources) { rc = new DIGReasoner(sources); - rc.init(); + try { + rc.init(); + } catch (ComponentInitException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } atomicConcepts = rc.getAtomicConcepts(); atomicRoles = rc.getAtomicRoles(); individuals = rc.getIndividuals(); Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-02-17 10:50:06 UTC (rev 588) @@ -41,6 +41,7 @@ import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.algorithms.refinement.ROLearner; import org.dllearner.core.Component; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; @@ -262,9 +263,10 @@ /** * Initialise all components. * @param id Session ID. + * @throws ComponentInitException */ @WebMethod - public void initAll(int id) throws ClientNotKnownException { + public void initAll(int id) throws ClientNotKnownException, ComponentInitException { ClientState state = getState(id); for(KnowledgeSource ks : state.getKnowledgeSources()) ks.init(); @@ -279,9 +281,10 @@ * @param componentID Component-ID. * @throws ClientNotKnownException Thrown if the client ID is nor registered. * @throws UnknownComponentException Thrown if the component is unknown. + * @throws ComponentInitException */ @WebMethod - public void init(int id, int componentID) throws ClientNotKnownException, UnknownComponentException { + public void init(int id, int componentID) throws ClientNotKnownException, UnknownComponentException, ComponentInitException { ClientState state = getState(id); Component component = state.getComponent(componentID); component.init(); Modified: trunk/src/dl-learner/org/dllearner/test/ComponentTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/ComponentTest.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/test/ComponentTest.java 2008-02-17 10:50:06 UTC (rev 588) @@ -24,6 +24,7 @@ import java.util.TreeSet; import org.dllearner.algorithms.RandomGuesser; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; @@ -45,8 +46,9 @@ /** * @param args + * @throws ComponentInitException */ - public static void main(String[] args) { + public static void main(String[] args) throws ComponentInitException { // get singleton instance of component manager ComponentManager cm = ComponentManager.getInstance(); Modified: trunk/src/dl-learner/org/dllearner/utilities/CrossValidation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/CrossValidation.java 2008-02-17 10:11:48 UTC (rev 587) +++ trunk/src/dl-learner/org/dllearner/utilities/CrossValidation.java 2008-02-17 10:50:06 UTC (rev 588) @@ -31,6 +31,7 @@ import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; import org.dllearner.cli.Start; +import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; @@ -84,7 +85,13 @@ // the first read of the file is used to detect the examples // and set up the splits correctly according to our validation // method - Start start = new Start(file); + Start start = null; + try { + start = new Start(file); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } LearningProblem lp = start.getLearningProblem(); ReasoningService rs = start.getReasoningService(); @@ -162,7 +169,12 @@ for(int currFold=0; currFold<folds; currFold++) { // we always perform a full initialisation to make sure that // no objects are reused - start = new Start(file); + try { + start = new Start(file); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } lp = start.getLearningProblem(); Set<String> pos = Datastructures.individualSetToStringSet(trainingSetsPos.get(currFold)); Set<String> neg = Datastructures.individualSetToStringSet(trainingSetsNeg.get(currFold)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-17 10:11:54
|
Revision: 587 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=587&view=rev Author: sknappe Date: 2008-02-17 02:11:48 -0800 (Sun, 17 Feb 2008) Log Message: ----------- changed the map and map link a bit, link now toggles the map Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/index.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-17 10:08:08 UTC (rev 586) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-17 10:11:48 UTC (rev 587) @@ -110,9 +110,10 @@ $content .= '<li><a href="'.$reference.'">'.$reference.'</a></li>'; $content .= '</ul></p>'; } + //display a Google Map if Geo-koordinates are available if (isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'])&&isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'])){ - $content.="<br/><img src=\"".$_GET['path']."images/mobmaps_googlemapsicon.jpg\" alt=\"Google Maps\" style=\"max-width:30px;\" /> <a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].",'".$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]."');return false;\">a map of the location</a><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; + $content.="<br/><img src=\"".$_GET['path']."images/mobmaps_googlemapsicon.jpg\" alt=\"Google Maps\" style=\"max-width:30px;\" /> <a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].",'".$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]."');return false;\">Toggle a map of the location</a><br/><br/><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; } Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-17 10:08:08 UTC (rev 586) +++ trunk/src/dbpedia-navigator/index.php 2008-02-17 10:11:48 UTC (rev 587) @@ -61,19 +61,24 @@ } function loadGoogleMap(Lat,Lng,Label) { - document.getElementById("map").style.display='block'; - if (GBrowserIsCompatible()) { - // Create and Center a Map - var map = new GMap2(document.getElementById("map")); - map.setCenter(new GLatLng(Lat, Lng), 12); - map.addControl(new GLargeMapControl()); - map.addControl(new GMapTypeControl()); - var marker=new GMarker(new GLatLng(Lat, Lng)); - GEvent.addListener(marker, "click", function() { - marker.openInfoWindowHtml(Label); - }); - map.addOverlay(marker); - } + if (document.getElementById("map").style.display=="none"){ + document.getElementById("map").style.display='block'; + if (GBrowserIsCompatible()) { + // Create and Center a Map + var map = new GMap2(document.getElementById("map")); + map.setCenter(new GLatLng(Lat, Lng), 12); + map.addControl(new GLargeMapControl()); + map.addControl(new GMapTypeControl()); + var marker=new GMarker(new GLatLng(Lat, Lng)); + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml(Label); + }); + map.addOverlay(marker); + } + } + else { + document.getElementById("map").style.display='none'; + } } </script> </head> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 10:08:17
|
Revision: 586 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=586&view=rev Author: jenslehmann Date: 2008-02-17 02:08:08 -0800 (Sun, 17 Feb 2008) Log Message: ----------- partial fix for #1880138 Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/ComponentManager.java trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java trunk/src/dl-learner/org/dllearner/gui/MiniGUI.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/utilities/PaperStatistics.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/LearningProblemUnsupportedException.java Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 09:48:24 UTC (rev 585) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-17 10:08:08 UTC (rev 586) @@ -48,6 +48,7 @@ import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.OntologyFormat; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningService; @@ -215,7 +216,12 @@ else handleError("Unknown value in " + algorithmOption); - la = cm.learningAlgorithm(laClass, lp, rs); + try { + la = cm.learningAlgorithm(laClass, lp, rs); + } catch (LearningProblemUnsupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } configureComponent(cm, la, componentPrefixMapping, parser); initComponent(cm, la); Modified: trunk/src/dl-learner/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2008-02-17 09:48:24 UTC (rev 585) +++ trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2008-02-17 10:08:08 UTC (rev 586) @@ -316,7 +316,7 @@ } // automagically calls the right constructor for the given learning problem - public <T extends LearningAlgorithm> T learningAlgorithm(Class<T> laClass, LearningProblem lp, ReasoningService rs) { + public <T extends LearningAlgorithm> T learningAlgorithm(Class<T> laClass, LearningProblem lp, ReasoningService rs) throws LearningProblemUnsupportedException { if (!learningAlgorithms.contains(laClass)) System.err.println("Warning: learning algorithm " + laClass + " is not a registered learning algorithm component."); @@ -330,11 +330,12 @@ } if (constructorArgument == null) { - System.err.println("Warning: No suitable constructor registered for algorithm " - + laClass.getName() + " and problem " + lp.getClass().getName() - + ". Registered constructors for " + laClass.getName() + ": " - + algorithmProblemsMapping.get(laClass) + "."); - return null; + throw new LearningProblemUnsupportedException(lp.getClass(), laClass, algorithmProblemsMapping.get(laClass)); +// System.err.println("Warning: No suitable constructor registered for algorithm " +// + laClass.getName() + " and problem " + lp.getClass().getName() +// + ". Registered constructors for " + laClass.getName() + ": " +// + algorithmProblemsMapping.get(laClass) + "."); +// return null; } T la = invokeConstructor(laClass, new Class[] { constructorArgument, ReasoningService.class }, new Object[] { lp, rs }); Added: trunk/src/dl-learner/org/dllearner/core/LearningProblemUnsupportedException.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningProblemUnsupportedException.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/LearningProblemUnsupportedException.java 2008-02-17 10:08:08 UTC (rev 586) @@ -0,0 +1,48 @@ +/** + * 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; + +import java.util.Collection; + +/** + * Exception, which is thrown when an application tries to run + * a learning algorithm with a learning problem it does not + * support. + * + * @author Jens Lehmann + * + */ +public class LearningProblemUnsupportedException extends Exception { + + private static final long serialVersionUID = 177919265073997460L; + + public LearningProblemUnsupportedException(Class<? extends LearningProblem> problemClass, Class<? extends LearningAlgorithm> algorithmClass) { + super("Warning: No suitable constructor registered for algorithm " + + algorithmClass.getName() + " and problem " + problemClass.getClass().getName() + "."); + } + + public LearningProblemUnsupportedException(Class<? extends LearningProblem> problemClass, Class<? extends LearningAlgorithm> algorithmClass, Collection<Class<? extends LearningProblem>> supportedProblems) { + super("Warning: No suitable constructor registered for algorithm " + + algorithmClass.getName() + " and problem " + problemClass.getClass().getName() + + ". Registered constructors for " + algorithmClass.getName() + ": " + + supportedProblems + "."); + } + +} Modified: trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-17 09:48:24 UTC (rev 585) +++ trunk/src/dl-learner/org/dllearner/gui/LearningAlgorithmPanel.java 2008-02-17 10:08:08 UTC (rev 586) @@ -28,6 +28,7 @@ import java.util.List; import org.dllearner.core.LearningAlgorithm; +import org.dllearner.core.LearningProblemUnsupportedException; /** * LearningAlgorithmPanel, tab 4. Choose LearningAlgorithm, change Options and @@ -107,10 +108,15 @@ public void setLearningAlgorithm() { if (config.getLearningProblem() != null && config.getReasoningService() != null) { - config.setLearningAlgorithm(config.getComponentManager() - .learningAlgorithm(learners.get(choosenClassIndex), - config.getLearningProblem(), - config.getReasoningService())); + try { + config.setLearningAlgorithm(config.getComponentManager() + .learningAlgorithm(learners.get(choosenClassIndex), + config.getLearningProblem(), + config.getReasoningService())); + } catch (LearningProblemUnsupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } updateOptionPanel(); } } Modified: trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2008-02-17 09:48:24 UTC (rev 585) +++ trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java 2008-02-17 10:08:08 UTC (rev 586) @@ -43,6 +43,7 @@ import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningService; import org.dllearner.core.owl.Description; @@ -163,7 +164,13 @@ // try the refinement operator based learning algorithm to solve // the problem - LearningAlgorithm la = cm.learningAlgorithm(ROLearner.class, lp, rs); + LearningAlgorithm la = null; + try { + la = cm.learningAlgorithm(ROLearner.class, lp, rs); + } catch (LearningProblemUnsupportedException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } la.init(); la.start(); Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-02-17 09:48:24 UTC (rev 585) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-02-17 10:08:08 UTC (rev 586) @@ -45,6 +45,7 @@ import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.config.ConfigOption; import org.dllearner.core.owl.NamedClass; @@ -248,7 +249,7 @@ } @WebMethod - public int setLearningAlgorithm(int id, String component) throws ClientNotKnownException, UnknownComponentException { + public int setLearningAlgorithm(int id, String component) throws ClientNotKnownException, UnknownComponentException, LearningProblemUnsupportedException { ClientState state = getState(id); Class<? extends LearningAlgorithm> laClass = learningAlgorithmMapping.get(component); if(laClass == null) Modified: trunk/src/dl-learner/org/dllearner/test/ComponentTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/ComponentTest.java 2008-02-17 09:48:24 UTC (rev 585) +++ trunk/src/dl-learner/org/dllearner/test/ComponentTest.java 2008-02-17 10:08:08 UTC (rev 586) @@ -28,6 +28,7 @@ import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningService; import org.dllearner.kb.OWLFile; @@ -77,7 +78,13 @@ lp.init(); // create the learning algorithm - LearningAlgorithm la = cm.learningAlgorithm(RandomGuesser.class, lp, rs); + LearningAlgorithm la = null; + try { + la = cm.learningAlgorithm(RandomGuesser.class, lp, rs); + } catch (LearningProblemUnsupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } cm.applyConfigEntry(la, "numberOfTrees", 100); cm.applyConfigEntry(la, "maxDepth", 5); la.init(); Modified: trunk/src/dl-learner/org/dllearner/utilities/PaperStatistics.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/PaperStatistics.java 2008-02-17 09:48:24 UTC (rev 585) +++ trunk/src/dl-learner/org/dllearner/utilities/PaperStatistics.java 2008-02-17 10:08:08 UTC (rev 586) @@ -32,6 +32,7 @@ import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.OntologyFormat; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningService; @@ -237,7 +238,12 @@ // if(exampleNr==3 || exampleNr==5 || exampleNr == 6) // Config.percentPerLengthUnit = 0.002; // learningAlgorithm = new GP(learningProblem); - learningAlgorithm = cm.learningAlgorithm(GP.class, learningProblem, rs); + try { + learningAlgorithm = cm.learningAlgorithm(GP.class, learningProblem, rs); + } catch (LearningProblemUnsupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } else if(algorithmNr==2) { // Config.algorithm = Algorithm.HYBRID_GP; // Config.GP.algorithmType = GP.AlgorithmType.GENERATIONAL; @@ -255,7 +261,12 @@ // if(exampleNr == 3 || exampleNr==5 || exampleNr==6) // Config.percentPerLengthUnit = 0.002; // learningAlgorithm = new GP(learningProblem); - learningAlgorithm = cm.learningAlgorithm(GP.class, learningProblem, rs); + try { + learningAlgorithm = cm.learningAlgorithm(GP.class, learningProblem, rs); + } catch (LearningProblemUnsupportedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } // rs.resetStatistics(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 09:48:37
|
Revision: 585 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=585&view=rev Author: jenslehmann Date: 2008-02-17 01:48:24 -0800 (Sun, 17 Feb 2008) Log Message: ----------- maybe fix of #1888650 Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-02-17 09:37:42 UTC (rev 584) +++ trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-02-17 09:48:24 UTC (rev 585) @@ -65,6 +65,8 @@ private Integer maxLength = 7; private String returnType; + private boolean stop = false; + // list of all generated concepts sorted by length private Map<Integer,List<Description>> generatedDefinitions = new HashMap<Integer,List<Description>>(); @@ -126,6 +128,9 @@ for(int i=1; i<=maxLength; i++) generatePrograms(i); + if(stop) + return; + long generationTime = System.currentTimeMillis() - generationStartTime; System.out.println("OK (" + generationTime + " ms)"); @@ -155,11 +160,15 @@ Score tmp; double score; - for(int i=1; i<=maxLength; i++) { + for(int i=1; i<=maxLength && !stop; i++) { long startTime = System.currentTimeMillis(); System.out.print("Testing definitions of length " + i + " ... "); count = 0; for(Description program : generatedDefinitions.get(i)) { + // stop testing further when algorithm is stopped + if(stop) + break; + // if a return type is already given an appropriate tree is // generated here Description newRoot; @@ -274,6 +283,7 @@ @Override public void stop() { + stop = true; } } Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-02-17 09:37:42 UTC (rev 584) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-02-17 09:48:24 UTC (rev 585) @@ -25,55 +25,49 @@ import java.net.URL; import java.util.Collection; import java.util.Comparator; -import java.util.Enumeration; import java.util.HashSet; import java.util.LinkedList; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; -import java.util.Vector; -import org.apache.commons.logging.impl.Log4JLogger; import org.apache.log4j.Level; -import org.apache.log4j.LogManager; import org.apache.log4j.Logger; -import org.apache.log4j.spi.LoggerRepository; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.config.ConfigEntry; import org.dllearner.core.config.ConfigOption; import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; -import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.AssertionalAxiom; -import org.dllearner.core.owl.NamedClass; -import org.dllearner.core.owl.Nothing; -import org.dllearner.core.owl.Description; import org.dllearner.core.owl.ClassAssertionAxiom; +import org.dllearner.core.owl.Description; import org.dllearner.core.owl.EquivalentClassesAxiom; -import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.FunctionalObjectPropertyAxiom; -import org.dllearner.core.owl.SubClassAxiom; import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.InverseObjectPropertyAxiom; import org.dllearner.core.owl.KB; -import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.Negation; +import org.dllearner.core.owl.Nothing; +import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyAssertion; -import org.dllearner.core.owl.PropertyAxiom; import org.dllearner.core.owl.ObjectPropertyHierarchy; +import org.dllearner.core.owl.ObjectSomeRestriction; +import org.dllearner.core.owl.PropertyAxiom; +import org.dllearner.core.owl.SubClassAxiom; import org.dllearner.core.owl.SubObjectPropertyAxiom; import org.dllearner.core.owl.SubsumptionHierarchy; import org.dllearner.core.owl.SymmetricObjectPropertyAxiom; import org.dllearner.core.owl.TerminologicalAxiom; import org.dllearner.core.owl.Thing; import org.dllearner.core.owl.TransitiveObjectPropertyAxiom; +import org.dllearner.core.owl.Union; import org.dllearner.kb.OWLFile; import org.dllearner.utilities.ConceptComparator; -import org.dllearner.utilities.Logging; import org.dllearner.utilities.RoleComparator; import org.semanticweb.owl.apibinding.OWLManager; import org.semanticweb.owl.inference.OWLReasoner; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-17 09:37:49
|
Revision: 584 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=584&view=rev Author: jenslehmann Date: 2008-02-17 01:37:42 -0800 (Sun, 17 Feb 2008) Log Message: ----------- - switched off extensive Pellet logging output when reasoning over OWL API - test results: using Pellet 1.5.1 via OWP API is now significantly faster compared to using Pellet 1.1 via DIG - DL-Learner with OWP API reasoning could be used as a Java Webstart application Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/utilities/Logging.java Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-02-16 14:10:01 UTC (rev 583) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-02-17 09:37:42 UTC (rev 584) @@ -25,13 +25,20 @@ import java.net.URL; import java.util.Collection; import java.util.Comparator; +import java.util.Enumeration; import java.util.HashSet; import java.util.LinkedList; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; +import java.util.Vector; +import org.apache.commons.logging.impl.Log4JLogger; +import org.apache.log4j.Level; +import org.apache.log4j.LogManager; +import org.apache.log4j.Logger; +import org.apache.log4j.spi.LoggerRepository; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.config.ConfigEntry; @@ -66,6 +73,7 @@ import org.dllearner.core.owl.TransitiveObjectPropertyAxiom; import org.dllearner.kb.OWLFile; import org.dllearner.utilities.ConceptComparator; +import org.dllearner.utilities.Logging; import org.dllearner.utilities.RoleComparator; import org.semanticweb.owl.apibinding.OWLManager; import org.semanticweb.owl.inference.OWLReasoner; @@ -97,7 +105,7 @@ */ public class OWLAPIReasoner extends ReasonerComponent { - private String reasonerType = "fact"; + private String reasonerType = "pellet"; private Set<KnowledgeSource> sources; private OWLReasoner reasoner; @@ -127,9 +135,9 @@ public static Collection<ConfigOption<?>> createConfigOptions() { Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - StringConfigOption type = new StringConfigOption("reasonerType", "FaCT++ or Pellet", "FaCT++"); + StringConfigOption type = new StringConfigOption("reasonerType", "FaCT++ or Pellet", "pellet"); type.setAllowedValues(new String[] {"fact", "pellet"}); - // closure-Option? siehe: + // closure option? see: // http://owlapi.svn.sourceforge.net/viewvc/owlapi/owl1_1/trunk/tutorial/src/main/java/uk/ac/manchester/owl/tutorial/examples/ClosureAxiomsExample.java?view=markup options.add(type); return options; @@ -204,6 +212,9 @@ } else { // instantiate Pellet reasoner reasoner = new org.mindswap.pellet.owlapi.Reasoner(manager); + + Logger pelletLogger = Logger.getLogger("org.mindswap.pellet"); + pelletLogger.setLevel(Level.WARN); } /* Added: trunk/src/dl-learner/org/dllearner/utilities/Logging.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Logging.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/Logging.java 2008-02-17 09:37:42 UTC (rev 584) @@ -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(); + } + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-16 14:10:14
|
Revision: 583 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=583&view=rev Author: sknappe Date: 2008-02-16 06:10:01 -0800 (Sat, 16 Feb 2008) Log Message: ----------- added a marker on the google map Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/index.php Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-16 13:45:26 UTC (rev 582) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-16 14:10:01 UTC (rev 583) @@ -112,7 +112,7 @@ } //display a Google Map if Geo-koordinates are available if (isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'])&&isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'])){ - $content.="<br/><img src=\"".$_GET['path']."images/mobmaps_googlemapsicon.jpg\" alt=\"Google Maps\" style=\"max-width:30px;\" /> <a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].");return false;\">a map of the location</a><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; + $content.="<br/><img src=\"".$_GET['path']."images/mobmaps_googlemapsicon.jpg\" alt=\"Google Maps\" style=\"max-width:30px;\" /> <a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].",'".$triples['http://www.w3.org/2000/01/rdf-schema#label'][0]."');return false;\">a map of the location</a><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; } Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-16 13:45:26 UTC (rev 582) +++ trunk/src/dbpedia-navigator/index.php 2008-02-16 14:10:01 UTC (rev 583) @@ -60,7 +60,7 @@ document.getElementById(id).style.display='none'; } - function loadGoogleMap(Lat,Lng) { + function loadGoogleMap(Lat,Lng,Label) { document.getElementById("map").style.display='block'; if (GBrowserIsCompatible()) { // Create and Center a Map @@ -68,8 +68,13 @@ map.setCenter(new GLatLng(Lat, Lng), 12); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); + var marker=new GMarker(new GLatLng(Lat, Lng)); + GEvent.addListener(marker, "click", function() { + marker.openInfoWindowHtml(Label); + }); + map.addOverlay(marker); } - } + } </script> </head> <body <?php print $onLoad;?>> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-16 13:45:36
|
Revision: 582 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=582&view=rev Author: sknappe Date: 2008-02-16 05:45:26 -0800 (Sat, 16 Feb 2008) Log Message: ----------- added an icon for the google maps refreshing a site should now be no problem (search not perfect yet) Modified Paths: -------------- trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/default.css trunk/src/dbpedia-navigator/index.php Added Paths: ----------- trunk/src/dbpedia-navigator/images/mobmaps_googlemapsicon.jpg Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-16 12:44:28 UTC (rev 581) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-16 13:45:26 UTC (rev 582) @@ -97,7 +97,7 @@ // give the link to the corresponding Wikipedia article if(isset($triples['http://xmlns.com/foaf/0.1/page'])) - $content .= '<p><img src="'.$_GET['path'].'images/wikipedia_favicon.png" alt"Wikipedia" /> <a href="'.$triples['http://xmlns.com/foaf/0.1/page'][0].'">view Wikipedia article</a>, '; + $content .= '<p><img src="'.$_GET['path'].'images/wikipedia_favicon.png" alt="Wikipedia" /> <a href="'.$triples['http://xmlns.com/foaf/0.1/page'][0].'">view Wikipedia article</a>, '; $content .= '<a href="'.$uri.'">view DBpedia resource description</a></p>'; // display a list of classes @@ -110,9 +110,9 @@ $content .= '<li><a href="'.$reference.'">'.$reference.'</a></li>'; $content .= '</ul></p>'; } - + //display a Google Map if Geo-koordinates are available if (isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'])&&isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'])){ - $content.="<br/><a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].");return false;\">a map of the location</a><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; + $content.="<br/><img src=\"".$_GET['path']."images/mobmaps_googlemapsicon.jpg\" alt=\"Google Maps\" style=\"max-width:30px;\" /> <a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].");return false;\">a map of the location</a><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; } Modified: trunk/src/dbpedia-navigator/default.css =================================================================== --- trunk/src/dbpedia-navigator/default.css 2008-02-16 12:44:28 UTC (rev 581) +++ trunk/src/dbpedia-navigator/default.css 2008-02-16 13:45:26 UTC (rev 582) @@ -45,8 +45,8 @@ } #content { - /*margin: 0 19em; - overflow: hidden;*/ + /*margin: 0 19em;*/ + overflow: hidden; /*width: 10%;*/ width: 60%; float: left; Added: trunk/src/dbpedia-navigator/images/mobmaps_googlemapsicon.jpg =================================================================== (Binary files differ) Property changes on: trunk/src/dbpedia-navigator/images/mobmaps_googlemapsicon.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-16 12:44:28 UTC (rev 581) +++ trunk/src/dbpedia-navigator/index.php 2008-02-16 13:45:26 UTC (rev 582) @@ -17,6 +17,16 @@ require_once 'Settings.php'; $settings=new Settings(); +//what happens onLoad +$onload=""; +if (isset($_GET['resource'])){ + $onLoad.="onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\""; + unset($_GET['resource']); +} +else if (isset($_SESSION['currentArticle'])){ + $onLoad.="onLoad=\"xajax_getarticle('',".$_SESSION['currentArticle'].");return false;\""; +} + require("ajax.php"); echo '<?xml version="1.0" encoding="UTF-8"?>'; @@ -55,14 +65,14 @@ if (GBrowserIsCompatible()) { // Create and Center a Map var map = new GMap2(document.getElementById("map")); - map.setCenter(new GLatLng(Lat, Lng), 10); + map.setCenter(new GLatLng(Lat, Lng), 12); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); } } </script> </head> - <body <?php if (isset($_GET['resource'])) print "onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\"";unset($_GET['resource']);?>> + <body <?php print $onLoad;?>> <!-- <h1>DBpedia Navigator</h1> --> <div><table border="0" width="100%"><tr><td width="35%"><img src="<?php print $path;?>images/dbpedia_navigator.png" alt="DBpedia Navigator" style="padding:5px" /></td><td width="50%"><span id="conceptlink"></span></td><td width="15%"><span id="Loading" style="display:none">Server Call... <img src="<?php print $path;?>images/remove.png" onclick="xajax_stopServerCall();return false;" /></span></td></tr></table></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-16 12:44:36
|
Revision: 581 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=581&view=rev Author: sknappe Date: 2008-02-16 04:44:28 -0800 (Sat, 16 Feb 2008) Log Message: ----------- change to support JSON Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-02-16 12:41:30 UTC (rev 580) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-02-16 12:44:28 UTC (rev 581) @@ -474,6 +474,7 @@ // call parser to parse concept Description concept = null; try { + System.out.println(conceptString); concept = KBParser.parseConcept(conceptString); } catch (ParseException e) { e.printStackTrace(); @@ -517,18 +518,19 @@ } @WebMethod - public String getAsJSON(int sessionID, int queryID) throws ClientNotKnownException + public String getAsJSON(int sessionID, int queryID) throws ClientNotKnownException, SparqlQueryException { ClientState state = getState(sessionID); - ResultSet resultSet=state.getQuery(queryID).getSparqlQuery().getResultSet(); - return SparqlQuery.getAsJSON(resultSet); + SparqlQueryException exception=null; + if ((exception=state.getQuery(queryID).getSparqlQuery().getException())!=null) throw exception; + return SparqlQuery.getAsJSON(state.getQuery(queryID).getResult()); } @WebMethod public String getAsXMLString(int sessionID, int queryID) throws ClientNotKnownException { ClientState state = getState(sessionID); - ResultSet resultSet=state.getQuery(queryID).getSparqlQuery().getResultSet(); + ResultSet resultSet=state.getQuery(queryID).getResult(); return SparqlQuery.getAsXMLString(resultSet); } @@ -564,6 +566,34 @@ } @WebMethod + public int[] getConceptDepth(int id, int nrOfConcepts) throws ClientNotKnownException { + ClientState state = getState(id); + List<Description> bestConcepts = state.getLearningAlgorithm().getBestSolutions(nrOfConcepts); + Iterator<Description> iter=bestConcepts.iterator(); + int[] length=new int[bestConcepts.size()]; + int i=0; + while (iter.hasNext()){ + length[i]=iter.next().getDepth(); + i++; + } + return length; + } + + @WebMethod + public int[] getConceptArity(int id, int nrOfConcepts) throws ClientNotKnownException { + ClientState state = getState(id); + List<Description> bestConcepts = state.getLearningAlgorithm().getBestSolutions(nrOfConcepts); + Iterator<Description> iter=bestConcepts.iterator(); + int[] arity=new int[bestConcepts.size()]; + int i=0; + while (iter.hasNext()){ + arity[i]=iter.next().getArity(); + i++; + } + return arity; + } + + @WebMethod public void debug(String deb) { System.out.println(deb); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sk...@us...> - 2008-02-16 12:41:35
|
Revision: 580 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=580&view=rev Author: sknappe Date: 2008-02-16 04:41:30 -0800 (Sat, 16 Feb 2008) Log Message: ----------- JSON is now used Google Maps added redirection is shown Modified Paths: -------------- trunk/src/dbpedia-navigator/DLLearnerConnection.php trunk/src/dbpedia-navigator/Settings.php trunk/src/dbpedia-navigator/ajaxfunctions.php trunk/src/dbpedia-navigator/default.css trunk/src/dbpedia-navigator/index.php Modified: trunk/src/dbpedia-navigator/DLLearnerConnection.php =================================================================== --- trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-15 16:56:37 UTC (rev 579) +++ trunk/src/dbpedia-navigator/DLLearnerConnection.php 2008-02-16 12:41:30 UTC (rev 580) @@ -120,13 +120,12 @@ { $query="SELECT ?pred ?obj ". "WHERE {{<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> ?pred ?obj}UNION{<http://dbpedia.org/resource/".str_replace(' ','_',$label)."> <http://dbpedia.org/property/redirect> ?Conc.?Conc ?pred ?obj}}"; - $result=$this->getSparqlResult($query); - if (!isset($result->item)) throw new Exception("Your query brought no result. The Label-Search is started."); + $result=json_decode($this->getSparqlResult($query),true); + if (count($result['results']['bindings'])==0) throw new Exception("Your query brought no result. The Label-Search is started."); $ret=array(); - foreach ($result->item as $results){ - $value=$results->item[1]; - if (strpos($value,"@".$this->lang)==(strlen($value)-strlen("@".$this->lang))) $ret[$results->item[0]][]=substr($value,0,strlen($value)-strlen("@".$this->lang)); - if (strpos($value,"@")!=(strlen($value)-strlen($this->lang)-1)) $ret[$results->item[0]][]=$value; + foreach ($result['results']['bindings'] as $results){ + $value=$results['obj']; + if (!(isset($value['xml:lang'])&&($value['xml:lang']!=$this->lang))) $ret[$results['pred']['value']][]=$value['value']; } return $ret; @@ -146,7 +145,7 @@ $running=$this->client->isSparqlQueryRunning($this->id,$queryID); if (!$running){ - $result=$this->client->getAsStringArray($this->id,$queryID); + $result=$this->client->getAsJSON($this->id,$queryID); return $result; } @@ -163,17 +162,17 @@ } while($seconds<$this->ttl); $this->client->stopSparqlQuery($id,$queryID); } - + function getSubjects($label) { $query="SELECT DISTINCT ?subject\n". "WHERE { ?subject <http://www.w3.org/2000/01/rdf-schema#label> ?object. ?object bif:contains '\"".$label."\"'@en}\n". "LIMIT 10"; - $result=$this->getSparqlResult($query); - if (!$result->item) throw new Exception("Your query brought no result."); + $result=json_decode($this->getSparqlResult($query),true); + if (count($result['results']['bindings'])==0) throw new Exception("Your query brought no result."); $ret=array(); - foreach ($result->item as $results){ - $ret[]=$results->item[0]; + foreach ($result['results']['bindings'] as $results){ + $ret[]=$results['subject']['value']; } return $ret; } @@ -183,11 +182,11 @@ $query="SELECT DISTINCT ?subject\n". "WHERE { ?subject a <".$concept.">}\n". "LIMIT 10"; - $result=$this->getSparqlResult($query); - if (!$result->item) throw new Exception("Your query brought no result."); + $result=json_decode($this->getSparqlResult($query),true); + if (count($result['results']['bindings'])==0) throw new Exception("Your query brought no result."); $ret=array(); - foreach ($result->item as $results){ - $ret[]=$results->item[0]; + foreach ($result['results']['bindings'] as $results){ + $ret[]=$results['subject']['value']; } return $ret; } @@ -265,9 +264,9 @@ } } /* -require_once("DLLearnerConnection.php"); $sc=new DLLearnerConnection(); $ids=$sc->getIDs(); $sc=new DLLearnerConnection($ids[0],$ids[1]); -$triples=$sc->getConceptFromExamples(array("http://dbpedia.org/resource/Angela_Merkel"),array("http://dbpedia.org/resource/Joschka_Fischer"));*/ +$triples=$sc->getSubjects("Angela Merkel"); +var_dump($triples);*/ ?> Modified: trunk/src/dbpedia-navigator/Settings.php =================================================================== --- trunk/src/dbpedia-navigator/Settings.php 2008-02-15 16:56:37 UTC (rev 579) +++ trunk/src/dbpedia-navigator/Settings.php 2008-02-16 12:41:30 UTC (rev 580) @@ -37,8 +37,10 @@ // public $dbpediauri='http://dbpedia2.openlinksw.com:8890/isparql'; public $sparqlttl=60; - //not yet used + public $language="en"; + + public $googleMapsKey="ABQIAAAAWwHG9WuZ8hxFSPjRX2-D-hSOxlJeL3USfakgDtFzmQkGhQTW0xTFM1Yr38ho8qREnjt-6oLs37o4xg"; } ?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajaxfunctions.php =================================================================== --- trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-15 16:56:37 UTC (rev 579) +++ trunk/src/dbpedia-navigator/ajaxfunctions.php 2008-02-16 12:41:30 UTC (rev 580) @@ -49,6 +49,7 @@ //get first Letter of label big $subject=ucfirst($subject); + $uri="http://dbpedia.org/resource/".str_replace(' ','_',$subject); //if article is in session, get it out of the session if (isset($articles)){ @@ -87,14 +88,17 @@ // display a picture if there is one if(isset($triples['http://xmlns.com/foaf/0.1/depiction'])) $content.='<img src="'.$triples['http://xmlns.com/foaf/0.1/depiction'][0].'" alt="Picture of '.$subject.'" style="float:right; max-width:200px;" \>'; - + + //display where it was redirected from, if it was redirected + if (isset($triples['http://dbpedia.org/property/redirect'])) $content.="<span id=\"redirectedFrom\">redirected from '$subject'</span>"; + // add short description in english $content.="<h4>Short Description</h4><p>".urldecode($triples['http://dbpedia.org/property/abstract'][0])."</p>"; // give the link to the corresponding Wikipedia article if(isset($triples['http://xmlns.com/foaf/0.1/page'])) $content .= '<p><img src="'.$_GET['path'].'images/wikipedia_favicon.png" alt"Wikipedia" /> <a href="'.$triples['http://xmlns.com/foaf/0.1/page'][0].'">view Wikipedia article</a>, '; - $content .= '<a href="'.$subject.'">view DBpedia resource description</a></p>'; + $content .= '<a href="'.$uri.'">view DBpedia resource description</a></p>'; // display a list of classes if(isset($triples['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'])) @@ -107,7 +111,11 @@ $content .= '</ul></p>'; } + if (isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'])&&isset($triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'])){ + $content.="<br/><a href=\"\" onClick=\"loadGoogleMap(".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#lat'][0].",".$triples['http://www.w3.org/2003/01/geo/wgs84_pos#long'][0].");return false;\">a map of the location</a><div id=\"map\" style=\"width: 500px; height: 300px;display:none;\"></div>"; + } + // filter out uninteresting properties and properties which // have already been displayed unset($triples['http://xmlns.com/foaf/0.1/page']); @@ -190,7 +198,7 @@ $objResponse->assign("articlecontent", "innerHTML", $content); $objResponse->assign("ArticleTitle","innerHTML",$artTitle); $objResponse->assign("lastarticles","innerHTML",$lastArticles); - $objResponse->assign("searchcontent", "innerHTML", $searchResult); + if ($searchResult!="") $objResponse->assign("searchcontent", "innerHTML", $searchResult); $objResponse->assign('Positives','innerHTML',$posInterests); $objResponse->assign('Negatives','innerHTML',$negInterests); return $objResponse; Modified: trunk/src/dbpedia-navigator/default.css =================================================================== --- trunk/src/dbpedia-navigator/default.css 2008-02-15 16:56:37 UTC (rev 579) +++ trunk/src/dbpedia-navigator/default.css 2008-02-16 12:41:30 UTC (rev 580) @@ -80,14 +80,6 @@ right: 15px;*/ } -#clear { - clear: both; -} - -#validation { - padding: 0.5em; -} - /* * sidebar content (boxes) */ @@ -384,4 +376,9 @@ #todo { padding: 15px; margin: 10px; +} + +#redirectedFrom { + color: #666; + font-size: 85%; } \ No newline at end of file Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-02-15 16:56:37 UTC (rev 579) +++ trunk/src/dbpedia-navigator/index.php 2008-02-16 12:41:30 UTC (rev 580) @@ -13,13 +13,10 @@ if (isset($_GET['path'])) $path=$_GET['path']; else $path=""; - -// debugging code -// echo '<pre>'; -// $sc=new DLLearnerConnection($settings->dbpediauri,$settings->wsdluri,$_SESSION['id'],$_SESSION['ksID']); -// print_r($sc->getTriples($settings->sparqlttl,'http://dbpedia.org/resource/Dog')); -// echo '</pre>'; +require_once 'Settings.php'; +$settings=new Settings(); + require("ajax.php"); echo '<?xml version="1.0" encoding="UTF-8"?>'; @@ -33,6 +30,8 @@ <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <link rel="stylesheet" href="<?php print $path;?>default.css"/> <?php $xajax->printJavascript($path.'xajax/'); ?> + <script src="http://maps.google.com/maps?file=api&v=2&key=<?php print $settings->googleMapsKey;?>" + type="text/javascript"></script> <script type="text/javascript"> showLoading = function() { xajax.$('Loading').style.display='inline'; @@ -49,7 +48,18 @@ function hidediv(id) { document.getElementById(id).style.display='none'; - } + } + + function loadGoogleMap(Lat,Lng) { + document.getElementById("map").style.display='block'; + if (GBrowserIsCompatible()) { + // Create and Center a Map + var map = new GMap2(document.getElementById("map")); + map.setCenter(new GLatLng(Lat, Lng), 10); + map.addControl(new GLargeMapControl()); + map.addControl(new GMapTypeControl()); + } + } </script> </head> <body <?php if (isset($_GET['resource'])) print "onLoad=\"xajax_getarticle('".$_GET['resource']."',-1);return false;\"";unset($_GET['resource']);?>> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2008-02-15 16:56:49
|
Revision: 579 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=579&view=rev Author: kurzum Date: 2008-02-15 08:56:37 -0800 (Fri, 15 Feb 2008) Log Message: ----------- long SPARQL Query test class Added Paths: ----------- trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java Added: trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/test/JenaLongQueryTest.java 2008-02-15 16:56:37 UTC (rev 579) @@ -0,0 +1,126 @@ +package org.dllearner.test; + +import com.hp.hpl.jena.query.ResultSet; +import com.hp.hpl.jena.query.ResultSetFormatter; +import com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP; + + + +/** + * this class was submitted to Jena Bug Tracker + * + */ +public class JenaLongQueryTest { + + public static void main(String[] args) { + String url = "http://dbpedia.openlinksw.com:8890/sparql"; + String defaultgraph = "http://dbpedia.org"; + String shortQuery = "SELECT ?predicate ?object " + + "WHERE { " + + "<http://dbpedia.org/resource/Philolaus> ?predicate ?object. "+ + "FILTER( "+ + "(!isLiteral(?object)) "+ + "&&( !regex(str(?predicate), 'http://dbpedia.org/property/relatedInstance') ) "+ + "&&( !regex(str(?predicate), 'http://dbpedia.org/property/wikiPageUsesTemplate') ) "+ + "&&( !regex(str(?predicate), 'http://www.w3.org/2002/07/owl#sameAs') ) "+ + "&&( !regex(str(?predicate), 'http://xmlns.com/foaf/0.1/') ) "+ + "&&( !regex(str(?predicate), 'http://www.w3.org/2004/02/skos/core') ) "+ + "&&( !regex(str(?object), 'http://xmlns.com/foaf/0.1/') ) "+ + "&&( !regex(str(?object), 'http://upload.wikimedia.org/wikipedia') ) "+ + "&&( !regex(str(?object), 'http://www4.wiwiss.fu-berlin.de/flickrwrappr') ) "+ + "&&( !regex(str(?object), 'http://dbpedia.org/resource/Template') ) "+ + "&&( !regex(str(?object), 'http://upload.wikimedia.org/wikipedia/commons') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://dbpedia.org/resource/Category:') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2004/02/skos/core') ) "+ + "&&( !regex(str(?object), 'http://www.geonames.org') )).} "; + + String longQuery="SELECT ?predicate ?object " + + "WHERE { " + + "<http://dbpedia.org/resource/Philolaus> ?predicate ?object. "+ + "FILTER( "+ + "(!isLiteral(?object)) "+ + "&&( !regex(str(?predicate), 'http://dbpedia.org/property/relatedInstance') ) "+ + "&&( !regex(str(?predicate), 'http://dbpedia.org/property/wikiPageUsesTemplate') ) "+ + "&&( !regex(str(?predicate), 'http://www.w3.org/2002/07/owl#sameAs') ) "+ + "&&( !regex(str(?predicate), 'http://xmlns.com/foaf/0.1/') ) "+ + "&&( !regex(str(?predicate), 'http://www.w3.org/2004/02/skos/core') ) "+ + "&&( !regex(str(?object), 'http://xmlns.com/foaf/0.1/') ) "+ + "&&( !regex(str(?object), 'http://upload.wikimedia.org/wikipedia') ) "+ + "&&( !regex(str(?object), 'http://www4.wiwiss.fu-berlin.de/flickrwrappr') ) "+ + "&&( !regex(str(?object), 'http://dbpedia.org/resource/Template') ) "+ + "&&( !regex(str(?object), 'http://upload.wikimedia.org/wikipedia/commons') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://dbpedia.org/resource/Category:') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2004/02/skos/core') ) "+ + "&&( !regex(str(?object), 'http://www.geonames.org') )).} "; + + ResultSet rs; + String xml; + QueryEngineHTTP queryExecution; + queryExecution = new QueryEngineHTTP(url, shortQuery); + queryExecution.addDefaultGraph(defaultgraph); + rs = queryExecution.execSelect(); + xml = ResultSetFormatter.asXMLString(rs); + System.out.println("Short Query ResultSet length: "+xml.length()); + + try{ + queryExecution=new QueryEngineHTTP(url,longQuery); + queryExecution.addDefaultGraph(defaultgraph); + rs = queryExecution.execSelect(); + xml = ResultSetFormatter.asXMLString(rs); + System.out.println("Long Query ResultSet length: "+xml.length()+"\n"); + System.out.println("Long query XML: "+xml); + }catch (Exception e) {e.printStackTrace();} + + String queryWithIncreasingLength=""; + for (int i = 0; i < 30; i++) { + queryWithIncreasingLength = makeQueryString ( i); + queryExecution=new QueryEngineHTTP(url,queryWithIncreasingLength); + queryExecution.addDefaultGraph(defaultgraph); + rs = queryExecution.execSelect(); + System.out.println("Query with length: "+queryWithIncreasingLength.length() + +" produces ResultSet length: "+ResultSetFormatter.toList(rs).size()); + } + + } + + public static String makeQueryString ( int charsToAdd){ + String add=""; + + for (int i = 0; i <charsToAdd; i++) { + add+="0123456789"+"0123456789"; + } + // NOTE THE LAST LINE + String query = "SELECT ?predicate ?object " + + "WHERE { " + + "<http://dbpedia.org/resource/Philolaus> ?predicate ?object. "+ + "FILTER( "+ + "(!isLiteral(?object)) "+ + "&&( !regex(str(?predicate), 'http://dbpedia.org/property/relatedInstance') ) "+ + "&&( !regex(str(?predicate), 'http://dbpedia.org/property/wikiPageUsesTemplate') ) "+ + "&&( !regex(str(?predicate), 'http://www.w3.org/2002/07/owl#sameAs') ) "+ + "&&( !regex(str(?predicate), 'http://xmlns.com/foaf/0.1/') ) "+ + "&&( !regex(str(?predicate), 'http://www.w3.org/2004/02/skos/core') ) "+ + "&&( !regex(str(?object), 'http://xmlns.com/foaf/0.1/') ) "+ + "&&( !regex(str(?object), 'http://upload.wikimedia.org/wikipedia') ) "+ + "&&( !regex(str(?object), 'http://www4.wiwiss.fu-berlin.de/flickrwrappr') ) "+ + "&&( !regex(str(?object), 'http://dbpedia.org/resource/Template') ) "+ + "&&( !regex(str(?object), 'http://upload.wikimedia.org/wikipedia/commons') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2006/03/wn/wn20/instances/synset') ) "+ + "&&( !regex(str(?object), 'http://dbpedia.org/resource/Category:') ) "+ + "&&( !regex(str(?object), 'http://www.w3.org/2004/02/skos/core') ) "+ + "&&( !regex(str(?object), 'http://www.geonames.org"+add+"') )).} "; + + + return query; + } + + + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2008-02-15 16:54:47
|
Revision: 578 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=578&view=rev Author: jenslehmann Date: 2008-02-15 08:20:18 -0800 (Fri, 15 Feb 2008) Log Message: ----------- added WSDL files to svn:ignore Property Changed: ---------------- trunk/src/php-examples/ Property changes on: trunk/src/php-examples ___________________________________________________________________ Name: svn:ignore + *.xsd main.wsdl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |