My first app - adding resources?


#21

Thanks Jorn. I am new to Solid and RDF. Trying to understand how solid works. Can you explain, how Solid stores the data in the POD? I read that it will be stored in the form of graph data. Is it possible to convert an image into graph data?


#22

The backend implementation in the server can be anything. In node Solid server it is the host machine file system, but it doesn’t have to be.

Images can be encoded, or stored as files. Whatever the backend, it needs to be able to store both resources that are serialised as RDF, and things which are in other formats such as images or PDF files. The latter could either be stored as files on a filesystem as in node-solid-server, or serialised and stored in some other way.

None of this will be apparent to the user, or affect applications.


#23

The Solid server functions as a classic webserver, more or less - you can GET, DELETE, PUT, POST to it as with any other webserver. You can store any kind of data anywhere you have access to (your POD or a friends POD) . A “POD” is simply a sub-section of the Solid server that you have special access to - like your part of your company’s shared network drives - just on the web instead.

In addition to this the Solid server support WebId authentication and understands the Linked Data Protocol that I linked to. The actual implementation is irrelevant as long as the HTTP interface looks like, well, HTTP :slight_smile:

You do not store images as graph data - you store images as you would do on a normal web server: PUT it to a specific URL and the binary data in it gets stored there in whatever backend implementation the server deems relevant. You can then GET the binary data later on.

The graph data, statements in the form of <subject, predicate, object> can then reference the image URL if needed. Graph data is stored in documents containing such statements (again the actual implementation is irrelevant). You can PUT a graph data document and you can GET it again - and parse the graph data (which is usually in a text format) locally and store a temporary local copy in your local store - which can then be queried.

In RDFLIB the store contains statements <S,P,O> and the fetcher allows you to fetch the graph data from URLs and, parse it, and copy them into your local store.


#24

Thank you happybeing and Jorn. :slight_smile: Now many of my doubts are cleared.

So, solid POD is like a private google drive where you can give access to particular people and it also generates URIs for each type of data stored in the POD. Am i right?


#25

You are right :+1: (and posts must be at least 20 chars)


#26

And now, finally, I also got “update” working. For this the update-manager.update() in rdflib.js worked fine. See https://github.com/JornWildt/SolidRC/blob/master/wwwroot/js/ORDFMapper.js for a “object to RDF mapper” that does the basic CRUD operations you need to work with data entry apps.

I’ve also discovered that the web-oriented operations in the fetcher and update-manager uses async programming with promises, so one really has to be careful about adding “await” in the right places to be able to read what you have just written (or rather, requested to be written async).