From: <hee...@us...> - 2008-12-07 22:42:12
|
Revision: 1543 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1543&view=rev Author: heeroyuy Date: 2008-12-07 22:42:06 +0000 (Sun, 07 Dec 2008) Log Message: ----------- -added arrows for the buttons to change an individual to positive or negative example list -added install and readme Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/tools/protege/Install_protege trunk/src/dl-learner/org/dllearner/tools/protege/Readme_protege trunk/src/dl-learner/org/dllearner/tools/protege/backspace.gif trunk/src/dl-learner/org/dllearner/tools/protege/space.gif Modified: trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2008-12-02 15:26:20 UTC (rev 1542) +++ trunk/src/dl-learner/org/dllearner/tools/protege/ActionHandler.java 2008-12-07 22:42:06 UTC (rev 1543) @@ -75,6 +75,8 @@ private Timer timer; private LearningAlgorithm la; private SuggestionRetriever retriever; + private final Color colorRed = new Color(139,0,0); + private final Color colorGreen = new Color(0,139,0); /** * This is the constructor for the action handler. * @@ -220,16 +222,27 @@ for (Iterator<EvaluatedDescription> i = model .getEvaluatedDescriptionList().iterator(); i.hasNext();) { eDescription = i.next(); - if (desc.equals(eDescription.getDescription() - .toManchesterSyntaxString( - editorKit.getModelManager() - .getActiveOntology().getURI().toString() - , null))) { - evaluatedDescription = eDescription; - - break; + if(eDescription.getDescription().toString().contains("#")) { + if (desc.equals(eDescription.getDescription() + .toManchesterSyntaxString( + editorKit.getModelManager() + .getActiveOntology().getURI().toString() + "#" + , null))) { + evaluatedDescription = eDescription; + + break; + } + } else { + if (desc.equals(eDescription.getDescription() + .toManchesterSyntaxString( + editorKit.getModelManager() + .getActiveOntology().getURI().toString() + , null))) { + evaluatedDescription = eDescription; + + break; + } } - } } @@ -400,14 +413,26 @@ while(ont.hasNext()) { String onto = ont.next().getURI().toString(); if(eval.getDescription().toString().contains(onto)) { - if(model.isConsistent(eval)) { - dm.add(i, new SuggestListItem(Color.GREEN, eval.getDescription().toManchesterSyntaxString(onto, null))); - i++; - break; + if(eval.getDescription().toString().contains("#")) { + if(model.isConsistent(eval)) { + dm.add(i, new SuggestListItem(colorGreen, eval.getDescription().toManchesterSyntaxString(onto+"#", null))); + i++; + break; + } else { + dm.add(i, new SuggestListItem(colorRed, eval.getDescription().toManchesterSyntaxString(onto+"#", null))); + i++; + break; + } } else { - dm.add(i, new SuggestListItem(Color.RED, eval.getDescription().toManchesterSyntaxString(onto, null))); - i++; - break; + if(model.isConsistent(eval)) { + dm.add(i, new SuggestListItem(colorGreen, eval.getDescription().toManchesterSyntaxString(onto, null))); + i++; + break; + } else { + dm.add(i, new SuggestListItem(colorRed, eval.getDescription().toManchesterSyntaxString(onto, null))); + i++; + break; + } } } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2008-12-02 15:26:20 UTC (rev 1542) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2008-12-07 22:42:06 UTC (rev 1543) @@ -402,25 +402,49 @@ OWLOntology ont = onto.next(); String indiv = ind.toString(); // checks if individual belongs to the selected concept - if (setPositivExamplesChecked(indiv)) { - if (indiv.contains(ont.getURI().toString())) { - // when yes then it sets the positive example checked + if(ind.toString().contains("#")) { + if (setPositivExamplesChecked(indiv)) { + if (indiv.contains(ont.getURI().toString())) { + // when yes then it sets the positive example checked - // OWLExpressionCheckerFactory - posListModel.add(0, ind.toManchesterSyntaxString(ont - .getURI().toString(), null)); - individualVector.add(new IndividualObject(indiv, true)); - break; + // OWLExpressionCheckerFactory + posListModel.add(0, ind.toManchesterSyntaxString(ont + .getURI().toString()+"#", null)); + individualVector.add(new IndividualObject(indiv, true)); + break; + } + + } else { + // When no it unchecks the positive example + if (indiv.contains(ont.getURI().toString())) { + individualVector + .add(new IndividualObject(indiv, false)); + negListModel.add(0, ind.toManchesterSyntaxString(ont + .getURI().toString()+"#", null)); + break; + } } + } else { + if (setPositivExamplesChecked(indiv)) { + if (indiv.contains(ont.getURI().toString())) { + // when yes then it sets the positive example checked - } else { - // When no it unchecks the positive example - if (indiv.contains(ont.getURI().toString())) { - individualVector - .add(new IndividualObject(indiv, false)); - negListModel.add(0, ind.toManchesterSyntaxString(ont - .getURI().toString(), null)); - break; + // OWLExpressionCheckerFactory + posListModel.add(0, ind.toManchesterSyntaxString(ont + .getURI().toString(), null)); + individualVector.add(new IndividualObject(indiv, true)); + break; + } + + } else { + // When no it unchecks the positive example + if (indiv.contains(ont.getURI().toString())) { + individualVector + .add(new IndividualObject(indiv, false)); + negListModel.add(0, ind.toManchesterSyntaxString(ont + .getURI().toString(), null)); + break; + } } } } Added: trunk/src/dl-learner/org/dllearner/tools/protege/Install_protege =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/Install_protege (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/protege/Install_protege 2008-12-07 22:42:06 UTC (rev 1543) @@ -0,0 +1,15 @@ +Requirements +============ +Java 6 and the Prot\xE9g\xE9 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\xE9g\xE9. + +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\xE9g\xE9 and close the old class description view. All features are included in the plugin. +If you have problems look at the screen cast in the release bundle. + + Modified: trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2008-12-02 15:26:20 UTC (rev 1542) +++ trunk/src/dl-learner/org/dllearner/tools/protege/MoreDetailForSuggestedConceptsPanel.java 2008-12-07 22:42:06 UTC (rev 1543) @@ -109,10 +109,10 @@ private JPanel negCoveredPanel; private JPanel negNotCoveredPanel; private EvaluatedDescription eval; - private final Color colorRed = Color.red; private JTextArea concept; private JTextArea conceptText; - private final Color colorGreen = Color.green; + private final Color colorRed = new Color(139,0,0); + private final Color colorGreen = new Color(0,139,0); /** * This is the constructor for the Panel. * @param model DLLearnerModel @@ -239,7 +239,12 @@ private void setInformation() { if(eval!=null) { //sets the accuracy of the selected concept - conceptText.setText(eval.getDescription().toManchesterSyntaxString(model.getURI().toString(), null)); + System.out.println("EVAL: " + eval.getDescription()); + if(eval.getDescription().toString().contains("#")) { + conceptText.setText(eval.getDescription().toManchesterSyntaxString(model.getURI().toString() + "#", null)); + } else { + conceptText.setText(eval.getDescription().toManchesterSyntaxString(model.getURI().toString(), null)); + } double acc = (eval.getAccuracy())*100; accuracyText.setText(String.valueOf(acc)+"%"); Iterator<Individual> i = eval.getCoveredPositives().iterator(); @@ -248,10 +253,20 @@ Individual ind = i.next(); while (onto.hasNext()) { String uri = onto.next().getURI().toString(); - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorGreen); - posCoveredPanel.add(posLabel); + if(ind.toString().contains("#")) { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); + posLabel.setForeground(colorGreen); + posCoveredPanel.add(posLabel); + break; + } + } else { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); + posLabel.setForeground(colorGreen); + posCoveredPanel.add(posLabel); + break; + } } } @@ -264,10 +279,20 @@ Individual ind = a.next(); while (onto.hasNext()) { String uri = onto.next().getURI().toString(); - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorRed); - posNotCoveredPanel.add(posLabel); + if(ind.toString().contains("#")) { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); + posLabel.setForeground(colorRed); + posNotCoveredPanel.add(posLabel); + break; + } + } else { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); + posLabel.setForeground(colorRed); + posNotCoveredPanel.add(posLabel); + break; + } } } @@ -282,10 +307,20 @@ Individual ind = b.next(); while (onto.hasNext()) { String uri = onto.next().getURI().toString(); - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorRed); - negCoveredPanel.add(posLabel); + if(ind.toString().contains("#")) { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); + posLabel.setForeground(colorRed); + negCoveredPanel.add(posLabel); + break; + } + } else { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); + posLabel.setForeground(colorRed); + negCoveredPanel.add(posLabel); + break; + } } } @@ -299,10 +334,18 @@ Individual ind = c.next(); while (onto.hasNext()) { String uri = onto.next().getURI().toString(); - if(ind.toString().contains(uri)) { - JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); - posLabel.setForeground(colorGreen); - negNotCoveredPanel.add(posLabel); + if(ind.toString().contains("#")) { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri + "#", null)); + posLabel.setForeground(colorGreen); + negNotCoveredPanel.add(posLabel); + } + } else { + if(ind.toString().contains(uri)) { + JLabel posLabel = new JLabel(ind.toManchesterSyntaxString(uri, null)); + posLabel.setForeground(colorGreen); + negNotCoveredPanel.add(posLabel); + } } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2008-12-02 15:26:20 UTC (rev 1542) +++ trunk/src/dl-learner/org/dllearner/tools/protege/OptionPanel.java 2008-12-07 22:42:06 UTC (rev 1543) @@ -61,7 +61,7 @@ minAccuracy.setPaintLabels(true); - maxExecutionTime = new JSlider(2, 20, 3); + maxExecutionTime = new JSlider(2, 20, 5); maxExecutionTime.setPaintTicks(true); maxExecutionTime.setMajorTickSpacing(5); maxExecutionTime.setMinorTickSpacing(1); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java 2008-12-02 15:26:20 UTC (rev 1542) +++ trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanel.java 2008-12-07 22:42:06 UTC (rev 1543) @@ -21,8 +21,10 @@ import java.awt.Dimension; import java.awt.GridLayout; +import java.net.URL; import javax.swing.DefaultListModel; +import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JList; @@ -90,6 +92,8 @@ // This is the Text area where the help message is displayed. private OptionPanel optionPanel; private DefaultListModel posListModel; + private ImageIcon addToPosListIcon; + private ImageIcon addToNegListIcon; private DefaultListModel negListModel; private JPanel examplePanel; private PosAndNegSelectPanelHandler handler; @@ -117,6 +121,10 @@ examplePanel = new JPanel(null); posLabelPanel = new JPanel(null); negLabelPanel = new JPanel(null); + URL iconUrl = this.getClass().getResource("backspace.gif"); + addToPosListIcon = new ImageIcon(iconUrl); + URL toggledIconUrl = this.getClass().getResource("space.gif"); + addToNegListIcon = new ImageIcon(toggledIconUrl); posListModel = new DefaultListModel(); negListModel = new DefaultListModel(); pos = new JLabel("Positive Examples"); @@ -129,8 +137,10 @@ negList = new JList(negListModel); negList.setName("neg"); negList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - addToPosExamples = new JButton("pos"); - addToNegExamples = new JButton("neg"); + addToPosExamples = new JButton(addToPosListIcon); + addToPosExamples.setName("pos"); + addToNegExamples = new JButton(addToNegListIcon); + addToNegExamples.setName("neg"); helpForPosExamples = new JButton("?"); helpForPosExamples.setBounds(100, 5, 20, 20); helpForNegExamples = new JButton("?"); Modified: trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java 2008-12-02 15:26:20 UTC (rev 1542) +++ trunk/src/dl-learner/org/dllearner/tools/protege/PosAndNegSelectPanelHandler.java 2008-12-07 22:42:06 UTC (rev 1543) @@ -60,8 +60,8 @@ */ public void actionPerformed(ActionEvent action) { - - if (action.getActionCommand().equals("pos")) { + System.out.println(action.getSource()); + if (action.getSource().toString().contains("pos")) { panel.setExampleToOtherList(true, panel.getNegExampleList().getSelectedValue().toString()); System.out.println("COUNT: " + panel.getPosExampleList().getModel().getSize()); if(panel.getPosExampleList().getModel().getSize()>0) { @@ -69,7 +69,7 @@ } } - if (action.getActionCommand().equals("neg")) { + if (action.getSource().toString().contains("neg")) { panel.setExampleToOtherList(false, panel.getPosExampleList().getSelectedValue().toString()); } Added: trunk/src/dl-learner/org/dllearner/tools/protege/Readme_protege =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/Readme_protege (rev 0) +++ trunk/src/dl-learner/org/dllearner/tools/protege/Readme_protege 2008-12-07 22:42:06 UTC (rev 1543) @@ -0,0 +1,15 @@ +README +====== +The Prot\xE9g\xE9 DL-Learner plugin allows to learn equivalence and super class axioms based on +the instance data in the ontologies loaded in Prot\xE9g\xE9. It integrated seamlessly in Prot\xE9g\xE9. + +Homepage: http://dl-learner.org/wiki/ProtegePlugin +Sourceforge.net Project Page: http://sourceforge.net/projects/dl-learner/ +Bugs & Feature Requests: http://sourceforge.net/tracker/?group_id=203619 +Mailing Lists: http://sourceforge.net/mail/?group_id=203619 +Latest Release: http://sourceforge.net/project/showfiles.php?group_id=203619 + +The Prot\xE9g\xE9 Plugin is Open Source and licenced under the GNU General Public License. + +Documentation for the Prot\xE9g\xE9 Plugin can be found +at http://dl-learner.org/wiki/ProtegePlugin. Added: trunk/src/dl-learner/org/dllearner/tools/protege/backspace.gif =================================================================== (Binary files differ) Property changes on: trunk/src/dl-learner/org/dllearner/tools/protege/backspace.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/src/dl-learner/org/dllearner/tools/protege/space.gif =================================================================== (Binary files differ) Property changes on: trunk/src/dl-learner/org/dllearner/tools/protege/space.gif ___________________________________________________________________ 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. |