Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect prefLabel chosen when multiple language labels are defined #91

Open
mdorf opened this issue Mar 21, 2019 · 9 comments
Open

Incorrect prefLabel chosen when multiple language labels are defined #91

mdorf opened this issue Mar 21, 2019 · 9 comments

Comments

@mdorf
Copy link
Member

mdorf commented Mar 21, 2019

When ontology defines RDFS labels in multiple languages for a given class, BioPortal picks a random (the first one in the array) label to be designated as the prefLabel.

Example: TXPO ontology (this ontology is private, must be an admin to view). Some of the classes are displayed in English and some are in Japanese.

@mdorf mdorf self-assigned this Mar 21, 2019
@mdorf
Copy link
Member Author

mdorf commented Mar 21, 2019

This ontology does not explicitly set the property: http://www.w3.org/2004/02/skos/core#prefLabel, which means, the prefLabel property is determined using the http://www.w3.org/2000/01/rdf-schema#label property. The latter may contain multiple entries, one for each specified language. Ex:

<rdfs:label xml:lang="en">occurrent</rdfs:label>
<rdfs:label xml:lang="ja">生起物</rdfs:label>

The code that sets the prefLabel property is located here:

https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/models/ontology_submission.rb#L648

The code that simply picks the first label on the list is located here:

https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/models/ontology_submission.rb#L652

The code on line 652 must instead examine whether an instance of :EN language label exists and pick its value instead of picking the first value in the array.

@mdorf
Copy link
Member Author

mdorf commented Mar 21, 2019

This issue is related to the previously addressed issue in JIRA: https://jira.bmir.stanford.edu/browse/NCBO-1662

@jonquet
Copy link

jonquet commented Apr 11, 2019

We have fixed this in SIFR and AgroPortal. We have a parameter to choose the default language.
@vemonet might certainly point to the change in code.

@graybeal
Copy link

graybeal commented Jul 9, 2019

If I understand our status correctly we have it working (to just show English first) for skos:prefLabel, but not for rdfs:label.

@vemonet It would be great to have a pointer to your code for the choice of default language. I assume that works for both rdfs:label and skos:prefLabel?

Also, I see the issue in annotations when annotating the default string, the 10th or so row for 'melanoma' puts up a Chinese label.

@graybeal graybeal changed the title Incorrect prefLabel is set when multiple language labels are defined Incorrect prefLabel chosen when multiple language labels are defined Jul 10, 2019
@graybeal
Copy link

graybeal commented Feb 5, 2021

@jonquet are you in a position that you could make a pull request to make it possible to choose the default language?

@jvendetti
Copy link
Member

An end user reported another instance of this issue today for the ontology with acronym TERRADCAT_AP. One example is the class with an English language label of "Distribution". BioPortal displays the Arabic language label in the class tree:

Screen Shot 2021-09-20 at 11 33 34 AM

This particular class comes from the imported DCAT ontology. DCAT is maintained in GitHub where you can view the declaration for the Distribution class, along with the multiple language labels:

dcat:Distribution
  a rdfs:Class ;
  a owl:Class ;
  ...
  rdfs:label "Distribuce"@cs ;
  rdfs:label "Distribución"@es ;
  rdfs:label "Distribution"@en ;
  rdfs:label "Distribution"@fr ;
  rdfs:label "Distribuzione"@it ;
  rdfs:label "Διανομή"@el ;
  rdfs:label "التوزيع"@ar ;
  rdfs:label "配信"@ja ;
  rdfs:label "Distribution"@da ;
  ...

@jonquet
Copy link

jonquet commented Sep 30, 2021

@jonquet are you in a position that you could make a pull request to make it possible to choose the default language?

No. This is 7 years old now.

@vemonet
Copy link

vemonet commented Oct 1, 2021

Hi @jonquet and @graybeal , sorry never noticed the notifications from this issue before

I remember we had some Java to clean ontologies with multiple labels, but not sure about choosing the default language, would need more details/example

In this case it seems to be a problem specifically related to rdfs:label not being used as a class label like skos:prefLabel.

You can fix it via the calls done to resolve labels when skos:prefLabel is not used if the lang attribute is accessible: https://github.com/ncbo/ontologies_linked_data/blob/master/lib/ontologies_linked_data/models/ontology_submission.rb#L645

But it would probably be better to fix it downstream, when the main prefLabel is picked, so you don't need to rely on this call everytime the class is accessed

@jonquet
Copy link

jonquet commented Mar 9, 2022

We are working on anew strategy/algorithm for this and will keep you updated soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants