Skosify icon indicating copy to clipboard operation
Skosify copied to clipboard

Use alphanumerical sorting as tie-breaker in case of prefLabel policies result in a tie

Open kouralex opened this issue 5 years ago • 1 comments

I noticed (due to https://github.com/NatLibFi/Finto-data/commit/26a2d876b403beec731f6e6748a6b75766db164e#diff-b7776f22f1355c1d1fbc86095078db1711cc8e6dea017ad6524fbf3d595617ac) that the preferred value policy selectors are not, by default, deterministic.

I believe these issues could be resolved by appending the policies by a default alphanumerical sorting (there should also be a possibility to reverse this). It should, if possible, be language-dependent as collation order depends on the language of the literal. E.g., 'ä' is sorted before 'b' in English but not in Finnish.

kouralex avatar Nov 23 '20 21:11 kouralex

There are really two separate aspects here:

  1. The preferred value policy selectors are not deterministic. That's bad - they should be.
  2. You propose a solution which relies on locale-aware alphanumerical sorting. While that's one possible way to solve the issue, I think there are simpler ways that could be used instead. I'll comment on the PR next...

osma avatar Aug 30 '21 11:08 osma