Skosmos icon indicating copy to clipboard operation
Skosmos copied to clipboard

Support for skos:OrderedCollection

Open mielvds opened this issue 3 years ago • 3 comments

I was wondering whether supporting skos:OrderedCollection is something that is being considered? Visually, I don't think there are much changes to how skos:Collection is displayed, with the exception of the ordering of the concepts.

The most annoying part is probably dealing with the list in skos:memberList, but you could get there with a query like

PREFIX : <https://stackoverflow.com/q/17523804/1281433/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT ?concept (count(?mid)-1 as ?position) 
WHERE {
  ?collection a skos:OrderedCollection.
  ?collection skos:memberList/rdf:rest* ?mid . 
  ?mid rdf:rest* ?node .
  ?node rdf:first ?concept .
  ?concept a skos:Concept.
}
GROUP BY ?node ?id ?label ?definition
ORDER BY ?position

If anything I missed, let me know

mielvds avatar Feb 03 '22 13:02 mielvds

Thanks for proposing this, and for the SPARQL example. Do you have an example of a SKOS vocabulary where skos:OrderedCollection is used?

We don't have a need for this at the moment in Finto, but contributions are welcome.

osma avatar Feb 11 '22 15:02 osma

We have this list of courses (sorry, just dutch labels) here: https://ilearn.ilabt.imec.be/Skosmos/exp-vakken/en/ and source: https://github.com/i-Learn-SKOS/common-conceptschemes/blob/main/common/schemes/vak-norelated-final.skos.ttl

Our use case is the following: the order of concepts was manually curated to visually co-locate related courses in applications. It's confusing for the creators to not see that order maintained on skosmos.

mielvds avatar Feb 11 '22 15:02 mielvds

Thank you for the example!

One possible workaround is to assign notation codes to the courses (using skos:notation), so that the order of the notations corresponds to the intended visual order. Then you can use the skosmos:showNotation and skosmos:sortByNotation configuration settings to make the notations visible and the courses ordered by notation code in either lexical or decimal sort order.

osma avatar Feb 14 '22 07:02 osma