OWLOntology o = OWLManager.createOWLOntologyManager().createOntology();
// SubObjectPropertyOf( ObjectPropertyChain( a:hasFather a:hasBrother )
// a:hasUncle ) The brother of someone's father is that person's uncle.
// SubObjectPropertyOf( ObjectPropertyChain( a:hasChild a:hasUncle )
// a:hasBrother ) The uncle of someone's child is that person's brother.
OWLObjectProperty father = df
.getOWLObjectProperty(IRI("urn:test:hasFather"));
OWLObjectProperty brother = df
.getOWLObjectProperty(IRI("urn:test:hasBrother"));
OWLObjectProperty child = df
.getOWLObjectProperty(IRI("urn:test:hasChild"));
OWLObjectProperty uncle = df
.getOWLObjectProperty(IRI("urn:test:hasUncle"));
o.getOWLOntologyManager()
.addAxiom(o, df.getOWLDeclarationAxiom(father));
o.getOWLOntologyManager().addAxiom(o,
df.getOWLDeclarationAxiom(brother));