Class.Property does not return properties with max and only restriction

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

Class.Property does not return properties with max and only restriction

GoMa
Hi Jiba,

for some reason owlready2 does not return the class connections for "max" and "only" properties:
Protege

Function call with: onto.class.property does not return MaxSubclass and OnlySubclass:


Function call with onto.class.is_a:


Is this a bug in onto.class.property or is it meant like this for some special reason? Calling it with is_a shows all connections.

Thanks for your support!
Reply | Threaded
Open this post in threaded view
|

Re: Class.Property does not return properties with max and only restriction

Jiba
Administrator
Hi,

By default, Owlready use "some" restrictions for class properties. You can change this behavior on a per-property basis, using the "class_property_type" annotation. You can set it either in Protégé (after importing the http://www.lesfleursdunormal.fr/static/_downloads/owlready_ontology.owl ontology) or in Python, e.g. with  onto.my_property.class_property_type = ["some", "only"]

The value must be a list, with a subset of the following values: "some", "only" and "relation" (for direct relation, as used in RDF). However, min/max/exactly are not yet supported as class property.

You can also access to all restrictions in .is_a (although more complex to handle). If you want to distinguish them by type (some/only/min/...), it is the only solution.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Class.Property does not return properties with max and only restriction

GoMa
Thanks for the reply, that makes sense.

Jiba wrote
The value must be a list, with a subset of the following values: "some", "only" and "relation" (for direct relation, as used in RDF). However, min/max/exactly are not yet supported as class property.
Do you have plans to integrate min/max/exactly to the class properties in the future? Is there a timeline?
Reply | Threaded
Open this post in threaded view
|

Re: Class.Property does not return properties with max and only restriction

Jiba
Administrator
Hi,

Integrating min/max/exactly to the class properties is difficult because it is not clear how to expose the associated cardinality. So I have no plan for that currently; most of the time I can dedicate to Owlready is actually devoted to the project of a Python reasoner.

Jiba