Skip to content

solid-lite/solidos-lite

Repository files navigation

solidos-lite

Lightweight SolidOS shim with data island support.

Live Demo

What is this?

solidos-lite lets you embed RDF data directly in HTML and render it with SolidOS - no server required. Just one script tag:

<script src="https://cdn.jsdelivr.net/npm/solidos-lite/solidos-lite.js"></script>

It automatically:

  • Loads mashlib from CDN
  • Parses embedded Turtle or JSON-LD data islands
  • Renders with SolidOS panes

Quick Start

<!DOCTYPE html>
<script type="text/turtle">
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<#me> a foaf:Person ; foaf:name "Alice" .
</script>
<script src="https://cdn.jsdelivr.net/npm/solidos-lite/solidos-lite.js"></script>

That's it! Visit page.html#me to see Alice's profile.

Supported Formats

Turtle

<script type="text/turtle">
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<#me> a foaf:Person ; foaf:name "Alice" .
</script>

JSON-LD

<script type="application/ld+json">
{
  "@context": { "foaf": "http://xmlns.com/foaf/0.1/" },
  "@id": "#me",
  "@type": "foaf:Person",
  "foaf:name": "Alice"
}
</script>

How It Works

  1. Auto-detection - When the page loads, solidos-lite checks for data islands
  2. Loads mashlib - Dynamically loads mashlib + CSS from CDN
  3. Creates UI - Adds required DOM elements to body automatically
  4. Parses data - Turtle parsed directly, JSON-LD converted to Turtle (custom parser, no webpack chunks)
  5. Renders - Navigates to the URL fragment (e.g., #me) or shows document view

API

For manual control:

// Run everything automatically
SolidOSLite.run()

// Or step by step:
await SolidOSLite.loadMashlib()
SolidOSLite.init({ verbose: true })
SolidOSLite.parseAllIslands()

SolidOSLite.run(options)

Initialize and run the data browser. Called automatically if data island detected.

SolidOSLite.loadMashlib()

Load mashlib from CDN. Returns a Promise.

SolidOSLite.init(options)

Initialize the data island shim. Options: { verbose: true } for logging.

SolidOSLite.parseAllIslands()

Parse all data islands into the RDF store.

SolidOSLite.VERSION

Current version string.

Examples

Browse all examples

Benefits

  • Zero boilerplate - Just data + script tag, UI created automatically
  • No CORS issues - Data is in the page
  • No server required - Works with static HTML files
  • Works offline - Once loaded, no network needed
  • Single script - Mashlib loaded automatically from CDN

License

AGPL-3.0

About

Lightweight SolidOS shim with data island support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published