assign a weight to a ObjectProperty beetween two individuals

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

assign a weight to a ObjectProperty beetween two individuals

Christian
Hi,

how can I assign a weight to a ObjectProperty beetween two individuals?

<pseudo-code>
with onto:
    class A(Thing)
        pass

    class B(Thing)
        pass

    class has(A >> B):
        pass

a = A("a")
b = B("b")

# How to assign a weight to the ObjectProperty "has" beetween a and b?
a.has.append("b")
</pseudo-code>
Reply | Threaded
Open this post in threaded view
|

Re: assign a weight to a ObjectProperty beetween two individuals

Jiba
Administrator
Hi,

By weight, you mean an arbitrary float value ? You can create a "weight" annotation as follows:

class weight(AnnotationProperty): pass

weight[a, has, b] = 0.5 # put here the desired value.

Best regards,
Jean-Baptiste Lamy
MCF, LIMICS, Université Paris 13