pwin / owlready2

GNU Lesser General Public License v3.0
132 stars 22 forks source link

Issue using .label with rdfs:label, but functions with rdf:label #36

Open Superraptor opened 1 year ago

Superraptor commented 1 year ago

Hello!

This issue concerns version 0.26 of owlready2, so please feel free to ignore if this is fixed in more recent systems, I just wanted to note (I'm unfortunately currently restricted to using 0.26 and I'll have to build a work-around, but just wasn't finding much online and wanted to create a record for others).

Essentially, I have a singular entity in which I'm trying to call for the label using "entity.label" (and several of its variants). None of these appeared to be returning any "rdfs:label" attributes of any entities, except for those which had been mislabeled as "rdf:label" (without the "s"). Because of this, it appeared that most entities had no label, when this was not the case.

For a second, I thought I had made a mistake and that "rdf:label" was the canonical form. However, this is not true, and "rdfs:label" is indeed correct (re: RDF Schema 1.1 documentation).

I believe the correct way to fix this issue in 0.26 is to do some form of custom rendering, but I haven't quite worked out the particulars. If I do find a solution, I'll come back and post it here.

Thank you so much for your time!

Superraptor commented 1 year ago

Essentially the only solution I could come up with was to create a temporary file where rdfs:label is replaced by rdf:label, read that in, and then delete the temp file. While this works, it is likely to be computationally expensive on larger ontology files.