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
How to process transformations on a container #35
Comments
You will probably like https://www.npmjs.com/package/iter-tools 🙂 |
Thanks, it sounds interesting! I'll take a look ;) |
Feel free to reopen if you don't find what you need! |
I added iter-tools to startinblox and it fits almost all my needs. The only problem I face is that I can't sort a list of resource, because of the asynchronicity of the proxies (see iter-tools/iter-tools#286) |
Sorting may indeed be valuable, as this could be pushed down to the SPARQL level by LDflex. |
Good idea; tracking sorting in LDflex/LDflex#41. Note however that, in several case, sorting makes operations blocking, i.e., you receive all of them at the end instead of incrementally. So this is why we, by default, prefer to leave it to the consumer to perform sorting. For instance, if you are feeding a UI, you could take unsorted results and then insert them in the right place as they arrive. But that all depends on the use case. As iter-tools also says:
So you could do Or, for your specific case, |
Yes the solution would be to re-create an array with the sorting key and then sort the resources. This was our last choice but I think this is the only one possible for now |
Sorting landed via LDflex/LDflex#43. |
For the needs of startinblox, we need to process some transformations on a container to sort, filter, group... resources.
To do this, we recreate an array of resources from the
AsyncIterator
returned by query-ldflex to perform the transformations.We have two main concerns with this approach:
sort
,filter
because of the asynchronous proxiesIs there a smarter way to handle this?
The text was updated successfully, but these errors were encountered: