How to create SKOS annotations for an individual and blank node use owlready2

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

How to create SKOS annotations for an individual and blank node use owlready2

zhiwei
I intend to use owlready2 to build an OWL Ontology, but I can't find a convenient way to create some SKOS annotations for a namedIndividual or a owl class.
Also, are there a method just like in rdflib to create a blank node in an ontology?
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: How to create SKOS annotations for an individual and blank node use owlready2

Jiba
Administrator
Hello,

Owlready was designed with OWL in mind, I'm not sure whether SKOS is OWL, or not. If it is, you should be able to load SKOS and then to use it as an ontology.

The creation of blank nodes is automatic, when using restrictions or other OWL structures that requires blank nodes. It's like in Protégé: you do not create the blank nodes manually.

Maybe you can use the rdflib support to access the Owlready quadstore as an rdflib graph and then use the rdflib functions to create blank nodes.

Best regards,

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: How to create SKOS annotations for an individual and blank node use owlready2

zhiwei
Thanks! I have found the way to do it:

# annotation
skos_file = 'file://skos.rdf'
skos = get_ontology(skos_file).load()
onto.imported_ontologies.append(skos)

onto.Contact.altLabel = "Contact annotation"  # Contact is an ontology class

# blank node
article = Article()