Skip to content

Commit

Permalink
Do not implement getInverseProperty and getNamedProperty in OWLObject…
Browse files Browse the repository at this point in the history
…PropertyExpressionImpl.

Make getSimplified return the current object, since all legal OPEs are irreducible.
  • Loading branch information
sesuncedu committed Aug 16, 2015
1 parent c15537e commit c74d563
Showing 1 changed file with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
package uk.ac.manchester.cs.owl.owlapi;

import static org.semanticweb.owlapi.util.OWLAPIPreconditions.verifyNotNull;

import javax.annotation.Nonnull;

import org.semanticweb.owlapi.model.OWLObjectInverseOf;
import org.semanticweb.owlapi.model.OWLObjectProperty;
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
import org.semanticweb.owlapi.util.ObjectPropertySimplifier;

/**
* @author Matthew Horridge, The University Of Manchester, Bio-Health
Expand Down Expand Up @@ -57,31 +51,7 @@ public boolean equals(Object obj) {
@Nonnull
@Override
public OWLObjectPropertyExpression getSimplified() {
if (simplestForm == null) {
ObjectPropertySimplifier simplifier = new ObjectPropertySimplifier(
new OWLDataFactoryImpl());
simplestForm = simplifier.getSimplified(this);
}
return verifyNotNull(simplestForm);
return this;
}

@Nonnull
@Override
public OWLObjectPropertyExpression getInverseProperty() {
if (inverse == null) {
inverse = new OWLObjectInverseOfImpl(this);
}
return verifyNotNull(inverse);
}

@Override
public OWLObjectProperty getNamedProperty() {
OWLObjectPropertyExpression simp = getSimplified();
if (simp.isAnonymous()) {
return ((OWLObjectInverseOf) simp).getInverse()
.asOWLObjectProperty();
} else {
return simp.asOWLObjectProperty();
}
}
}

0 comments on commit c74d563

Please sign in to comment.