How can I transform class iris to skos:prefLabel using the owlready2 api?

45 views Asked by At

I have an owl ontology with class iris like "http://fkie.fraunhofer.de/EnArgus_Ontologie.owl#Dog". I would like to give those classes a skos:prefLabel based on the iri, i.e. in this case skos:prefLabel "Dog", using the owlready2 api.

I already figured out, how to transform them to rdfs:label:

        for cls in onto.classes():
            new_label = locstr(cls.name, lang=language_tag)
            cls.label.append(new_label)
            print(f"{new_label} added.")

Thanks a lot

0

There are 0 answers