[Specifications] Indicate a partial collection view is ordered (#172)

pietercolpaert has just created a new issue for https://github.com/HydraCG/Specifications:

== Indicate a partial collection view is ordered ==
Opening a difficult discussion here, yet I hope given a limited scope, we could set a good standard here:

Currently there is no way to to indicate how a partial collection view is ordered. I therefore propose a way to add this as in the following example:
```turtle
<collection1> a hydra:Collection ;
              hydra:manages [ rdf:predicate a ; rdf:object foaf:Person ] ;
              hydra:view [
                           hydra:orderedBy ( [
                                 a hydra:OrderDescription ;
                                 rdf:predicate dbpedia-owl:birthDate ;
                                 hydra:orderOption hydra:ascending ;
                                 hydra:castTo xsd:Year
                           ]) ;
                           hydra:first <?page=2014>;
                           hydra:last <?page=2020>;
                           hydra:next <?page=2019>
                      ] .
```

This allows to have:
 * Indicate the entity the ordering relates to happens via manages
 * Multiple predicates on which the collection is ordered through an rdf:List
 * Being able to order on a part of a literal via SPARQL literal casting: https://www.w3.org/TR/sparql11-query/#FunctionMapping
 * Being able to indicate ascending or descending order via hydra:orderOption

Mind that the goal is *not* to specify the order of object within the JSON-LD documents. A client should always order the triples or object itself when the document has been retrieved. It only tells something about how the next page related to its previous page.

Limitation:
 * Unclear how to handle deeper ordering (e.g., ordering on the birthDate of a parent of a foaf:Person managed by the collection)

Related issue: https://github.com/HydraCG/Specifications/issues/6 — However, I do not want to introduce a hypermedia control to order a partial collection view, I just want a way to indicate how a partial collection view is ordered.

Are there other proposals of how to do this? Are there proposals that can overcome this limitation?

Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/172 using your GitHub account

Received on Tuesday, 27 November 2018 11:23:20 UTC