Using Solid with JSON-LD


#1

For web developers that are not (yet) accustomed to Linked Data it is much easier to build apps that can handle JSON trees.

Luckily there is JSON-LD, a JSON serialization of RDF, and Node Solid Server is able to serialize a resource as such:

curl --header Accept:application/ld+json https://angelo.veltens.org/profile/card

This will give you the data from my profile as JSON-LD.

Using JSON-LD Framing, you can easily apply a context and structure that fits your client app.

{
  "id": "#me",
  "type": [
    "schema:Person",
    "foaf:Person"
  ],
  "photo": "me.jpg",
  "name": "Angelo Veltens"
}

This way you can handle Linked Data as if it was just regular JSON. (Because it is, now).

You can find a running example in the JSON-LD playground.

Source: https://angelo.veltens.org/articles/2019/04/solid-with-jsonld


#2

Yup; just had a related conversation, which TBL answered in the Solid Gitter Chat.

I much prefer the JSON-LD syntax and form; makes working with Linked Data much more exciting imo.

Fun stuff!