From: <jen...@us...> - 2008-11-11 12:57:23
|
Revision: 1506 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1506&view=rev Author: jenslehmann Date: 2008-11-11 12:57:12 +0000 (Tue, 11 Nov 2008) Log Message: ----------- - reasoner component redesign continued - SVN partially broken Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/BaseReasoner.java trunk/src/dl-learner/org/dllearner/core/IndividualReasoner.java trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java trunk/src/dl-learner/org/dllearner/core/SchemaReasoner.java trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.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/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/utilities/Helper.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloser.java trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloserOWLAPI.java Modified: trunk/src/dl-learner/org/dllearner/core/BaseReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/BaseReasoner.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/core/BaseReasoner.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -23,6 +23,9 @@ import java.util.Set; import java.util.SortedSet; +import org.dllearner.core.owl.Constant; +import org.dllearner.core.owl.DatatypeProperty; +import org.dllearner.core.owl.Entity; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; @@ -60,6 +63,37 @@ public Set<ObjectProperty> getObjectProperties(); /** + * Gets all data properties in the knowledge base, e.g. hasIncome, height. + * @return All data properties in KB. + */ + public SortedSet<DatatypeProperty> getDatatypeProperties(); + + /** + * Gets all data properties with range xsd:boolean. + * @see org.dllearner.core.owl.Datatype#BOOLEAN + * @return Boolean data properties in KB. + */ + public SortedSet<DatatypeProperty> getBooleanDatatypeProperties(); + + /** + * Gets all data properties with range xsd:double. + * TODO We could extend this to all types, which can be parsed into + * a double value, e.g. floats. + * @see org.dllearner.core.owl.Datatype#DOUBLE + * @return Double data properties in KB. + */ + public SortedSet<DatatypeProperty> getDoubleDatatypeProperties(); + + /** + * Gets all data properties with range xsd:int. + * TODO We could extend this to all types, which can be parsed into + * Integers, e.g. xsd:integer, xsd:negativeInteger, xsd:nonNegativeInteger etc. + * @see org.dllearner.core.owl.Datatype#INT + * @return Integer data properties in KB. + */ + public SortedSet<DatatypeProperty> getIntDatatypeProperties(); + + /** * Gets all individuals in the knowledge base, e.g. Eric, London, Car829. * @return All individuals in KB. */ @@ -81,4 +115,11 @@ */ public Map<String, String> getPrefixes(); + /** + * Returns the RDFS labels of an entity. + * @param entity An entity, e.g. Machine. + * @return All values of rdfs:label for the entity, e.g. {"Machine"@en, "Maschine"@de}. + */ + public Set<Constant> getLabel(Entity entity); + } Modified: trunk/src/dl-learner/org/dllearner/core/IndividualReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/IndividualReasoner.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/core/IndividualReasoner.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -19,12 +19,16 @@ */ package org.dllearner.core; +import java.util.Map; import java.util.Set; import java.util.SortedSet; +import org.dllearner.core.owl.Constant; +import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.ObjectProperty; import org.dllearner.utilities.datastructures.SortedSetTuple; /** @@ -81,4 +85,92 @@ * @return All instances of the class description and its negation. */ public SortedSetTuple<Individual> doubleRetrieval(Description description); + + /** + * Returns the set of individuals, which are connect to the given individual + * with the specified object property. + * @param individual An individual, e.g. eric. + * @param objectProperty An object property, e.g. hasChild. + * @return A set of individuals, e.g. {anna, maria}. + */ + public Set<Individual> getRelatedIndividuals(Individual individual, + ObjectProperty objectProperty); + + /** + * Returns the set of individuals, which are connect to the given individual + * with the specified data property. + * @param individual An individual, e.g. eric. + * @param datatyoeProperty A data property, e.g. hasIncome. + * @return A set of individuals, e.g. {48000^^xsd:int}. + */ + public Set<Constant> getRelatedValues(Individual individual, DatatypeProperty datatypeProperty); + + /** + * Computes and returns all connections between individuals through the specified + * property, e.g. {eric => {maria, anna}, anna => {eric}}. + * @param objectProperty An object property. + * @return The mapping of individuals to other individuals through this object property. + */ + public Map<Individual, SortedSet<Individual>> getPropertyMembers(ObjectProperty objectProperty); + + /** + * Computes and returns all connections between individuals and values through the + * specified property, e.g. {eric => {48000^^xsd:int}, sarah => {56000^^xsd:int}}. + * @param datatypeProperty A data property. + * @return The mapping between individuals and values through the given property. + */ + public Map<Individual, SortedSet<Constant>> getDatatypeMembers(DatatypeProperty datatypeProperty); + + /** + * Convenience method, which can be used if it is known that the property has + * values which can be parsed as double. + * @see #getDatatypeMembers(DatatypeProperty) + * @see Double#valueOf(String) + * @param datatypeProperty A data property. + * @return The mapping between individuals and double values through the given property. + */ + public Map<Individual, SortedSet<Double>> getDoubleDatatypeMembers(DatatypeProperty datatypeProperty); + + /** + * Convenience method, which can be used if it is known that the property has + * values which can be parsed as integer. + * @see #getDatatypeMembers(DatatypeProperty) + * @see Integer#valueOf(String) + * @param datatypeProperty A data property. + * @return The mapping between individuals and integer values through the given property. + */ + public Map<Individual, SortedSet<Integer>> getIntDatatypeMembers(DatatypeProperty datatypeProperty); + + /** + * Convenience method, which can be used if it is known that the property has + * values which can be parsed as boolean value. Only "true" or "false" are + * accepted. If other values occur, a warning will be issued. + * @see #getDatatypeMembers(DatatypeProperty) + * @param datatypeProperty A data property. + * @return The mapping between individuals and boolean values through the given property. + */ + public Map<Individual, SortedSet<Boolean>> getBooleanDatatypeMembers(DatatypeProperty datatypeProperty); + + /** + * Convenience method, which can be used to get all individuals, which have value + * "true" for the given property. Usually, data properties can have several values + * for a given individual, but this method will throw a runtime exception if this + * is the case (i.e. the set of values is {"true", "false"}). + * @see #getDatatypeMembers(DatatypeProperty) + * @param datatypeProperty A data property. + * @return The set of individuals for which the boolean property holds. + */ + public SortedSet<Individual> getTrueDatatypeMembers(DatatypeProperty datatypeProperty); + + /** + * Convenience method, which can be used to get all individuals, which have value + * "false" for the given property. Usually, data properties can have several values + * for a given individual, but this method will throw a runtime exception if this + * is the case (i.e. the set of values is {"true", "false"}). + * @see #getDatatypeMembers(DatatypeProperty) + * @param datatypeProperty A data property. + * @return The set of individuals for which the boolean property does not hold. + */ + public SortedSet<Individual> getFalseDatatypeMembers(DatatypeProperty datatypeProperty); + } Modified: trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/core/ReasonerComponent.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -328,7 +328,7 @@ throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - + @Override public final SortedSet<Individual> hasType(Description concept, Set<Individual> s) { // logger.debug("instanceCheck "+concept.toKBSyntaxString()); @@ -356,9 +356,23 @@ returnSet.add(individual); } return returnSet; - } + } @Override + public final Set<NamedClass> getInconsistentClasses() { + try { + return getInconsistentClassesImpl(); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } + } + + protected Set<NamedClass> getInconsistentClassesImpl() throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); + } + + @Override public final boolean isSatisfiable() { reasoningStartTimeTmp = System.nanoTime(); boolean result; @@ -376,10 +390,11 @@ protected boolean isSatisfiableImpl() throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); - } - - public Set<Individual> getRelatedIndividuals(Individual individual, - ObjectProperty objectProperty) throws ReasoningMethodUnsupportedException { + } + + @Override + public final Set<Individual> getRelatedIndividuals(Individual individual, + ObjectProperty objectProperty) { try { return getRelatedIndividualsImpl(individual, objectProperty); } catch (ReasoningMethodUnsupportedException e) { @@ -388,8 +403,14 @@ } } - public Set<Constant> getRelatedValues(Individual individual, DatatypeProperty datatypeProperty) - throws ReasoningMethodUnsupportedException { + protected Set<Individual> getRelatedIndividualsImpl(Individual individual, + ObjectProperty objectProperty) throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); + } + + @Override + public final Set<Constant> getRelatedValues(Individual individual, + DatatypeProperty datatypeProperty) { try { return getRelatedValuesImpl(individual, datatypeProperty); } catch (ReasoningMethodUnsupportedException e) { @@ -398,7 +419,13 @@ } } - public Set<Constant> getLabel(Entity entity) throws ReasoningMethodUnsupportedException { + protected Set<Constant> getRelatedValuesImpl(Individual individual, + DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); + } + + @Override + public final Set<Constant> getLabel(Entity entity) { try { return getLabelImpl(entity); } catch (ReasoningMethodUnsupportedException e) { @@ -407,11 +434,16 @@ } } - public Map<Individual, SortedSet<Individual>> getRoleMembers(ObjectProperty atomicRole) { + protected Set<Constant> getLabelImpl(Entity entity) throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); + } + + @Override + public final Map<Individual, SortedSet<Individual>> getPropertyMembers(ObjectProperty atomicRole) { reasoningStartTimeTmp = System.nanoTime(); Map<Individual, SortedSet<Individual>> result; try { - result = getRoleMembersImpl(atomicRole); + result = getPropertyMembersImpl(atomicRole); } catch (ReasoningMethodUnsupportedException e) { handleExceptions(e); return null; @@ -422,152 +454,74 @@ return result; } - public abstract boolean hasDatatypeSupport(); - - public Map<Individual, SortedSet<Double>> getDoubleDatatypeMembers( - DatatypeProperty datatypeProperty) { - try { - return getDoubleDatatypeMembersImpl(datatypeProperty); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } + protected Map<Individual, SortedSet<Individual>> getPropertyMembersImpl( + ObjectProperty atomicRole) throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); } - public Map<Individual, SortedSet<Integer>> getIntDatatypeMembers( + @Override + public final Map<Individual, SortedSet<Constant>> getDatatypeMembers( DatatypeProperty datatypeProperty) { try { - return getIntDatatypeMembersImpl(datatypeProperty); + return getDatatypeMembersImpl(datatypeProperty); } catch (ReasoningMethodUnsupportedException e) { handleExceptions(e); return null; } } - public SortedSet<Individual> getTrueDatatypeMembers(DatatypeProperty datatypeProperty) { - try { - return getTrueDatatypeMembersImpl(datatypeProperty); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } + protected Map<Individual, SortedSet<Constant>> getDatatypeMembersImpl( + DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { + throw new ReasoningMethodUnsupportedException(); } - public SortedSet<Individual> getFalseDatatypeMembers(DatatypeProperty datatypeProperty) { + @Override + public final Map<Individual, SortedSet<Double>> getDoubleDatatypeMembers( + DatatypeProperty datatypeProperty) { try { - return getFalseDatatypeMembersImpl(datatypeProperty); + return getDoubleDatatypeMembersImpl(datatypeProperty); } catch (ReasoningMethodUnsupportedException e) { handleExceptions(e); return null; } } - public SortedSet<DatatypeProperty> getDatatypeProperties() { - try { - return getDatatypePropertiesImpl(); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; + protected Map<Individual, SortedSet<Double>> getDoubleDatatypeMembersImpl( + DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { + Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty); + Map<Individual, SortedSet<Double>> ret = new TreeMap<Individual, SortedSet<Double>>(); + for (Entry<Individual, SortedSet<Constant>> e : mapping.entrySet()) { + SortedSet<Constant> values = e.getValue(); + SortedSet<Double> valuesDouble = new TreeSet<Double>(); + for (Constant c : values) { + double v = Double.valueOf(c.getLiteral()); + valuesDouble.add(v); + } + ret.put(e.getKey(), valuesDouble); } + return ret; } - public SortedSet<DatatypeProperty> getBooleanDatatypeProperties() { + @Override + public final Map<Individual, SortedSet<Integer>> getIntDatatypeMembers( + DatatypeProperty datatypeProperty) { try { - return getBooleanDatatypePropertiesImpl(); + return getIntDatatypeMembersImpl(datatypeProperty); } catch (ReasoningMethodUnsupportedException e) { handleExceptions(e); return null; } } - public SortedSet<DatatypeProperty> getIntDatatypeProperties() { - try { - return getIntDatatypePropertiesImpl(); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } - } - - public SortedSet<DatatypeProperty> getDoubleDatatypeProperties() { - try { - return getDoubleDatatypePropertiesImpl(); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } - } - - public Description getDomain(ObjectProperty objectProperty) { - try { - return getDomainImpl(objectProperty); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } - } - - public Description getDomain(DatatypeProperty datatypeProperty) { - try { - return getDomainImpl(datatypeProperty); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } - } - - public Description getRange(ObjectProperty objectProperty) { - try { - return getRangeImpl(objectProperty); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } - } - - public DataRange getRange(DatatypeProperty datatypeProperty) { - try { - return getRangeImpl(datatypeProperty); - } catch (ReasoningMethodUnsupportedException e) { - handleExceptions(e); - return null; - } - } - - public Set<Individual> getRelatedIndividualsImpl(Individual individual, - ObjectProperty objectProperty) throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); - } - - public Set<Constant> getRelatedValuesImpl(Individual individual, + protected Map<Individual, SortedSet<Integer>> getIntDatatypeMembersImpl( DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); - } - - public Set<Constant> getLabelImpl(Entity entity) throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); - } - - public Map<Individual, SortedSet<Individual>> getRoleMembersImpl(ObjectProperty atomicRole) - throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); - } - - public Map<Individual, SortedSet<Constant>> getDatatypeMembersImpl( - DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); - } - - // convenience method to get int value mappings of a datatype property - public Map<Individual, SortedSet<Integer>> getIntDatatypeMembersImpl( - DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty); Map<Individual, SortedSet<Integer>> ret = new TreeMap<Individual, SortedSet<Integer>>(); for (Entry<Individual, SortedSet<Constant>> e : mapping.entrySet()) { SortedSet<Constant> values = e.getValue(); SortedSet<Integer> valuesInt = new TreeSet<Integer>(); for (Constant c : values) { - int v = Integer.parseInt(c.getLiteral()); + int v = Integer.valueOf(c.getLiteral()); valuesInt.add(v); } ret.put(e.getKey(), valuesInt); @@ -575,25 +529,18 @@ return ret; } - // convenience method to get double value mappings of a datatype property - public Map<Individual, SortedSet<Double>> getDoubleDatatypeMembersImpl( - DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { - Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty); - Map<Individual, SortedSet<Double>> ret = new TreeMap<Individual, SortedSet<Double>>(); - for (Entry<Individual, SortedSet<Constant>> e : mapping.entrySet()) { - SortedSet<Constant> values = e.getValue(); - SortedSet<Double> valuesDouble = new TreeSet<Double>(); - for (Constant c : values) { - double v = Double.parseDouble(c.getLiteral()); - valuesDouble.add(v); - } - ret.put(e.getKey(), valuesDouble); + @Override + public final Map<Individual, SortedSet<Boolean>> getBooleanDatatypeMembers( + DatatypeProperty datatypeProperty) { + try { + return getBooleanDatatypeMembersImpl(datatypeProperty); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; } - return ret; } - // convenience method to get boolean value mappings of a datatype property - public Map<Individual, SortedSet<Boolean>> getBooleanDatatypeMembersImpl( + protected Map<Individual, SortedSet<Boolean>> getBooleanDatatypeMembersImpl( DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty); Map<Individual, SortedSet<Boolean>> ret = new TreeMap<Individual, SortedSet<Boolean>>(); @@ -601,124 +548,203 @@ SortedSet<Constant> values = e.getValue(); SortedSet<Boolean> valuesBoolean = new TreeSet<Boolean>(); for (Constant c : values) { - boolean v = Boolean.parseBoolean(c.getLiteral()); - valuesBoolean.add(v); + String s = c.getLiteral(); + if (s.equalsIgnoreCase("true")) { + valuesBoolean.add(true); + } else if (s.equalsIgnoreCase("false")) { + valuesBoolean.add(false); + } else { + logger.warn("Requested to parse boolean value of property " + datatypeProperty + + ", but " + c + " could not be parsed successfully."); + } } ret.put(e.getKey(), valuesBoolean); } return ret; } - // convenience method returning those values which have value "true" for - // this - // datatype property - public SortedSet<Individual> getTrueDatatypeMembersImpl(DatatypeProperty datatypeProperty) + @Override + public final SortedSet<Individual> getTrueDatatypeMembers(DatatypeProperty datatypeProperty) { + try { + return getTrueDatatypeMembersImpl(datatypeProperty); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } + } + + protected SortedSet<Individual> getTrueDatatypeMembersImpl(DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty); SortedSet<Individual> ret = new TreeSet<Individual>(); for (Entry<Individual, SortedSet<Constant>> e : mapping.entrySet()) { SortedSet<Constant> values = e.getValue(); - for (Constant c : values) { - boolean v = Boolean.parseBoolean(c.getLiteral()); - if (v == true) + if (values.size() > 1) { + logger.warn("Property " + datatypeProperty + " has value " + e.getValue() + + ". Cannot determine whether it is true."); + } else { + if (values.first().getLiteral().equalsIgnoreCase("true")) { ret.add(e.getKey()); + } } } return ret; } - // convenience method returning those values which have value "false" for - // this - // datatype property - public SortedSet<Individual> getFalseDatatypeMembersImpl(DatatypeProperty datatypeProperty) + @Override + public final SortedSet<Individual> getFalseDatatypeMembers(DatatypeProperty datatypeProperty) { + try { + return getFalseDatatypeMembersImpl(datatypeProperty); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } + } + + protected SortedSet<Individual> getFalseDatatypeMembersImpl(DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { Map<Individual, SortedSet<Constant>> mapping = getDatatypeMembersImpl(datatypeProperty); SortedSet<Individual> ret = new TreeSet<Individual>(); for (Entry<Individual, SortedSet<Constant>> e : mapping.entrySet()) { SortedSet<Constant> values = e.getValue(); - for (Constant c : values) { - boolean v = Boolean.parseBoolean(c.getLiteral()); - if (v == false) + if (values.size() > 1) { + logger.warn("Property " + datatypeProperty + " has value " + e.getValue() + + ". Cannot determine whether it is false."); + } else { + if (values.first().getLiteral().equalsIgnoreCase("false")) { ret.add(e.getKey()); + } } } return ret; } + @Override + public final SortedSet<DatatypeProperty> getDatatypeProperties() { + try { + return getDatatypePropertiesImpl(); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } + } - public SortedSetTuple<Individual> doubleRetrievalImpl(Description concept, Description adc) + protected SortedSet<DatatypeProperty> getDatatypePropertiesImpl() throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } + @Override + public final SortedSet<DatatypeProperty> getBooleanDatatypeProperties() { + try { + return getBooleanDatatypePropertiesImpl(); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } + } - - - - public void prepareRoleHierarchyImpl(Set<ObjectProperty> allowedRoles) + // TODO Even if there is a small performance penalty, we could implement + // the method right here by iterating over all data properties and + // querying their ranges. At least, this should be done once we have a + // reasoner independant of OWL API with datatype support. + protected SortedSet<DatatypeProperty> getBooleanDatatypePropertiesImpl() throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - public void prepareDatatypePropertyHierarchyImpl(Set<DatatypeProperty> allowedDatatypeProperties) - throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); + @Override + public final SortedSet<DatatypeProperty> getIntDatatypeProperties() { + try { + return getIntDatatypePropertiesImpl(); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } } - public ObjectPropertyHierarchy getRoleHierarchyImpl() + protected SortedSet<DatatypeProperty> getIntDatatypePropertiesImpl() throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - public DatatypePropertyHierarchy getDatatypePropertyHierarchyImpl() - throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); + @Override + public final SortedSet<DatatypeProperty> getDoubleDatatypeProperties() { + try { + return getDoubleDatatypePropertiesImpl(); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } } - public Description getDomainImpl(ObjectProperty objectProperty) + protected SortedSet<DatatypeProperty> getDoubleDatatypePropertiesImpl() throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - public Description getDomainImpl(DatatypeProperty datatypeProperty) - throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); + @Override + public final Description getDomain(ObjectProperty objectProperty) { + try { + return getDomainImpl(objectProperty); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } } - public Description getRangeImpl(ObjectProperty objectProperty) + protected Description getDomainImpl(ObjectProperty objectProperty) throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - public DataRange getRangeImpl(DatatypeProperty datatypeProperty) - throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); + @Override + public final Description getDomain(DatatypeProperty datatypeProperty) { + try { + return getDomainImpl(datatypeProperty); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } } - public SortedSet<DatatypeProperty> getDatatypePropertiesImpl() + protected Description getDomainImpl(DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - public SortedSet<DatatypeProperty> getBooleanDatatypePropertiesImpl() - throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); + @Override + public final Description getRange(ObjectProperty objectProperty) { + try { + return getRangeImpl(objectProperty); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } } - public SortedSet<DatatypeProperty> getDoubleDatatypePropertiesImpl() + protected Description getRangeImpl(ObjectProperty objectProperty) throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - public SortedSet<DatatypeProperty> getIntDatatypePropertiesImpl() + @Override + public final DataRange getRange(DatatypeProperty datatypeProperty) { + try { + return getRangeImpl(datatypeProperty); + } catch (ReasoningMethodUnsupportedException e) { + handleExceptions(e); + return null; + } + } + + protected DataRange getRangeImpl(DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException(); } - public Set<NamedClass> getInconsistentClassesImpl() throws ReasoningMethodUnsupportedException { - throw new ReasoningMethodUnsupportedException(); - } - + + @Override public final SortedSet<Description> getSuperClasses(Description concept) { return getClassHierarchy().getMoreGeneralConcepts(concept); @@ -769,7 +795,16 @@ return getDatatypePropertyHierarchy().getMostSpecialRoles(); } - protected ClassHierarchy prepareSubsumptionHierarchy() throws ReasoningMethodUnsupportedException { + /** + * Creates the class hierarchy. Invoking this method is optional (if not + * called explicitly, it is called the first time, it is needed). + * + * @return The class hierarchy. + * @throws ReasoningMethodUnsupportedException + * Thrown if subsumption hierarchy creation is not supported by + * the reasoner. + */ + public ClassHierarchy prepareSubsumptionHierarchy() throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException( "Subsumption hierarchy creation not supported by this reasoner."); } @@ -780,7 +815,7 @@ if (subsumptionHierarchy == null) { subsumptionHierarchy = prepareSubsumptionHierarchy(); } -// subsumptionHierarchy = getSubsumptionHierarchyImpl(); + // subsumptionHierarchy = getSubsumptionHierarchyImpl(); } catch (ReasoningMethodUnsupportedException e) { handleExceptions(e); } @@ -788,11 +823,17 @@ return subsumptionHierarchy; } -// public ClassHierarchy getSubsumptionHierarchyImpl() throws ReasoningMethodUnsupportedException { -// throw new ReasoningMethodUnsupportedException(); -// } - - protected ObjectPropertyHierarchy prepareRoleHierarchy() throws ReasoningMethodUnsupportedException { + /** + * Creates the object property hierarchy. Invoking this method is optional + * (if not called explicitly, it is called the first time, it is needed). + * + * @return The object property hierarchy. + * @throws ReasoningMethodUnsupportedException + * Thrown if object property hierarchy creation is not supported + * by the reasoner. + */ + public ObjectPropertyHierarchy prepareRoleHierarchy() + throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException( "Object property hierarchy creation not supported by this reasoner."); } @@ -809,7 +850,17 @@ return roleHierarchy; } - protected DatatypePropertyHierarchy prepareDatatypePropertyHierarchy() throws ReasoningMethodUnsupportedException { + /** + * Creates the data property hierarchy. Invoking this method is optional (if + * not called explicitly, it is called the first time, it is needed). + * + * @return The data property hierarchy. + * @throws ReasoningMethodUnsupportedException + * Thrown if data property hierarchy creation is not supported + * by the reasoner. + */ + public DatatypePropertyHierarchy prepareDatatypePropertyHierarchy() + throws ReasoningMethodUnsupportedException { throw new ReasoningMethodUnsupportedException( "Datatype property hierarchy creation not supported by this reasoner."); } @@ -824,8 +875,8 @@ } } return datatypePropertyHierarchy; - } - + } + public List<NamedClass> getAtomicConceptsList() { if (atomicConceptsList == null) atomicConceptsList = new LinkedList<NamedClass>(getNamedClasses()); @@ -880,10 +931,6 @@ return subsumptionReasoningTimeNs; } - /* - * public long getSubsumptionHierarchyTimeNs() { return - * subsumptionHierarchyTimeNs; } - */ public int getNrOfSubsumptionHierarchyQueries() { return nrOfSubsumptionHierarchyQueries; } Modified: trunk/src/dl-learner/org/dllearner/core/SchemaReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/SchemaReasoner.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/core/SchemaReasoner.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -23,10 +23,12 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.dllearner.core.owl.DataRange; import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.DatatypePropertyHierarchy; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.ClassHierarchy; +import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectPropertyHierarchy; @@ -39,6 +41,43 @@ public interface SchemaReasoner { /** + * Returns all named classes, which are not satisfiable, i.e. cannot + * have instances. + * @return The set of inconsistent classes. + */ + public Set<NamedClass> getInconsistentClasses(); + + /** + * Returns the domain of this object property. (Theoretically, there could + * be more than one domain axiom. However, this can be considered a modelling + * error.) + * @param objectProperty An object property in the knowledge base. + * @return The rdfs:domain of <code>objectProperty</code> + */ + public Description getDomain(ObjectProperty objectProperty); + + /** + * Returns the domain of this data property. + * @param datatypeProperty An data property in the knowledge base. + * @return The rdfs:domain of <code>datatypeProperty</code> + */ + public Description getDomain(DatatypeProperty datatypeProperty); + + /** + * Returns the range of this object property. + * @param objectProperty An object property in the knowledge base. + * @return The rdfs:range of <code>objectProperty</code> + */ + public Description getRange(ObjectProperty objectProperty); + + /** + * Returns the range of this data property. + * @param datatypeProperty An data property in the knowledge base. + * @return The rdfs:range of <code>datatypeProperty</code> + */ + public DataRange getRange(DatatypeProperty datatypeProperty); + + /** * Checks whether <code>superClass</code> is a super class of <code>subClass</code>. * @param superClass The (supposed) super class. * @param subClass The (supposed) sub class. Modified: trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -5,7 +5,6 @@ import org.apache.log4j.Logger; import org.dllearner.algorithms.gp.ADC; import org.dllearner.core.ComponentManager; -import org.dllearner.core.ReasoningMethodUnsupportedException; import org.dllearner.core.ReasonerComponent; import org.dllearner.core.owl.Constant; import org.dllearner.core.owl.DatatypeExactCardinalityRestriction; @@ -85,18 +84,18 @@ private String getLabelFromReasoner(Entity ent) { String label; - try{ +// try{ Set<Constant> set=service.getLabel(ent); if (set.size()>0){ Iterator<Constant> iter=set.iterator(); label=iter.next().getLiteral(); } else label=""; - } - catch (ReasoningMethodUnsupportedException e) - { - label=""; - } +// } +// catch (ReasoningMethodUnsupportedException e) +// { +// label=""; +// } return label; } Modified: trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/reasoning/DIGReasoner.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -699,7 +699,7 @@ // das in Responsegroup auch nicht definiert // => deswegen wird hier die XML-Cursor-API verwendet @Override - public Map<Individual, SortedSet<Individual>> getRoleMembers(ObjectProperty atomicRole) { + public Map<Individual, SortedSet<Individual>> getPropertyMembersImpl(ObjectProperty atomicRole) { String relatedIndividualsDIG = asksPrefix; relatedIndividualsDIG += "<relatedIndividuals id=\"related_individuals\">"; relatedIndividualsDIG += "<ratom name=\"" + atomicRole.getName() + "\" />"; @@ -800,9 +800,9 @@ return null; } - @Override - public boolean hasDatatypeSupport() { - return false; - } +// @Override +// public boolean hasDatatypeSupport() { +// return false; +// } } Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -221,7 +221,7 @@ logger.debug("dematerialising object properties"); for (ObjectProperty atomicRole : atomicRoles) { - opPos.put(atomicRole, rc.getRoleMembers(atomicRole)); + opPos.put(atomicRole, rc.getPropertyMembers(atomicRole)); } logger.debug("dematerialising datatype properties"); @@ -499,11 +499,11 @@ return atomicConcepts; } - @Override - public Map<Individual, SortedSet<Double>> getDoubleDatatypeMembers( - DatatypeProperty datatypeProperty) { - return rc.getDoubleDatatypeMembers(datatypeProperty); - } +// @Override +// public Map<Individual, SortedSet<Double>> getDoubleDatatypeMembersImpl( +// DatatypeProperty datatypeProperty) { +// return rc.getDoubleDatatypeMembers(datatypeProperty); +// } /* * (non-Javadoc) @@ -516,22 +516,22 @@ } @Override - public SortedSet<DatatypeProperty> getDatatypeProperties() { + public SortedSet<DatatypeProperty> getDatatypePropertiesImpl() { return datatypeProperties; } @Override - public SortedSet<DatatypeProperty> getBooleanDatatypeProperties() { + public SortedSet<DatatypeProperty> getBooleanDatatypePropertiesImpl() { return booleanDatatypeProperties; } @Override - public SortedSet<DatatypeProperty> getDoubleDatatypeProperties() { + public SortedSet<DatatypeProperty> getDoubleDatatypePropertiesImpl() { return doubleDatatypeProperties; } @Override - public SortedSet<DatatypeProperty> getIntDatatypeProperties() { + public SortedSet<DatatypeProperty> getIntDatatypePropertiesImpl() { return intDatatypeProperties; } @@ -565,20 +565,20 @@ // return rc.getClassHierarchy(); // } - @Override - public void prepareRoleHierarchyImpl(Set<ObjectProperty> allowedRoles) { - rc.prepareRoleHierarchy(allowedRoles); - } +// @Override +// public void prepareRoleHierarchyImpl(Set<ObjectProperty> allowedRoles) { +// rc.prepareRoleHierarchy(allowedRoles); +// } // @Override // public ObjectPropertyHierarchy getRoleHierarchy() { // return rc.getRoleHierarchy(); // } - @Override - public void prepareDatatypePropertyHierarchyImpl(Set<DatatypeProperty> allowedRoles) { - rc.prepareDatatypePropertyHierarchyImpl(allowedRoles); - } +// @Override +// public void prepareDatatypePropertyHierarchyImpl(Set<DatatypeProperty> allowedRoles) { +// rc.prepareDatatypePropertyHierarchyImpl(allowedRoles); +// } // @Override // public DatatypePropertyHierarchy getDatatypePropertyHierarchy() { @@ -642,37 +642,37 @@ } @Override - public Description getDomain(ObjectProperty objectProperty) { + public Description getDomainImpl(ObjectProperty objectProperty) { return rc.getDomain(objectProperty); } @Override - public Description getDomain(DatatypeProperty datatypeProperty) { + public Description getDomainImpl(DatatypeProperty datatypeProperty) { return rc.getDomain(datatypeProperty); } @Override - public Description getRange(ObjectProperty objectProperty) { + public Description getRangeImpl(ObjectProperty objectProperty) { return rc.getRange(objectProperty); } @Override - public Map<Individual, SortedSet<Individual>> getRoleMembers(ObjectProperty atomicRole) { + public Map<Individual, SortedSet<Individual>> getPropertyMembersImpl(ObjectProperty atomicRole) { return opPos.get(atomicRole); } @Override - public Set<Individual> getRelatedIndividuals(Individual individual, ObjectProperty objectProperty) throws ReasoningMethodUnsupportedException { + public Set<Individual> getRelatedIndividualsImpl(Individual individual, ObjectProperty objectProperty) throws ReasoningMethodUnsupportedException { return rc.getRelatedIndividuals(individual, objectProperty); } @Override - public Set<Constant> getRelatedValues(Individual individual, DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { + public Set<Constant> getRelatedValuesImpl(Individual individual, DatatypeProperty datatypeProperty) throws ReasoningMethodUnsupportedException { return rc.getRelatedValues(individual, datatypeProperty); } @Override - public Set<Constant> getLabel(Entity entity) throws ReasoningMethodUnsupportedException { + public Set<Constant> getLabelImpl(Entity entity) throws ReasoningMethodUnsupportedException { return rc.getLabel(entity); } @@ -686,10 +686,10 @@ rc.releaseKB(); } - @Override - public boolean hasDatatypeSupport() { - return true; - } +// @Override +// public boolean hasDatatypeSupport() { +// return true; +// } /* (non-Javadoc) * @see org.dllearner.core.ReasonerComponent#getTypesImpl(org.dllearner.core.owl.Individual) Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastRetrievalReasoner.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -208,8 +208,8 @@ rc.releaseKB(); } - @Override - public boolean hasDatatypeSupport() { - return true; - } +// @Override +// public boolean hasDatatypeSupport() { +// return true; +// } } Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -384,7 +384,7 @@ } @Override - public SortedSet<DatatypeProperty> getDatatypeProperties() { + public SortedSet<DatatypeProperty> getDatatypePropertiesImpl() { return datatypeProperties; } @@ -512,8 +512,7 @@ // public ObjectPropertyHierarchy getRoleHierarchy() { // return roleHierarchy; // } - - @Override + public void prepareDatatypePropertyHierarchyImpl(Set<DatatypeProperty> allowedRoles) { // code copied from DIG reasoner @@ -668,7 +667,7 @@ } @Override - public Description getDomain(ObjectProperty objectProperty) { + public Description getDomainImpl(ObjectProperty objectProperty) { OWLObjectProperty prop = getOWLAPIDescription(objectProperty); try { // TODO: look up why OWL API return a two dimensional set here @@ -687,7 +686,7 @@ } @Override - public Description getDomain(DatatypeProperty datatypeProperty) { + public Description getDomainImpl(DatatypeProperty datatypeProperty) { OWLDataProperty prop = getOWLAPIDescription(datatypeProperty); try { // TODO: look up why OWL API return a two dimensional set here @@ -706,7 +705,7 @@ } @Override - public Description getRange(ObjectProperty objectProperty) { + public Description getRangeImpl(ObjectProperty objectProperty) { OWLObjectProperty prop = getOWLAPIDescription(objectProperty); try { Set<OWLDescription> set = reasoner.getRanges(prop); @@ -720,7 +719,7 @@ } @Override - public Map<Individual, SortedSet<Individual>> getRoleMembers(ObjectProperty atomicRole) { + public Map<Individual, SortedSet<Individual>> getPropertyMembersImpl(ObjectProperty atomicRole) { OWLObjectProperty prop = getOWLAPIDescription(atomicRole); Map<Individual, SortedSet<Individual>> map = new TreeMap<Individual, SortedSet<Individual>>(); for(Individual i : individuals) { @@ -744,7 +743,7 @@ } @Override - public Set<Individual> getRelatedIndividuals(Individual individual, ObjectProperty objectProperty) { + public Set<Individual> getRelatedIndividualsImpl(Individual individual, ObjectProperty objectProperty) { OWLIndividual ind = factory.getOWLIndividual(URI.create(individual.getName())); OWLObjectProperty prop = getOWLAPIDescription(objectProperty); Set<OWLIndividual> inds = null; @@ -762,7 +761,7 @@ } @Override - public Set<Constant> getRelatedValues(Individual individual, DatatypeProperty datatypeProperty) { + public Set<Constant> getRelatedValuesImpl(Individual individual, DatatypeProperty datatypeProperty) { OWLIndividual ind = factory.getOWLIndividual(URI.create(individual.getName())); OWLDataProperty prop = getOWLAPIDescription(datatypeProperty); Set<OWLConstant> constants = null; @@ -1009,7 +1008,7 @@ * @return the booleanDatatypeProperties */ @Override - public SortedSet<DatatypeProperty> getBooleanDatatypeProperties() { + public SortedSet<DatatypeProperty> getBooleanDatatypePropertiesImpl() { return booleanDatatypeProperties; } @@ -1017,7 +1016,7 @@ * @return the doubleDatatypeProperties */ @Override - public SortedSet<DatatypeProperty> getDoubleDatatypeProperties() { + public SortedSet<DatatypeProperty> getDoubleDatatypePropertiesImpl() { return doubleDatatypeProperties; } @@ -1025,7 +1024,7 @@ * @return the intDatatypeProperties */ @Override - public SortedSet<DatatypeProperty> getIntDatatypeProperties() { + public SortedSet<DatatypeProperty> getIntDatatypePropertiesImpl() { return intDatatypeProperties; } @@ -1065,10 +1064,10 @@ configurator.setReasonerType(type); }*/ - @Override - public boolean hasDatatypeSupport() { - return true; - } +// @Override +// public boolean hasDatatypeSupport() { +// return true; +// } @Override public Set<NamedClass> getInconsistentClassesImpl(){ @@ -1099,7 +1098,7 @@ @Override @SuppressWarnings("all") - public Set<Constant> getLabel(Entity entity) { + public Set<Constant> getLabelImpl(Entity entity) { OWLEntity owlEntity = getOWLAPIEntity(entity); Set<OWLAnnotation> labelAnnotations = owlEntity.getAnnotations(owlAPIOntologies.get(0), URI.create("http://www.w3.org/2000/01/rdf-schema#label")); Set<Constant> annotations = new HashSet<Constant>(); Modified: trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -217,7 +217,7 @@ valueFrequency.put(op, opMap); // sets ordered by corresponding individual (which we ignore) - Collection<SortedSet<Individual>> fillerSets = rs.getRoleMembers(op).values(); + Collection<SortedSet<Individual>> fillerSets = rs.getPropertyMembers(op).values(); for(SortedSet<Individual> fillerSet : fillerSets) { for(Individual i : fillerSet) { // System.out.println("op " + op + " i " + i); @@ -264,7 +264,7 @@ if(useCardinalityRestrictions) { for(ObjectProperty op : rs.getObjectProperties()) { int maxFillers = 0; - Map<Individual,SortedSet<Individual>> opMembers = rs.getRoleMembers(op); + Map<Individual,SortedSet<Individual>> opMembers = rs.getPropertyMembers(op); for(SortedSet<Individual> inds : opMembers.values()) { if(inds.size()>maxFillers) maxFillers = inds.size(); Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -580,7 +580,7 @@ @WebMethod public String[] getIndividualsForARole(int id, String role) throws ClientNotKnownException { ClientState state = getState(id); - Map<Individual,SortedSet<Individual>> m = state.getReasonerComponent().getRoleMembers(new ObjectProperty(role)); + Map<Individual,SortedSet<Individual>> m = state.getReasonerComponent().getPropertyMembers(new ObjectProperty(role)); Set<Individual> individuals = m.keySet(); return Datastructures.sortedSet2StringListIndividuals(individuals); } Modified: trunk/src/dl-learner/org/dllearner/utilities/Helper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/utilities/Helper.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -564,7 +564,7 @@ } for (ObjectProperty atomicRole : rs.getObjectProperties()) { - aBox.rolesPos.put(atomicRole.getName(), getStringMap(rs.getRoleMembers(atomicRole))); + aBox.rolesPos.put(atomicRole.getName(), getStringMap(rs.getPropertyMembers(atomicRole))); aBox.roles.add(atomicRole.getName()); } Modified: trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -250,7 +250,7 @@ public void makeNegativeExamplesFromDomain(ObjectProperty atomicRole){ fromDomain.clear(); logger.debug("making Negative Examples from Domain of : "+atomicRole); - fromDomain.addAll(reasoningService.getRoleMembers(atomicRole).keySet()); + fromDomain.addAll(reasoningService.getPropertyMembers(atomicRole).keySet()); fromDomain.removeAll(fullPositiveSet); logger.debug("|-neg Example size from Domain: "+this.fromDomain.size()); } @@ -265,7 +265,7 @@ public void makeNegativeExamplesFromRange(ObjectProperty atomicRole){ fromRange.clear(); logger.debug("making Negative Examples from Range of : "+atomicRole); - Collection<SortedSet<Individual>> tmp = reasoningService.getRoleMembers(atomicRole).values(); + Collection<SortedSet<Individual>> tmp = reasoningService.getPropertyMembers(atomicRole).values(); for (SortedSet<Individual> set : tmp) { fromRange.addAll(set); } Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloser.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloser.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -96,7 +96,7 @@ // System.out.println(oneRole.getClass()); Map<Individual, SortedSet<Individual>> allRoleMembers = this.rs - .getRoleMembers(oneRole); + .getPropertyMembers(oneRole); for (Individual oneInd : allRoleMembers.keySet()) { SortedSet<Individual> fillers = allRoleMembers.get(oneInd); if (fillers.size() > 0) { @@ -126,7 +126,7 @@ // System.out.println(oneRole.getClass()); Map<Individual, SortedSet<Individual>> allRoleMembers = this.rs - .getRoleMembers(oneRole); + .getPropertyMembers(oneRole); for (Individual oneInd : allRoleMembers.keySet()) { SortedSet<Individual> fillers = allRoleMembers.get(oneInd); if (fillers.size() > 0) { @@ -177,7 +177,7 @@ // System.out.println(oneRole.getClass()); Map<Individual, SortedSet<Individual>> allRoleMembers = this.rs - .getRoleMembers(oneRole); + .getPropertyMembers(oneRole); for (Individual oneInd : allRoleMembers.keySet()) { SortedSet<Individual> fillers = allRoleMembers.get(oneInd); //if (fillers.size() > 0) { Modified: trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloserOWLAPI.java =================================================================== --- trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloserOWLAPI.java 2008-11-11 10:59:23 UTC (rev 1505) +++ trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloserOWLAPI.java 2008-11-11 12:57:12 UTC (rev 1506) @@ -59,7 +59,7 @@ for (ObjectProperty oneRole : allRoles) { Map<Individual, SortedSet<Individual>> allRoleMembers = this.rs - .getRoleMembers(oneRole); + .getPropertyMembers(oneRole); for (Individual oneInd : allRoleMembers.keySet()) { SortedSet<Individual> fillers = allRoleMembers.get(oneInd); // only where roles exist @@ -100,7 +100,7 @@ // collect info for roles and individuals for (ObjectProperty oneRole : allRoles) { Map<Individual, SortedSet<Individual>> allRoleMembers = this.rs - .getRoleMembers(oneRole); + .getPropertyMembers(oneRole); for (Individual oneInd : allRoleMembers.keySet()) { SortedSet<Individual> fillers = allRoleMembers.get(oneInd); if (fillers.size() > 0) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |