From: <jen...@us...> - 2007-08-27 17:20:03
|
Revision: 71 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=71&view=rev Author: jenslehmann Date: 2007-08-27 10:20:01 -0700 (Mon, 27 Aug 2007) Log Message: ----------- added support for querying the most general and most specific roles Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/reasoning/ReasoningService.java trunk/src/dl-learner/org/dllearner/reasoning/RoleHierarchy.java Modified: trunk/src/dl-learner/org/dllearner/reasoning/ReasoningService.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/ReasoningService.java 2007-08-27 16:42:51 UTC (rev 70) +++ trunk/src/dl-learner/org/dllearner/reasoning/ReasoningService.java 2007-08-27 17:20:01 UTC (rev 71) @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Set; import java.util.SortedSet; +import java.util.TreeSet; import org.dllearner.OntologyFileFormat; import org.dllearner.dl.AtomicConcept; @@ -291,6 +292,7 @@ /** * Returns more general concepts in the subsumption hierarchy. * + * @see RoleHierarchy#getMoreGeneralRoles(AtomicRole) * @param role Atomic concept, top, or bottom. * @return A set of more general concepts. */ @@ -301,6 +303,7 @@ /** * Returns more special concepts in the subsumption hierarchy. * + * @see RoleHierarchy#getMoreSpecialRoles(AtomicRole) * @param role Atomic concept, top, or bottom. * @return A set of more special concepts. */ @@ -308,6 +311,22 @@ return getRoleHierarchy().getMoreSpecialRoles(role); } + /** + * @see RoleHierarchy#getMostGeneralRoles() + * @return The most general roles. + */ + public TreeSet<AtomicRole> getMostGeneralRoles() { + return getRoleHierarchy().getMostGeneralRoles(); + } + + /** + * @see RoleHierarchy#getMostSpecialRoles() + * @return The most special roles. + */ + public TreeSet<AtomicRole> getMostSpecialRoles() { + return getRoleHierarchy().getMostSpecialRoles(); + } + public SubsumptionHierarchy getSubsumptionHierarchy() { try { nrOfSubsumptionHierarchyQueries++; Modified: trunk/src/dl-learner/org/dllearner/reasoning/RoleHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/RoleHierarchy.java 2007-08-27 16:42:51 UTC (rev 70) +++ trunk/src/dl-learner/org/dllearner/reasoning/RoleHierarchy.java 2007-08-27 17:20:01 UTC (rev 71) @@ -69,6 +69,8 @@ return (TreeSet<AtomicRole>) roleHierarchyDown.get(role).clone(); } + + @Override public String toString() { String str = ""; @@ -89,5 +91,20 @@ str += toString(hierarchy, c, depth+1); } return str; - } + } + + /** + * @return The most general roles. + */ + public TreeSet<AtomicRole> getMostGeneralRoles() { + return mostGeneralRoles; + } + + /** + * @return The most special roles. + */ + public TreeSet<AtomicRole> getMostSpecialRoles() { + return mostSpecialRoles; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |