timea-solid / SolidHelloWorlds

A list of introductory Solid projects with different stacks.
https://timea.solidcommunity.net/HelloWorld/
5 stars 1 forks source link
code-examples rdf solid

Welcome to Solid Hello Worlds!

Note: This project is built on prototype libraries. And it serves multiple goals.

Table of contents

Purpose of App

This demo serves multiple goals.

1) A collection of beginner-friendly Solid code examples. The Solid Community survey identified this as one of the biggest needs in the Solid Community. 2) A reply to a conversation over at the Solid forum. 3) Create a Solid Web App with low code by defining the Web App UI in RDF (no need to know any frontend framework). 4) Showcase how the 'Single point of truth' can be achieved and used with Solid.

About the code

This Web App makes use of HTML, Simple CSS, RDF, and basic JavaScript. The heavy lifting (rendering the UI from RDF) is taken care of libraries one can simply reuse such as Comunica, Mashlib, and solid-ui-components, see attributions for links.

Data Model

The Solid Hello Worlds data model is a Knowledge Graph which consists of:

Solid Hello Worlds Thesaurus

The Solid Hello Worlds Thesaurus is based on SKOS and contains skos:concepts that describe:

The Solid Hello Worlds Thesaurus structure drives the facets/the accordion menu on the search (main page). When I say the structure drives the menu it technically means a SPARQL query executed on the Solid Hello Worlds Thesaurus appsDisplay.ttl automatically fills the search options for each accordion.

The Solid Hello Worlds Thesaurus looks like this:


Solid Hello Worlds Thesaurus

Solid Hello Worlds Ontology

The ontology extends the SKOS scheme with predicates that help further describe or connect/descriove the skos:concepts. The ontology looks like:


Solid Hello Worlds Ontology

How to run the code locally

  1. Git clone repo.
  2. OPTIONAL: Change the links to the data model and forms over in the config.js. Defaults are the Knowledge Graph (KG) and form of the project.
  3. OPTIONAL: Change the link to the appsDisplay.ttl over in the index.html
  4. OPTIONAL: Change the link to your Knowledge Graph (KG) in the appsDisplay.ttl L20 and L42
  5. Run with npm run start or npx vite.

NOTE Unfortunately solid-ui only works with absolute URLs reason why the development KG and forms are the ones deployed on my Pod.

Improvements and ideas

Known TODOs

How to deploy the code

Read about my experiements with deployments of the app.

Run on a Pod

  1. Create a folder on your Pod and make it public.
  2. Deploy the data from this project to the Pod in the same exact structure. Be sure to have data, src, lib, static, index.html, and their contents on your Pod.
  3. Change the links to the data model and forms over in the config.js. Defaults are the Knowledge Graph (KG) and form of the project which will not work.
  4. Change the link to the appsDisplay.ttl over in the index.html
  5. Change the link to your KG in the appsDisplay.ttl L20 and L42
  6. Navigate to the Pod folder name you created for your project and you should see the index.html rendered.

Example: my running demo is simply on my Pod, in a HelloWorld folder over at https://timea.solidcommunity.net/HelloWorld/components/. I made sure the HelloWorld folder has public access.

NOTE make sure to use minified versions of the libs (solid-ui, mashlib especially) otherwise the app loads quite slowly.

NOTE the adminPage is not working on a Pod deployment due to mashlib.

NOTE Unfortunately solid-ui only works with absolute URLs reason why the development Knowledge Graph (KG) and forms are the ones deployed on my Pod.

Run as a distributed system

  1. Create a folder on a Pod and make it public.
  2. Rename the KG example-helloWorld.ttl to helloWorld.ttl and deploy in the new folder.
  3. Create a folder on a Pod for your forms, can be the same folder or separate folders for each form. Make sure they are publicly readable.
  4. Deploy the appsDisplay.ttl form and the helloWorldForm.ttl form to the new folder/s. Keep the names.
  5. Change the links to the data model and forms over in the config.js. Defaults are the KG and form of the project which will not work.
  6. Change the link to the appsDisplay.ttl over in the index.html
  7. Change the link to your KG in the appsDisplay.ttl L20 and L42
  8. Navigate to your project on your platform and you should see the index.html rendered.

NOTE make sure to use minified versions of the libs (solid-ui, mashlib especially) otherwise the app loads quite slowly.

NOTE the adminPage is not working on a Pod deployment due to mashlib.

NOTE Unfortunately solid-ui only works with absolute URLs reason why in the config.js we need full URLs.

Example: my running demo is deployed, in this case, on two of my Pods. The main code is over in the HelloWorld folder on https://timea.solidcommunity.net/SolidHelloWorldDistributed/. The data and forms are on another Pod over at https://solidweb.me/timeacss/public/SolidHelloWorlds/. I made sure the SolidHelloWorlds folder has public access because this is where the single point of truth (the Knowledge Graph (KG)) is.

Attribution