Skip to content
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

Pagination #37

Open
jblemee opened this issue Aug 6, 2019 · 3 comments
Open

Pagination #37

jblemee opened this issue Aug 6, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@jblemee
Copy link
Contributor

jblemee commented Aug 6, 2019

Hello,

I need LDFlex to support pagination and I would like some advice before starting an PR.

Do someone think about this feature in LDFLex. If yes, how do you see it ?

I was thinking of something like :

path = path.create({ subject: namedNode('https://ruben.verborgh.org/profile/#me') })
next_path = path.next() // return a new path following the " Link: url; rel='next' " header
previous_path = path.previous() // Follow the previous header
@RubenVerborgh
Copy link
Member

The most crucial challenge is if and how pagination fits into LDflex conceptually. I see two issues:

  1. The relation is between documents. So it would not be data["https://ruben.verborgh.org/profile/#me"].next (given that #me is not the document) but data["https://ruben.verborgh.org/profile/"].next (given that /profile/ is a document and that the next link has that document as starting point)

  2. The Link header contents are not part of the document triples, whereas LDflex currently focuses on those.

I can elaborate on both, but already wanted to get the main points across.

@jblemee
Copy link
Contributor Author

jblemee commented Aug 7, 2019

  1. Ok should it be more something like :
const queryEngine = new ComunicaEngine('https://ruben.verborgh.org/profile/');
const path = new PathFactory({ context, queryEngine });
const nextPathFactory = path.next()
const ruben = nextPathFactory.create({ subject: namedNode('https://ruben.verborgh.org/profile/#me') })

?

  1. Is there a way to access headers on LDFlex ? Since we have the base url on the queryEngine, we could do an 'OPTIONS' request on this url and get the headers.

@RubenVerborgh
Copy link
Member

  1. Yes, that would be the way.

  2. It's not a technical limitation; the implementation could do a GET on the document and read+parse the Link header. The question is rather whether we should, because the idea of LDflex is to query the RDF data inside of the representation. So what if an actual next link is part of the representation? Do we treat it equally, or with priority? This is part of a bigger discussion on whether hypermedia controls should be part of the representation or the HTTP headers (and in the latter case, whether the "triples" in the HTTP Link and other headers can be considered triples).

So at the moment, I don't think such functionality is a good fit for LDflex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants