-
Notifications
You must be signed in to change notification settings - Fork 95
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
The way concepts with notation codes are sorted should be described in config.ttl #937
Comments
There are two reasonable ways of sorting by notation that I can think of: decimal (where 30.10 comes before 30.2, as in decimal classifications such as UDC, DDC and YKL/PLC - the most common case) and natural (where 30.10 comes after 30.9, e.g. in the PTVL classification). We already have a configuration setting
I looked at locations in the code where sorting by notation currently happens. I think these are the important ones:
To me it seems that 1. and 3. are the important cases; 2. should be investigated further to see what (if any) effect the prepending of notation codes has. Making the notation code sorting strategy configurable means that the setting must be passed both to PHP and JS code, and the code in the above locations must be adjusted so that it can handle both decimal and natural sorting of notation codes. |
Very interesting idea @osma ! I think your approach might work very well! If I recall correctly, step 2. is also important as it decides how the values are ordered on the concept page. Of course, in all cases, the ordered listing should be the same considering the given That said, implementing the above solution could give us consistent values between PHP/JS sorting mechanisms, if done well. I am quite sure some work needs to be taken care for handling the "extra/special" characters the same - needless to say about the content language sorting use case. However, SPARQL queries returning ordered lists (based on labels) won't be fixed in any case but that can be raised as an issue later on (actually, #1190 already reflects this). Ps. could you please use permalinks instead of code links to master? 🙂 GitHub displays it differently (i.e., directly here) and those lines can not change (that is what the "perma" for "permanent" is there for) - code in master branch can change and the lines be out of order. See attached image below: |
This didn't seem to be the case - the values on the concept page are sorted by the code in 1. (I just tested)
Yes, the sort order in both PHP and JS should be consistent at least in the common cases (alphanumeric notation codes with a few commonly occurring special characters such as On the PHP side, we have
Out of scope for this issue.
Good point - I changed to permalinks by editing the above comment. The display is still the same though (probably because I used Markdown links, not plain URLs) |
Oh, I forgot that we already have a Skosmos/resource/js/scripts.js Lines 329 to 344 in 4b4359d
|
I bet there are some tests that do use this feature. Following their definitions should unveil the mystery. Edit: also git blame may tell something? |
Nope, I just removed it in PR #1205 and nothing happened.
Didn't check, but my strong suspicion at the moment is that this is just dead code. |
At the moment, there are different types of classification systems published on finto.fi, however, they all must now follow the same sorting setting for notation codes, namely
strnatcasecmp
method. This causes issues whilst sorting e.g., related concepts for http://finto.fi/ykl/en/page/49.262 that has related concepts such as30.1 Sociology
30.8 Good manners and etiquette
30.11 Social systems
30.12 Sociology of lifestyles. Cultural sociology
30.81 Arranging parties and celebrations
(in this particular order).
Note that for the decimal classification system used for this vocabulary (PCL) is not interoperable with the wanted ordering of related concepts, which would look like this:
30.1 Sociology
30.11 Social systems
30.12 Sociology of lifestyles. Cultural sociology
30.8 Good manners and etiquette
30.81 Arranging parties and celebrations
That said, there should be a way to describe the way sorting of notation codes is done by Skosmos as some classification systems prefer natural sorting and others do not. Also, there may be other cases (undocumented here) that should be taken into consideration - the implementation should allow user-defined sorting.
Please, have a look at related issues (#265 , #556, #737 and #889) for background details.
The text was updated successfully, but these errors were encountered: