Administrator
|
Hello,
You can access to all restriction in the is_a attribute, as Restriction object. Then you have to filter to retain only Restriction, and only those of the ONLY type.
Alternatively, if you are only interested in ONLY restrictions but not in SOME restrictions, you can change the behavior of Owlready so as Class.property returns ONLY restrictions instead of SOME.
This can be done by setting the special "class_property_type" annotation on the property, as follows:
my_prop.class_property_type = ["only"]
Jiba
|