From: <jen...@us...> - 2009-12-29 15:39:57
|
Revision: 1961 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1961&view=rev Author: jenslehmann Date: 2009-12-29 15:39:49 +0000 (Tue, 29 Dec 2009) Log Message: ----------- rewrote max. 0 cardinality restrictions to make them easier to read for humans Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/core/owl/Negation.java trunk/src/dl-learner/org/dllearner/utilities/owl/DescriptionMinimizer.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-12-29 15:24:35 UTC (rev 1960) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-12-29 15:39:49 UTC (rev 1961) @@ -533,7 +533,7 @@ // check whether the node is a potential solution candidate private Description rewriteNode(OENode node) { Description description = node.getDescription(); - // minimize description (expensive!) + // minimize description (expensive!) - also performes some human friendly rewrites Description niceDescription = minimizer.minimizeClone(description); // replace \exists r.\top with \exists r.range(r) which is easier to read for humans ConceptTransformation.replaceRange(niceDescription, reasoner); Modified: trunk/src/dl-learner/org/dllearner/core/owl/Negation.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/owl/Negation.java 2009-12-29 15:24:35 UTC (rev 1960) +++ trunk/src/dl-learner/org/dllearner/core/owl/Negation.java 2009-12-29 15:39:49 UTC (rev 1961) @@ -58,6 +58,6 @@ */ @Override public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) { - return "(not " +children.get(0).toString(baseURI, prefixes) + ")"; + return "(not " +children.get(0).toManchesterSyntaxString(baseURI, prefixes) + ")"; } } Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/DescriptionMinimizer.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/DescriptionMinimizer.java 2009-12-29 15:24:35 UTC (rev 1960) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/DescriptionMinimizer.java 2009-12-29 15:39:49 UTC (rev 1961) @@ -128,6 +128,11 @@ if(description.getChild(0) instanceof Nothing) { return Thing.instance; } + // we rewrite <= 0 r C to \neg \exists r C - easier to read for humans + if(((ObjectMaxCardinalityRestriction)description).getCardinality() == 0) { + ObjectProperty p = (ObjectProperty)((ObjectMaxCardinalityRestriction)description).getRole(); + return new Negation(new ObjectSomeRestriction(p, description.getChild(0))); + } return description; } else if(description instanceof ObjectMinCardinalityRestriction) { // >= 0 r.C \equiv \top This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |