ontoportal / ontoportal-project

OntoPortal Alliance centralized repository for the management of the OntoPortal project
https://ontoportal.org/
3 stars 1 forks source link

Filter API Search with a language parameter #56

Closed luddaniel closed 3 months ago

luddaniel commented 6 months ago

Describe the bug While using API /search query parameter lang or language is not taken in account.

To Reproduce Example : https://data.agroportal.lirmm.fr/search?pagesize=1&q=phylloxera&language=en Result:

"prefLabel": [
    "Phylloxera",
    "Phylloxera",
    "حشرة الأوراق الجافة",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "포도뿌리혹벌레속",
    "Phylloxera",
    "فیلوکسرا",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "Phylloxera",
    "フィロキセラ属",
    "倭蚜属",
    "Phylloxera",
    "Phylloxera",
    "फाइलोक्सेरा",
    "Phylloxera"
],

Expected behavior prefLabel and synonym should only contain the specified language. Also, it should be possible to specify many languages like language=en,fr

luddaniel commented 3 months ago

Seems fixed by https://github.com/ontoportal-lirmm/ontologies_api/pull/82 But I still experience weird stuff :

Without parameter language Sans langue


With language=fr Avec langue fr

What do you think about it @syphax-bouazzouni ?

syphax-bouazzouni commented 3 months ago

Seems fixed by ontoportal-lirmm/ontologies_api#82 But I still experience weird stuff :

Without parameter language Sans langue

With language=fr Avec langue fr

What do you think about it @syphax-bouazzouni ?

@luddaniel, when you do lang=fr it means you filter/search only in values labeled with French tag. It does not mean you display the results in french.

luddaniel commented 3 months ago

Trouble was with language that does not behave like lang. I have a really good behavious with https://data.agroportal.lirmm.fr/search?q=poulard&lang=en,fr Having both search and result in french and english. Good job, this closes the issue.