question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate creating new interface for file/sparql store backends

See original GitHub issue

We should look into generalizing ResourceStore behaviour. E.g. if one of them rejects setting a Representation at a certain URI because there already is a container there, we want this to be consistent across stores. One idea is to have a DataResourceStore which handles all this behaviour and takes as input a DataAccessor (names totally up for change). DataAccessors would then have functions such as hasResource, createContainer, setResource, etc. which can be used to implement the behaviour. In the case of a file data accessor for example, hasResource would be implemented by fs.lstat, while in the case of a sparql backend it would be an ASK query.

The main question is if this can be done (cleanly) without losing any functionality. We would have to investigate which functions would all be needed and to make sure there is no drastic change in efficiency because of this.

Some potential issues I though of (but there probably are plenty more):

  • Probably need a different function to write a Representation and its metadata since metadata is always going to be a Quad array while a Representation can be anything (unless there is some way to also handle this in the DataResourceStore).
  • SPARQL stores only accept Quad streams as Representation, so there still needs to be a way to handle cases like this.
  • PATCH/modifyResource calls probably still have to be sent directly to the accessor since in the case of SPARQL these get sent directly to the endpoint.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
RubenVerborghcommented, Aug 21, 2020

Note: deleteSpecificResource can be deleteDocument (resources in LDP are either documents or containers).

0reactions
RubenVerborghcommented, Sep 2, 2020

OK with your proposal at https://gist.github.com/joachimvh/e0e4cf89b5c889cfb81e331503c2af20

I would just give DataAccessor method names that are on the low level, such as read[Data], write[Data], change[Data], delete[Data].

Plus we need a detailed comment on DataResourceStore explaining how this design works, and its performance trade-off. (I would also name it DataAccessorBasedStore or so.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backend interface | Microsoft Learn
Interface representing a Backend. ... Notifies the APIM proxy to create a new connection to the backend after the specified timeout.
Read more >
DIRSIG5 Atmosphere Model Backends
These external atmospheric models are referred to "backends", and there are currently two backend interfaces that have been created:.
Read more >
Backend interfaces — Cryptography 3.4.5 documentation
A backend with methods for using cryptographic hash functions. The following backends implement this interface: OpenSSL backend. hash_supported (algorithm)¶.
Read more >
Backends For Frontends - Sam Newman
The BFF is tightly focused on a single UI, and just that UI. ... it if the transaction cost of creating a new...
Read more >
Using Back-End Design to Create Customizable Front-End ...
By controlling the front end of mobile apps from the back end we can build customized experiences at runtime, creating cleaner interfaces and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found