/** * Testing correctness of converting nested inverses */ @Test public void testNestedInverses() { OWLDataFactory factory = new OWLDataFactoryImpl(); OWLObjectProperty r = factory.getOWLObjectProperty(IRI.create("R")); OWLObjectPropertyExpression ri = factory.getOWLObjectInverseOf(r); OWLPropertyExpressionVisitorEx<ElkObjectPropertyExpression> converter = OwlObjectPropertyExpressionConverterVisitor .getInstance(); ElkObjectPropertyExpression s = r.accept(converter); ElkObjectPropertyExpression si = ri.accept(converter); assertTrue(s instanceof ElkObjectProperty); assertTrue(si instanceof ElkObjectInverseOf); ElkIri expectedIri = ((ElkObjectProperty) s).getIri(); assertEquals(expectedIri, ((ElkObjectInverseOf) si).getObjectProperty() .getIri()); }
@Override public <O> O accept(OWLPropertyExpressionVisitorEx<O> visitor) { return visitor.visit(this); }