Re: Read out restrictions of classes

Posted by Jiba on
URL: http://owlready.306.s1.nabble.com/Read-out-restrictions-of-classes-tp2154p2159.html

Hello,

You can use the property, type, cardinality and value attribute of the restriction to decompose it.

Attention, Class.is_a contains all is-a relations, and not only Restriction. You should check before is the current parent is a restriction, with:

     if not isinstance(restriction, Restriction): continue

Jiba