Owlready
Search
everywhere
only in this topic
Advanced Search
Object property
Classic
List
Threaded
♦
♦
Locked
2 messages
Mustafa
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Object property
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
Jiba
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Object property
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
Free forum by Nabble
Edit this page