From: <jen...@us...> - 2008-02-11 15:03:54
|
Revision: 539 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=539&view=rev Author: jenslehmann Date: 2008-02-11 07:03:50 -0800 (Mon, 11 Feb 2008) Log Message: ----------- - continued carcinogenesis mapper - started datatype support in DL-Learner core Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiDown.java trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiUp.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/Reasoner.java trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java trunk/src/dl-learner/org/dllearner/core/ReasoningService.java trunk/src/dl-learner/org/dllearner/core/config/CommonConfigMappings.java trunk/src/dl-learner/org/dllearner/core/dl/All.java trunk/src/dl-learner/org/dllearner/core/dl/ConceptAssertion.java trunk/src/dl-learner/org/dllearner/core/dl/Exists.java trunk/src/dl-learner/org/dllearner/core/dl/FunctionalRoleAxiom.java trunk/src/dl-learner/org/dllearner/core/dl/GreaterEqual.java trunk/src/dl-learner/org/dllearner/core/dl/InverseRoleAxiom.java trunk/src/dl-learner/org/dllearner/core/dl/KB.java trunk/src/dl-learner/org/dllearner/core/dl/LessEqual.java trunk/src/dl-learner/org/dllearner/core/dl/NumberRestriction.java trunk/src/dl-learner/org/dllearner/core/dl/Quantification.java trunk/src/dl-learner/org/dllearner/core/dl/RoleHierarchy.java trunk/src/dl-learner/org/dllearner/core/dl/SubRoleAxiom.java trunk/src/dl-learner/org/dllearner/core/dl/SymmetricRoleAxiom.java trunk/src/dl-learner/org/dllearner/core/dl/TransitiveRoleAxiom.java trunk/src/dl-learner/org/dllearner/examples/Carcinogenesis.java trunk/src/dl-learner/org/dllearner/reasoning/DIGConverter.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/utilities/ConceptTransformation.java trunk/src/dl-learner/org/dllearner/utilities/Datastructures.java trunk/src/dl-learner/org/dllearner/utilities/Helper.java trunk/src/dl-learner/org/dllearner/utilities/RoleComparator.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/dl/DatatypeProperty.java trunk/src/dl-learner/org/dllearner/core/dl/DatatypePropertyAssertion.java trunk/src/dl-learner/org/dllearner/core/dl/DoubleDatatypePropertyAssertion.java trunk/src/dl-learner/org/dllearner/core/dl/ObjectProperty.java trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyAssertion.java trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyExpression.java trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyInverse.java trunk/src/dl-learner/org/dllearner/core/dl/Property.java trunk/src/dl-learner/org/dllearner/core/dl/PropertyAssertion.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/core/dl/AtomicRole.java trunk/src/dl-learner/org/dllearner/core/dl/InverseRole.java trunk/src/dl-learner/org/dllearner/core/dl/Role.java trunk/src/dl-learner/org/dllearner/core/dl/RoleAssertion.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-02-11 15:03:50 UTC (rev 539) @@ -37,7 +37,7 @@ import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.dl.All; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Bottom; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Conjunction; @@ -251,7 +251,7 @@ // EXISTS and ALL for(Concept childNode : generatedDefinitions.get(length-2)) { - for(AtomicRole atomicRole : learningProblem.getReasoningService().getAtomicRoles()) { + for(ObjectProperty atomicRole : learningProblem.getReasoningService().getAtomicRoles()) { Concept root1 = new Exists(atomicRole,childNode); generatedDefinitions.get(length).add(root1); Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2008-02-11 15:03:50 UTC (rev 539) @@ -12,7 +12,7 @@ import org.dllearner.core.Score; import org.dllearner.core.dl.All; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Bottom; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Exists; @@ -439,12 +439,12 @@ name = bestNeighbours.get(3).get(nr-sizeSum2); // returnNode = new Exists(new AtomicRole(name)); // returnNode.addChild(node); - returnNode = new Exists(new AtomicRole(name),node); + returnNode = new Exists(new ObjectProperty(name),node); } else { name = bestNeighbours.get(4).get(nr-sizeSum3); // returnNode = new All(new AtomicRole(name)); // returnNode.addChild(node); - returnNode = new All(new AtomicRole(name),node); + returnNode = new All(new ObjectProperty(name),node); } return returnNode; Modified: trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiDown.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiDown.java 2008-02-11 15:03:50 UTC (rev 539) @@ -11,7 +11,7 @@ import org.dllearner.core.ReasoningService; import org.dllearner.core.dl.All; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Bottom; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Exists; @@ -70,7 +70,7 @@ topSet.add(new Negation(c)); // EXISTS r.TOP und ALL r.TOP für alle r - for(AtomicRole r : reasoningService.getAtomicRoles()) { + for(ObjectProperty r : reasoningService.getAtomicRoles()) { topSet.add(new All(r, new Top())); topSet.add(new Exists(r, new Top())); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiUp.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiUp.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/PsiUp.java 2008-02-11 15:03:50 UTC (rev 539) @@ -11,7 +11,7 @@ import org.dllearner.core.ReasoningService; import org.dllearner.core.dl.All; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Bottom; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Exists; @@ -58,7 +58,7 @@ bottomSet.add(new Negation(c)); // EXISTS r.BOTTOM und ALL r.BOTTOM für alle r - for(AtomicRole r : reasoningService.getAtomicRoles()) { + for(ObjectProperty r : reasoningService.getAtomicRoles()) { bottomSet.add(new All(r, new Bottom())); bottomSet.add(new Exists(r, new Bottom())); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-02-11 15:03:50 UTC (rev 539) @@ -40,7 +40,7 @@ import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Concept; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; @@ -89,12 +89,12 @@ private static String defaultSearchTreeFile = "log/searchTree.txt"; private String heuristic = "lexicographic"; Set<AtomicConcept> allowedConcepts; - Set<AtomicRole> allowedRoles; + Set<ObjectProperty> allowedRoles; Set<AtomicConcept> ignoredConcepts; - Set<AtomicRole> ignoredRoles; + Set<ObjectProperty> ignoredRoles; // these are computed as the result of the previous four settings Set<AtomicConcept> usedConcepts; - Set<AtomicRole> usedRoles; + Set<ObjectProperty> usedRoles; private boolean applyAllFilter = true; private boolean applyExistsFilter = true; private boolean useTooWeakList = true; Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-02-11 15:03:50 UTC (rev 539) @@ -25,7 +25,7 @@ import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.MultiConjunction; import org.dllearner.core.dl.MultiDisjunction; @@ -51,12 +51,12 @@ private static String defaultSearchTreeFile = "log/searchTree.txt"; private Heuristic heuristic = Heuristic.LEXICOGRAPHIC; Set<AtomicConcept> allowedConcepts; - Set<AtomicRole> allowedRoles; + Set<ObjectProperty> allowedRoles; Set<AtomicConcept> ignoredConcepts; - Set<AtomicRole> ignoredRoles; + Set<ObjectProperty> ignoredRoles; // these are computed as the result of the previous four settings Set<AtomicConcept> usedConcepts; - Set<AtomicRole> usedRoles; + Set<ObjectProperty> usedRoles; private boolean applyAllFilter = true; private boolean applyExistsFilter = true; private boolean useTooWeakList = true; Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/RhoDown.java 2008-02-11 15:03:50 UTC (rev 539) @@ -32,7 +32,7 @@ import org.dllearner.core.ReasoningService; import org.dllearner.core.dl.All; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Bottom; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Conjunction; @@ -42,7 +42,7 @@ import org.dllearner.core.dl.MultiDisjunction; import org.dllearner.core.dl.Negation; import org.dllearner.core.dl.Quantification; -import org.dllearner.core.dl.Role; +import org.dllearner.core.dl.ObjectPropertyExpression; import org.dllearner.core.dl.Top; import org.dllearner.utilities.ConceptComparator; import org.dllearner.utilities.ConceptTransformation; @@ -264,7 +264,7 @@ } } else if (concept instanceof Exists) { - Role role = ((Quantification)concept).getRole(); + ObjectPropertyExpression role = ((Quantification)concept).getRole(); // rule 1: EXISTS r.D => EXISTS r.E tmp = refine(concept.getChild(0), maxLength-2, null); @@ -275,14 +275,14 @@ // rule 2: EXISTS r.D => EXISTS s.D or EXISTS r^-1.D => EXISTS s^-1.D // currently inverse roles are not supported - AtomicRole ar = (AtomicRole) role; - Set<AtomicRole> moreSpecialRoles = rs.getMoreSpecialRoles(ar); - for(AtomicRole moreSpecialRole : moreSpecialRoles) { + ObjectProperty ar = (ObjectProperty) role; + Set<ObjectProperty> moreSpecialRoles = rs.getMoreSpecialRoles(ar); + for(ObjectProperty moreSpecialRole : moreSpecialRoles) { refinements.add(new Exists(moreSpecialRole, concept.getChild(0))); } } else if (concept instanceof All) { - Role role = ((Quantification)concept).getRole(); + ObjectPropertyExpression role = ((Quantification)concept).getRole(); // rule 1: ALL r.D => ALL r.E tmp = refine(concept.getChild(0), maxLength-2, null); @@ -302,9 +302,9 @@ // rule 3: ALL r.D => ALL s.D or ALL r^-1.D => ALL s^-1.D // currently inverse roles are not supported - AtomicRole ar = (AtomicRole) role; - Set<AtomicRole> moreSpecialRoles = rs.getMoreSpecialRoles(ar); - for(AtomicRole moreSpecialRole : moreSpecialRoles) { + ObjectProperty ar = (ObjectProperty) role; + Set<ObjectProperty> moreSpecialRoles = rs.getMoreSpecialRoles(ar); + for(ObjectProperty moreSpecialRole : moreSpecialRoles) { refinements.add(new All(moreSpecialRole, concept.getChild(0))); } @@ -334,8 +334,8 @@ if(c instanceof All) { for(Concept child : concept.getChildren()) { if(child instanceof All) { - Role r1 = ((All)c).getRole(); - Role r2 = ((All)child).getRole(); + ObjectPropertyExpression r1 = ((All)c).getRole(); + ObjectPropertyExpression r2 = ((All)child).getRole(); if(r1.toString().equals(r2.toString())) skip = true; } @@ -543,7 +543,7 @@ // m3.add(new Exists(r, new Top())); //} // new operator: only uses most general roles - for(AtomicRole r : rs.getMostGeneralRoles()) { + for(ObjectProperty r : rs.getMostGeneralRoles()) { m3.add(new Exists(r, new Top())); } m.put(3,m3); @@ -573,7 +573,7 @@ // m.get(i+2).add(new All(r,c)); // } - for(AtomicRole r : rs.getMostGeneralRoles()) { + for(ObjectProperty r : rs.getMostGeneralRoles()) { m.get(i+2).add(new All(r,c)); } } Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-02-11 15:03:50 UTC (rev 539) @@ -62,7 +62,7 @@ import org.dllearner.core.config.StringSetConfigOption; import org.dllearner.core.config.StringTupleListConfigOption; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Individual; import org.dllearner.kb.KBFile; @@ -504,7 +504,7 @@ int stringLength = rs.getAtomicRoles().toString().length(); if (stringLength > maxLineLength) { System.out.println("roles[" + rs.getAtomicRoles().size() + "]: "); - for (AtomicRole r : rs.getAtomicRoles()) + for (ObjectProperty r : rs.getAtomicRoles()) System.out.println(" " + r); } else System.out.println("roles[" + rs.getAtomicRoles().size() + "]: " @@ -647,7 +647,7 @@ SortedSet<AtomicConcept> occurringConcepts = new TreeSet<AtomicConcept>( new ConceptComparator()); occurringConcepts.addAll(Helper.getAtomicConcepts(concept)); - SortedSet<AtomicRole> occurringRoles = new TreeSet<AtomicRole>( + SortedSet<ObjectProperty> occurringRoles = new TreeSet<ObjectProperty>( new RoleComparator()); occurringRoles.addAll(Helper.getAtomicRoles(concept)); @@ -662,7 +662,7 @@ // is used) for (AtomicConcept ac : rs.getAtomicConcepts()) occurringConcepts.remove(ac); - for (AtomicRole ar : rs.getAtomicRoles()) + for (ObjectProperty ar : rs.getAtomicRoles()) occurringRoles.remove(ar); boolean nonExistingConstructs = false; Modified: trunk/src/dl-learner/org/dllearner/core/Reasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/Reasoner.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/Reasoner.java 2008-02-11 15:03:50 UTC (rev 539) @@ -25,7 +25,7 @@ import java.util.SortedSet; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Individual; import org.dllearner.core.dl.RoleHierarchy; @@ -48,7 +48,7 @@ // => erstellt auch vereinfachte Sichten auf Subsumptionhierarchie // (siehe einfacher Traversal in Diplomarbeit) public void prepareSubsumptionHierarchy(Set<AtomicConcept> allowedConcepts); - public void prepareRoleHierarchy(Set<AtomicRole> allowedRoles) throws ReasoningMethodUnsupportedException; + public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) throws ReasoningMethodUnsupportedException; public boolean subsumes(Concept superConcept, Concept subConcept) throws ReasoningMethodUnsupportedException; @@ -68,7 +68,7 @@ public SortedSet<Individual> retrieval(Concept concept) throws ReasoningMethodUnsupportedException; - public Map<Individual, SortedSet<Individual>> getRoleMembers(AtomicRole atomicRole) throws ReasoningMethodUnsupportedException; + public Map<Individual, SortedSet<Individual>> getRoleMembers(ObjectProperty atomicRole) throws ReasoningMethodUnsupportedException; public boolean instanceCheck(Concept concept, Individual individual) throws ReasoningMethodUnsupportedException; @@ -86,7 +86,7 @@ public Set<AtomicConcept> getAtomicConcepts(); - public Set<AtomicRole> getAtomicRoles(); + public Set<ObjectProperty> getAtomicRoles(); public SortedSet<Individual> getIndividuals(); } Modified: trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-02-11 15:03:50 UTC (rev 539) @@ -26,7 +26,7 @@ import java.util.TreeSet; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Individual; import org.dllearner.core.dl.RoleHierarchy; @@ -69,7 +69,7 @@ throw new ReasoningMethodUnsupportedException(); } - public Map<Individual, SortedSet<Individual>> getRoleMembers(AtomicRole atomicRole) + public Map<Individual, SortedSet<Individual>> getRoleMembers(ObjectProperty atomicRole) throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } @@ -108,7 +108,7 @@ throw new ReasoningMethodUnsupportedException(); } - public void prepareRoleHierarchy(Set<AtomicRole> allowedRoles) throws ReasoningMethodUnsupportedException { + public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } Modified: trunk/src/dl-learner/org/dllearner/core/ReasoningService.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasoningService.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/ReasoningService.java 2008-02-11 15:03:50 UTC (rev 539) @@ -28,7 +28,7 @@ import java.util.TreeSet; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Concept; import org.dllearner.core.dl.Individual; import org.dllearner.core.dl.RoleHierarchy; @@ -73,7 +73,7 @@ // Listenansicht private List<AtomicConcept> atomicConceptsList; - private List<AtomicRole> atomicRolesList; + private List<ObjectProperty> atomicRolesList; // private SortedSet<Concept> retrievalsSet = new TreeSet<Concept>(new ConceptComparator()); @@ -291,22 +291,22 @@ /** * Returns more general concepts in the subsumption hierarchy. * - * @see RoleHierarchy#getMoreGeneralRoles(AtomicRole) + * @see RoleHierarchy#getMoreGeneralRoles(ObjectProperty) * @param role Atomic concept, top, or bottom. * @return A set of more general concepts. */ - public SortedSet<AtomicRole> getMoreGeneralRoles(AtomicRole role) { + public SortedSet<ObjectProperty> getMoreGeneralRoles(ObjectProperty role) { return getRoleHierarchy().getMoreGeneralRoles(role); } /** * Returns more special concepts in the subsumption hierarchy. * - * @see RoleHierarchy#getMoreSpecialRoles(AtomicRole) + * @see RoleHierarchy#getMoreSpecialRoles(ObjectProperty) * @param role Atomic concept, top, or bottom. * @return A set of more special concepts. */ - public SortedSet<AtomicRole> getMoreSpecialRoles(AtomicRole role) { + public SortedSet<ObjectProperty> getMoreSpecialRoles(ObjectProperty role) { return getRoleHierarchy().getMoreSpecialRoles(role); } @@ -314,7 +314,7 @@ * @see RoleHierarchy#getMostGeneralRoles() * @return The most general roles. */ - public TreeSet<AtomicRole> getMostGeneralRoles() { + public TreeSet<ObjectProperty> getMostGeneralRoles() { return getRoleHierarchy().getMostGeneralRoles(); } @@ -322,7 +322,7 @@ * @see RoleHierarchy#getMostSpecialRoles() * @return The most special roles. */ - public TreeSet<AtomicRole> getMostSpecialRoles() { + public TreeSet<ObjectProperty> getMostSpecialRoles() { return getRoleHierarchy().getMostSpecialRoles(); } @@ -348,7 +348,7 @@ prepareRoleHierarchy(getAtomicRoles()); } - public void prepareRoleHierarchy(Set<AtomicRole> allowedRoles) { + public void prepareRoleHierarchy(Set<ObjectProperty> allowedRoles) { try { reasoner.prepareRoleHierarchy(allowedRoles); } catch (ReasoningMethodUnsupportedException e) { @@ -382,7 +382,7 @@ // gibt zu einer Rolle alle Elemente zur�ck // private, da es keine Standardoperation ist - public Map<Individual, SortedSet<Individual>> getRoleMembers(AtomicRole atomicRole) { + public Map<Individual, SortedSet<Individual>> getRoleMembers(ObjectProperty atomicRole) { reasoningStartTimeTmp = System.nanoTime(); Map<Individual, SortedSet<Individual>> result; try { @@ -401,7 +401,7 @@ return reasoner.getAtomicConcepts(); } - public Set<AtomicRole> getAtomicRoles() { + public Set<ObjectProperty> getAtomicRoles() { return reasoner.getAtomicRoles(); } @@ -419,9 +419,9 @@ return atomicConceptsList; } - public List<AtomicRole> getAtomicRolesList() { + public List<ObjectProperty> getAtomicRolesList() { if(atomicRolesList == null) - atomicRolesList = new LinkedList<AtomicRole>(getAtomicRoles()); + atomicRolesList = new LinkedList<ObjectProperty>(getAtomicRoles()); return atomicRolesList; } Modified: trunk/src/dl-learner/org/dllearner/core/config/CommonConfigMappings.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/CommonConfigMappings.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/config/CommonConfigMappings.java 2008-02-11 15:03:50 UTC (rev 539) @@ -24,7 +24,7 @@ import java.util.TreeSet; import org.dllearner.core.dl.AtomicConcept; -import org.dllearner.core.dl.AtomicRole; +import org.dllearner.core.dl.ObjectProperty; import org.dllearner.core.dl.Individual; import org.dllearner.utilities.ConceptComparator; @@ -51,10 +51,10 @@ return set; } - public static SortedSet<AtomicRole> getAtomicRoleSet(Set<String> atomicRoles) { - SortedSet<AtomicRole> set = new TreeSet<AtomicRole>(); + public static SortedSet<ObjectProperty> getAtomicRoleSet(Set<String> atomicRoles) { + SortedSet<ObjectProperty> set = new TreeSet<ObjectProperty>(); for(String atomicRole : atomicRoles) - set.add(new AtomicRole(atomicRole)); + set.add(new ObjectProperty(atomicRole)); return set; } } Modified: trunk/src/dl-learner/org/dllearner/core/dl/All.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/All.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/All.java 2008-02-11 15:03:50 UTC (rev 539) @@ -5,7 +5,7 @@ public class All extends Quantification { - public All(Role role, Concept c) { + public All(ObjectPropertyExpression role, Concept c) { super(role, c); } Deleted: trunk/src/dl-learner/org/dllearner/core/dl/AtomicRole.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/AtomicRole.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/AtomicRole.java 2008-02-11 15:03:50 UTC (rev 539) @@ -1,51 +0,0 @@ -/** - * Copyright (C) 2007, 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.core.dl; - -import java.util.Map; - -import org.dllearner.utilities.Helper; - -/** - * Represents an atomic concept in a knowledge base / ontology, - * e.g. "hasChild". - * - * @author Jens Lehmann - * - */ -public class AtomicRole extends Role { - - public AtomicRole(String name) { - super(name); - } - - public int getLength() { - return 1; - } - - @Override - public String toString() { - return name; - } - - public String toString(String baseURI, Map<String,String> prefixes) { - return Helper.getAbbreviatedString(name, baseURI, prefixes); - } -} Modified: trunk/src/dl-learner/org/dllearner/core/dl/ConceptAssertion.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/ConceptAssertion.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/ConceptAssertion.java 2008-02-11 15:03:50 UTC (rev 539) @@ -22,7 +22,7 @@ import java.util.Map; /** - * Represents an concept assertion in a knowledge base / ontology, + * Represents a concept assertion in a knowledge base / ontology, * e.g. "heiko is a person", "heiko is a male person having one child". * * @author Jens Lehmann Added: trunk/src/dl-learner/org/dllearner/core/dl/DatatypeProperty.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/DatatypeProperty.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/DatatypeProperty.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,52 @@ +/** + * Copyright (C) 2007-2008, 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.core.dl; + +import java.util.Map; + +import org.dllearner.utilities.Helper; + +/** + * @author Jens Lehmann + * + */ +public class DatatypeProperty implements Property { + + protected String name; + + public DatatypeProperty(String name) { + this.name=name; + } + + /* (non-Javadoc) + * @see org.dllearner.core.dl.KBElement#getLength() + */ + public int getLength() { + return 1; + } + + /* (non-Javadoc) + * @see org.dllearner.core.dl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + return Helper.getAbbreviatedString(name, baseURI, prefixes); + } + +} Added: trunk/src/dl-learner/org/dllearner/core/dl/DatatypePropertyAssertion.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/DatatypePropertyAssertion.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/DatatypePropertyAssertion.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,59 @@ +/** + * Copyright (C) 2007-2008, 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.core.dl; + +/** + * A datatype property assertion. + * + * @author Jens Lehmann + * + */ +public abstract class DatatypePropertyAssertion extends PropertyAssertion { + + protected DatatypeProperty datatypeProperty; + protected Individual individual; + + public DatatypePropertyAssertion(DatatypeProperty datatypeProperty, Individual individual) { + this.datatypeProperty = datatypeProperty; + this.individual = individual; + } + + /* (non-Javadoc) + * @see org.dllearner.core.dl.KBElement#getLength() + */ + public int getLength() { + return 3; + } + + /** + * @return the individual + */ + public Individual getIndividual() { + return individual; + } + + /** + * @return the datatypeProperty + */ + public DatatypeProperty getDatatypeProperty() { + return datatypeProperty; + } + +} Added: trunk/src/dl-learner/org/dllearner/core/dl/DoubleDatatypePropertyAssertion.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/DoubleDatatypePropertyAssertion.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/DoubleDatatypePropertyAssertion.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,50 @@ +/** + * Copyright (C) 2007-2008, 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.core.dl; + +import java.util.Map; + +/** + * @author Jens Lehmann + * + */ +public class DoubleDatatypePropertyAssertion extends DatatypePropertyAssertion { + + private double value; + + public DoubleDatatypePropertyAssertion(DatatypeProperty datatypeProperty, Individual individual, double value) { + super(datatypeProperty, individual); + this.value = value; + } + + + + /* (non-Javadoc) + * @see org.dllearner.core.dl.KBElement#toString(java.lang.String, java.util.Map) + */ + public String toString(String baseURI, Map<String, String> prefixes) { + return datatypeProperty.toString(baseURI, prefixes) + "(" + individual.toString(baseURI, prefixes) + "," + value +")"; + } + + public double getValue() { + return value; + } + +} Modified: trunk/src/dl-learner/org/dllearner/core/dl/Exists.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/Exists.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/Exists.java 2008-02-11 15:03:50 UTC (rev 539) @@ -5,7 +5,7 @@ public class Exists extends Quantification { - public Exists(Role role, Concept c) { + public Exists(ObjectPropertyExpression role, Concept c) { super(role,c); } Modified: trunk/src/dl-learner/org/dllearner/core/dl/FunctionalRoleAxiom.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/FunctionalRoleAxiom.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/FunctionalRoleAxiom.java 2008-02-11 15:03:50 UTC (rev 539) @@ -4,13 +4,13 @@ public class FunctionalRoleAxiom extends RBoxAxiom { - private AtomicRole role; + private ObjectProperty role; - public FunctionalRoleAxiom(AtomicRole role) { + public FunctionalRoleAxiom(ObjectProperty role) { this.role = role; } - public Role getRole() { + public ObjectPropertyExpression getRole() { return role; } Modified: trunk/src/dl-learner/org/dllearner/core/dl/GreaterEqual.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/GreaterEqual.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/GreaterEqual.java 2008-02-11 15:03:50 UTC (rev 539) @@ -4,7 +4,7 @@ public class GreaterEqual extends NumberRestriction { - public GreaterEqual(int number, Role role, Concept c) { + public GreaterEqual(int number, ObjectPropertyExpression role, Concept c) { super(number,role,c); } Deleted: trunk/src/dl-learner/org/dllearner/core/dl/InverseRole.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/InverseRole.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/InverseRole.java 2008-02-11 15:03:50 UTC (rev 539) @@ -1,46 +0,0 @@ -/** - * Copyright (C) 2007, 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.core.dl; - -import java.util.Map; - -import org.dllearner.utilities.Helper; - -/** - * An inverse role. - * - * @author Jens Lehmann - * - */ -public class InverseRole extends Role { - - public InverseRole(String name) { - super(name); - } - - public int getLength() { - return 2; - } - - public String toString(String baseURI, Map<String,String> prefixes) { - return Helper.getAbbreviatedString(name, baseURI, prefixes) + "-"; - } -} Modified: trunk/src/dl-learner/org/dllearner/core/dl/InverseRoleAxiom.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/InverseRoleAxiom.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/InverseRoleAxiom.java 2008-02-11 15:03:50 UTC (rev 539) @@ -4,19 +4,19 @@ public class InverseRoleAxiom extends RBoxAxiom { - private AtomicRole inverseRole; - private AtomicRole role; + private ObjectProperty inverseRole; + private ObjectProperty role; - public InverseRoleAxiom(AtomicRole inverseRole, AtomicRole role) { + public InverseRoleAxiom(ObjectProperty inverseRole, ObjectProperty role) { this.inverseRole = inverseRole; this.role = role; } - public AtomicRole getInverseRole() { + public ObjectProperty getInverseRole() { return inverseRole; } - public AtomicRole getRole() { + public ObjectProperty getRole() { return role; } Modified: trunk/src/dl-learner/org/dllearner/core/dl/KB.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/KB.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/KB.java 2008-02-11 15:03:50 UTC (rev 539) @@ -16,9 +16,9 @@ SortedSet<Individual> individuals = new TreeSet<Individual>(); for(Axiom axiom : abox) { - if(axiom instanceof RoleAssertion) { - individuals.add(((RoleAssertion)axiom).getIndividual1()); - individuals.add(((RoleAssertion)axiom).getIndividual2()); + if(axiom instanceof ObjectPropertyAssertion) { + individuals.add(((ObjectPropertyAssertion)axiom).getIndividual1()); + individuals.add(((ObjectPropertyAssertion)axiom).getIndividual2()); } else if(axiom instanceof ConceptAssertion) { individuals.add(((ConceptAssertion)axiom).getIndividual()); } @@ -27,12 +27,12 @@ return individuals; } - public Set<AtomicRole> findAllAtomicRoles() { + public Set<ObjectProperty> findAllAtomicRoles() { Set<String> roleNames = new HashSet<String>(); for(Axiom axiom : abox) { - if(axiom instanceof RoleAssertion) - roleNames.add(((RoleAssertion)axiom).getRole().getName()); + if(axiom instanceof ObjectPropertyAssertion) + roleNames.add(((ObjectPropertyAssertion)axiom).getRole().getName()); } for(Axiom axiom : tbox) { @@ -61,9 +61,9 @@ } } - Set<AtomicRole> ret = new HashSet<AtomicRole>(); + Set<ObjectProperty> ret = new HashSet<ObjectProperty>(); for(String name : roleNames) { - ret.add(new AtomicRole(name)); + ret.add(new ObjectProperty(name)); } return ret; } @@ -202,8 +202,8 @@ // alle direkt mit diesem Individual verbundenen Individuals finden TreeSet<Individual> connectedSet = new TreeSet<Individual>(); for(AssertionalAxiom axiom : abox) { - if(axiom instanceof RoleAssertion) { - RoleAssertion ra = (RoleAssertion)axiom; + if(axiom instanceof ObjectPropertyAssertion) { + ObjectPropertyAssertion ra = (ObjectPropertyAssertion)axiom; if(ra.getIndividual1().equals(individual)) connectedSet.add(ra.getIndividual2()); } Modified: trunk/src/dl-learner/org/dllearner/core/dl/LessEqual.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/LessEqual.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/LessEqual.java 2008-02-11 15:03:50 UTC (rev 539) @@ -4,7 +4,7 @@ public class LessEqual extends NumberRestriction { - public LessEqual(int number, Role role, Concept c) { + public LessEqual(int number, ObjectPropertyExpression role, Concept c) { super(number,role,c); } Modified: trunk/src/dl-learner/org/dllearner/core/dl/NumberRestriction.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/NumberRestriction.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/NumberRestriction.java 2008-02-11 15:03:50 UTC (rev 539) @@ -2,10 +2,10 @@ public abstract class NumberRestriction extends Concept { - protected Role role; + protected ObjectPropertyExpression role; protected int number; - public NumberRestriction(int number, Role role, Concept c) { + public NumberRestriction(int number, ObjectPropertyExpression role, Concept c) { addChild(c); this.role = role; this.number = number; @@ -19,7 +19,7 @@ return number; } - public Role getRole() { + public ObjectPropertyExpression getRole() { return role; } Copied: trunk/src/dl-learner/org/dllearner/core/dl/ObjectProperty.java (from rev 535, trunk/src/dl-learner/org/dllearner/core/dl/AtomicRole.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/ObjectProperty.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/ObjectProperty.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,51 @@ +/** + * Copyright (C) 2007, 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.core.dl; + +import java.util.Map; + +import org.dllearner.utilities.Helper; + +/** + * Represents an object property in a knowledge base / ontology, + * e.g. "hasChild". + * + * @author Jens Lehmann + * + */ +public class ObjectProperty extends ObjectPropertyExpression implements Property { + + public ObjectProperty(String name) { + super(name); + } + + public int getLength() { + return 1; + } + + @Override + public String toString() { + return name; + } + + public String toString(String baseURI, Map<String,String> prefixes) { + return Helper.getAbbreviatedString(name, baseURI, prefixes); + } +} Copied: trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyAssertion.java (from rev 535, trunk/src/dl-learner/org/dllearner/core/dl/RoleAssertion.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyAssertion.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyAssertion.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,62 @@ +/** + * Copyright (C) 2007, 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.core.dl; + +import java.util.Map; + +/** + * Represents an role assertion in a knowledge base / ontology, + * e.g. "heiko is brother of stefan". + * + * @author Jens Lehmann + * + */ +public class ObjectPropertyAssertion extends PropertyAssertion { + + private ObjectProperty role; + private Individual individual1; + private Individual individual2; + + public ObjectPropertyAssertion(ObjectProperty role, Individual individual1, Individual individual2) { + this.role = role; + this.individual1 = individual1; + this.individual2 = individual2; + } + + public Individual getIndividual1() { + return individual1; + } + + public Individual getIndividual2() { + return individual2; + } + + public ObjectProperty getRole() { + return role; + } + + public int getLength() { + return 2 + role.getLength(); + } + + public String toString(String baseURI, Map<String,String> prefixes) { + return role.toString(baseURI, prefixes) + "(" + individual1.toString(baseURI, prefixes) + "," + individual2.toString(baseURI, prefixes) +")"; + } +} Copied: trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyExpression.java (from rev 535, trunk/src/dl-learner/org/dllearner/core/dl/Role.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyExpression.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyExpression.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,42 @@ +/** + * Copyright (C) 2007, 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.core.dl; + +/** + * An object property expression is an object property construct, which + * can be used in axioms, e.g. complex class descriptions. It can be + * either an object property or an inverse of an object property. + * + * @author Jens Lehmann + * + */ +public abstract class ObjectPropertyExpression implements KBElement { + + protected String name; + + public ObjectPropertyExpression(String name) { + this.name = name; + } + + public String getName() { + return name; + } + +} Copied: trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyInverse.java (from rev 535, trunk/src/dl-learner/org/dllearner/core/dl/InverseRole.java) =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyInverse.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/ObjectPropertyInverse.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,52 @@ +/** + * Copyright (C) 2007, 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.core.dl; + +import java.util.Map; + +import org.dllearner.utilities.Helper; + +/** + * Represents the inverse of a property expression. It can be used + * in axioms e.g. complex class descriptions. For instance: + * + * father = male AND isChildOf^-1 + * + * This way, you can refer to an inverse of an object property without + * actually giving it a name (you could name it isParentOf in this case). + * + * @author Jens Lehmann + * + */ +public class ObjectPropertyInverse extends ObjectPropertyExpression { + + public ObjectPropertyInverse(String name) { + super(name); + } + + public int getLength() { + return 2; + } + + public String toString(String baseURI, Map<String,String> prefixes) { + return Helper.getAbbreviatedString(name, baseURI, prefixes) + "-"; + } +} Added: trunk/src/dl-learner/org/dllearner/core/dl/Property.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/Property.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/Property.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2008, 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.core.dl; + +/** + * @author Jens Lehmann + * + */ +public interface Property extends KBElement { + +} Added: trunk/src/dl-learner/org/dllearner/core/dl/PropertyAssertion.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/PropertyAssertion.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/dl/PropertyAssertion.java 2008-02-11 15:03:50 UTC (rev 539) @@ -0,0 +1,28 @@ +/** + * Copyright (C) 2007-2008, 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.core.dl; + +/** + * @author Jens Lehmann + * + */ +public abstract class PropertyAssertion extends AssertionalAxiom { + +} Modified: trunk/src/dl-learner/org/dllearner/core/dl/Quantification.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/Quantification.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/Quantification.java 2008-02-11 15:03:50 UTC (rev 539) @@ -2,14 +2,14 @@ public abstract class Quantification extends Concept { - Role role; + ObjectPropertyExpression role; - public Quantification(Role role, Concept c) { + public Quantification(ObjectPropertyExpression role, Concept c) { this.role = role; addChild(c); } - public Role getRole() { + public ObjectPropertyExpression getRole() { return role; } Deleted: trunk/src/dl-learner/org/dllearner/core/dl/Role.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/Role.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/Role.java 2008-02-11 15:03:50 UTC (rev 539) @@ -1,15 +0,0 @@ -package org.dllearner.core.dl; - -public abstract class Role implements KBElement { - - protected String name; - - public Role(String name) { - this.name = name; - } - - public String getName() { - return name; - } - -} Deleted: trunk/src/dl-learner/org/dllearner/core/dl/RoleAssertion.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/RoleAssertion.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/RoleAssertion.java 2008-02-11 15:03:50 UTC (rev 539) @@ -1,62 +0,0 @@ -/** - * Copyright (C) 2007, 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.core.dl; - -import java.util.Map; - -/** - * Represents an role assertion in a knowledge base / ontology, - * e.g. "heiko is brother of stefan". - * - * @author Jens Lehmann - * - */ -public class RoleAssertion extends AssertionalAxiom { - - private AtomicRole role; - private Individual individual1; - private Individual individual2; - - public RoleAssertion(AtomicRole role, Individual individual1, Individual individual2) { - this.role = role; - this.individual1 = individual1; - this.individual2 = individual2; - } - - public Individual getIndividual1() { - return individual1; - } - - public Individual getIndividual2() { - return individual2; - } - - public AtomicRole getRole() { - return role; - } - - public int getLength() { - return 2 + role.getLength(); - } - - public String toString(String baseURI, Map<String,String> prefixes) { - return role.toString(baseURI, prefixes) + "(" + individual1.toString(baseURI, prefixes) + "," + individual2.toString(baseURI, prefixes) +")"; - } -} Modified: trunk/src/dl-learner/org/dllearner/core/dl/RoleHierarchy.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/RoleHierarchy.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/RoleHierarchy.java 2008-02-11 15:03:50 UTC (rev 539) @@ -38,17 +38,17 @@ public class RoleHierarchy { RoleComparator rc = new RoleComparator(); - TreeMap<AtomicRole,TreeSet<AtomicRole>> roleHierarchyUp; - TreeMap<AtomicRole,TreeSet<AtomicRole>> roleHierarchyDown; - TreeSet<AtomicRole> mostGeneralRoles = new TreeSet<AtomicRole>(rc); - TreeSet<AtomicRole> mostSpecialRoles = new TreeSet<AtomicRole>(rc); + TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyUp; + TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyDown; + TreeSet<ObjectProperty> mostGeneralRoles = new TreeSet<ObjectProperty>(rc); + TreeSet<ObjectProperty> mostSpecialRoles = new TreeSet<ObjectProperty>(rc); - public RoleHierarchy(Set<AtomicRole> atomicRoles, TreeMap<AtomicRole,TreeSet<AtomicRole>> roleHierarchyUp , TreeMap<AtomicRole,TreeSet<AtomicRole>> roleHierarchyDown) { + public RoleHierarchy(Set<ObjectProperty> atomicRoles, TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyUp , TreeMap<ObjectProperty,TreeSet<ObjectProperty>> roleHierarchyDown) { this.roleHierarchyUp = roleHierarchyUp; this.roleHierarchyDown = roleHierarchyDown; // find most general and most special roles - for(AtomicRole role : atomicRoles) { + for(ObjectProperty role : atomicRoles) { if(getMoreGeneralRoles(role).size()==0) mostGeneralRoles.add(role); if(getMoreSpecialRoles(role).size()==0) @@ -57,15 +57,15 @@ } @SuppressWarnings("unchecked") - public SortedSet<AtomicRole> getMoreGeneralRoles(AtomicRole role) { + public SortedSet<ObjectProperty> getMoreGeneralRoles(ObjectProperty role) { // we clone all concepts before returning them such that they cannot be // modified externally - return (TreeSet<AtomicRole>) roleHierarchyUp.get(role).clone(); + return (TreeSet<ObjectProperty>) roleHierarchyUp.get(role).clone(); } @SuppressWarnings("unchecked") - public SortedSet<AtomicRole> getMoreSpecialRoles(AtomicRole role) { - return (TreeSet<AtomicRole>) roleHierarchyDown.get(role).clone(); + public SortedSet<ObjectProperty> getMoreSpecialRoles(ObjectProperty role) { + return (TreeSet<ObjectProperty>) roleHierarchyDown.get(role).clone(); } @@ -73,20 +73,20 @@ @Override public String toString() { String str = ""; - for(AtomicRole role : mostGeneralRoles) { + for(ObjectProperty role : mostGeneralRoles) { str += toString(roleHierarchyDown, role, 0); } return str; } - private String toString(TreeMap<AtomicRole,TreeSet<AtomicRole>> hierarchy, AtomicRole role, int depth) { + private String toString(TreeMap<ObjectProperty,TreeSet<ObjectProperty>> hierarchy, ObjectProperty role, int depth) { String str = ""; for(int i=0; i<depth; i++) str += " "; str += role.toString() + "\n"; - Set<AtomicRole> tmp = hierarchy.get(role); + Set<ObjectProperty> tmp = hierarchy.get(role); if(tmp!=null) { - for(AtomicRole c : tmp) + for(ObjectProperty c : tmp) str += toString(hierarchy, c, depth+1); } return str; @@ -95,14 +95,14 @@ /** * @return The most general roles. */ - public TreeSet<AtomicRole> getMostGeneralRoles() { + public TreeSet<ObjectProperty> getMostGeneralRoles() { return mostGeneralRoles; } /** * @return The most special roles. */ - public TreeSet<AtomicRole> getMostSpecialRoles() { + public TreeSet<ObjectProperty> getMostSpecialRoles() { return mostSpecialRoles; } Modified: trunk/src/dl-learner/org/dllearner/core/dl/SubRoleAxiom.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/SubRoleAxiom.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/SubRoleAxiom.java 2008-02-11 15:03:50 UTC (rev 539) @@ -4,19 +4,19 @@ public class SubRoleAxiom extends RBoxAxiom { - private AtomicRole role; - private AtomicRole subRole; + private ObjectProperty role; + private ObjectProperty subRole; - public SubRoleAxiom(AtomicRole subRole, AtomicRole role) { + public SubRoleAxiom(ObjectProperty subRole, ObjectProperty role) { this.role = role; this.subRole = subRole; } - public AtomicRole getRole() { + public ObjectProperty getRole() { return role; } - public AtomicRole getSubRole() { + public ObjectProperty getSubRole() { return subRole; } Modified: trunk/src/dl-learner/org/dllearner/core/dl/SymmetricRoleAxiom.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/dl/SymmetricRoleAxiom.java 2008-02-11 15:00:55 UTC (rev 538) +++ trunk/src/dl-learner/org/dllearner/core/dl/SymmetricRoleAxiom.java 2008-02-11 15:03:50 UTC (rev 539) @@ -4,13 +4,13 @@ public class SymmetricRoleAxiom extends RBoxAxiom { - private AtomicRole role; + private ObjectProperty role; - public SymmetricRoleAxiom(AtomicRole role) { + public SymmetricRoleAxiom(ObjectProperty role) { this.role = role; } - public AtomicRole getRole() { + public ObjectProperty getRole() { return role; } Modified: trunk/src/dl-learner/org/dllearner/core/dl/Transit... [truncated message content] |