Define annotation as a list

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

Define annotation as a list

jlbellier
Hello eveybody,

I would like to annotate classes with a annotation that contain a list of values.

I tried the following in protege 5.5 : on the class I added an annotation with the following syntax for the value :  {val1, val2}

My values are booleans (e.g. {true, false}).

When I read this with owlready2, I gfet the following :
<class 'owlready2.prop.IndividualValueList'> ['{true, false}']

Is there a way of writing this so that I get [true, false] with owlready2 ?

Thank you in advance for your help.

Best regards,
Jean(Luc.
Reply | Threaded
Open this post in threaded view
|

Re: Define annotation as a list

Jiba
Administrator
Hello,

When putting "{true, false}" in the annotation value in Protégé, it is understood by Protégé as a string, not as a list/set of two elements. Thus, with Owlready, you get a string.

You can either parse the string in Python, or use a more "structured" model in the ontology (e.g. with 2 distinct annotation properties, one for each of the boolean).

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Define annotation as a list

jlbellier
Hello,

Thank you for your reply. It confirms what I thought. In my case, I think that parsing the string would be the best choice, because I may have a variable number of booleans.

Best regards,
Jean-Luc.