ncbo / bioportal_web_ui

A Rails application for biological ontologies
http://bioportal.bioontology.org/
Other
22 stars 2 forks source link

multilingual support: jump_to box doesn't work as expected for ontologies which set English as a single naturalLanguage #335

Open alexskr opened 1 month ago

alexskr commented 1 month ago

jump_to search box doesn't show results for single language ontologies which set English as the naturalLanguage. Unsetting English fixes the issue.

Screenshot 2024-10-02 at 16 26 34
syphax-bouazzouni commented 1 month ago

Do you have the error logs?

mdorf commented 1 month ago

Some additional detail: https://bioportal.bioontology.org/ontologies/D3O?p=summary

Screenshot 2024-10-02 at 16 17 28

Search entries are below. They DO NOT include the XXX_en attributes:

Screenshot 2024-10-02 at 16 19 33

When searching for lang=en, you get no results:

https://data.bioontology.org/search?q=energy&ontologies=D3O&lang=en

Screenshot 2024-10-02 at 16 22 33

However, when using classes endpoints with lang=en, the prefLabels show up correctly: https://data.bioontology.org/ontologies/D3O/classes/?lang=en

Screenshot 2024-10-02 at 16 23 39
mdorf commented 1 month ago

@syphax-bouazzouni, since the ontology specifically ads "English" as a language, shouldn't we expect to see the "XXX_en" attributes in the index for D3O?

mdorf commented 1 month ago

More details:

Here is a sample term declaration in the OWL file (D3O.owl):

    <AnnotationAssertion>
        <AnnotationProperty abbreviatedIRI="rdfs:comment"/>
        <IRI>EnergyMetabolism</IRI>
        <Literal xml:lang="en">A set of metabolic pathways that are involved in the generation and use of energy within an organism, typically through processes like cellular respiration and photosynthesis.</Literal>
    </AnnotationAssertion>
    <AnnotationAssertion>
        <AnnotationProperty abbreviatedIRI="rdfs:label"/>
        <IRI>EnergyMetabolism</IRI>
        <Literal xml:lang="en">Energy Metabolism</Literal>
    </AnnotationAssertion>

As seen below, it defines a label (lang=en) and definition (lang=en). But the the prefLabel is defined as:

@prefLabel={:none=>["Energy Metabolism"]}, 

WHY? I would expect:

@prefLabel={:en=>["Energy Metabolism"]}, 

Below, is the corresponding Class instance in ontologies_linked_data:

#<LinkedData::Models::Class:0x000000010700e120
 @aggregates=[#<struct Goo::Base::AGGREGATE_VALUE attribute=:children, aggregate=:count, value=0>],
 @created=nil,
 @cui=[],
 @definition=
  {:en=>
    ["A set of metabolic pathways that are involved in the generation and use of energy within an organism, typically through processes like cellular respiration and photosynthesis."]},
 @id=#<RDF::URI:0x5064(https://purl.dsmz.de/schema/EnergyMetabolism)>,
 @label={:en=>["Energy Metabolism"]},
 @persistent=true,
 @prefLabel={:none=>["Energy Metabolism"]},
 @prefixIRI=nil,
 @previous_values=nil,
 @semanticType=[],
 @subClassOf=[#<RDF::URI:0x5014(https://purl.dsmz.de/schema/MetabolicPathway)>],
 @synonym=[],
 @unmapped=
  {#<RDF::URI:0x5078(http://www.w3.org/2000/01/rdf-schema#label)>=>{:en=>[#<RDF::Literal:0x508c("Energy Metabolism"@en)>]},
   #<RDF::URI:0x5028(http://www.w3.org/2000/01/rdf-schema#comment)>=>
    {:en=>
, typically through processes like cellular respiration and photosynthesis."@en)>]},
thway)>],
   #<RDF::URI:0x503c(http://www.w3.org/1999/02/22-rdf-syntax-ns#type)>=>[#<RDF::URI:0x50c8(http://www.w3.org/2002/07/owl#Class)>],
   #<RDF::URI:0x5050(http://data.bioontology.org/metadata/def/prefLabel)>=>
    {:none=>[#<RDF::Literal:0x50dc("Energy Metabolism"^^<http://www.w3.org/2001/XMLSchema#string>)>]},
rgyMetabolism)>],
   #<RDF::URI:0x5118(http://data.bioontology.org/metadata/def/mappingLoom)>=>
    {:none=>[#<RDF::Literal:0x512c("energymetabolism"^^<http://www.w3.org/2001/XMLSchema#string>)>]}},
 @xref=nil>
jonquet commented 1 month ago

Good point. We should have seen this. Our driving use cases were very much "SKOS" so we missed it.

jvendetti commented 3 weeks ago

@alexskr - why was this issue closed? It's still broken in our production environment. See the https://bioportal.bioontology.org/ontologies/CMECS ontology as an example. The ontology declares English as the natural language, and the Jump to box doesn't work:

Screenshot 2024-10-28 at 4 11 00 PM
alexskr commented 3 weeks ago

The fix introduced in https://github.com/ncbo/ontologies_linked_data/pull/221 fixed problems with D3O ontology; however, this problem remains unresolved for many ontologies. (AIO, BAO, DTO, CMECS, FYP, OPB, etc)