Hi,
I'm using the DBPedia ontology and iterating over the classes with the classes() method. I want to get the rdfs:comment annotation and tried like this:
onto = get_ontology("dbpedia.owl").load()
for oclass in onto.classes():
print(oclass.comment)
But this just prints an empty list despite the ontology containing several rdfs:comment annotations. I tried with other ontologies and this approach works. Do you know what could be happening with the dbpedia ontology?
Here's a snippet from the dbpedia ontology:
<owl:Class rdf:about="
http://dbpedia.org/ontology/SongWriter"> <rdfs:label xml:lang="en">Songwriter</rdfs:label>
<rdfs:label xml:lang="fr">Auteur-Compositeur</rdfs:label>
<rdfs:comment xml:lang="en">a person who writes songs.</rdfs:comment>
<rdfs:subClassOf rdf:resource="
http://dbpedia.org/ontology/Writer"/> <prov:wasDerivedFrom rdf:resource="
http://mappings.dbpedia.org/index.php/OntologyClass:SongWriter"/> </owl:Class>
How should I access the rdfs:comment annotation if not like this?