Skip to content

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:

<scriptsrc="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><scripttype="text/turtle">
@prefixfoaf: <http://xmlns.com/foaf/0.1/> .<#me> a foaf:Person ; foaf:name "Alice" .
</script><scriptsrc="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

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

JSON-LD

<scripttype="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 automaticallySolidOSLite.run()// Or step by step:awaitSolidOSLite.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

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages