Owlready
Login
Register
Search
everywhere
only in this topic
Advanced Search
Object property
Classic
List
Threaded
♦
♦
Locked
2 messages
Options
Loading...
Subscribe via email
Move topic
Pin topic
Unpin topic
Lock topic
Unlock topic
Delete this topic
Delete this topic
Change title and meta tags
Embed post
Permalink
Mustafa
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
More
Loading...
Reply to author
Edit post
Move post
Delete this post
Delete this post and replies
Change post date
Print post
Permalink
Raw mail
Jun 27, 2021; 10:26pm
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
♦
♦
|
More
Loading...
Reply to author
Edit post
Move post
Delete this post
Delete this post and replies
Change post date
Print post
Permalink
Raw mail
Jul 02, 2021; 11:39am
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