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

Indicate a partial collection view is ordered #172

Open
pietercolpaert opened this Issue Nov 27, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@pietercolpaert
Copy link

pietercolpaert commented Nov 27, 2018

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:

<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: #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?

@cristianvasquez

This comment has been minimized.

Copy link

cristianvasquez commented Nov 27, 2018

Hi, what is the purpose of hydra:manages[] ?

@pietercolpaert

This comment has been minimized.

Copy link

pietercolpaert commented Nov 27, 2018

Hi, what is the purpose of hydra:manages[] ?

It’s an unstable draft proposal for partially indicating the contents of a hydra:Collection. See https://github.com/HydraCG/Specifications/blob/master/drafts/collection-representation.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment