Updated annotations cannot be saved

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

Updated annotations cannot be saved

yxuil
New user is trying to expand an annotation (list), but the updated annotation wasn't saved to file.

searched = onto.search(iri=f"*_{keyword}_*")
for i in searched:
    anno = get_anno(i.name)
    i.altLabel = i.altLabel + anno
onto.save(output_fn)

However when open the output file, the updates were not present. I examine the altLabel, which does contain the new annotations (anno)

I am pretty sure it works as expected before.

What could be possible reasons that I have overlooked?
Reply | Threaded
Open this post in threaded view
|

Re: Updated annotations cannot be saved

Jiba
Administrator
Hi,

How/where the altLabel annotation is defined / created ? You need to define it, otherwise it is considered as a Python attribute (and thus not saved in OWL). For example :

with onto:
    class altLabel(AnnotationProperty): pass

Jiba