ols4 icon indicating copy to clipboard operation
ols4 copied to clipboard

Default labelProperties Set raises issues

Open rombaum opened this issue 9 months ago • 1 comments
trafficstars

Describe the bug I loaded the Radiology Lexicon (RadLex) ontology to ols on a local machine. This ontology defines an own property http://radlex.org/RID/Preferred_name for the main label of an entity. Next to this rdfs:label is defined in the file as well but it should only used as an synonym property since it contains the local identifier. I defined in the config file that http://radlex.org/RID/Preferred_name should be used for the label. Nevertheless after indexing I found out that both properties where used for the label.

To Reproduce Steps to reproduce the behavior:

  1. Download the RadLex file from BioPortal
  2. Index the file to ols with http://radlex.org/RID/Preferred_name as the value for the key label_property
  3. Check http://localhost:8080/api/v2/entities?search=diabete&size=5&lang=en&exactMatch=false&includeObsoleteEntities=false or http://localhost:8080/api/select?q=diabetes
  4. See incorrect indexed label.

Expected behavior Only the property http://radlex.org/RID/Preferred_name should be used for the label as defined in the config file. It is nice to have default values for the label but not in each ontology the properties are used on the same way and it could lead to unwanted behavior of the indexing process.

Screenshots

Image Config for the RadLex file.

Image There are two labels(diabetes and RID39048) for the term for the API call: http://localhost:8080/api/v2/entities?search=diabete&size=5&lang=en&exactMatch=false&includeObsoleteEntities=false

Image There is only one label for the select OLS3 API see: http://localhost:8080/api/select?q=diabetes. In this case it is the rdfs:label which was not defined in the config file.

Additional context I fixed this issue by adding a line to the corresponding Java class LabelAnnotator. As an test I indexed two ontologies. For RadLex I used the following line at the config file for the label "label_property": [ "http://radlex.org/RID/Preferred_name"] . For the second ontology I didn't defined any property for the label in the config file. For RadLex http://radlex.org/RID/Preferred_name was used and for the other ontology the default property rdfs:label was used. The indexed ontologies looks as expected. I used in my case just the Plasma Ontology since it is not so huge and I know that it uses rdfs:label for the labels. I will provide a pull requests to fix this issue.

Image

Image

rombaum avatar Feb 14 '25 16:02 rombaum