How to know what restrictions have been applied to a class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to know what restrictions have been applied to a class

Neha
Hello,

Can we figure out what restrictions apply to a class or if any restrictions have been applied to a class with owlready2?
Reply | Threaded
Open this post in threaded view
|

Re: How to know what restrictions have been applied to a class

Jiba
Administrator
Hi,

Restriction are considered as superclass in OWL, so they are listed in Class.is_a and Class.equivalent_to.

Then, you can use isinstance to test whether a given superclass is a class (isinstance(superclass, EntityClass)), a Restriction (isinstance(superclass, Restriction)), or more generally a construct (isinstance(superclass, Construct)), etc.

Jiba