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...> - 2009-05-05 10:02:00
|
Revision: 1733 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1733&view=rev Author: jenslehmann Date: 2009-05-05 10:01:50 +0000 (Tue, 05 May 2009) Log Message: ----------- implemented changes suggested by Francesca Lisi Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/URLConfigOption.java trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java trunk/src/dl-learner/org/dllearner/gui/StartGUI.java trunk/src/dl-learner/org/dllearner/gui/StatusPanel.java trunk/src/dl-learner/org/dllearner/gui/TutorialWindow.java trunk/src/dl-learner/org/dllearner/gui/tutorial.html trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -20,6 +20,7 @@ package org.dllearner.core.configurators; +import java.net.URL; import org.dllearner.core.ComponentManager; import org.dllearner.core.ReasonerComponent; import org.dllearner.learningproblems.ClassLearningProblem; @@ -47,7 +48,7 @@ * @param classToDescribe class of which a description should be learned * @return ClassLearningProblem **/ -public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, String classToDescribe) { +public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, URL classToDescribe) { ClassLearningProblem component = ComponentManager.getInstance().learningProblem(ClassLearningProblem.class, reasoningService); ComponentManager.getInstance().applyConfigEntry(component, "classToDescribe", classToDescribe); return component; @@ -57,13 +58,13 @@ * classToDescribe class of which a description should be learned. * mandatory: true| reinit necessary: false * default value: null -* @return String +* @return URL **/ -public String getClassToDescribe() { -return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "classToDescribe") ; +public URL getClassToDescribe() { +return (URL) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "classToDescribe") ; } /** -* type Whether to learn an equivalence class or super class axiom or domain/range of a property.. +* type whether to learn an equivalence class or super class axiom. * mandatory: false| reinit necessary: true * default value: equivalence * @return String @@ -77,11 +78,11 @@ * mandatory: true| reinit necessary: false * default value: null **/ -public void setClassToDescribe(String classToDescribe) { +public void setClassToDescribe(URL classToDescribe) { ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "classToDescribe", classToDescribe); } /** -* @param type Whether to learn an equivalence class or super class axiom or domain/range of a property.. +* @param type whether to learn an equivalence class or super class axiom. * mandatory: false| reinit necessary: true * default value: equivalence **/ Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -122,7 +122,7 @@ * @param reasoningService see ReasoningService * @return a component ready for initialization ClassLearningProblem **/ -public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, String classToDescribe) { +public static ClassLearningProblem getClassLearningProblem(ReasonerComponent reasoningService, URL classToDescribe) { return ClassLearningProblemConfigurator.getClassLearningProblem(reasoningService, classToDescribe); } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -70,15 +70,6 @@ public boolean getDefaultNegation() { return (Boolean) ComponentManager.getInstance().getConfigOptionValue(fastInstanceChecker, "defaultNegation") ; } -/** -* forallRetrievalSemantics This option controls how to interpret the all quantifier in orall r.C. The standard option isto return all those which do not have an r-filler not in C. The domain semantics is to use thosewhich are in the domain of r and do not have an r-filler not in C. The forallExists semantics is touse those which have at least one r-filler and do not have an r-filler not in C.. -* mandatory: false| reinit necessary: true -* default value: standard -* @return String -**/ -public String getForallRetrievalSemantics() { -return (String) ComponentManager.getInstance().getConfigOptionValue(fastInstanceChecker, "forallRetrievalSemantics") ; -} /** * @param reasonerType FaCT++ or Pellet to dematerialize. @@ -98,15 +89,6 @@ ComponentManager.getInstance().applyConfigEntry(fastInstanceChecker, "defaultNegation", defaultNegation); reinitNecessary = true; } -/** -* @param forallRetrievalSemantics This option controls how to interpret the all quantifier in orall r.C. The standard option isto return all those which do not have an r-filler not in C. The domain semantics is to use thosewhich are in the domain of r and do not have an r-filler not in C. The forallExists semantics is touse those which have at least one r-filler and do not have an r-filler not in C.. -* mandatory: false| reinit necessary: true -* default value: standard -**/ -public void setForallRetrievalSemantics(String forallRetrievalSemantics) { -ComponentManager.getInstance().applyConfigEntry(fastInstanceChecker, "forallRetrievalSemantics", forallRetrievalSemantics); -reinitNecessary = true; -} /** * true, if this component needs reinitializsation. Modified: trunk/src/dl-learner/org/dllearner/core/options/URLConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/URLConfigOption.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/core/options/URLConfigOption.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -33,6 +33,8 @@ private boolean refersToFile = false; + private boolean refersToOWLClass = false; + public URLConfigOption(String name, String description) { super(name, description); } @@ -64,6 +66,23 @@ this.refersToFile = refersToFile; } + /** + * Returns whether the URI can refer to a class in a loaded + * ontology. This can be used in user interfaces for this component. + * @return the refersToOWLClass Whether it refers to an OWL class. + */ + public boolean refersToOWLClass() { + return refersToOWLClass; + } + + /** + * @param refersToFile Set whether this option refers to an OWL class in the + * loaded ontology. + */ + public void setRefersToOWLClass(boolean refersToOWLClass) { + this.refersToOWLClass = refersToOWLClass; + } + /* (non-Javadoc) * @see org.dllearner.core.config.ConfigOption#checkType(java.lang.Object) */ Modified: trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/core/owl/NamedClass.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -19,6 +19,7 @@ */ package org.dllearner.core.owl; +import java.net.URI; import java.util.Map; import org.dllearner.utilities.Helper; @@ -38,6 +39,10 @@ this.name = name; } + public NamedClass(URI uri) { + this.name = uri.toString(); + } + public String getName() { return name; } Modified: trunk/src/dl-learner/org/dllearner/gui/StartGUI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/gui/StartGUI.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -46,6 +46,7 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; +import org.dllearner.algorithms.el.ELLearningAlgorithm; import org.dllearner.algorithms.refinement2.ROLComponent2; import org.dllearner.core.Component; import org.dllearner.core.KnowledgeSource; @@ -55,7 +56,9 @@ import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.reasoning.FastRetrievalReasoner; /** * This class builds the basic GUI elements and is used to start the DL-Learner @@ -127,9 +130,15 @@ List<Class<? extends Component>> ignoredKnowledgeSources = new LinkedList<Class<? extends Component>>(); ignoredKnowledgeSources.add(OWLAPIOntology.class); panels[0] = new ComponentPanel(config, this, KnowledgeSource.class, OWLFile.class, ignoredKnowledgeSources); - panels[1] = new ComponentPanel(config, this, ReasonerComponent.class, FastInstanceChecker.class); - panels[2] = new ComponentPanel(config, this, LearningProblem.class, PosNegLPStandard.class); - panels[3] = new ComponentPanel(config, this, LearningAlgorithm.class, ROLComponent2.class); + List<Class<? extends Component>> ignoredReasoners = new LinkedList<Class<? extends Component>>(); + ignoredReasoners.add(FastRetrievalReasoner.class); + panels[1] = new ComponentPanel(config, this, ReasonerComponent.class, FastInstanceChecker.class, ignoredReasoners); + List<Class<? extends Component>> ignoredLearningProblems = new LinkedList<Class<? extends Component>>(); + ignoredLearningProblems.add(PosNegLPStrict.class); + panels[2] = new ComponentPanel(config, this, LearningProblem.class, PosNegLPStandard.class, ignoredLearningProblems); + List<Class<? extends Component>> ignoredAlgorithms = new LinkedList<Class<? extends Component>>(); + ignoredAlgorithms.add(ELLearningAlgorithm.class); + panels[3] = new ComponentPanel(config, this, LearningAlgorithm.class, ROLComponent2.class, ignoredAlgorithms); runPanel = new RunPanel(config, this); // add tabs for panels Modified: trunk/src/dl-learner/org/dllearner/gui/StatusPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/StatusPanel.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/gui/StatusPanel.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -34,7 +34,7 @@ private static final long serialVersionUID = 2426470148153461670L; - private String tabInitText = "Please fill in the mandatory config options and proceed to the next tab."; + private String tabInitText = "<html>Please fill in the mandatory config options and proceed to the next tab.<br />(Move the mouse over an option name to view a short description of it.)</html>"; private String tabCompleteText = "All mandatory options filled in. You can continue to the next tab."; Modified: trunk/src/dl-learner/org/dllearner/gui/TutorialWindow.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/TutorialWindow.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/gui/TutorialWindow.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -42,7 +42,7 @@ setTitle("Quick Tutorial"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setLocationByPlatform(true); - setSize(300, 600); + setSize(525, 600); setVisible(true); getContentPane().setLayout(new BorderLayout()); Modified: trunk/src/dl-learner/org/dllearner/gui/tutorial.html =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/tutorial.html 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/gui/tutorial.html 2009-05-05 10:01:50 UTC (rev 1733) @@ -23,6 +23,27 @@ special role: It is used to start the learning algorithm and display statistical information. </p><br /> + +<p> +<i>Example:</i><br /> +Suppose you want to learn the definition of a class in an existing ontology. In this case, +you can proceed as follows:<br /> +1. In the tab "Knowledge Source", choose an OWL file containing your ontology.<br /> +2. Click on the tab "Reasoner". We recommend to the defaults unchanged here, but you + are free to modify the settings and choose the reasoner you like.<br /> +3. Click on the tab "Learning Problem". This may take a while, since the reasoner will now + read the ontology you specified in step 1. Since you want to learn the definition of a class, + use the drop down box and select "Class Learning Problem". After this, set the value of + the option "classToDescribe" to the desired class.<br /> +4. Click on the "Learning Algorithm" tab. Here, you can select a learning algorithm and + modify its settings. If you are unsure what to do, just stick with the default values.<br /> +5. Click on the "Run" tab and press the "Start" button. The algorithm is now running + and the currently best solutions found are displayed in the panel below (using Manchester + OWL Syntax) along with some reasoning statistics. Depending on the learning algorithm + and settings, the run may not terminate (in reasonable time). In such a case you can use + the "Stop" button to gracefully stop the algorithm.<br /> +For explanations of components in each step, please consult the DL-Learner manual. +</p><br /> <p> <i>Tab heads explanation:</i><br /> @@ -33,6 +54,7 @@ <p><i>Further references:</i><br /> Homepage: <a href="http://dl-learner.org">http://dl-learner.org</a><br /> +DL-Learner Manual: <a href="http://dl-learner.org/files/dl-learner-manual.pdf">http://dl-learner.org/files/dl-learner-manual.pdf</a><br /> DL-Learner Architecture: <a href="http://dl-learner.org/wiki/Architecture">http://dl-learner.org/wiki/Architecture</a> </p><br /> Modified: trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -23,14 +23,22 @@ import java.awt.event.ActionListener; import java.net.MalformedURLException; import java.net.URL; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; import javax.swing.JButton; +import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JTextField; import org.dllearner.core.Component; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.ClassLearningProblemConfigurator; import org.dllearner.core.options.URLConfigOption; +import org.dllearner.core.owl.NamedClass; import org.dllearner.gui.Config; import org.dllearner.gui.ExampleFileChooser; import org.dllearner.kb.OWLFile; @@ -51,6 +59,9 @@ private URL value; private JTextField stringField; + private JComboBox comboBox; + private List<NamedClass> classes; + /** * Provides a widget for URL options. * @@ -97,6 +108,16 @@ e1.printStackTrace(); } fireValueChanged(value); + } else if (e.getSource() == comboBox) { + // pick the selected class + NamedClass clazz = classes.get(comboBox.getSelectedIndex()); + try { + value = new URL(clazz.getName()); + } catch (MalformedURLException e1) { + // cannot happen + e1.printStackTrace(); + } + fireValueChanged(value); } } @@ -107,30 +128,45 @@ // get current value of this option for the given component value = config.getConfigOptionValue(component, configOption); - // text field for strings - stringField = new JTextField(35); - if (value != null) { - stringField.setText(value.toString()); - } - stringField.setToolTipText(configOption.getAllowedValuesDescription()); + // if the option value is an OWL class, we offer a dropdown box + if(((URLConfigOption) configOption).refersToOWLClass()) { + comboBox = new JComboBox(); + ReasonerComponent reasoner = config.getReasoner(); + String baseURI = reasoner.getBaseURI(); + Map<String,String> prefixes = reasoner.getPrefixes(); + classes = new LinkedList<NamedClass>(reasoner.getNamedClasses()); + for(NamedClass clazz : classes) { + comboBox.addItem(clazz.toManchesterSyntaxString(baseURI, prefixes)); + } + comboBox.addActionListener(this); + comboBox.setSelectedIndex(0); + add(comboBox); + } else { + // text field for strings + stringField = new JTextField(35); + if (value != null) { + stringField.setText(value.toString()); + } + stringField.setToolTipText(configOption.getAllowedValuesDescription()); - // set button (value is only updated when this button is pressed => - // would better without set) - setButton = new JButton("Set"); - setButton.addActionListener(this); + // set button (value is only updated when this button is pressed => + // would be better without set) + setButton = new JButton("Set"); + setButton.addActionListener(this); - add(stringField); - add(setButton); + add(stringField); + add(setButton); - // if the URL can refer to a file, we add the possibility to - // choose a local file - if (((URLConfigOption) configOption).refersToFile()) { - chooseLocalButton = new JButton("Choose Local File"); - chooseLocalButton.addActionListener(this); - add(new JLabel(" or ")); - add(chooseLocalButton); + // if the URL can refer to a file, we add the possibility to + // choose a local file + if (((URLConfigOption) configOption).refersToFile()) { + chooseLocalButton = new JButton("Choose Local File"); + chooseLocalButton.addActionListener(this); + add(new JLabel(" or ")); + add(chooseLocalButton); + } } - + } } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -33,6 +33,7 @@ import org.dllearner.core.configurators.ClassLearningProblemConfigurator; import org.dllearner.core.options.ConfigOption; import org.dllearner.core.options.StringConfigOption; +import org.dllearner.core.options.URLConfigOption; import org.dllearner.core.owl.Axiom; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.EquivalentClassesAxiom; @@ -74,8 +75,10 @@ public static Collection<ConfigOption<?>> createConfigOptions() { Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - options.add(new StringConfigOption("classToDescribe", "class of which a description should be learned", null, true, false)); - StringConfigOption type = new StringConfigOption("type", "Whether to learn an equivalence class or super class axiom or domain/range of a property.","equivalence"); + URLConfigOption classToDescribeOption = new URLConfigOption("classToDescribe", "class of which a description should be learned", null, true, false); + classToDescribeOption.setRefersToOWLClass(true); + options.add(classToDescribeOption); + StringConfigOption type = new StringConfigOption("type", "whether to learn an equivalence class or super class axiom","equivalence"); // or domain/range of a property. type.setAllowedValues(new String[] {"equivalence", "superClass"}); // , "domain", "range"}); options.add(type); return options; @@ -87,7 +90,8 @@ @Override public void init() throws ComponentInitException { - classToDescribe = new NamedClass(configurator.getClassToDescribe()); + classToDescribe = new NamedClass(configurator.getClassToDescribe().toString()); + if(!reasoner.getNamedClasses().contains(classToDescribe)) { throw new ComponentInitException("The class \"" + configurator.getClassToDescribe() + "\" does not exist. Make sure you spelled it correctly."); } Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2009-05-04 13:47:49 UTC (rev 1732) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2009-05-05 10:01:50 UTC (rev 1733) @@ -162,7 +162,7 @@ forallSemantics.setAllowedValues(new String[] { "standard", "domain", "forallExists" }); // closure option? see: // http://owlapi.svn.sourceforge.net/viewvc/owlapi/owl1_1/trunk/tutorial/src/main/java/uk/ac/manchester/owl/tutorial/examples/ClosureAxiomsExample.java?view=markup - options.add(forallSemantics); +// options.add(forallSemantics); return options; } @@ -586,9 +586,9 @@ // \forall restrictions are difficult to handle; assume we want to check // \forall hasChild.male with domain(hasChild)=Person; then for all non-persons // this is satisfied trivially (all of their non-existing children are male) - if(!configurator.getForallRetrievalSemantics().equals("standard")) { - throw new Error("Only forallExists semantics currently implemented."); - } +// if(!configurator.getForallRetrievalSemantics().equals("standard")) { +// throw new Error("Only forallExists semantics currently implemented."); +// } // problem: we need to make sure that \neg \exists r.\top \equiv \forall r.\bot // can still be reached in an algorithm (\forall r.\bot \equiv \bot under forallExists This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-05-04 13:56:11
|
Revision: 1732 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1732&view=rev Author: lorenz_b Date: 2009-05-04 13:47:49 +0000 (Mon, 04 May 2009) Log Message: ----------- fixed error Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java 2009-05-04 12:25:17 UTC (rev 1731) +++ trunk/src/dl-learner/org/dllearner/tools/ore/RepairPanelDescriptor.java 2009-05-04 13:47:49 UTC (rev 1732) @@ -93,13 +93,15 @@ DefaultListModel negModel = repairPanel.getNegFailureModel(); negModel.clear(); - for(Individual ind : ore.getNewClassDescription().getCoveredNegatives()){ + for(Individual ind : ore.getNewClassDescription().getAdditionalInstances()){ negModel.addElement(ind); } DefaultListModel posModel = repairPanel.getPosFailureModel(); - posModel.clear(); - for(Individual ind : ore.getNewClassDescription().getNotCoveredPositives()){ + posModel.clear();System.out.println(ore.getNewClassDescription().getCoveredInstances()); + Set<Individual> posNotCovered = ore.getOwlReasoner().getIndividuals(ore.getIgnoredConcept()); + posNotCovered.removeAll(ore.getNewClassDescription().getCoveredInstances()); + for(Individual ind : posNotCovered){ posModel.addElement(ind); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-05-04 12:25:22
|
Revision: 1731 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1731&view=rev Author: lorenz_b Date: 2009-05-04 12:25:17 +0000 (Mon, 04 May 2009) Log Message: ----------- fixed error according to new swingx lib Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanel.java trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanelDescriptor.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWL.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -33,6 +33,12 @@ import javax.swing.event.ListSelectionListener; import org.jdesktop.swingx.JXBusyLabel; +import org.jdesktop.swingx.JXList; +import org.jdesktop.swingx.decorator.ColorHighlighter; +import org.jdesktop.swingx.decorator.FilterPipeline; +import org.jdesktop.swingx.decorator.HighlightPredicate; +import org.jdesktop.swingx.decorator.HighlighterFactory; +import org.jdesktop.swingx.decorator.ShuttleSorter; import org.jdesktop.swingx.icon.EmptyIcon; import org.jdesktop.swingx.painter.BusyPainter; @@ -45,7 +51,7 @@ private static final long serialVersionUID = 3026319637264844550L; - private javax.swing.JList conceptList; + private JXList conceptList; private JPanel contentPanel; @@ -94,8 +100,17 @@ JPanel contentPanel1 = new JPanel(); JScrollPane scroll = new JScrollPane(); - - conceptList = new JList(model); + + + conceptList = new JXList(model); + conceptList.setFilterEnabled(true); + conceptList.setFilters(new FilterPipeline(new ShuttleSorter(0, true))); + conceptList.setHighlighters(HighlighterFactory.createSimpleStriping(HighlighterFactory.CLASSIC_LINE_PRINTER)); + conceptList.addHighlighter(new ColorHighlighter( HighlightPredicate.ROLLOVER_ROW)); + conceptList.setRolloverEnabled(true); +// conceptList.setSearchable(new ListsSearchPredicate.MATCH_ALL); +// conceptList.setHighlighters(HighlighterFactory.createAlternateStriping()); + scroll.setPreferredSize(new Dimension(400, 400)); scroll.setViewportView(conceptList); contentPanel1.add(scroll); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ClassPanelOWLDescriptor.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -22,7 +22,6 @@ import javax.swing.event.ListSelectionEvent; - import org.dllearner.core.owl.NamedClass; Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ColumnListCellRenderer.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -32,7 +32,7 @@ import javax.swing.JPanel; import javax.swing.ListCellRenderer; -import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; +import org.dllearner.learningproblems.EvaluatedDescriptionClass; /** * List cell renderer for 2 columns. @@ -58,13 +58,13 @@ JLabel cor = new JLabel(); JLabel desc = new JLabel(); setLayout(new GridBagLayout()); - desc.setText(((EvaluatedDescriptionPosNeg) value).getDescription().toManchesterSyntaxString(ore.getBaseURI(), ore.getPrefixes())); + desc.setText(((EvaluatedDescriptionClass) value).getDescription().toManchesterSyntaxString(ore.getBaseURI(), ore.getPrefixes())); //round accuracy to 2 digits - double accuracy = ((EvaluatedDescriptionPosNeg) value).getAccuracy(); + double accuracy = ((EvaluatedDescriptionClass) value).getAccuracy(); BigDecimal roundedAccuracy = new BigDecimal(accuracy * 100); roundedAccuracy = roundedAccuracy.setScale(2, BigDecimal.ROUND_HALF_UP); - cor.setText(roundedAccuracy.toString()); + cor.setText(String.valueOf(roundedAccuracy)); add(cor, new GridBagConstraints(0, 0, 1, 1, 0.1, 0.0, GridBagConstraints.LINE_END, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));//, BorderLayout.WEST); add(desc, new GridBagConstraints(1, 0, 1, 1, 0.8, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));//, BorderLayout.EAST); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/DescriptionPanel.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -97,7 +97,7 @@ remove(c); } } - ore.updateReasoner(); +// ore.updateReasoner(); correct = true; if (mode.equals("neg")) { for (JLabel jL : ore.descriptionToJLabelNeg(ind, newClassDescription)) { Modified: trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanel.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanel.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -165,6 +165,7 @@ browseButton.addActionListener(l); fileURL.addActionListener(l); sparqlURL.addActionListener(l); + connectButton.addActionListener(l); owl.addActionListener(l); sparql.addActionListener(l); fileURL.getDocument().addDocumentListener(d); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanelDescriptor.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/KnowledgeSourcePanelDescriptor.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -103,6 +103,10 @@ } } + + private void connect2Sparql(){ + + } public void changedUpdate(DocumentEvent e) { Modified: trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanel.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanel.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -87,7 +87,7 @@ JPanel statusPanel = new JPanel(); statusLabel = new JLabel(); loadingLabel = new JXBusyLabel(new Dimension(15, 15)); - BusyPainter<Object> painter = new BusyPainter<Object>( + BusyPainter painter = new BusyPainter( new RoundRectangle2D.Float(0, 0, 6.0f, 2.6f, 10.0f, 10.0f), new Ellipse2D.Float(2.0f, 2.0f, 11.0f, 11.0f)); painter.setTrailLength(2); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanelDescriptor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanelDescriptor.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/LearningPanelDescriptor.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -35,7 +35,7 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; -import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; +import org.dllearner.learningproblems.EvaluatedDescriptionClass; @@ -99,7 +99,7 @@ // Description de = new NamedClass("http://example.com/father#male"); if (!e.getValueIsAdjusting()){ - getWizardModel().getOre().setNewClassDescription(((EvaluatedDescriptionPosNeg) (learnPanel.getResultList().getSelectedValue()))); + getWizardModel().getOre().setNewClassDescription(((EvaluatedDescriptionClass) (learnPanel.getResultList().getSelectedValue()))); } } @@ -113,6 +113,7 @@ learnPanel.getListModel().clear(); learnPanel.getStartButton().setEnabled(false); learnPanel.getStopButton().setEnabled(true); + worker = new LearnSwingWorker(); worker.execute(); } else{ @@ -248,9 +249,7 @@ @Override protected void process(List<List<? extends EvaluatedDescription>> resultLists) { - -// panel4.getModel().clear(); - + for (List<? extends EvaluatedDescription> list : resultLists) { updateList(list); } Modified: trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -33,11 +33,12 @@ import javax.swing.JLabel; -import org.dllearner.algorithms.refinement2.ROLComponent2; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; 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.owl.Description; @@ -48,10 +49,17 @@ import org.dllearner.core.owl.Union; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; -import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; -import org.dllearner.learningproblems.PosNegLPStandard; +import org.dllearner.learningproblems.ClassLearningProblem; +import org.dllearner.learningproblems.EvaluatedDescriptionClass; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.OWLAPIReasoner; +import org.mindswap.pellet.exceptions.InconsistentOntologyException; +import org.mindswap.pellet.owlapi.PelletReasonerFactory; +import org.mindswap.pellet.owlapi.Reasoner; +import org.semanticweb.owl.apibinding.OWLManager; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLOntologyCreationException; +import org.semanticweb.owl.model.OWLOntologyManager; /** * This class contains init methods, and is used as broker between wizard and OWL-API. @@ -63,7 +71,7 @@ private LearningAlgorithm la; private ReasonerComponent rs; private KnowledgeSource ks; - private PosNegLPStandard lp; + private LearningProblem lp; private ComponentManager cm; private ReasonerComponent fastReasoner; @@ -73,7 +81,7 @@ private SortedSet<Individual> negExamples; private NamedClass classToLearn; - private EvaluatedDescriptionPosNeg newClassDescription; + private EvaluatedDescriptionClass newClassDescription; private OntologyModifier modifier; @@ -83,7 +91,9 @@ private double noise = 0.0; + private File owlFile; + public ORE() { cm = ComponentManager.getInstance(); @@ -96,6 +106,7 @@ * Applying knowledge source. */ public void setKnowledgeSource(File f) { + this.owlFile = f; ks = cm.knowledgeSource(OWLFile.class); @@ -115,7 +126,24 @@ } + public boolean consistentOntology() throws InconsistentOntologyException{ + boolean consistent = true; + try { + OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); + OWLOntology ont = manager.loadOntology(owlFile.toURI()); + Reasoner reasoner = new PelletReasonerFactory().createReasoner(manager); + reasoner.loadOntology(ont); + + consistent = reasoner.isConsistent(); + } catch (OWLOntologyCreationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return consistent; + } + /** * Initialize the reasoners. */ @@ -144,16 +172,9 @@ } - /** - * Returns the reasoningservice. - * @return reasoning service - */ - public ReasonerComponent getReasonerComponent(){ - return rs; - } + - public void setPosNegExamples(){ posExamples = owlReasoner.getIndividuals(classToLearn); negExamples = owlReasoner.getIndividuals(); @@ -170,7 +191,7 @@ } - public EvaluatedDescriptionPosNeg getNewClassDescription() { + public EvaluatedDescriptionClass getNewClassDescription() { return newClassDescription; } @@ -192,17 +213,32 @@ } public void setLearningProblem(){ - lp = new PosNegLPStandard(owlReasoner, posExamples, negExamples); - lp.init(); + lp = cm.learningProblem(ClassLearningProblem.class, fastReasoner); + cm.applyConfigEntry(lp, "classToDescribe", classToLearn.toString()); + try { + lp.init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } public void setNoise(double noise){ + System.out.println("setze noise auf" + noise); + cm.applyConfigEntry(la, "noisePercentage", noise); + try { + la.init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } this.noise = noise; } public void setLearningAlgorithm(){ try { - la = cm.learningAlgorithm(ROLComponent2.class, lp, owlReasoner); + la = cm.learningAlgorithm(CELOE.class, lp, fastReasoner); + cm.applyConfigEntry(la, "useNegation", false); } catch (LearningProblemUnsupportedException e1) { // TODO Auto-generated catch block e1.printStackTrace(); @@ -212,8 +248,8 @@ t.add(classToLearn.getName()); - cm.applyConfigEntry(la, "ignoredConcepts", t); - cm.applyConfigEntry(la, "guaranteeXgoodDescriptions", 10); +// cm.applyConfigEntry(la, "ignoredConcepts", t); +// cm.applyConfigEntry(la, "guaranteeXgoodDescriptions", 10); try { la.init(); } catch (ComponentInitException e) { @@ -232,13 +268,13 @@ } public void init(){ - try { - owlReasoner.init(); - fastReasoner.init(); - } catch (ComponentInitException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } +// try { +// owlReasoner.init(); +// fastReasoner.init(); +// } catch (ComponentInitException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } this.setPosNegExamples(); this.setLearningProblem(); this.setLearningAlgorithm(); @@ -251,9 +287,9 @@ */ public void start(){ Set<String> t = new TreeSet<String>(); - t.add(classToLearn.getName()); - cm.applyConfigEntry(la, "ignoredConcepts", t); - cm.applyConfigEntry(la, "noisePercentage", noise); +// t.add(classToLearn.getName()); +// cm.applyConfigEntry(la, "ignoredConcepts", t); +// cm.applyConfigEntry(la, "noisePercentage", noise); try { la.init(); } catch (ComponentInitException e) { @@ -265,7 +301,7 @@ } - public void setNewClassDescription(EvaluatedDescriptionPosNeg newClassDescription) { + public void setNewClassDescription(EvaluatedDescriptionClass newClassDescription) { this.newClassDescription = newClassDescription; } @@ -517,7 +553,7 @@ // TODO Auto-generated catch block e.printStackTrace(); } -// rs = cm.reasoningService(owlReasoner); + setLearningAlgorithm(); } @@ -538,7 +574,7 @@ } } } -// System.out.println("Disjunkt sind: " + complements); + System.out.println("Disjunkt sind: " + complements); return complements; } @@ -546,29 +582,55 @@ public static void main(String[] args){ - final ORE test = new ORE(); + try{ + ComponentManager cm = ComponentManager.getInstance(); - File owlFile1 = new File("examples/ore/people+pets.owl"); - File owlFile2 = new File("examples/ore/inconsistent.owl"); - File owlFile3 = new File("examples/ore/incohaerent.owl"); + // create knowledge source + KnowledgeSource source = cm.knowledgeSource(OWLFile.class); + String example = "examples/ore/inconsistent.owl"; + cm.applyConfigEntry(source, "url", new File(example).toURI().toURL()); + source.init(); - test.setKnowledgeSource(owlFile1); - test.initReasoners(); - System.out.println(test.owlReasoner.isSatisfiable()); + // create OWL API reasoning service with standard settings + ReasonerComponent reasoner = cm.reasoner(OWLAPIReasoner.class, source); + reasoner.init(); - test.setKnowledgeSource(owlFile2); - test.initReasoners(); - System.out.println(test.owlReasoner.isSatisfiable()); + // create a learning problem and set positive and negative examples + LearningProblem lp = cm.learningProblem(ClassLearningProblem.class, reasoner); +// cm.applyConfigEntry(lp, "type", "superClass"); + cm.applyConfigEntry(lp, "classToDescribe", "http://cohse.semanticweb.org/ontologies/people#mad+cow"); + lp.init(); - test.setKnowledgeSource(owlFile3); - test.initReasoners(); - System.out.println(test.owlReasoner.isSatisfiable()); + // create the learning algorithm + LearningAlgorithm la = null; + try { + la = cm.learningAlgorithm(CELOE.class, lp, reasoner); + la.init(); + } catch (LearningProblemUnsupportedException e) { + e.printStackTrace(); + } + + // start the algorithm and print the best concept found + la.start(); + + System.out.println(la.getCurrentlyBestEvaluatedDescriptions(10, 0.8, true)); + } catch (MalformedURLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } +} - } + + } + + // public static void main(String[] args){ // Modified: trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -486,7 +486,7 @@ //superclasses and class1 // Set<OWLDescription> superClasses1 = owlClass1.getSuperClasses(ontology); Set<OWLDescription> superClasses1 = new HashSet<OWLDescription>(); - for(Description d1 : rs.getSuperClasses(desc1)){ + for(Description d1 : reasoner.getSuperClasses(desc1)){ superClasses1.add(OWLAPIDescriptionConvertVisitor.getOWLDescription(d1)); } superClasses1.add(owlClass1); @@ -495,7 +495,7 @@ //superclasses and class2 // Set<OWLDescription> superClasses2 = owlClass2.getSuperClasses(ontology); Set<OWLDescription> superClasses2 = new HashSet<OWLDescription>(); - for(Description d2 : rs.getSuperClasses(desc2)){ + for(Description d2 : reasoner.getSuperClasses(desc2)){ superClasses2.add(OWLAPIDescriptionConvertVisitor.getOWLDescription(d2)); } superClasses2.add(owlClass2); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/StatsPanel.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -206,7 +206,7 @@ for(String i : value){ actionPane.add(new JLabel("<html><strike>" + i + "</strike></html>")); } - actionPane.setExpanded(false); + actionPane.setCollapsed(false); propertyPane.add(actionPane); } else if(newPropMap.keySet().contains(key)){ JXTaskPane actionPane = new JXTaskPane(); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-05-04 11:38:19 UTC (rev 1730) +++ trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java 2009-05-04 12:25:17 UTC (rev 1731) @@ -25,13 +25,18 @@ import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; +import java.util.logging.Level; import javax.swing.DefaultListModel; +import javax.swing.Icon; import javax.swing.JOptionPane; import javax.swing.SwingWorker; +import javax.swing.UIManager; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.NamedClass; +import org.jdesktop.swingx.JXErrorPane; +import org.jdesktop.swingx.error.ErrorInfo; import org.semanticweb.owl.model.OWLOntologyChange; /** @@ -92,13 +97,24 @@ if(nextPanelDescriptor.equals("CLASS_CHOOSE_OWL_PANEL")){ // model.getOre().getOwlReasoner().isSatisfiable() - + if(!ore.consistentOntology()){ + Exception e = new Exception("ff"); + ErrorInfo info = new ErrorInfo("Inconsistent ontology", "2", "3", null, e, Level.ALL, null); + JXErrorPane error = new JXErrorPane(); + Icon icon = UIManager.getIcon("JOptionPane.errorIcon"); + error.setErrorInfo(info); + error.setIcon(icon);System.out.println(icon); + JXErrorPane.showDialog(wizard.getDialog(), error); + + + } ((ClassPanelOWLDescriptor) nextDescriptor).getOwlClassPanel().getModel().clear(); new ConceptRetriever(nextPanelDescriptor).execute(); } if(nextPanelDescriptor.equals("LEARNING_PANEL")){ ore.init(); +// ore.get LearningPanelDescriptor learnDescriptor = ((LearningPanelDescriptor) model.getPanelHashMap().get(nextPanelDescriptor)); learnDescriptor.setPanelDefaults(); @@ -266,6 +282,7 @@ class ConceptRetriever extends SwingWorker<Set<NamedClass>, NamedClass> { private Object nextPanelID; private ClassPanelOWL owlClassPanel; + private Set<NamedClass> unsatClasses; public ConceptRetriever(Object nextPanelDescriptor) { @@ -278,14 +295,14 @@ owlClassPanel.getStatusLabel().setText("Loading atomic classes"); owlClassPanel.getLoadingLabel().setBusy(true); - owlClassPanel.getList().setCellRenderer(new ColorListCellRenderer(wizard.getModel().getOre())); +// owlClassPanel.getList().setCellRenderer(new ColorListCellRenderer(wizard.getModel().getOre())); wizard.getModel().getOre().initReasoners(); - Set<NamedClass> ind = wizard.getModel().getOre().getOwlReasoner().getNamedClasses(); - + Set<NamedClass> classes = wizard.getModel().getOre().getOwlReasoner().getNamedClasses(); + unsatClasses = wizard.getModel().getOre().getOwlReasoner().getInconsistentClasses(); - return ind; + return classes; } @Override @@ -307,6 +324,7 @@ for (NamedClass cl : ind) { dm.addElement(cl); + //nextPanel.panel3.getModel().addElement(cl); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-05-04 11:38:26
|
Revision: 1730 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1730&view=rev Author: heeroyuy Date: 2009-05-04 11:38:19 +0000 (Mon, 04 May 2009) Log Message: ----------- -fixed problem that learned classes stay stored after closing the plugin Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-05-01 07:52:00 UTC (rev 1729) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-05-04 11:38:19 UTC (rev 1730) @@ -416,10 +416,13 @@ */ public void changeDLLearnerDescriptionsToOWLDescriptions( Description descript) { + ds.clear(); + owlDescription.clear(); setNewConceptOWLAPI(descript); oldConceptOWLAPI = OWLAPIDescriptionConvertVisitor .getOWLDescription(currentConcept); ds.add(oldConceptOWLAPI); + System.out.println("Test: " + ds); OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLDataFactory factory = manager.getOWLDataFactory(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2009-05-01 07:52:03
|
Revision: 1729 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1729&view=rev Author: lorenz_b Date: 2009-05-01 07:52:00 +0000 (Fri, 01 May 2009) Log Message: ----------- lib update fixes some bugs while retrieving explanations pellet rc 6 swingx 0.9.7 Modified Paths: -------------- trunk/lib/owlapi/owlapi-bin.jar trunk/lib/pellet/pellet-core.jar trunk/lib/pellet/pellet-datatypes.jar trunk/lib/pellet/pellet-el.jar trunk/lib/pellet/pellet-explanation.jar trunk/lib/pellet/pellet-owlapi.jar trunk/lib/pellet/pellet-rules.jar Added Paths: ----------- trunk/lib/ore-tool/swingx-0.9.7.jar trunk/lib/pellet/pellet-modularity.jar Removed Paths: ------------- trunk/lib/ore-tool/swingx-0.9.2.jar Deleted: trunk/lib/ore-tool/swingx-0.9.2.jar =================================================================== (Binary files differ) Added: trunk/lib/ore-tool/swingx-0.9.7.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/ore-tool/swingx-0.9.7.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/lib/owlapi/owlapi-bin.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-core.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-datatypes.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-el.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-explanation.jar =================================================================== (Binary files differ) Added: trunk/lib/pellet/pellet-modularity.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/pellet/pellet-modularity.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/lib/pellet/pellet-owlapi.jar =================================================================== (Binary files differ) Modified: trunk/lib/pellet/pellet-rules.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-04-29 11:31:03
|
Revision: 1728 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1728&view=rev Author: heeroyuy Date: 2009-04-29 11:30:53 +0000 (Wed, 29 Apr 2009) Log Message: ----------- -add message when learning algorithm runs Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-04-25 13:29:42 UTC (rev 1727) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-04-29 11:30:53 UTC (rev 1728) @@ -106,7 +106,8 @@ model.setLearningProblem(); model.setLearningAlgorithm(); view.getRunButton().setEnabled(false); - view.renderErrorMessage("learning\nstarted"); + view.getHintPanel().setForeground(Color.RED); + view.setHintMessage("learning started"); retriever = new SuggestionRetriever(); retriever.execute(); // model.setCurrentConcept(null); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-25 13:29:42 UTC (rev 1727) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-29 11:30:53 UTC (rev 1728) @@ -468,16 +468,20 @@ * This method sets the run button enable after learning. */ public void algorithmTerminated() { - String error = "learning\nsuccessful"; + String error = "learning successful\n"; + hint.setForeground(Color.RED); + setHintMessage(error); String message = ""; if(isInconsistent) { - message = "Class expressions marked red will lead to an inconsistent ontology. \nPlease double click on them to view detail information."; + message ="Class expressions marked red will lead to an inconsistent ontology. \nPlease double click on them to view detail information."; } else { - message = "To view details about why a class expression was suggested, please click on it."; + message ="To view details about why a class expression was suggested, please click on it."; } run.setEnabled(true); // start the algorithm and print the best concept found - renderErrorMessage(error); + //renderErrorMessage(error); + hint.setForeground(Color.BLACK); + hint.append(message); setHintMessage(message); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-25 13:29:45
|
Revision: 1727 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1727&view=rev Author: jenslehmann Date: 2009-04-25 13:29:42 +0000 (Sat, 25 Apr 2009) Log Message: ----------- Protege plugin release preparations Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/tools/protege/protege-4.0.110.zip Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-25 09:49:53 UTC (rev 1726) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-25 13:29:42 UTC (rev 1727) @@ -29,6 +29,7 @@ import java.net.URL; import java.net.URLConnection; import java.util.Collection; +import java.util.Date; import java.util.LinkedList; import org.dllearner.kb.sparql.SparqlEndpoint; @@ -114,7 +115,7 @@ counter++; if(counter % 1000 == 0) { - System.out.println(counter + " points processed. " + matches + " matches found."); + System.out.println(new Date().toString() + ": " + counter + " points processed. " + matches + " matches found."); } itemCount = 0; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL 2009-04-25 09:49:53 UTC (rev 1726) +++ trunk/src/dl-learner/org/dllearner/tools/protege/INSTALL 2009-04-25 13:29:42 UTC (rev 1727) @@ -1,16 +1,15 @@ Requirements ============ -Java 6 and the Protégé 4.0 Beta are required. (All other libraries are included in the release.) +Java 6 and the Protégé 4.0 Beta are required. (All other libraries are +included in the release.) Installation ============ -Put the DL-Learner-protege-plugin.jar in your plugin folder of Protégé. +Put the DL-Learner-protege-plugin.jar in your plugin folder of Protégé. +(The plugin is also included in the Protégé plugin repository, so you +can install it within Protégé.) Running Instructions ==================== -To use the plugin go to view --> class views and click on class descriptions (including DL-Learner plugin). -Put the new frame somewhere in the classes tab in Protégé and close the old class description view. All features are included in the plugin. - -If you have problems look at the screen cast: http://dl-learner.org/wiki/ProtegePlugin. - - +Please have a look at the wiki page and screen cast: +http://dl-learner.org/wiki/ProtegePlugin. Deleted: trunk/src/dl-learner/org/dllearner/tools/protege/protege-4.0.110.zip =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-04-25 09:49:54
|
Revision: 1726 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1726&view=rev Author: heeroyuy Date: 2009-04-25 09:49:53 +0000 (Sat, 25 Apr 2009) Log Message: ----------- -corrected spelling mistake Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-04-23 10:19:45 UTC (rev 1725) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-04-25 09:49:53 UTC (rev 1726) @@ -369,7 +369,7 @@ g2D.setColor(Color.YELLOW); g2D.fillOval(65, 211, 9, 9); g2D.setColor(darkRed); - g2D.drawString("covers the same instances.", 95, 220); + g2D.drawString("cover the same instances.", 95, 220); } this.setVisible(true); panel.repaint(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-04-23 10:19:46
|
Revision: 1725 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1725&view=rev Author: heeroyuy Date: 2009-04-23 10:19:45 +0000 (Thu, 23 Apr 2009) Log Message: ----------- -fixed error in ReadingOntologyThread Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-04-21 18:31:13 UTC (rev 1724) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-04-23 10:19:45 UTC (rev 1725) @@ -155,6 +155,7 @@ // This is a List of evaluated descriptions to get more information of the // suggested concept private List<? extends EvaluatedDescription> evalDescriptions; + private boolean isReasonerSet; /** * This is the constructor for DL-Learner model. @@ -168,7 +169,7 @@ */ public DLLearnerModel(OWLEditorKit editorKit, DLLearnerView view) { editor = editorKit; - + isReasonerSet = false; this.view = view; ontologyConsistent = true; owlDescription = new HashSet<OWLDescription>(); @@ -191,7 +192,6 @@ alreadyLearned = false; setKnowledgeSource(); setReasoner(); - } /** @@ -225,6 +225,7 @@ reasoner.init(); reasoner.isSatisfiable(); view.setIsInconsistent(false); + isReasonerSet = true; } catch (ComponentInitException e) { // TODO Auto-generated catch block System.out.println("fehler!!!!!!!!!"); @@ -494,6 +495,10 @@ public String getID() { return id; } + + public boolean isReasonerSet() { + return isReasonerSet; + } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-21 18:31:13 UTC (rev 1724) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-23 10:19:45 UTC (rev 1725) @@ -120,6 +120,7 @@ private static final int SCROLL_WIDTH = 600; private static final int SCROLL_HEIGHT = 400; private boolean toogled = false; + private String labels; /** * The constructor for the DL-Learner tab in the class description @@ -130,6 +131,7 @@ */ public DLLearnerView(OWLEditorKit editor) { editorKit = editor; + labels = ""; model = new DLLearnerModel(editorKit, this); sugPanel = new SuggestClassPanel(); learnerPanel = new JPanel(); @@ -162,7 +164,6 @@ accept.setPreferredSize(new Dimension(70, 40)); run.setPreferredSize(new Dimension(260, 30)); advanced.setName("Advanced"); - model.initReasoner(); learnerScroll.setPreferredSize(new Dimension(SCROLL_WIDTH, SCROLL_HEIGHT)); learnerScroll.getVerticalScrollBar().setUnitIncrement(SCROLL_SPEED); posPanel = new PosAndNegSelectPanel(model, action); @@ -192,14 +193,26 @@ * This Method renders the view of the plugin. */ public void makeView(String label) { + run.setEnabled(false); + String currentConcept = editorKit.getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass().toString(); + if(!labels.equals(currentConcept)) { + readThread = new ReadingOntologyThread(editorKit, this, model); + } + if(!readThread.isAlive() && !labels.equals(currentConcept)) { + readThread.start(); + } + if(readThread.hasIndividuals()) { + run.setEnabled(true); + } + labels = currentConcept; run.setText("suggest " + label + " expression"); GridBagConstraints c = new GridBagConstraints(); learner.remove(detail); model.setID(label); runPanel.add(BorderLayout.WEST, run); runPanel.add(BorderLayout.EAST, wikiPane); - run.setEnabled(false); + c.anchor = GridBagConstraints.FIRST_LINE_START; c.gridx = 0; c.weightx = 0.0; @@ -261,10 +274,8 @@ detail.unsetPanel(); learnerPanel.setPreferredSize(new Dimension(WIDTH, HEIGHT)); detail.setVisible(false); - hint.setText(""); isInconsistent = false; - readThread = new ReadingOntologyThread(editorKit, this, model); - readThread.start(); + hint.setVisible(true); action.resetToggled(); detail.setVisible(true); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java 2009-04-21 18:31:13 UTC (rev 1724) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ProtegePlugin.java 2009-04-23 10:19:45 UTC (rev 1725) @@ -70,11 +70,6 @@ @Override public void initialise() throws Exception { view = new DLLearnerView(super.getOWLEditorKit()); - if(this.getAxiomType().toString().equals(EQUIVALENT_CLASS_STRING)) { - view.makeView("equivalent class"); - } else if(this.getAxiomType().toString().equals(SUPERCLASS_STRING)) { - view.makeView("super class"); - } } @Override Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-04-21 18:31:13 UTC (rev 1724) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-04-23 10:19:45 UTC (rev 1725) @@ -96,6 +96,7 @@ // individuals of // the concept currentConcept = concept; + if (reasoner.getIndividuals(concept) != null) { if (reasoner.getIndividuals(concept).size() > 0) { hasIndividuals = true; @@ -160,12 +161,16 @@ @Override public void run() { - model.getSuggestModel().removeAllElements(); - //model.initReasoner(); + String loading ="loading instances..."; + view.getHintPanel().setForeground(Color.RED); + view.setHintMessage(loading); + if(!model.isReasonerSet()) { + model.setKnowledgeSource(); + model.setReasoner(); + } reasoner = model.getReasoner(); isInconsistent = false; if(!isInconsistent) { - this.checkURI(); this.setPositiveConcept(); if (this.hasIndividuals()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-04-21 18:31:23
|
Revision: 1724 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1724&view=rev Author: heeroyuy Date: 2009-04-21 18:31:13 +0000 (Tue, 21 Apr 2009) Log Message: ----------- -added protege including dl-learner plugin for testing purpose Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/protege/protege-4.0.110.zip Added: trunk/src/dl-learner/org/dllearner/tools/protege/protege-4.0.110.zip =================================================================== (Binary files differ) Property changes on: trunk/src/dl-learner/org/dllearner/tools/protege/protege-4.0.110.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-21 17:40:51
|
Revision: 1723 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1723&view=rev Author: jenslehmann Date: 2009-04-21 17:40:47 +0000 (Tue, 21 Apr 2009) Log Message: ----------- negative lat/long now working Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-21 17:11:00 UTC (rev 1722) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-21 17:40:47 UTC (rev 1723) @@ -296,9 +296,6 @@ return null; // use Tripliy spatial extension } else { - if(dbpediaPoint.getGeoLat() < 0 || dbpediaPoint.getGeoLong() < 0) { - return null; - } if(!quiet) System.out.println(dbpediaPoint.getLabel()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-21 17:11:11
|
Revision: 1722 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1722&view=rev Author: jenslehmann Date: 2009-04-21 17:11:00 +0000 (Tue, 21 Apr 2009) Log Message: ----------- avoid computerized scientific notation in double representation hacked Triplify to avoid limited output Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-21 13:06:39 UTC (rev 1721) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-21 17:11:00 UTC (rev 1722) @@ -93,8 +93,8 @@ String label = null; String[] classes = null; int decimalCount = 0; - double geoLat = 0; - double geoLong = 0; + Double geoLat = null; + Double geoLong = null; while ((line = br.readLine()) != null) { @@ -124,15 +124,23 @@ case 1 : label = line; break; case 2 : classes = line.substring(1, line.length()).split(","); break; case 3 : - geoLat = new Double(line); + geoLat = new Double(line); + // we avoid "computerized scientific notation" e.g. 9.722222457639873E-4 + // since it causes problems in the REST interface + if(geoLat.toString().contains("E")) { + geoLat = 0.0; + } decimalCount = 0; String[] tmp = line.split("."); if(tmp.length == 2) { decimalCount = tmp[1].length(); } break; - case 4: geoLong = new Double(line); + case 4: geoLong = new Double(line); + if(geoLong.toString().contains("E")) { + geoLong = 0.0; } + } itemCount++; } @@ -295,7 +303,7 @@ if(!quiet) System.out.println(dbpediaPoint.getLabel()); - URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/near/"+dbpediaPoint.getGeoLat()+","+dbpediaPoint.getGeoLong()+"/"+distanceThresholdMeters); + URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/nearhacked/"+dbpediaPoint.getGeoLat()+","+dbpediaPoint.getGeoLong()+"/"+distanceThresholdMeters); double highestScore = 0; String bestURI = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-21 13:06:42
|
Revision: 1721 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1721&view=rev Author: jenslehmann Date: 2009-04-21 13:06:39 +0000 (Tue, 21 Apr 2009) Log Message: ----------- running matching script (needs a lot more tuning) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/Info.java trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java Modified: trunk/src/dl-learner/org/dllearner/Info.java =================================================================== --- trunk/src/dl-learner/org/dllearner/Info.java 2009-04-20 17:32:06 UTC (rev 1720) +++ trunk/src/dl-learner/org/dllearner/Info.java 2009-04-21 13:06:39 UTC (rev 1721) @@ -3,6 +3,6 @@ package org.dllearner; public class Info { - public static final String build = "2009-04-17"; + public static final String build = "2009-04-20"; } \ No newline at end of file Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-20 17:32:06 UTC (rev 1720) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-21 13:06:39 UTC (rev 1721) @@ -24,13 +24,21 @@ import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; +import java.io.InputStreamReader; import java.net.URI; +import java.net.URL; +import java.net.URLConnection; +import java.util.Collection; +import java.util.LinkedList; import org.dllearner.kb.sparql.SparqlEndpoint; import org.dllearner.kb.sparql.SparqlQuery; +import org.dllearner.utilities.Files; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; +import com.wcohen.ss.Jaro; +import com.wcohen.ss.api.StringDistance; /** * Computes owl:sameAs links between DBpedia and LinkedGeoData @@ -41,16 +49,27 @@ */ public class DBpediaLinkedGeoData { - // chose between nt and csv - private static String dbpediaFileFormat = "csv"; + // chose between nt and dat + private static String dbpediaFileFormat = "dat"; private static File dbpediaFile = new File("log/DBpedia_POIs." + dbpediaFileFormat); private static boolean regenerateFile = false; private static File matchingFile = new File("log/DBpedia_GeoData_Links.nt"); + private static File missesFile = new File("log/DBpedia_GeoData_Misses.dat"); + private static double scoreThreshold = 0.8; + private static StringDistance distance = new Jaro(); private static SparqlEndpoint dbpediaEndpoint = SparqlEndpoint.getEndpointLOCALDBpedia(); private static SparqlEndpoint geoDataEndpoint = SparqlEndpoint.getEndpointLOCALGeoData(); + // read in DBpedia ontology such that we perform taxonomy reasoning +// private static ReasonerComponent reasoner = TestOntologies.getTestOntology(TestOntology.DBPEDIA_OWL); +// private static ClassHierarchy hierarchy = reasoner.getClassHierarchy(); + + // true = SPARQL is used for retrieving close points; + // false = Triplify spatial extension is used + private static boolean useSparqlForGettingNearbyPoints = false; + public static void main(String[] args) throws IOException { // download all objects having geo-coordinates from DBpedia if necessary @@ -58,34 +77,66 @@ createDBpediaFile(); } + Files.clearFile(matchingFile); + Files.clearFile(missesFile); FileOutputStream fos = new FileOutputStream(matchingFile, true); + FileOutputStream fosMiss = new FileOutputStream(missesFile, true); // read file point by point BufferedReader br = new BufferedReader(new FileReader(dbpediaFile)); String line; int counter = 0; int matches = 0; + + // temporary variables needed while reading in file + int itemCount = 0; + URI uri = null; + String label = null; + String[] classes = null; + int decimalCount = 0; + double geoLat = 0; + double geoLong = 0; + while ((line = br.readLine()) != null) { - // read line and convert it into an object - String[] parts = line.split(","); - URI uri = URI.create(parts[0]); - String label = parts[1]; - double geoLat = new Double(parts[2]); - double geoLong = new Double(parts[3]); - DBpediaPoint dp = new DBpediaPoint(uri, label, geoLat, geoLong); - - // find match (we assume there is exactly one match) - URI matchURI = findGeoDataMatch(dp); - if(matchURI != null) { - String matchStr = "<" + uri + "> <http://www.w3.org/2002/07/owl#sameAs> <" + matchURI + "> .\n"; - fos.write(matchStr.getBytes()); - matches++; + if(line.isEmpty()) { + DBpediaPoint dp = new DBpediaPoint(uri, label, classes, geoLat, geoLong, decimalCount); + + // find match (we assume there is exactly one match) + URI matchURI = findGeoDataMatch(dp); + if(matchURI == null) { + String missStr = dp.toString() + "\n"; + fosMiss.write(missStr.getBytes()); + } else { + String matchStr = "<" + dp.getUri() + "> <http://www.w3.org/2002/07/owl#sameAs> <" + matchURI + "> .\n"; + fos.write(matchStr.getBytes()); + matches++; + } + counter++; + + if(counter % 1000 == 0) { + System.out.println(counter + " points processed. " + matches + " matches found."); + } + + itemCount = 0; + } else { + switch(itemCount) { + case 0 : uri = URI.create(line); break; + case 1 : label = line; break; + case 2 : classes = line.substring(1, line.length()).split(","); break; + case 3 : + geoLat = new Double(line); + decimalCount = 0; + String[] tmp = line.split("."); + if(tmp.length == 2) { + decimalCount = tmp[1].length(); + } + break; + case 4: geoLong = new Double(line); + } + + itemCount++; } - counter++; - if(counter % 1000 == 0) { - System.out.println(counter + " points processed. " + matches + " matches found."); - } } br.close(); fos.close(); @@ -99,98 +150,194 @@ int offset = 0; int counter = 0; + int points = 0; FileOutputStream fos = new FileOutputStream(dbpediaFile, true); do { counter = 0; // query DBpedia for all objects having geo-coordinates - String queryStr = "SELECT ?object, ?lat, ?long, ?label WHERE {"; + String queryStr = "SELECT ?object, ?lat, ?long, ?label, ?type WHERE {"; queryStr += "?object <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ."; queryStr += "?object <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long ."; - queryStr += "?object rdfs:label ?label . }"; + queryStr += "?object rdfs:label ?label . "; + queryStr += "OPTIONAL { ?object rdf:type ?type . "; + queryStr += "FILTER (!(?type LIKE <http://dbpedia.org/ontology/Resource>)) ."; + queryStr += "FILTER (?type LIKE <http://dbpedia.org/ontology/%>) ."; + queryStr += "} }"; queryStr += "LIMIT " + limit + " OFFSET " + offset; SparqlQuery query = new SparqlQuery(queryStr, dbpediaEndpoint); ResultSet rs = query.send(); + String previousObject = null; + String geoLat = ""; + String geoLong = ""; + String label = ""; + Collection<String> types = new LinkedList<String>(); while(rs.hasNext()) { QuerySolution qs = rs.nextSolution(); String object = qs.get("object").toString(); - String geoLat = qs.getLiteral("lat").getString(); - String geoLong = qs.getLiteral("long").getString(); - String label = qs.getLiteral("label").getString(); - String content = ""; - if(dbpediaFileFormat.equals("nt")) { - content += "<" + object + ">" + " <http://www.w3.org/2000/01/rdf-schema#label> \"" + label + "\" .\n"; - content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#lat> \"" + geoLat + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; - content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#long> \"" + geoLong + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; + if(object.equals(previousObject)) { + // only type has changed compared to previous row + types.add(qs.get("type").toString()); + + // we are only interested in the most special DBpedia class +// NamedClass nc = new NamedClass(typeTmp); +// if(hierarchy.getSubClasses(nc).size()==1) { + // usually there is just one type assigned in the DBpedia ontology +// if(!type.equals("unknown")) { +// throw new Error("two different types for " + object + ": " + type + " and " + typeTmp); +// } +// type = typeTmp; +// } } else { - content += object + ",\"" + label + "\"," + geoLat + "," + geoLong + "\n"; + if(previousObject != null) { + // we have new a new point => write previous point to file + String content = ""; + if(dbpediaFileFormat.equals("nt")) { + content += "<" + previousObject + ">" + " <http://www.w3.org/2000/01/rdf-schema#label> \"" + label + "\" .\n"; + for(String type : types) { + content += "<" + previousObject + ">" + " <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> \"" + type + "\" .\n"; + } + content += "<" + previousObject + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#lat> \"" + geoLat + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; + content += "<" + previousObject + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#long> \"" + geoLong + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; + } else { + content += previousObject + "\n" + label + "\n" + types.toString().replace(" ", "") + "\n" + geoLat + "\n" + geoLong + "\n\n"; + } + + fos.write(content.getBytes()); + + } + + // reset default values + types.clear(); + + // get new data + geoLat = qs.getLiteral("lat").getString(); + geoLong = qs.getLiteral("long").getString(); + label = qs.getLiteral("label").getString(); + if(qs.contains("type")) { + types.add(qs.get("type").toString()); + + // we are only interested in the most special DBpedia class +// NamedClass nc = new NamedClass(typeTmp); +// if(hierarchy.getSubClasses(nc).size()==1) { + // usually there is just one type assigned in the DBpedia ontology +// if(!type.equals("unknown")) { +// throw new Error("two different types for " + object + ": " + type + " and " + typeTmp); +// } +// type = typeTmp; +// } + } + + previousObject = object; + points++; } - - fos.write(content.getBytes()); - + counter++; } offset += limit; - System.out.println(offset + " points queried."); + System.out.println(points + " points queried."); } while(counter == limit); fos.close(); } - private static URI findGeoDataMatch(DBpediaPoint dbpediaPoint) { + private static URI findGeoDataMatch(DBpediaPoint dbpediaPoint) throws IOException { - // get all GeoData points close to the given point -// SparqlQuery query = new SparqlQuery("", geoDataEndpoint); + // 1 degree is about 111 km (depending on the specific point) + int distanceThresholdMeters = 1000; + boolean quiet = true; - /* - int distanceThresholdMeters = 100; - - // use official DBpedia endpoint (switch to db0 later) - SparqlEndpoint endpoint = SparqlEndpoint.getEndpointDBpedia(); - SPARQLTasks st = new SPARQLTasks(endpoint); - - // query latitude and longitude - String query = "SELECT ?lat ?long WHERE { "; - query += "<" + dbpediaURI + "> <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ."; - query += "<" + dbpediaURI + "> <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long . } LIMIT 1"; - - // perform query and read lat and long from results - ResultSet results = st.queryAsResultSet(query); - QuerySolution qs = results.nextSolution(); - String geoLat = qs.getLiteral("lat").getString(); - String geoLong = qs.getLiteral("long").getString(); - - System.out.println("lat: " + geoLat + ", long: " + geoLong); - - URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/near/"+geoLat+","+geoLong+"/"+distanceThresholdMeters); - - // TODO: replace by SPARQL query - - URLConnection conn = linkedGeoDataURL.openConnection(); - BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); - StringBuffer sb = new StringBuffer(); - String line=""; -// int pointID = 0; - while ((line = rd.readLine()) != null) - { - if(line.contains("Auerbach")) { - System.out.println(line); + if(useSparqlForGettingNearbyPoints) { + // TODO: convert from meters to lat/long + double distanceThresholdLat = 0.3; + double distanceThresholdLong = 0.3; + + // create a box around the point + double minLat = dbpediaPoint.getGeoLat() - distanceThresholdLat; + double maxLat = dbpediaPoint.getGeoLat() + distanceThresholdLat; + double minLong = dbpediaPoint.getGeoLong() - distanceThresholdLong; + double maxLong = dbpediaPoint.getGeoLong() + distanceThresholdLong; + + // query all points in the box + String queryStr = "select ?point ?lat ?long ?name where { "; + queryStr += "?point <http://linkedgeodata.org/vocabulary/latitude> ?lat ."; + queryStr += "FILTER (xsd:float(?lat) > " + minLat + ") ."; + queryStr += "FILTER (xsd:float(?lat) < " + maxLat + ") ."; + queryStr += "?point <http://linkedgeodata.org/vocabulary/longitude> ?long ."; + queryStr += "FILTER (xsd:float(?long) > " + minLong + ") ."; + queryStr += "FILTER (xsd:float(?long) < " + maxLong + ") ."; + queryStr += "?point <http://linkedgeodata.org/vocabulary/name> ?name ."; + queryStr += "}"; + + SparqlQuery query = new SparqlQuery(queryStr, geoDataEndpoint); + ResultSet rs = query.send(); + + while(rs.hasNext()) { +// QuerySolution qs = rs.nextSolution(); + + // measure string similarity and proximity + // TODO: incomplete + } + return null; + // use Tripliy spatial extension + } else { + if(dbpediaPoint.getGeoLat() < 0 || dbpediaPoint.getGeoLong() < 0) { + return null; } - sb.append(line); + if(!quiet) + System.out.println(dbpediaPoint.getLabel()); + + URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/near/"+dbpediaPoint.getGeoLat()+","+dbpediaPoint.getGeoLong()+"/"+distanceThresholdMeters); + + double highestScore = 0; + String bestURI = null; + String bestLabel = null; + URLConnection conn = linkedGeoDataURL.openConnection(); + BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); +// StringBuffer sb = new StringBuffer(); + String line=""; + while ((line = rd.readLine()) != null) + { + if(line.contains("<http://linkedgeodata.org/vocabulary#name>") || line.contains("<http://linkedgeodata.org/vocabulary/#name%25en>")) { + int first = line.indexOf("\"") + 1; + int last = line.lastIndexOf("\""); + String label = line.substring(first, last); + + // perform string similarity + // (we can use a variety of string matching heuristics) + double score = distance.score(label, dbpediaPoint.getLabel()); + if(score > highestScore) { + highestScore = score; + bestURI = line.substring(1, line.indexOf(" ")-1); + bestLabel = label; + } + } +// sb.append(line); + } + rd.close(); + + if(!quiet) { + System.out.println(" " + linkedGeoDataURL); + System.out.println(" " + highestScore); + System.out.println(" " + bestURI); + System.out.println(" " + bestLabel); + } + + if(highestScore > scoreThreshold) { +// System.out.println(" match"); + return URI.create(bestURI); + } else { +// System.out.println(" no match"); + return null; + } } - rd.close(); - -// System.out.println(sb.toString()); - - */ - return null; } } Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java 2009-04-20 17:32:06 UTC (rev 1720) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java 2009-04-21 13:06:39 UTC (rev 1721) @@ -32,11 +32,19 @@ private URI uri; private String label; + + private String[] classes; - public DBpediaPoint(URI uri, String label, double geoLat, double geoLong) { + // decimal count in latitude value => indicator for size of object (no or low + // number of decimals indicates a large object) + private int decimalCount; + + public DBpediaPoint(URI uri, String label, String[] classes, double geoLat, double geoLong, int decimalCount) { super(geoLat,geoLong); this.uri = uri; this.label = label; + this.classes = classes; + this.decimalCount = decimalCount; } /** @@ -53,4 +61,23 @@ return label; } + public String[] getClasses() { + return classes; + } + + /** + * @return the decimalCount + */ + public int getDecimalCount() { + return decimalCount; + } + + @Override + public String toString() { + String str = uri + ", \"" + label + "\", " + geoLat + ", " + geoLong + " (classes: "; + for(String clazz : classes) { + str += clazz + " "; + } + return str + ")"; + } } Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java 2009-04-20 17:32:06 UTC (rev 1720) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java 2009-04-21 13:06:39 UTC (rev 1721) @@ -27,9 +27,9 @@ */ public class Point { - private double geoLat; + protected double geoLat; - private double geoLong; + protected double geoLong; public Point(double geoLat, double geoLong) { this.geoLat = geoLat; Modified: trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java =================================================================== --- trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-04-20 17:32:06 UTC (rev 1720) +++ trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java 2009-04-21 13:06:39 UTC (rev 1721) @@ -41,7 +41,7 @@ */ public final class TestOntologies { - public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE }; + public enum TestOntology { EMPTY, SIMPLE, SIMPLE_NO_DR, SIMPLE_NO_DISJOINT, SIMPLE_NO_DR_DISJOINT, SIMPLE2, SIMPLE3, R1SUBR2, DATA1, FIVE_ROLES, FATHER_OE, CARCINOGENESIS, EPC_OE, KRK_ZERO_ONE, DBPEDIA_OWL }; public static ReasonerComponent getTestOntology(TestOntology ont) { String kbString = ""; @@ -117,7 +117,9 @@ owlFile = "examples/epc/sap_epc_oe.owl"; } else if(ont.equals(TestOntology.KRK_ZERO_ONE)) { owlFile = "examples/krk/KRK_ZERO_ONE.owl"; - } + } else if(ont.equals(TestOntology.DBPEDIA_OWL)) { + owlFile = "/home/jl/promotion/ontologien/dbpedia.owl"; + } try { ComponentManager cm = ComponentManager.getInstance(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-20 17:32:21
|
Revision: 1720 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1720&view=rev Author: jenslehmann Date: 2009-04-20 17:32:06 +0000 (Mon, 20 Apr 2009) Log Message: ----------- continued ontology matching Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-20 15:12:11 UTC (rev 1719) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-20 17:32:06 UTC (rev 1720) @@ -22,13 +22,10 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; +import java.io.FileReader; import java.io.IOException; -import java.io.InputStreamReader; import java.net.URI; -import java.net.URL; -import java.net.URLConnection; -import org.dllearner.kb.sparql.SPARQLTasks; import org.dllearner.kb.sparql.SparqlEndpoint; import org.dllearner.kb.sparql.SparqlQuery; @@ -44,9 +41,13 @@ */ public class DBpediaLinkedGeoData { - private static File dbpediaFile = new File("log/DBpedia_POIs.nt"); + // chose between nt and csv + private static String dbpediaFileFormat = "csv"; + private static File dbpediaFile = new File("log/DBpedia_POIs." + dbpediaFileFormat); private static boolean regenerateFile = false; + private static File matchingFile = new File("log/DBpedia_GeoData_Links.nt"); + private static SparqlEndpoint dbpediaEndpoint = SparqlEndpoint.getEndpointLOCALDBpedia(); private static SparqlEndpoint geoDataEndpoint = SparqlEndpoint.getEndpointLOCALGeoData(); @@ -57,56 +58,37 @@ createDBpediaFile(); } + FileOutputStream fos = new FileOutputStream(matchingFile, true); // read file point by point - // for each point: call match method - - System.exit(0); - - // we start from the DBpedia URI and try to find the corresponding - // OSM URI (assuming that each location having coordinates in Wikipedia also - // exists in OSM) - URI dbpediaURI = URI.create("http://dbpedia.org/resource/Auerbachs_Keller"); - - int distanceThresholdMeters = 100; - - // use official DBpedia endpoint (switch to db0 later) - SparqlEndpoint endpoint = SparqlEndpoint.getEndpointDBpedia(); - SPARQLTasks st = new SPARQLTasks(endpoint); - - // query latitude and longitude - String query = "SELECT ?lat ?long WHERE { "; - query += "<" + dbpediaURI + "> <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ."; - query += "<" + dbpediaURI + "> <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long . } LIMIT 1"; - - // perform query and read lat and long from results - ResultSet results = st.queryAsResultSet(query); - QuerySolution qs = results.nextSolution(); - String geoLat = qs.getLiteral("lat").getString(); - String geoLong = qs.getLiteral("long").getString(); - - System.out.println("lat: " + geoLat + ", long: " + geoLong); - - URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/near/"+geoLat+","+geoLong+"/"+distanceThresholdMeters); - - // TODO: replace by SPARQL query - - URLConnection conn = linkedGeoDataURL.openConnection(); - BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); - StringBuffer sb = new StringBuffer(); - String line=""; -// int pointID = 0; - while ((line = rd.readLine()) != null) - { - if(line.contains("Auerbach")) { - System.out.println(line); + BufferedReader br = new BufferedReader(new FileReader(dbpediaFile)); + String line; + int counter = 0; + int matches = 0; + while ((line = br.readLine()) != null) { + + // read line and convert it into an object + String[] parts = line.split(","); + URI uri = URI.create(parts[0]); + String label = parts[1]; + double geoLat = new Double(parts[2]); + double geoLong = new Double(parts[3]); + DBpediaPoint dp = new DBpediaPoint(uri, label, geoLat, geoLong); + + // find match (we assume there is exactly one match) + URI matchURI = findGeoDataMatch(dp); + if(matchURI != null) { + String matchStr = "<" + uri + "> <http://www.w3.org/2002/07/owl#sameAs> <" + matchURI + "> .\n"; + fos.write(matchStr.getBytes()); + matches++; } + counter++; - sb.append(line); + if(counter % 1000 == 0) { + System.out.println(counter + " points processed. " + matches + " matches found."); + } } - rd.close(); - -// System.out.println(sb.toString()); - + br.close(); + fos.close(); } // downloads information about DBpedia into a separate file @@ -140,10 +122,15 @@ String geoLong = qs.getLiteral("long").getString(); String label = qs.getLiteral("label").getString(); - String content = "<" + object + ">" + " <http://www.w3.org/2000/01/rdf-schema#label> \"" + label + "\" .\n"; - content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#lat> \"" + geoLat + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; - content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#long> \"" + geoLong + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; - + String content = ""; + if(dbpediaFileFormat.equals("nt")) { + content += "<" + object + ">" + " <http://www.w3.org/2000/01/rdf-schema#label> \"" + label + "\" .\n"; + content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#lat> \"" + geoLat + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; + content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#long> \"" + geoLong + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; + } else { + content += object + ",\"" + label + "\"," + geoLat + "," + geoLong + "\n"; + } + fos.write(content.getBytes()); counter++; @@ -154,13 +141,56 @@ } while(counter == limit); - fos.close(); - } - private static URI findLinkedGeoDataMatch(DBpediaPoint dbpediaPoint) { + private static URI findGeoDataMatch(DBpediaPoint dbpediaPoint) { + // get all GeoData points close to the given point +// SparqlQuery query = new SparqlQuery("", geoDataEndpoint); + + /* + int distanceThresholdMeters = 100; + + // use official DBpedia endpoint (switch to db0 later) + SparqlEndpoint endpoint = SparqlEndpoint.getEndpointDBpedia(); + SPARQLTasks st = new SPARQLTasks(endpoint); + + // query latitude and longitude + String query = "SELECT ?lat ?long WHERE { "; + query += "<" + dbpediaURI + "> <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ."; + query += "<" + dbpediaURI + "> <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long . } LIMIT 1"; + + // perform query and read lat and long from results + ResultSet results = st.queryAsResultSet(query); + QuerySolution qs = results.nextSolution(); + String geoLat = qs.getLiteral("lat").getString(); + String geoLong = qs.getLiteral("long").getString(); + + System.out.println("lat: " + geoLat + ", long: " + geoLong); + + URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/near/"+geoLat+","+geoLong+"/"+distanceThresholdMeters); + + // TODO: replace by SPARQL query + + URLConnection conn = linkedGeoDataURL.openConnection(); + BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); + StringBuffer sb = new StringBuffer(); + String line=""; +// int pointID = 0; + while ((line = rd.readLine()) != null) + { + if(line.contains("Auerbach")) { + System.out.println(line); + } + + sb.append(line); + } + rd.close(); + +// System.out.println(sb.toString()); + + */ return null; } } Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java 2009-04-20 15:12:11 UTC (rev 1719) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java 2009-04-20 17:32:06 UTC (rev 1720) @@ -19,10 +19,38 @@ */ package org.dllearner.scripts.matching; +import java.net.URI; + /** + * A geo location in DBpedia. + * * @author Jens Lehmann * */ -public class DBpediaPoint { +public class DBpediaPoint extends Point { + private URI uri; + + private String label; + + public DBpediaPoint(URI uri, String label, double geoLat, double geoLong) { + super(geoLat,geoLong); + this.uri = uri; + this.label = label; + } + + /** + * @return the uri + */ + public URI getUri() { + return uri; + } + + /** + * @return the label + */ + public String getLabel() { + return label; + } + } Added: trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/Point.java 2009-04-20 17:32:06 UTC (rev 1720) @@ -0,0 +1,47 @@ +/** + * Copyright (C) 2007-2009, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.scripts.matching; + +/** + * A geo location. + * + * @author Jens Lehmann + * + */ +public class Point { + + private double geoLat; + + private double geoLong; + + public Point(double geoLat, double geoLong) { + this.geoLat = geoLat; + this.geoLong = geoLong; + } + + public double getGeoLat() { + return geoLat; + } + + public double getGeoLong() { + return geoLong; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-20 15:12:17
|
Revision: 1719 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1719&view=rev Author: jenslehmann Date: 2009-04-20 15:12:11 +0000 (Mon, 20 Apr 2009) Log Message: ----------- method to find all geo-locations in DBpedia and write them to an N-Triple file Modified Paths: -------------- trunk/README trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java Modified: trunk/README =================================================================== --- trunk/README 2009-04-20 12:14:59 UTC (rev 1718) +++ trunk/README 2009-04-20 15:12:11 UTC (rev 1719) @@ -14,4 +14,5 @@ DL-Learner is Open Source and licenced unter the GNU General Public License. Documentation for DL-Learner (e.g. various configuration options) can be found -in the "doc" directory and at http://dl-learner.org. +in the "doc" directory and at http://dl-learner.org. We recommend to read +doc/manual.pdf to get started. Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java 2009-04-20 12:14:59 UTC (rev 1718) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/SparqlEndpoint.java 2009-04-20 15:12:11 UTC (rev 1719) @@ -172,6 +172,18 @@ return new SparqlEndpoint(u, defaultGraphURIs, new LinkedList<String>()); } + public static SparqlEndpoint getEndpointLOCALGeoData() { + URL u = null; + try { + u = new URL("http://139.18.2.37:8890/sparql"); + } catch (Exception e) { + e.printStackTrace(); + } + LinkedList<String> defaultGraphURIs=new LinkedList<String>(); + defaultGraphURIs.add("http://linkedgeodata.org"); + return new SparqlEndpoint(u, defaultGraphURIs, new LinkedList<String>()); + } + public static SparqlEndpoint getEndpointlocalJoseki() { URL u = null; try { Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-20 12:14:59 UTC (rev 1718) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-20 15:12:11 UTC (rev 1719) @@ -20,6 +20,8 @@ package org.dllearner.scripts.matching; import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.URI; @@ -28,6 +30,7 @@ import org.dllearner.kb.sparql.SPARQLTasks; import org.dllearner.kb.sparql.SparqlEndpoint; +import org.dllearner.kb.sparql.SparqlQuery; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; @@ -41,8 +44,24 @@ */ public class DBpediaLinkedGeoData { + private static File dbpediaFile = new File("log/DBpedia_POIs.nt"); + private static boolean regenerateFile = false; + + private static SparqlEndpoint dbpediaEndpoint = SparqlEndpoint.getEndpointLOCALDBpedia(); + private static SparqlEndpoint geoDataEndpoint = SparqlEndpoint.getEndpointLOCALGeoData(); + public static void main(String[] args) throws IOException { + // download all objects having geo-coordinates from DBpedia if necessary + if(!dbpediaFile.exists() || regenerateFile) { + createDBpediaFile(); + } + + // read file point by point + // for each point: call match method + + System.exit(0); + // we start from the DBpedia URI and try to find the corresponding // OSM URI (assuming that each location having coordinates in Wikipedia also // exists in OSM) @@ -90,4 +109,58 @@ } + // downloads information about DBpedia into a separate file + private static void createDBpediaFile() throws IOException { + + // use this to set the "chunk size" for getting DBpedia points + int limit = 1000; + int offset = 0; + + int counter = 0; + FileOutputStream fos = new FileOutputStream(dbpediaFile, true); + + do { + counter = 0; + + // query DBpedia for all objects having geo-coordinates + String queryStr = "SELECT ?object, ?lat, ?long, ?label WHERE {"; + queryStr += "?object <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ."; + queryStr += "?object <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long ."; + queryStr += "?object rdfs:label ?label . }"; + queryStr += "LIMIT " + limit + " OFFSET " + offset; + + SparqlQuery query = new SparqlQuery(queryStr, dbpediaEndpoint); + ResultSet rs = query.send(); + + while(rs.hasNext()) { + QuerySolution qs = rs.nextSolution(); + + String object = qs.get("object").toString(); + String geoLat = qs.getLiteral("lat").getString(); + String geoLong = qs.getLiteral("long").getString(); + String label = qs.getLiteral("label").getString(); + + String content = "<" + object + ">" + " <http://www.w3.org/2000/01/rdf-schema#label> \"" + label + "\" .\n"; + content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#lat> \"" + geoLat + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; + content += "<" + object + ">" + " <http://www.w3.org/2003/01/geo/wgs84_pos#long> \"" + geoLong + "\"^^<http://www.w3.org/2001/XMLSchema#float> .\n"; + + fos.write(content.getBytes()); + + counter++; + } + + offset += limit; + System.out.println(offset + " points queried."); + + } while(counter == limit); + + + fos.close(); + + } + + private static URI findLinkedGeoDataMatch(DBpediaPoint dbpediaPoint) { + + return null; + } } Added: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaPoint.java 2009-04-20 15:12:11 UTC (rev 1719) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2009, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.scripts.matching; + +/** + * @author Jens Lehmann + * + */ +public class DBpediaPoint { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-04-20 12:15:00
|
Revision: 1718 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1718&view=rev Author: heeroyuy Date: 2009-04-20 12:14:59 +0000 (Mon, 20 Apr 2009) Log Message: ----------- -fixed some bugs -added additional information on graphical panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-04-20 11:02:19 UTC (rev 1717) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-04-20 12:14:59 UTC (rev 1718) @@ -102,7 +102,7 @@ if (z.getActionCommand().equals("suggest equivalent class expression") || z.getActionCommand().equals("suggest super class expression")) { model.setKnowledgeSource(); - model.setReasoner(); + //model.setReasoner(); model.setLearningProblem(); model.setLearningAlgorithm(); view.getRunButton().setEnabled(false); @@ -383,6 +383,7 @@ ontology, null), ((EvaluatedDescriptionClass) eval) .getAccuracy() * 100)); + i++; break; } else { dm.add(i, new SuggestListItem(colorRed, @@ -392,6 +393,7 @@ ((EvaluatedDescriptionClass) eval) .getAccuracy() * 100)); view.setIsInconsistent(true); + i++; break; } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-20 11:02:19 UTC (rev 1717) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-20 12:14:59 UTC (rev 1718) @@ -160,8 +160,9 @@ advanced.setSize(20, 20); learner.setLayout(new GridBagLayout()); accept.setPreferredSize(new Dimension(70, 40)); - run.setPreferredSize(new Dimension(220, 50)); + run.setPreferredSize(new Dimension(260, 30)); advanced.setName("Advanced"); + model.initReasoner(); learnerScroll.setPreferredSize(new Dimension(SCROLL_WIDTH, SCROLL_HEIGHT)); learnerScroll.getVerticalScrollBar().setUnitIncrement(SCROLL_SPEED); posPanel = new PosAndNegSelectPanel(model, action); @@ -192,7 +193,6 @@ */ public void makeView(String label) { run.setText("suggest " + label + " expression"); - run.setPreferredSize(new Dimension(200, 40)); GridBagConstraints c = new GridBagConstraints(); learner.remove(detail); model.setID(label); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-04-20 11:02:19 UTC (rev 1717) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-04-20 12:14:59 UTC (rev 1718) @@ -85,6 +85,7 @@ private final Random random; private final Color darkGreen; private final Color darkRed; + private int notCoveredInd; private final MoreDetailForSuggestedConceptsPanel panel; /** @@ -104,7 +105,7 @@ String concept, MoreDetailForSuggestedConceptsPanel p) { this.setVisible(false); this.setForeground(Color.GREEN); - this.setPreferredSize(new Dimension(500, 230)); + this.setPreferredSize(new Dimension(540, 230)); eval = desc; model = m; panel = p; @@ -162,48 +163,63 @@ p = p + 20; } g2D.setColor(darkGreen); - Ellipse2D circlePoint = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); + Ellipse2D circlePoint = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint); g2D.setColor(Color.BLACK); g2D.drawString("individuals covered by", 320, p); g2D.setColor(Color.ORANGE); - g2D.fillOval(445, p - 9, 9, 9); + g2D.fillOval(455, p - 9, 9, 9); g2D.setColor(Color.BLACK); - g2D.drawString("and", 460, p); + g2D.drawString("and", 485, p); g2D.setColor(Color.YELLOW); - g2D.fillOval(490, p - 9, 9, 9); + g2D.fillOval(525, p - 9, 9, 9); + g2D.setColor(Color.BLACK); p = p + 20; + g2D.drawString("(OK)", 320, p); + p = p + 20; if(id.equals(EQUI_STRING)) { g2D.setColor(darkRed); - Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); + Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint2); g2D.setColor(Color.BLACK); g2D.drawString("individuals covered by", 320, p); g2D.setColor(Color.ORANGE); - g2D.fillOval(445, p - 9, 9, 9); + g2D.fillOval(455, p - 9, 9, 9); + g2D.setColor(Color.BLACK); p = p + 20; + g2D.drawString("(potential problem)", 320, p); + p = p + 20; g2D.setColor(darkRed); - Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); + Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint3); g2D.setColor(Color.BLACK); g2D.drawString("individuals covered by", 320, p); g2D.setColor(Color.YELLOW); - g2D.fillOval(445, p - 9, 9, 9); + g2D.fillOval(455, p - 9, 9, 9); + g2D.setColor(Color.BLACK); + p = p + 20; + g2D.drawString("(potential problem)", 320, p); } else { g2D.setColor(Color.BLACK); - Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); + Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint2); g2D.drawString("individuals covered by", 320, p); g2D.setColor(Color.ORANGE); - g2D.fillOval(445, p - 9, 9, 9); + g2D.fillOval(455, p - 9, 9, 9); + g2D.setColor(Color.BLACK); p = p + 20; + g2D.drawString("(no problem)", 320, p); + p = p + 20; g2D.setColor(darkRed); - Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); + Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 4, 4); g2D.fill(circlePoint3); g2D.setColor(Color.BLACK); g2D.drawString("individuals covered by", 320, p); g2D.setColor(Color.YELLOW); - g2D.fillOval(445, p - 9, 9, 9); + g2D.fillOval(455, p - 9, 9, 9); + g2D.setColor(Color.BLACK); + p = p + 20; + g2D.drawString("(potential problem)", 320, p); } g2D.setColor(Color.YELLOW); @@ -217,7 +233,7 @@ // Plus 1 if (coveredIndividualSize != model.getReasoner().getIndividuals( model.getCurrentConcept()).size() - && coveredIndividualSize != 0) { + && notCoveredInd != 0) { g2D.drawLine(x1 - 1 - shiftOldConcept, y1 - 1, x2 + 1 - shiftOldConcept, y1 - 1); g2D.drawLine(x1 - shiftOldConcept, centerY - 1, x2 @@ -268,7 +284,7 @@ // Plus 3 if (coveredIndividualSize != model.getReasoner().getIndividuals( - model.getCurrentConcept()).size()) { + model.getCurrentConcept()).size() && ((EvaluatedDescriptionClass) eval).getAdditionalInstances().size() != 0) { g2D.drawLine(x1 - 1 + shiftNewConcept, y1 - 1, x2 + 1 + shiftNewConcept, y1 - 1); g2D.drawLine(x1 + shiftNewConcept, centerY - 1, x2 @@ -291,7 +307,7 @@ g2D.drawLine(x2 + 1 + shiftNewConcept, y1 - 1, x2 + 1 + shiftNewConcept, y2 + 1); } - + //Plus 4 if (((EvaluatedDescriptionClass) eval).getAddition() != 1.0 && ((EvaluatedDescriptionClass) eval).getCoverage() == 1.0) { g2D.drawLine(x1 - 1 + shiftNewConceptX, y1 - 1 @@ -344,6 +360,17 @@ g2D.setColor(darkRed); g2D.drawString("Adding this class expression may lead to an inconsistent ontology.", 0, 220); } + if(eval.getAccuracy() == 1.0) { + g2D.setComposite(original); + g2D.setColor(Color.ORANGE); + g2D.fillOval(0, 211, 9, 9); + g2D.setColor(darkRed); + g2D.drawString("and", 25, 220); + g2D.setColor(Color.YELLOW); + g2D.fillOval(65, 211, 9, 9); + g2D.setColor(darkRed); + g2D.drawString("covers the same instances.", 95, 220); + } this.setVisible(true); panel.repaint(); } @@ -409,10 +436,17 @@ int i = conceptNew.length(); while (i > 0) { - int sub = conceptNew.indexOf(" "); - String subString = conceptNew.substring(0, sub) + " "; + int sub = 0; + String subString = ""; + if(conceptNew.contains(" ")) { + sub = conceptNew.indexOf(" "); + subString = conceptNew.substring(0, sub) + " "; conceptNew = conceptNew.replace(conceptNew.substring(0, sub + 1), ""); + } else { + subString = conceptNew; + conceptNew = ""; + } while (sub < SUBSTRING_SIZE) { if (conceptNew.length() > 0 && conceptNew.contains(" ")) { sub = conceptNew.indexOf(" "); @@ -544,6 +578,7 @@ Set<Individual> notCovInd = model.getReasoner().getIndividuals( model.getCurrentConcept()); notCovInd.removeAll(posInd); + notCoveredInd = notCovInd.size(); int k = 0; x = random.nextInt(n); y = random.nextInt(n); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-04-20 11:02:19 UTC (rev 1717) +++ trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-04-20 12:14:59 UTC (rev 1718) @@ -46,7 +46,7 @@ this.point = p; this.xAxis = x; this.yAxis = y; - this.circlePoint = new Ellipse2D.Double(x - 1, y - 1, 3, 3); + this.circlePoint = new Ellipse2D.Double(x - 1, y - 1, 4, 4); this.individual = ind; } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-04-20 11:02:19 UTC (rev 1717) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-04-20 12:14:59 UTC (rev 1718) @@ -60,7 +60,7 @@ private Set<String> ontologiesStrings; private final JTextArea conceptText; private static final int HEIGHT = 230; - private static final int WIDTH = 510; + private static final int WIDTH = 540; private GraphicalCoveragePanel p; private final MoreDetailForSuggestedConceptsPanelHandler handler; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-04-20 11:02:19 UTC (rev 1717) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ReadingOntologyThread.java 2009-04-20 12:14:59 UTC (rev 1718) @@ -161,7 +161,7 @@ @Override public void run() { model.getSuggestModel().removeAllElements(); - model.initReasoner(); + //model.initReasoner(); reasoner = model.getReasoner(); isInconsistent = false; if(!isInconsistent) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-20 11:02:22
|
Revision: 1717 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1717&view=rev Author: jenslehmann Date: 2009-04-20 11:02:19 +0000 (Mon, 20 Apr 2009) Log Message: ----------- added ant task to automatically build the manual for a new release Modified Paths: -------------- trunk/build.xml trunk/doc/manual/manual.tex Added Paths: ----------- trunk/lib/ant_latex.jar Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-04-20 10:21:12 UTC (rev 1716) +++ trunk/build.xml 2009-04-20 11:02:19 UTC (rev 1717) @@ -28,7 +28,7 @@ </path> <!-- build target --> - <target name="full_release" depends="javadoc,build" description="full release, javadoc, scripts"> + <target name="full_release" depends="manual,javadoc,build" description="full release, javadoc, scripts"> </target> <!-- build target --> @@ -281,6 +281,31 @@ <echo file="bin/gui" message="#!/bin/bash${line.separator}java -Xmx${max_memory}m -Djava.library.path=lib/fact/ -cp ${pathStringUnix} org.dllearner.gui.StartGUI $@"/> </target> + <!-- generate manual --> + <taskdef name="latex" classname="de.dokutransdata.antlatex.LaTeX" + classpath="lib/ant_latex.jar"/> + <target name="manual"> + + <!-- automatically adds correct build number in manual --> + <replaceregexp file="doc/manual/manual.tex" + match="DL-Learner (.*) command line interface" + replace="DL-Learner ${today} command line interface" + byline="true"/> + + <!-- run pdflatex and bibtex over doc/manual/ --> + <latex + latexfile="manual.tex" + verbose="off" + clean="on" + pdftex="on" + workingDir="doc/manual"> + <bibtex + run="on" + workingDir="doc/manual/" + /> + </latex> + </target> + <!-- generate Javadoc --> <target name="javadoc"> <pathconvert refid="classpath" property="jdocclasspath"/> Modified: trunk/doc/manual/manual.tex =================================================================== --- trunk/doc/manual/manual.tex 2009-04-20 10:21:12 UTC (rev 1716) +++ trunk/doc/manual/manual.tex 2009-04-20 11:02:19 UTC (rev 1717) @@ -69,7 +69,7 @@ \emph{Conf files}, e.g. \verb|examples/father.conf| in this case, describe the learning problem and specify which algorithm you want to use to solve it. In the simplest case they just say where to find the background knowledge to use (in the OWL file \verb|examples/father.owl| in this case) and the positive and negative examples (marked by ``+'' and ``-'', respectively). When running the above command, you should get something similar to the following: \begin{verbatim} -DL-Learner 2008-10-13 command line interface +DL-Learner 2009-04-20 command line interface starting component manager ... OK (157ms) initialising component "OWL file" ... OK (0ms) initialising component "fast instance checker" ... OK (842ms) Added: trunk/lib/ant_latex.jar =================================================================== (Binary files differ) Property changes on: trunk/lib/ant_latex.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-20 10:21:14
|
Revision: 1716 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1716&view=rev Author: jenslehmann Date: 2009-04-20 10:21:12 +0000 (Mon, 20 Apr 2009) Log Message: ----------- - added possibility to query for algorithms supporting a given learning problem in component manager - GUI: when selecting class learning problem, the option classToDescribe is now mandatory - GUI: made sure that only appropriate learning algorithms wrt. a given learning problem can be selected - GUI: files ending with nt or rdf are now selectable by default Modified Paths: -------------- trunk/build.xml trunk/src/dl-learner/org/dllearner/core/ComponentManager.java trunk/src/dl-learner/org/dllearner/gui/ComponentPanel.java trunk/src/dl-learner/org/dllearner/gui/Config.java trunk/src/dl-learner/org/dllearner/gui/ExampleFileChooser.java trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/utilities/datastructures/Maps.java Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-04-19 16:38:14 UTC (rev 1715) +++ trunk/build.xml 2009-04-20 10:21:12 UTC (rev 1716) @@ -4,7 +4,7 @@ <!-- directory settings --> <property name="lib_dir" value="lib" /> <property name="source_dir" value="src/dl-learner" /> - <property name="protege_dir" value="C:\Program Files\Protege_4.0_beta\plugins" /> + <property name="protege_dir" value="/home/jl/programme/Protege_4.0_beta/plugins" /> <property name="class_dir" value="classes" /> <property name="php_client_dir" value="src/php-client" /> Modified: trunk/src/dl-learner/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2009-04-19 16:38:14 UTC (rev 1715) +++ trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2009-04-20 10:21:12 UTC (rev 1716) @@ -40,6 +40,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; import org.apache.log4j.Logger; import org.dllearner.cli.ConfMapper; @@ -48,6 +49,7 @@ import org.dllearner.core.options.InvalidConfigOptionValueException; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.utilities.Files; +import org.dllearner.utilities.datastructures.Maps; /** * Central manager class for DL-Learner. There are currently four types of @@ -85,7 +87,8 @@ private static Map<Class<? extends Component>, List<ConfigOption<?>>> componentOptions; private static Map<Class<? extends Component>, Map<String, ConfigOption<?>>> componentOptionsByName; private static Map<Class<? extends LearningAlgorithm>, Collection<Class<? extends LearningProblem>>> algorithmProblemsMapping; - + private static Map<Class<? extends LearningProblem>, Collection<Class<? extends LearningAlgorithm>>> problemAlgorithmsMapping; + private ConfMapper confMapper = new ConfMapper(); // list of default values of config options @@ -116,7 +119,7 @@ learningProblems = new TreeSet<Class<? extends LearningProblem>>(classComparator); learningAlgorithms = new TreeSet<Class<? extends LearningAlgorithm>>(classComparator); algorithmProblemsMapping = new TreeMap<Class<? extends LearningAlgorithm>, Collection<Class<? extends LearningProblem>>>( - classComparator); + classComparator); // create classes from strings for (String componentString : componentsString) { @@ -143,13 +146,14 @@ e.printStackTrace(); } } + problemAlgorithmsMapping = Maps.revertCollectionMap(algorithmProblemsMapping); componentNames = new HashMap<Class<? extends Component>, String>(); // read in all configuration options componentOptions = new HashMap<Class<? extends Component>, List<ConfigOption<?>>>(); componentOptionsByName = new HashMap<Class<? extends Component>, Map<String, ConfigOption<?>>>(); // configOptionDefaults = new HashMap<ConfigOption<?>,Object>(); - + for (Class<? extends Component> component : components) { String name = (String) invokeStaticMethod(component, "getName"); @@ -169,8 +173,6 @@ } - // System.out.println(components); - // System.out.println(learningProblems); } /** @@ -683,6 +685,23 @@ } /** + * Returns the set of learning algorithms, which support the given learning problem type. + * @param learningProblem A learning problem type. + * @return The set of learning algorithms applicable for this learning problem. + */ + public List<Class<? extends LearningAlgorithm>> getApplicableLearningAlgorithms(Class<? extends LearningProblem> learningProblem) { + List<Class<? extends LearningAlgorithm>> algorithms = new LinkedList<Class<? extends LearningAlgorithm>>(); + for(Entry<Class<? extends LearningProblem>,Collection<Class<? extends LearningAlgorithm>>> entry : problemAlgorithmsMapping.entrySet()) { + Class<? extends LearningProblem> prob = entry.getKey(); + if(prob.isAssignableFrom(learningProblem)) { + algorithms.addAll(entry.getValue()); + } + } +// System.out.println(learningProblem + ": " + algorithms); + return algorithms; + } + + /** * Returns a list of all available learning algorithms in this instance * of <code>ComponentManager</code>. * @return the components A list of learning algorithm classes available in this Modified: trunk/src/dl-learner/org/dllearner/gui/ComponentPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ComponentPanel.java 2009-04-19 16:38:14 UTC (rev 1715) +++ trunk/src/dl-learner/org/dllearner/gui/ComponentPanel.java 2009-04-20 10:21:12 UTC (rev 1716) @@ -29,12 +29,15 @@ import javax.swing.JComboBox; import javax.swing.JPanel; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.core.Component; 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.learningproblems.ClassLearningProblem; +import org.dllearner.learningproblems.PosOnlyLP; /** * Class displaying a component (and its options). @@ -107,7 +110,8 @@ } else if (panelClass == LearningProblem.class) { selectableComponents.addAll(config.getComponentManager().getLearningProblems()); } else if (panelClass == LearningAlgorithm.class) { - selectableComponents.addAll(config.getComponentManager().getLearningAlgorithms()); +// selectableComponents.addAll(config.getComponentManager().getLearningAlgorithms()); + selectableComponents.addAll(config.getComponentManager().getApplicableLearningAlgorithms(config.getLearningProblem().getClass())); } // set default component class (move it to first position) @@ -151,6 +155,16 @@ // change component and update option panel Class<? extends Component> c = selectableComponents.get(comboBox.getSelectedIndex()); currentComponent = changeInstance(c); + // we may have to change the learning algorithm depending on the learning problem + if(c.equals(ClassLearningProblem.class) || c.equals(PosOnlyLP.class)) { + try { + config.changeLearningAlgorithm(CELOE.class); + } catch (LearningProblemUnsupportedException e1) { + // cannot happend since CELOE supports class learning problem + e1.printStackTrace(); + } + } + updateOptionPanel(); // if the component does not have mandatory values, we can // enable the following tabs @@ -201,6 +215,21 @@ */ public void panelActivated() { // hook method, which does nothing yet + if(panelClass.equals(LearningAlgorithm.class)) { + // update selectable components + selectableComponents.clear(); + selectableComponents.addAll(config.getComponentManager().getApplicableLearningAlgorithms(config.getLearningProblem().getClass())); + // clear combo box and add selectable items to it + comboBox.removeActionListener(this); + comboBox.removeAllItems(); + // recreate combo box + for (int i = 0; i < selectableComponents.size(); i++) { + comboBox.addItem(config.getComponentManager().getComponentName( + selectableComponents.get(i))); + } + comboBox.addActionListener(this); + update(); + } } // creates an instance of the specified component class Modified: trunk/src/dl-learner/org/dllearner/gui/Config.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/Config.java 2009-04-19 16:38:14 UTC (rev 1715) +++ trunk/src/dl-learner/org/dllearner/gui/Config.java 2009-04-20 10:21:12 UTC (rev 1716) @@ -41,7 +41,9 @@ import org.dllearner.kb.KBFile; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.parser.ParseException; /** @@ -548,6 +550,16 @@ .size() == 0) { return false; } + } else if (component instanceof PosOnlyLP) { + if (cm.getConfigOptionValue(component, "positiveExamples") == null + || ((Set<String>) cm.getConfigOptionValue(component, "positiveExamples")) + .size() == 0) { + return false; + } + } else if (component instanceof ClassLearningProblem) { + if (cm.getConfigOptionValue(component, "classToDescribe") == null) { + return false; + } } else if (component instanceof SparqlKnowledgeSource) { if (cm.getConfigOptionValue(component, "instances") == null || ((Set<String>) cm.getConfigOptionValue(component, "instances")).size() == 0) { Modified: trunk/src/dl-learner/org/dllearner/gui/ExampleFileChooser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/ExampleFileChooser.java 2009-04-19 16:38:14 UTC (rev 1715) +++ trunk/src/dl-learner/org/dllearner/gui/ExampleFileChooser.java 2009-04-20 10:21:12 UTC (rev 1716) @@ -34,20 +34,36 @@ private static final long serialVersionUID = 1566010391199697892L; - public ExampleFileChooser(final String fileEnding) { + private final String description; + + // public ExampleFileChooser(final String fileEnding) { + public ExampleFileChooser(final String ... fileEndings) { super(new File("examples/")); + String display = ""; + for(String fileEnding : fileEndings) { + display += "*."+ fileEnding + " "; + } + display += "files"; + description = display; + FileFilter filter = new FileFilter() { @Override public boolean accept(File f) { - if (f.isDirectory()) + if (f.isDirectory()) { return true; - return f.getName().toLowerCase().endsWith("." + fileEnding); + } + for(String fileEnding : fileEndings) { + if(f.getName().toLowerCase().endsWith("." + fileEnding)) { + return true; + } + } + return false; } @Override public String getDescription() { - return fileEnding + " files"; // name for filter + return description; } }; Modified: trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java 2009-04-19 16:38:14 UTC (rev 1715) +++ trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelURL.java 2009-04-20 10:21:12 UTC (rev 1716) @@ -70,7 +70,7 @@ if (e.getSource() == chooseLocalButton) { JFileChooser fc; if (component instanceof OWLFile) { - fc = new ExampleFileChooser("owl"); + fc = new ExampleFileChooser("owl","rdf","nt"); } else { fc = new ExampleFileChooser("kb"); } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-04-19 16:38:14 UTC (rev 1715) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-04-20 10:21:12 UTC (rev 1716) @@ -76,7 +76,7 @@ Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); options.add(new StringConfigOption("classToDescribe", "class of which a description should be learned", null, true, false)); StringConfigOption type = new StringConfigOption("type", "Whether to learn an equivalence class or super class axiom or domain/range of a property.","equivalence"); - type.setAllowedValues(new String[] {"equivalence", "superClass", "domain", "range"}); + type.setAllowedValues(new String[] {"equivalence", "superClass"}); // , "domain", "range"}); options.add(type); return options; } Added: trunk/src/dl-learner/org/dllearner/utilities/datastructures/Maps.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/datastructures/Maps.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/utilities/datastructures/Maps.java 2009-04-20 10:21:12 UTC (rev 1716) @@ -0,0 +1,78 @@ +/** + * Copyright (C) 2007-2009, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.utilities.datastructures; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public class Maps { + + /** + * Reverts a map, i.e. if the map contains an entry x => y, then the + * returned map contains an entry y => x. (The minimal map with this + * property is returned.) + * + * @param <X> + * Type of map keys. + * @param <Y> + * Type of map values + * @param map + * The map to invert. + * @return A reverted map. + */ + public static <X, Y> Map<Y, Collection<X>> revert(Map<X, Y> map) { + Map<Y, Collection<X>> result = new HashMap<Y, Collection<X>>(); + + for (Map.Entry<X, Y> entry : map.entrySet()) { + X x = entry.getKey(); + Y y = entry.getValue(); + Collection<X> s = result.get(y); + if (s == null) { + result.put(y, s = new HashSet<X>()); + } + s.add(x); + } + return result; + } + + public static <X, Y> Map<Y, Collection<X>> revertCollectionMap(Map<X, Collection<Y>> map) { + Map<Y, Collection<X>> result = new HashMap<Y, Collection<X>>(); + + for (Map.Entry<X, Collection<Y>> entry : map.entrySet()) { + X x = entry.getKey(); + Collection<Y> y = entry.getValue(); + for (Y value : y) { + Collection<X> s = result.get(value); + if (s == null) { + result.put(value, s = new HashSet<X>()); + } + s.add(x); + } + } + return result; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-19 16:38:25
|
Revision: 1715 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1715&view=rev Author: jenslehmann Date: 2009-04-19 16:38:14 +0000 (Sun, 19 Apr 2009) Log Message: ----------- - fixed sorting issues in learning algorithm results (now SortedSet is in ascending order as required in Java) - fixed remaining warnings Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Beta.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/BetaGenerator.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Tau.java trunk/src/dl-learner/org/dllearner/tools/ore/explanation/TauGenerator.java trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionPosNegComparator.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -227,7 +227,7 @@ } @Override - public SortedSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public TreeSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { return bestEvaluatedDescriptions.getSet(); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELLearningAlgorithm.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; -import java.util.SortedSet; import java.util.TreeSet; import org.apache.log4j.Logger; @@ -217,7 +216,7 @@ } @Override - public SortedSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public TreeSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { return bestEvaluatedDescriptions.getSet(); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -1037,10 +1037,10 @@ } @Override - public SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { + public TreeSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { int count = 0; SortedSet<Node> rev = candidatesStable.descendingSet(); - SortedSet<EvaluatedDescriptionPosNeg> cbd = new TreeSet<EvaluatedDescriptionPosNeg>(edComparator); + TreeSet<EvaluatedDescriptionPosNeg> cbd = new TreeSet<EvaluatedDescriptionPosNeg>(edComparator); for(Node eb : rev) { cbd.add(new EvaluatedDescriptionPosNeg(eb.getConcept(), getSolutionScore(eb.getConcept()))); // return a maximum of 200 elements (we need a maximum, because the Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLComponent2.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -25,7 +25,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; -import java.util.SortedSet; +import java.util.TreeSet; import org.apache.log4j.Level; import org.apache.log4j.Logger; @@ -456,7 +456,7 @@ } @Override - public synchronized SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { + public synchronized TreeSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { return algorithm.getCurrentlyBestEvaluatedDescriptions(); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -1198,10 +1198,10 @@ return best; } - public SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { + public TreeSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions() { Iterator<ExampleBasedNode> it = candidatesStable.descendingIterator(); int count = 0; - SortedSet<EvaluatedDescriptionPosNeg> cbd = new TreeSet<EvaluatedDescriptionPosNeg>(edComparator); + TreeSet<EvaluatedDescriptionPosNeg> cbd = new TreeSet<EvaluatedDescriptionPosNeg>(edComparator); while(it.hasNext()) { ExampleBasedNode eb = it.next(); cbd.add(new EvaluatedDescriptionPosNeg(eb.getConcept(), getScore(eb.getConcept()))); @@ -1280,7 +1280,7 @@ if(this.stop){ return true; } - System.out.println("ssssss"); +// System.out.println("ssssss"); long totalTimeNeeded = System.currentTimeMillis() - this.runtime; long maxMilliSeconds = maxExecutionTimeInSeconds * 1000; long minMilliSeconds = minExecutionTimeInSeconds * 1000; Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; -import java.util.SortedSet; import java.util.TreeSet; import org.dllearner.core.owl.Description; @@ -204,10 +203,10 @@ /** * Returns a sorted set of the best descriptions found so far. We * assume that they are ordered such that the best ones come in - * first. + * last. (In Java, iterators traverse a SortedSet in ascending order.) * @return Best class descriptions found so far. */ - public SortedSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { + public TreeSet<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions() { TreeSet<EvaluatedDescription> ds = new TreeSet<EvaluatedDescription>(); ds.add(getCurrentlyBestEvaluatedDescription()); return ds; @@ -232,9 +231,9 @@ * @return A list of currently best class descriptions. */ public synchronized List<? extends EvaluatedDescription> getCurrentlyBestEvaluatedDescriptions(int nrOfDescriptions, double accuracyThreshold, boolean filterNonMinimalDescriptions) { - SortedSet<? extends EvaluatedDescription> currentlyBest = getCurrentlyBestEvaluatedDescriptions(); + TreeSet<? extends EvaluatedDescription> currentlyBest = getCurrentlyBestEvaluatedDescriptions(); List<EvaluatedDescription> returnList = new LinkedList<EvaluatedDescription>(); - for(EvaluatedDescription ed : currentlyBest) { + for(EvaluatedDescription ed : currentlyBest.descendingSet()) { // once we hit a description with a below threshold accuracy, we simply return // because learning algorithms are advised to order descriptions by accuracy, // so we won't find any concept with higher accuracy in the remaining list Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -63,7 +63,7 @@ return (String) ComponentManager.getInstance().getConfigOptionValue(classLearningProblem, "classToDescribe") ; } /** -* type Whether to learn an equivalence class or super class axiom.. +* type Whether to learn an equivalence class or super class axiom or domain/range of a property.. * mandatory: false| reinit necessary: true * default value: equivalence * @return String @@ -81,7 +81,7 @@ ComponentManager.getInstance().applyConfigEntry(classLearningProblem, "classToDescribe", classToDescribe); } /** -* @param type Whether to learn an equivalence class or super class axiom.. +* @param type Whether to learn an equivalence class or super class axiom or domain/range of a property.. * mandatory: false| reinit necessary: true * default value: equivalence **/ Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -26,12 +26,14 @@ import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.configurators.RefinementOperatorConfigurator; /** * automatically generated, do not edit manually. * run org.dllearner.scripts.ConfigJavaGenerator to update **/ -public class ROLComponent2Configurator extends RefinementOperatorConfigurator implements Configurator { +@SuppressWarnings("all") +public class ROLComponent2Configurator extends RefinementOperatorConfigurator implements Configurator { private boolean reinitNecessary = false; @SuppressWarnings("unused") @@ -331,15 +333,6 @@ return (Boolean) ComponentManager.getInstance().getConfigOptionValue(rOLComponent2, "usePropernessChecks") ; } /** -* maxPosOnlyExpansion specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate. -* mandatory: false| reinit necessary: true -* default value: 4 -* @return int -**/ -public int getMaxPosOnlyExpansion() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(rOLComponent2, "maxPosOnlyExpansion") ; -} -/** * noisePercentage the (approximated) percentage of noise within the examples. * mandatory: false| reinit necessary: true * default value: 0.0 @@ -683,15 +676,6 @@ reinitNecessary = true; } /** -* @param maxPosOnlyExpansion specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is considered as solution candidate. -* mandatory: false| reinit necessary: true -* default value: 4 -**/ -public void setMaxPosOnlyExpansion(int maxPosOnlyExpansion) { -ComponentManager.getInstance().applyConfigEntry(rOLComponent2, "maxPosOnlyExpansion", maxPosOnlyExpansion); -reinitNecessary = true; -} -/** * @param noisePercentage the (approximated) percentage of noise within the examples. * mandatory: false| reinit necessary: true * default value: 0.0 Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Beta.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Beta.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Beta.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -67,6 +67,7 @@ return result; } + @Override public Set<OWLDescription> visit(OWLObjectExactCardinalityRestriction desc) { Set<OWLDescription> fillers = computeBeta((OWLDescription)desc.getFiller()); @@ -79,6 +80,7 @@ return result; } + @Override public Set<OWLDescription> visit(OWLObjectUnionOf desc) { return super.visit(desc); @@ -96,16 +98,19 @@ return result; } + @Override protected OWLClass getLimit() { return getDataFactory().getOWLNothing(); } + @Override protected OWLDataRange getDataLimit() { return getDataFactory().getOWLDataComplementOf(getDataFactory().getTopDataType()); } + @Override public Set<OWLDescription> visit(OWLDataValueRestriction desc) { return Collections.singleton((OWLDescription)desc); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/BetaGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/BetaGenerator.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/BetaGenerator.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -67,6 +67,7 @@ return result; } + @Override public Set<OWLDescription> visit(OWLObjectExactCardinalityRestriction desc) { Set<OWLDescription> fillers = computeBeta((OWLDescription)desc.getFiller()); @@ -79,6 +80,7 @@ return result; } + @Override public Set<OWLDescription> visit(OWLObjectUnionOf desc) { return super.visit(desc); @@ -96,16 +98,19 @@ return result; } + @Override protected OWLClass getLimit() { return getDataFactory().getOWLNothing(); } + @Override protected OWLDataRange getDataLimit() { return getDataFactory().getOWLDataComplementOf(getDataFactory().getTopDataType()); } + @Override public Set<OWLDescription> visit(OWLDataValueRestriction desc) { return Collections.singleton((OWLDescription)desc); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Tau.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Tau.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/Tau.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -68,11 +68,13 @@ return result; } + @Override protected OWLClass getLimit() { return getDataFactory().getOWLThing(); } + @Override protected OWLDataRange getDataLimit() { return getDataFactory().getTopDataType(); Modified: trunk/src/dl-learner/org/dllearner/tools/ore/explanation/TauGenerator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/ore/explanation/TauGenerator.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/tools/ore/explanation/TauGenerator.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -68,11 +68,13 @@ return result; } + @Override protected OWLClass getLimit() { return getDataFactory().getOWLThing(); } + @Override protected OWLDataRange getDataLimit() { return getDataFactory().getTopDataType(); Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionPosNegComparator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionPosNegComparator.java 2009-04-19 09:27:10 UTC (rev 1714) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/EvaluatedDescriptionPosNegComparator.java 2009-04-19 16:38:14 UTC (rev 1715) @@ -43,16 +43,16 @@ double acc1 = ed1.getAccuracy(); double acc2 = ed2.getAccuracy(); if(acc1 > acc2) + return 1; + else if(acc1 < acc2) return -1; - else if(acc1 < acc2) - return 1; else { int length1 = ed1.getDescriptionLength(); int length2 = ed2.getDescriptionLength(); if(length1 < length2) + return 1; + else if(length1 > length2) return -1; - else if(length1 > length2) - return 1; else return cc.compare(ed1.getDescription(), ed2.getDescription()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2009-04-19 09:27:14
|
Revision: 1714 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1714&view=rev Author: heeroyuy Date: 2009-04-19 09:27:10 +0000 (Sun, 19 Apr 2009) Log Message: ----------- -some resize problems fixed -some changes on graphical panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/SuggestClassPanel.java Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-04-19 07:24:32 UTC (rev 1713) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2009-04-19 09:27:10 UTC (rev 1714) @@ -398,6 +398,7 @@ } } view.getSuggestClassPanel().setSuggestList(dm); + view.getLearnerView().repaint(); } }; SwingUtilities.invokeLater(doUpdateList); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-19 07:24:32 UTC (rev 1713) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerView.java 2009-04-19 09:27:10 UTC (rev 1714) @@ -159,7 +159,7 @@ learner = new JPanel(); advanced.setSize(20, 20); learner.setLayout(new GridBagLayout()); - accept.setPreferredSize(new Dimension(90, 50)); + accept.setPreferredSize(new Dimension(70, 40)); run.setPreferredSize(new Dimension(220, 50)); advanced.setName("Advanced"); learnerScroll.setPreferredSize(new Dimension(SCROLL_WIDTH, SCROLL_HEIGHT)); @@ -192,6 +192,7 @@ */ public void makeView(String label) { run.setText("suggest " + label + " expression"); + run.setPreferredSize(new Dimension(200, 40)); GridBagConstraints c = new GridBagConstraints(); learner.remove(detail); model.setID(label); @@ -208,7 +209,7 @@ learner.add(runPanel, c); sugPanel.setSuggestList(new DefaultListModel()); - c.fill = GridBagConstraints.NONE; + c.fill = GridBagConstraints.BOTH; c.gridx = 0; c.gridy = 1; c.weightx = 1.0; @@ -230,8 +231,6 @@ c.fill = GridBagConstraints.HORIZONTAL; c.gridwidth = GridBagConstraints.REMAINDER; c.gridx = 0; - c.weightx = 0.0; - c.weighty = 0.0; c.gridy = 2; learner.add(hint, c); @@ -248,7 +247,7 @@ learner.add(advancedPanel, c); posPanel.setVisible(false); - c.fill = GridBagConstraints.NONE; + c.fill = GridBagConstraints.BOTH; c.gridwidth = GridBagConstraints.RELATIVE; c.gridheight = GridBagConstraints.RELATIVE; c.gridx = 0; @@ -301,7 +300,8 @@ detail.setVisible(true); c.fill = GridBagConstraints.NONE; - c.gridwidth = GridBagConstraints.RELATIVE; + c.gridwidth = GridBagConstraints.REMAINDER; + c.anchor = GridBagConstraints.LINE_START; c.gridx = 0; c.gridy = 3; c.weightx = 0.0; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-04-19 07:24:32 UTC (rev 1713) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-04-19 09:27:10 UTC (rev 1714) @@ -21,6 +21,7 @@ import java.awt.AlphaComposite; import java.awt.Color; +import java.awt.Composite; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; @@ -101,13 +102,13 @@ */ public GraphicalCoveragePanel(EvaluatedDescription desc, DLLearnerModel m, String concept, MoreDetailForSuggestedConceptsPanel p) { - this.setPreferredSize(new Dimension(600, 220)); this.setVisible(false); this.setForeground(Color.GREEN); - this.repaint(); + this.setPreferredSize(new Dimension(500, 230)); eval = desc; model = m; panel = p; + this.repaint(); id = model.getID(); darkGreen = new Color(0, 100, 0); darkRed = new Color(205, 0, 0); @@ -147,7 +148,7 @@ if (eval != null) { Graphics2D g2D; g2D = (Graphics2D) g; - + Composite original = g2D.getComposite(); AlphaComposite ac = AlphaComposite.getInstance( AlphaComposite.SRC_OVER, 0.5f); g2D.setColor(Color.BLACK); @@ -162,32 +163,47 @@ } g2D.setColor(darkGreen); Ellipse2D circlePoint = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); - g2D.draw(circlePoint); + g2D.fill(circlePoint); g2D.setColor(Color.BLACK); - g2D.drawString("individuals covered by the", 320, p); + g2D.drawString("individuals covered by", 320, p); + g2D.setColor(Color.ORANGE); + g2D.fillOval(445, p - 9, 9, 9); + g2D.setColor(Color.BLACK); + g2D.drawString("and", 460, p); + g2D.setColor(Color.YELLOW); + g2D.fillOval(490, p - 9, 9, 9); p = p + 20; - g2D.drawString("new class expression", 320, p); - p = p + 20; if(id.equals(EQUI_STRING)) { g2D.setColor(darkRed); Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); - g2D.draw(circlePoint2); + g2D.fill(circlePoint2); g2D.setColor(Color.BLACK); - g2D.drawString("additional or not covered", 320, p); + g2D.drawString("individuals covered by", 320, p); + g2D.setColor(Color.ORANGE); + g2D.fillOval(445, p - 9, 9, 9); p = p + 20; - g2D.drawString("individuals", 320, p); + g2D.setColor(darkRed); + Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); + g2D.fill(circlePoint3); + g2D.setColor(Color.BLACK); + g2D.drawString("individuals covered by", 320, p); + g2D.setColor(Color.YELLOW); + g2D.fillOval(445, p - 9, 9, 9); } else { - g2D.setColor(darkRed); + g2D.setColor(Color.BLACK); Ellipse2D circlePoint2 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); - g2D.draw(circlePoint2); - g2D.setColor(Color.BLACK); - g2D.drawString("not covered individuals", 320, p); + g2D.fill(circlePoint2); + g2D.drawString("individuals covered by", 320, p); + g2D.setColor(Color.ORANGE); + g2D.fillOval(445, p - 9, 9, 9); p = p + 20; - g2D.setColor(Color.BLACK); + g2D.setColor(darkRed); Ellipse2D circlePoint3 = new Ellipse2D.Double(315 - 1, p - 6, 3, 3); - g2D.draw(circlePoint3); + g2D.fill(circlePoint3); g2D.setColor(Color.BLACK); - g2D.drawString("additional individuals", 320, p); + g2D.drawString("individuals covered by", 320, p); + g2D.setColor(Color.YELLOW); + g2D.fillOval(445, p - 9, 9, 9); } g2D.setColor(Color.YELLOW); @@ -311,18 +327,23 @@ for (int i = 0; i < posCovIndVector.size(); i++) { g2D.setColor(darkGreen); - g2D.draw(posCovIndVector.get(i).getIndividualPoint()); + g2D.fill(posCovIndVector.get(i).getIndividualPoint()); } for (int i = 0; i < posNotCovIndVector.size(); i++) { g2D.setColor(darkRed); - g2D.draw(posNotCovIndVector.get(i).getIndividualPoint()); + g2D.fill(posNotCovIndVector.get(i).getIndividualPoint()); } for (int i = 0; i < additionalIndividuals.size(); i++) { g2D.setColor(Color.BLACK); - g2D.draw(additionalIndividuals.get(i).getIndividualPoint()); + g2D.fill(additionalIndividuals.get(i).getIndividualPoint()); } + if(!((EvaluatedDescriptionClass) eval).isConsistent()) { + g2D.setComposite(original); + g2D.setColor(darkRed); + g2D.drawString("Adding this class expression may lead to an inconsistent ontology.", 0, 220); + } this.setVisible(true); panel.repaint(); } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-04-19 07:24:32 UTC (rev 1713) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2009-04-19 09:27:10 UTC (rev 1714) @@ -59,8 +59,8 @@ private final JTextArea concept; private Set<String> ontologiesStrings; private final JTextArea conceptText; - private static final int HEIGHT = 220; - private static final int WIDTH = 485; + private static final int HEIGHT = 230; + private static final int WIDTH = 510; private GraphicalCoveragePanel p; private final MoreDetailForSuggestedConceptsPanelHandler handler; @@ -112,7 +112,7 @@ //this method adds the informations for the selected concept to the panel this.setInformation(); p = new GraphicalCoveragePanel(eval, model, conceptText.getText(), this); - p.setBounds(5, 0, 600, 350); + p.setBounds(5, 0, 600, 700); //adds all information to the example panel unsetEverything(); conceptPanel.removeAll(); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2009-04-19 07:24:32 UTC (rev 1713) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2009-04-19 09:27:10 UTC (rev 1714) @@ -19,7 +19,8 @@ */ package org.dllearner.tools.protege; -import java.awt.Dimension; +import java.awt.BorderLayout; +import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; @@ -39,26 +40,27 @@ private final JSlider minAccuracy; private final JSlider maxExecutionTime; private final JSlider nrOfConcepts; + private JPanel labelPanel; + private JPanel sliderPanel; private double accuracy; /** * Constructor for the Option Panel. */ public OptionPanel() { - setPreferredSize(new Dimension(490, 150)); - setLayout(null); - minAccuracyLabel = new JLabel("noise in %"); - minAccuracyLabel.setBounds(5, 0, 150, 40); - maxExecutionTimeLabel = new JLabel("maximum execution time"); - maxExecutionTimeLabel.setBounds(5, 60, 150, 40); - nrOfConceptsLabel = new JLabel("max. number of results"); - nrOfConceptsLabel.setBounds(5, 120, 150, 40); + setLayout(new BorderLayout()); + labelPanel = new JPanel(); + labelPanel.setLayout(new GridLayout(0,1)); + sliderPanel = new JPanel(); + sliderPanel.setLayout(new GridLayout(0,1)); + minAccuracyLabel = new JLabel("noise in %: "); + maxExecutionTimeLabel = new JLabel("maximum execution time: "); + nrOfConceptsLabel = new JLabel("max. number of results: "); minAccuracy = new JSlider(0, 50, 5); minAccuracy.setPaintTicks(true); minAccuracy.setMajorTickSpacing(10); minAccuracy.setMinorTickSpacing(1); minAccuracy.setPaintLabels(true); - minAccuracy.setBounds(200, 0, 200, 40); maxExecutionTime = new JSlider(0, 40, 8); @@ -66,7 +68,6 @@ maxExecutionTime.setMajorTickSpacing(10); maxExecutionTime.setMinorTickSpacing(1); maxExecutionTime.setPaintLabels(true); - maxExecutionTime.setBounds(200, 60, 200, 40); nrOfConcepts = new JSlider(2, 20, 10); @@ -74,14 +75,16 @@ nrOfConcepts.setMajorTickSpacing(2); nrOfConcepts.setMinorTickSpacing(1); nrOfConcepts.setPaintLabels(true); - nrOfConcepts.setBounds(200, 120, 200, 40); - add(minAccuracyLabel); - add(minAccuracy); - add(maxExecutionTimeLabel); - add(maxExecutionTime); - add(nrOfConceptsLabel); - add(nrOfConcepts); + labelPanel.add(minAccuracyLabel); + labelPanel.add(maxExecutionTimeLabel); + labelPanel.add(nrOfConceptsLabel); + + sliderPanel.add(minAccuracy); + sliderPanel.add(maxExecutionTime); + sliderPanel.add(nrOfConcepts); + add(BorderLayout.WEST, labelPanel); + add(BorderLayout.CENTER, sliderPanel); } /** Modified: trunk/src/dl-learner/org/dllearner/tools/protege/SuggestClassPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/SuggestClassPanel.java 2009-04-19 07:24:32 UTC (rev 1713) +++ trunk/src/dl-learner/org/dllearner/tools/protege/SuggestClassPanel.java 2009-04-19 09:27:10 UTC (rev 1714) @@ -19,7 +19,7 @@ */ package org.dllearner.tools.protege; -import java.awt.Dimension; +import java.awt.BorderLayout; import javax.swing.DefaultListModel; import javax.swing.JList; @@ -48,26 +48,25 @@ //Scroll panel if the suggestions are longer than the Panel itself private final JScrollPane suggestScroll; - private static final int WIDTH = 460; - private static final int HEIGHT = 108; /** * This is the constructor for the suggest panel. * It creates a new Scroll panel and puts the Suggest List in it. */ public SuggestClassPanel() { super(); - this.setPreferredSize(new Dimension(470, 120)); + this.setLayout(new BorderLayout()); //renders scroll bars if necessary suggestScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); descriptions = new JList(); descriptions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); suggestPanel = new JPanel(); descriptions.setVisible(true); + descriptions.setVisibleRowCount(6); + descriptions.getPreferredScrollableViewportSize(); suggestPanel.add(descriptions); - suggestScroll.setPreferredSize(new Dimension(WIDTH, HEIGHT)); suggestScroll.setViewportView(descriptions); descriptions.setCellRenderer(new SuggestListCellRenderer()); - add(suggestScroll); + add(BorderLayout.CENTER, suggestScroll); } /** @@ -86,6 +85,7 @@ */ public void setSuggestList(DefaultListModel desc) { descriptions.setModel(desc); + descriptions.repaint(); repaint(); } /** @@ -104,12 +104,5 @@ descriptions.addMouseListener(action); } - - public void resizePanel(int w, int h) { - suggestScroll.setPreferredSize(new Dimension(WIDTH + w, HEIGHT + h)); - suggestScroll.setViewportView(descriptions); - add(suggestScroll); - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ku...@us...> - 2009-04-19 07:24:42
|
Revision: 1713 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1713&view=rev Author: kurzum Date: 2009-04-19 07:24:32 +0000 (Sun, 19 Apr 2009) Log Message: ----------- fixed termination criteria Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-04-17 10:28:36 UTC (rev 1712) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement2/ROLearner2.java 2009-04-19 07:24:32 UTC (rev 1713) @@ -1280,6 +1280,7 @@ if(this.stop){ return true; } + System.out.println("ssssss"); long totalTimeNeeded = System.currentTimeMillis() - this.runtime; long maxMilliSeconds = maxExecutionTimeInSeconds * 1000; long minMilliSeconds = minExecutionTimeInSeconds * 1000; @@ -1333,6 +1334,8 @@ } minExecutionTimeAlreadyReached = true; result = result && true; + }else { + result = false; } return result; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-17 10:28:38
|
Revision: 1712 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1712&view=rev Author: jenslehmann Date: 2009-04-17 10:28:36 +0000 (Fri, 17 Apr 2009) Log Message: ----------- extended build script to include manual (but not the LaTeX source) Modified Paths: -------------- trunk/bin/dllearner trunk/bin/dllearner.bat trunk/bin/gui trunk/bin/gui.bat trunk/bin/quickstart trunk/bin/quickstart.bat trunk/bin/ws trunk/bin/ws.bat trunk/build.xml trunk/src/dl-learner/org/dllearner/Info.java Modified: trunk/bin/dllearner =================================================================== --- trunk/bin/dllearner 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/dllearner 2009-04-17 10:28:36 UTC (rev 1712) @@ -1,2 +1,2 @@ #!/bin/bash -java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.Start $@ \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-core.jar:./lib/pellet/pellet-datatypes.jar:./lib/pellet/pellet-el.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet-owlapi.jar:./lib/pellet/pellet-rules.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/secondstring-20060615.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.Start $@ \ No newline at end of file Modified: trunk/bin/dllearner.bat =================================================================== --- trunk/bin/dllearner.bat 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/dllearner.bat 2009-04-17 10:28:36 UTC (rev 1712) @@ -1 +1 @@ -java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.Start %* \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-core.jar;.\lib\pellet\pellet-datatypes.jar;.\lib\pellet\pellet-el.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet-owlapi.jar;.\lib\pellet\pellet-rules.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\secondstring-20060615.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.Start %* \ No newline at end of file Modified: trunk/bin/gui =================================================================== --- trunk/bin/gui 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/gui 2009-04-17 10:28:36 UTC (rev 1712) @@ -1,2 +1,2 @@ #!/bin/bash -java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.gui.StartGUI $@ \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-core.jar:./lib/pellet/pellet-datatypes.jar:./lib/pellet/pellet-el.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet-owlapi.jar:./lib/pellet/pellet-rules.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/secondstring-20060615.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.gui.StartGUI $@ \ No newline at end of file Modified: trunk/bin/gui.bat =================================================================== --- trunk/bin/gui.bat 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/gui.bat 2009-04-17 10:28:36 UTC (rev 1712) @@ -1 +1 @@ -java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.gui.StartGUI %* \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-core.jar;.\lib\pellet\pellet-datatypes.jar;.\lib\pellet\pellet-el.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet-owlapi.jar;.\lib\pellet\pellet-rules.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\secondstring-20060615.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.gui.StartGUI %* \ No newline at end of file Modified: trunk/bin/quickstart =================================================================== --- trunk/bin/quickstart 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/quickstart 2009-04-17 10:28:36 UTC (rev 1712) @@ -1,2 +1,2 @@ #!/bin/bash -java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-core.jar:./lib/pellet/pellet-datatypes.jar:./lib/pellet/pellet-el.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet-owlapi.jar:./lib/pellet/pellet-rules.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/secondstring-20060615.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file Modified: trunk/bin/quickstart.bat =================================================================== --- trunk/bin/quickstart.bat 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/quickstart.bat 2009-04-17 10:28:36 UTC (rev 1712) @@ -1 +1 @@ -java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-core.jar;.\lib\pellet\pellet-datatypes.jar;.\lib\pellet\pellet-el.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet-owlapi.jar;.\lib\pellet\pellet-rules.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\secondstring-20060615.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.cli.QuickStart \ No newline at end of file Modified: trunk/bin/ws =================================================================== --- trunk/bin/ws 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/ws 2009-04-17 10:28:36 UTC (rev 1712) @@ -1,2 +1,2 @@ #!/bin/bash -java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.server.DLLearnerWSStart $@ \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .:./lib/dig1.1-xmlbeans.jar:./lib/fact/FaCTpp-OWLAPI-v1.1.11.jar:./lib/ini4j-0.3.2.jar:./lib/jamon-2.7.jar:./lib/jena/antlr-2.7.5.jar:./lib/jena/arq.jar:./lib/jena/commons-logging-1.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/mysql/mysql-connector-java-5.1.6-bin.jar:./lib/ore-tool/swingx-0.9.2.jar:./lib/owlapi/owlapi-bin.jar:./lib/pellet/aterm-java-1.6.jar:./lib/pellet/pellet-core.jar:./lib/pellet/pellet-datatypes.jar:./lib/pellet/pellet-el.jar:./lib/pellet/pellet-explanation.jar:./lib/pellet/pellet-owlapi.jar:./lib/pellet/pellet-rules.jar:./lib/pellet/relaxngDatatype.jar:./lib/pellet/xsdlib.jar:./lib/protege/org.protege.editor.core.application.jar:./lib/protege/org.protege.editor.owl.jar:./lib/secondstring-20060615.jar:./lib/xbean.jar:./lib/dllearner.jar org.dllearner.server.DLLearnerWSStart $@ \ No newline at end of file Modified: trunk/bin/ws.bat =================================================================== --- trunk/bin/ws.bat 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/bin/ws.bat 2009-04-17 10:28:36 UTC (rev 1712) @@ -1 +1 @@ -java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.server.DLLearnerWSStart %* \ No newline at end of file +java -Xmx512m -Djava.library.path=lib/fact/ -cp .;.\lib\dig1.1-xmlbeans.jar;.\lib\fact\FaCTpp-OWLAPI-v1.1.11.jar;.\lib\ini4j-0.3.2.jar;.\lib\jamon-2.7.jar;.\lib\jena\antlr-2.7.5.jar;.\lib\jena\arq.jar;.\lib\jena\commons-logging-1.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\mysql\mysql-connector-java-5.1.6-bin.jar;.\lib\ore-tool\swingx-0.9.2.jar;.\lib\owlapi\owlapi-bin.jar;.\lib\pellet\aterm-java-1.6.jar;.\lib\pellet\pellet-core.jar;.\lib\pellet\pellet-datatypes.jar;.\lib\pellet\pellet-el.jar;.\lib\pellet\pellet-explanation.jar;.\lib\pellet\pellet-owlapi.jar;.\lib\pellet\pellet-rules.jar;.\lib\pellet\relaxngDatatype.jar;.\lib\pellet\xsdlib.jar;.\lib\protege\org.protege.editor.core.application.jar;.\lib\protege\org.protege.editor.owl.jar;.\lib\secondstring-20060615.jar;.\lib\xbean.jar;.\lib\dllearner.jar org.dllearner.server.DLLearnerWSStart %* \ No newline at end of file Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/build.xml 2009-04-17 10:28:36 UTC (rev 1712) @@ -149,8 +149,9 @@ <!-- copy documentation excluding developer documentation --> <copy toDir="${release_tmp_dir}/doc"> <fileset dir="doc"> - <exclude name="eclipse/" /> - <exclude name="javadoc/" /> + <!-- <exclude name="eclipse/" /> + <exclude name="javadoc/" /> --> + <exclude name="manual/" /> </fileset> </copy> @@ -181,13 +182,18 @@ <fileset dir="${source_dir}" includes="**/*.java,**/*.html,**/*.gif,**/*.jjt,build.xml"/> </copy> + <!-- copy manual --> + <copy toFile="${release_tmp_dir}/doc/manual.pdf" file="doc/manual/manual.pdf" /> + <!-- create copy developer documentation --> + <!-- <copy todir="${release_tmp_dir}/doc/eclipse/"> <fileset dir="doc/eclipse/"/> </copy> <copy todir="${release_tmp_dir}/doc/javadoc/"> <fileset dir="doc/javadoc/"/> - </copy> + </copy> + --> <!-- create backup (= standard build + source code + developer documentation) --> <tar longfile="gnu" destfile="dllearner-${today}.tar.gz" compression="gzip"> Modified: trunk/src/dl-learner/org/dllearner/Info.java =================================================================== --- trunk/src/dl-learner/org/dllearner/Info.java 2009-04-17 09:51:53 UTC (rev 1711) +++ trunk/src/dl-learner/org/dllearner/Info.java 2009-04-17 10:28:36 UTC (rev 1712) @@ -3,6 +3,6 @@ package org.dllearner; public class Info { - public static final String build = "2009-02-17"; + public static final String build = "2009-04-17"; } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-17 09:52:04
|
Revision: 1711 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1711&view=rev Author: jenslehmann Date: 2009-04-17 09:51:53 +0000 (Fri, 17 Apr 2009) Log Message: ----------- added flag showing whether the suggested axiom already logically follows from the knowledge base Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-04-17 09:34:44 UTC (rev 1710) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-04-17 09:51:53 UTC (rev 1711) @@ -157,7 +157,10 @@ // leads to an inconsistent knowledge base boolean isConsistent = coverage >= 0.999999 || isConsistent(description); - return new ClassScore(coveredInstances, coverage, additionalInstances, protusion, getAccuracy(coverage, protusion), isConsistent); + // we check whether the axiom already follows from the knowledge base + boolean followsFromKB = reasoner.isSuperClassOf(description, classToDescribe); + + return new ClassScore(coveredInstances, coverage, additionalInstances, protusion, getAccuracy(coverage, protusion), isConsistent, followsFromKB); } public boolean isEquivalenceProblem() { Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-04-17 09:34:44 UTC (rev 1710) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-04-17 09:51:53 UTC (rev 1711) @@ -40,14 +40,16 @@ private double accuracy; private boolean isConsistent; + private boolean followsFromKB; - public ClassScore(Set<Individual> coveredInstances, double coverage, Set<Individual> additionalInstances, double protusion, double accuracy, boolean isConsistent) { + public ClassScore(Set<Individual> coveredInstances, double coverage, Set<Individual> additionalInstances, double protusion, double accuracy, boolean isConsistent, boolean followsFromKB) { this.coveredInstances = coveredInstances; this.additionalInstances = additionalInstances; this.coverage = coverage; this.addition = protusion; this.accuracy = accuracy; this.isConsistent = isConsistent; + this.followsFromKB = followsFromKB; } /** @@ -95,6 +97,13 @@ */ public boolean isConsistent() { return isConsistent; + } + + /** + * @return the followsFromKB + */ + public boolean followsFromKB() { + return followsFromKB; } } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java 2009-04-17 09:34:44 UTC (rev 1710) +++ trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java 2009-04-17 09:51:53 UTC (rev 1711) @@ -87,4 +87,12 @@ return classScore.isConsistent(); } + /** + * + * @return True if adding the axiom to the knowledge base does not logically change the knowledge base (i.e. the axiom already follows from it). False otherwise. + */ + public boolean followsFromKB() { + return classScore.followsFromKB(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-17 09:34:46
|
Revision: 1710 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1710&view=rev Author: jenslehmann Date: 2009-04-17 09:34:44 +0000 (Fri, 17 Apr 2009) Log Message: ----------- CELOE bug fixes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/utilities/owl/ConceptTransformation.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-04-17 06:36:08 UTC (rev 1709) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-04-17 09:34:44 UTC (rev 1710) @@ -410,7 +410,7 @@ } else { // none of the superclasses of the class to learn must appear on the // outermost property level - TreeSet<Description> toTest = new TreeSet<Description>(); + TreeSet<Description> toTest = new TreeSet<Description>(descriptionComparator); toTest.add(classToDescribe); while(!toTest.isEmpty()) { Description d = toTest.pollFirst(); Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/ConceptTransformation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/ConceptTransformation.java 2009-04-17 06:36:08 UTC (rev 1709) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/ConceptTransformation.java 2009-04-17 09:34:44 UTC (rev 1710) @@ -39,6 +39,7 @@ import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.Property; import org.dllearner.core.owl.Restriction; import org.dllearner.core.owl.Union; import org.dllearner.core.owl.Negation; @@ -572,6 +573,11 @@ } } + /** + * Counts occurrences of \forall in description. + * @param description A description. + * @return Number of \forall occurrences. + */ public static int getForallOccurences(Description description) { int count = 0; if(description instanceof ObjectAllRestriction) { @@ -583,6 +589,13 @@ return count; } + /** + * Gets the "contexts" of all \forall occurrences in a description. A context + * is a set of properties, i.e. in \exists hasChild.\exists hasBrother.\forall hasChild.male, + * the context of the only \forall occurrence is [hasChild, hasBrother, hasChild]. + * @param description A description. + * @return Set of property contexts. + */ public static SortedSet<PropertyContext> getForallContexts(Description description) { return getForallContexts(description, new PropertyContext()); } @@ -590,17 +603,23 @@ private static SortedSet<PropertyContext> getForallContexts(Description description, PropertyContext currentContext) { // the context changes if we have a restriction if(description instanceof Restriction) { - ObjectProperty op = (ObjectProperty) ((Restriction)description).getRestrictedPropertyExpression(); - currentContext.add(op); - // if we have an all-restriction, we return it; otherwise we only change the context - // and call the method on the child - if(description instanceof ObjectAllRestriction) { - TreeSet<PropertyContext> contexts = new TreeSet<PropertyContext>(); - contexts.add(currentContext); - contexts.addAll(getForallContexts(description.getChild(0), currentContext)); - return contexts; + Property op = (Property) ((Restriction)description).getRestrictedPropertyExpression(); + // object restrictions + if(op instanceof ObjectProperty) { + currentContext.add((ObjectProperty)op); + // if we have an all-restriction, we return it; otherwise we only change the context + // and call the method on the child + if(description instanceof ObjectAllRestriction) { + TreeSet<PropertyContext> contexts = new TreeSet<PropertyContext>(); + contexts.add(currentContext); + contexts.addAll(getForallContexts(description.getChild(0), currentContext)); + return contexts; + } else { + return getForallContexts(description.getChild(0), currentContext); + } + // we have a data restriction => no \forall can occur in those } else { - return getForallContexts(description.getChild(0), currentContext); + return new TreeSet<PropertyContext>(); } // for non-restrictions, we collect contexts over all children } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2009-04-17 06:36:10
|
Revision: 1709 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1709&view=rev Author: jenslehmann Date: 2009-04-17 06:36:08 +0000 (Fri, 17 Apr 2009) Log Message: ----------- small logo versions Added Paths: ----------- trunk/resources/logos/dllearner_small.png trunk/resources/logos/dllearner_thumbnail.png Added: trunk/resources/logos/dllearner_small.png =================================================================== (Binary files differ) Property changes on: trunk/resources/logos/dllearner_small.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/resources/logos/dllearner_thumbnail.png =================================================================== (Binary files differ) Property changes on: trunk/resources/logos/dllearner_thumbnail.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |