Automate Ontology Metadata

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

Automate Ontology Metadata

rdk
Hi Jean-Baptiste,

How can we automatically add metadata (annotations, version, authors, etc.) to an ontology created using Owlready2?
I have tried something like the code below, but with no success:

onto.comment = [locstr('Ontology Description.', lang = 'en')]

Best regards,
Rui
Reply | Threaded
Open this post in threaded view
|

Re: Automate Ontology Metadata

Jiba
Administrator
Hi,

You're true, there is no mean to access / define ontology metadata... This is mainly because onto.something search for entity "something" in onto, and does not refer to the annotation of the ontology.

In the development version, I've added onto.metadata, which allows to query or define metadata:

   >>> print(onto.metadata.comment)
   [...]
   >>> onto.metadata.comment.append("my first comment")


Currently, the only workaround possible is to add the triple directly in the quadstore:

   >>> onto.add_triple(onto.storid, comment.storid, to_literal("abc"))

Best regards,
Jiba

rdk
Reply | Threaded
Open this post in threaded view
|

Re: Automate Ontology Metadata

rdk
That's great Jean-Baptiste.
Thanks!

Cheers,
Rui