linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
564 stars 143 forks source link

support local storage #539

Closed jeff-zucker closed 2 years ago

jeff-zucker commented 2 years ago

See issue https://github.com/linkeddata/rdflib.js/issues/538

jeff-zucker commented 2 years ago

Argh, forgot the typescript stuff ... fixing ...

josephguillaume commented 2 years ago
  • What happens with containers? If I'm creating a new file, do I also need to manually create the containment triples, and even the containers metadata? That would create some unexpected behaviour.

I think this is solely about storing single documents in local storage. In a sense it's a simplified version of solid-rest, which provides a more complete solid interface.

jeff-zucker commented 2 years ago
  • What happens with containers?

The code for returning turtle for a container is only about 40 lines in solid-rest. I could use that here, and that would solve reading a container. We can already create a container with PUT either directly or indirectly by creating file in a non-existent container.

bourgeoa commented 2 years ago

I'm a bit anxious to see solid protocol implemented in rdflib. And container representation is not even stable.

josephguillaume commented 2 years ago

I'm in favour of keeping this code minimal too and leaving out solid-specific implementation. Solid-rest seems like the right place for that.

josephguillaume commented 2 years ago

Just noting that regarding the API choice (use of a dedicated Uri + constructor options parameter), I'd also added a comment on the linked issue regarding how I would want to use this functionality in a local first context.

https://github.com/linkeddata/rdflib.js/issues/538#issuecomment-995584629

jeff-zucker commented 2 years ago

I'm a bit anxious to see solid protocol implemented in rdflib. And container representation is not even stable.

My initial impulse was to go with minimal so I am fine with delegating container reads to solid-rest.

jeff-zucker commented 2 years ago

This PR was obviously premature. I have updated Solid Rest Browser with a local-first example and a possible way to handle it. Let's continue the discussion there and possibly brings some of it back into rdflib if that makes sense.