From: <hee...@us...> - 2009-11-26 14:10:18
|
Revision: 1923 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1923&view=rev Author: heeroyuy Date: 2009-11-26 14:10:09 +0000 (Thu, 26 Nov 2009) Log Message: ----------- -added some additional information on graphical panel Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF Modified: trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -564,6 +564,10 @@ public boolean getIsKnowledgeSourceIsUpdated() { return knowledgeSourceIsUpdated; } + + public OWLEditorKit getOWLEditorKit() { + return editor; + } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanel.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -35,6 +35,7 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.owl.Individual; import org.dllearner.learningproblems.EvaluatedDescriptionClass; +import org.semanticweb.owl.model.OWLDataFactory; /** * This class draws the graphical coverage of a learned concept. @@ -87,6 +88,7 @@ private final Color darkGreen; private final Color darkRed; private int notCoveredInd; + private OWLDataFactory factory; /** * @@ -137,6 +139,7 @@ + adjustment, ELLIPSE_Y_AXIS, WIDTH + distortionOld, HEIGHT + distortionOld); } + factory = model.getOWLEditorKit().getOWLModelManager().getOWLDataFactory(); this.computeIndividualPoints(); this.addMouseMotionListener(handler); this.addMouseListener(handler); @@ -497,7 +500,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { posCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } i++; @@ -545,7 +548,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { posNotCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } } else { @@ -553,7 +556,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { additionalIndividuals.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } } @@ -594,7 +597,7 @@ for(String uri : uriString) { if(ind.toString().contains(uri)) { posNotCovIndVector.add(new IndividualPoint("*", - (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), ind, uri)); + (int) x, (int) y, ind.toManchesterSyntaxString(uri, null), factory.getOWLIndividual(ind.getURI()), ind, uri)); } } k++; Modified: trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/GraphicalCoveragePanelHandler.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -37,6 +37,12 @@ import org.dllearner.core.owl.ObjectProperty; import org.dllearner.learningproblems.EvaluatedDescriptionClass; import org.dllearner.reasoning.FastInstanceChecker; +import org.semanticweb.owl.model.OWLDataPropertyAssertionAxiom; +import org.semanticweb.owl.model.OWLDifferentIndividualsAxiom; +import org.semanticweb.owl.model.OWLNegativeDataPropertyAssertionAxiom; +import org.semanticweb.owl.model.OWLNegativeObjectPropertyAssertionAxiom; +import org.semanticweb.owl.model.OWLOntology; +import org.semanticweb.owl.model.OWLSameIndividualsAxiom; /** * This class takes care of all events happening in the GraphicalCoveragePanel. @@ -55,6 +61,7 @@ private BasicComboPopup scrollPopup; private final Vector<String> individualComboBox; private JComboBox indiBox; + private OWLOntology ontology; /** * This is the constructor for the handler. @@ -71,6 +78,8 @@ this.panel = p; description = eval; model = m; + ontology = model.getOWLEditorKit().getOWLModelManager() + .getActiveOntology(); individualComboBox = new Vector<String>(); } @@ -113,12 +122,13 @@ && v.get(i).getXAxis() <= m.getX() + 5 && v.get(i).getYAxis() >= m.getY() - 5 && v.get(i).getYAxis() <= m.getY() + 5) { - String individualInformation = "<html><body>" - + v.get(i).getIndividualName().toString(); + String individualInformation = "<html><body><b>" + + v.get(i).getIndividualName().toString() + "</b>"; if (v.get(i).getDLLearnerIndividual() != null) { + Set<NamedClass> types = reasoner.getTypes(v.get(i) .getDLLearnerIndividual()); - individualInformation += "<br><b>Types:</b><br>"; + individualInformation += "<br><br><b>Types:</b><br>"; for (NamedClass dlLearnerClass : types) { individualInformation += dlLearnerClass .toManchesterSyntaxString( @@ -146,6 +156,43 @@ } individualInformation += "<br>"; } + if (v.get(i).getIndividualOWL() != null) { + Set<OWLDataPropertyAssertionAxiom> dataProperties = ontology + .getDataPropertyAssertionAxioms(v.get(i) + .getIndividualOWL()); + individualInformation += "<br><b>Dataproperties</b><br>"; + for (OWLDataPropertyAssertionAxiom dataProperty : dataProperties) { + individualInformation += dataProperty.toString() + + "<br>"; + } + + Set<OWLNegativeObjectPropertyAssertionAxiom> negObjects = ontology.getNegativeObjectPropertyAssertionAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>negative ObjectProperties</b><br>"; + for (OWLNegativeObjectPropertyAssertionAxiom negObject : negObjects) { + individualInformation += negObject.toString() + + "<br>"; + } + + Set<OWLNegativeDataPropertyAssertionAxiom> negDatas = ontology.getNegativeDataPropertyAssertionAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>negative Dataproperties</b><br>"; + for (OWLNegativeDataPropertyAssertionAxiom negData : negDatas) { + individualInformation += negData.toString() + + "<br>"; + } + Set<OWLSameIndividualsAxiom> sameIndies = ontology.getSameIndividualAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>Same Individuals</b><br>"; + for (OWLSameIndividualsAxiom sameIndie : sameIndies) { + individualInformation += sameIndie.toString() + + "<br>"; + } + + Set<OWLDifferentIndividualsAxiom> differentIndies = ontology.getDifferentIndividualAxioms(v.get(i).getIndividualOWL()); + individualInformation += "<br><b>Different Individuals</b><br>"; + for (OWLDifferentIndividualsAxiom differentIndie : differentIndies) { + individualInformation += differentIndie.toString() + + "<br>"; + } + } } individualInformation += "</body></htlm>"; panel.getGraphicalCoveragePanel().setToolTipText( Modified: trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/IndividualPoint.java 2009-11-26 14:10:09 UTC (rev 1923) @@ -22,6 +22,7 @@ import java.awt.geom.Ellipse2D; import org.dllearner.core.owl.Individual; +import org.semanticweb.owl.model.OWLIndividual; /** * This class is a datastructure for one individual shown in @@ -38,6 +39,7 @@ private final Ellipse2D circlePoint; private Individual individualDLLearner; private String baseUri; + private OWLIndividual individualOWL; /** * Constructor of the class. @@ -74,6 +76,27 @@ this.individualDLLearner = indi; this.baseUri = base; } + + /** + * + * @param p + * @param x + * @param y + * @param ind + * @param indi + * @param base + */ + public IndividualPoint(String p, int x, int y, String ind, OWLIndividual indi, Individual indiDLLearner, String base) { + this.point = p; + this.xAxis = x; + this.yAxis = y; + this.circlePoint = new Ellipse2D.Double(x-1, y-1, 4, 4); + this.individual = ind; + this.individualOWL = indi; + this.individualDLLearner = indiDLLearner; + this.baseUri = base; + + } /** * This method returns the display string of the individual. @@ -130,4 +153,12 @@ public String getBaseUri() { return baseUri; } + + /** + * + * @return + */ + public OWLIndividual getIndividualOWL() { + return individualOWL; + } } Modified: trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF =================================================================== --- trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF 2009-11-26 13:24:53 UTC (rev 1922) +++ trunk/src/dl-learner/org/dllearner/tools/protege/META-INF/MANIFEST.MF 2009-11-26 14:10:09 UTC (rev 1923) @@ -6,7 +6,7 @@ Bundle-Description: Protege DL-Learner Plugin Bundle-Vendor: DL-Learner Project Bundle-DocURL: http://dl-learner.org/wiki/ProtegePlugin -Bundle-ClassPath: .,lib/junit-4.4.jar,lib/jamon-2.7.jar,lib/pellet/pellet-core.jar,lib/pellet/pellet-datatypes.jar,lib/ore-tool/BrowserLauncher2-all-1_3.jar,lib/pellet/pellet-el.jar,lib/pellet/pellet-explanation.jar,lib/pellet/pellet-owlapi.jar,lib/pellet/pellet-rules.jar,lib/pellet/aterm-java-1.6.jar,lib/jena/json.jar,lib/pellet/relaxngDatatype.jar,lib/pellet/xsdlib.jar,lib/jena/commons-logging-1.1.1.jar,lib/ore-tool/swingx-0.9.2.jar +Bundle-ClassPath: .,lib/junit-4.4.jar,lib/jamon-2.7.jar,lib/pellet/pellet-core.jar,lib/pellet/pellet-datatypes.jar,lib/ore-tool/BrowserLauncher2-all-1_3.jar,lib/pellet/pellet-el.jar,lib/pellet/pellet-explanation.jar,lib/pellet/pellet-owlapi.jar,lib/pellet/pellet-rules.jar,lib/pellet/aterm-java-1.6.jar,lib/jena/json.jar,lib/pellet/relaxngDatatype.jar,lib/pellet/xsdlib.jar,lib/jena/commons-logging-1.1.1.jar,lib/ore-tool/swingx-0.9.2.jar,lib/owlapi/owlapiV3-bin.jar Import-Package: org.osgi.framework,org.apache.log4j Export-Package: lib Bundle-Version: 0.5.2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |