Adding documentation to an ontology

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

Adding documentation to an ontology

Peter
Dear List
Does anyone have an illustration of adding documentation to an ontology being written using owlready2 - the license, date modified etc.  Also, how in this documentation could I add  blank nodes e.g.

<http://example.org/onto
a owl:Ontology;
  dct:creator [
      rdfs:seeAlso <http://peter.me/foaf.ttl> ;
      foaf:name "Peter" ;
    ] ;
  dct:license <https://creativecommons.org/publicdomain/zero/1.0/> ;
  dct:modified "2019-29-30"^^xsd:date ;
.

Reply | Threaded
Open this post in threaded view
|

Re: Adding documentation to an ontology

Jiba
Administrator
Hi,

You can use ontology.metadata to access or modify the ontology's metadata.

If you want to create untyped blank node, you can use Thing(0) (the 0 instruct to create it as a blank node).

For example:

from owlready2 import *

onto = get_ontology("http://test.org/onto.owl")

with onto:
    onto.metadata.comment.append("A comment")
    creator = Thing(0)
    creator.seeAlso = "See xxx"
    onto.metadata.comment.append(creator)

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Adding documentation to an ontology

Peter
Dear Jiba and list

I'm still having a problem in creating blank nodes that are linked via predicates - something like the following:
======================================
<http://www.example.org/myont>
  a owl:Ontology ;
  dct:contributor [
      a foaf:Person ;
      sdo:affiliation [
          foaf:homepage <https://owlready.nabble.com> ;
          foaf:name "Owlready2 Organisation" ;
        ] ;
      rdfs:seeAlso <https://another.org/1234> ;
      foaf:name "Owl Ready" ;
      foaf:workInfoHomepage <http://owlready.org/OWL> ;
    ] ;
.


=======================================

If anyone has any advice on how to code this in owlready2 I would really appreciate it
Reply | Threaded
Open this post in threaded view
|

Re: Adding documentation to an ontology

Jiba
Administrator
Hi,

Maybe you should look at RDFlib (which can be used in combination with Owlready). FOAF is not a proper OWL ontology, and blank node are seldomly used as entity in ontologies.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Adding documentation to an ontology

Peter
thanks for the idea