Object property

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

Object property

Mustafa
If we have relation
(Sub1, prop, obj1)
and another relation
(Sub2,prop, obj2)
Where (obj 1 , obj2, sub1,sub 2) are instances
and (prop) is the same both relations.
How can i add those instances dynamically as domain and range
for prop

Thx
Reply | Threaded
Open this post in threaded view
|

Re: Object property

Jiba
Administrator
Hi,

You can add instances (not classes) to range / domain by using a "OneOf" OWL construct (it transforms a list of instances into a class):

one_of = OneOf([])

one_of.instances.append(sub1)
one_of.instances.append(sub2)

prop.domain.append(one_of)


You may also use Prop.get_relations() to list all the (sub, obj) pairs for that property.

Jiba