Hello dataspace

Give your app an identity: a title, a description and a landing page

In LinkedDataHub everything is a document, and every document is a named graph whose name is the document's URL. Your dataspace starts with a single document: the root document at the base URI. It doubles as the app's homepage, so making the app yours starts with describing this one document.

In this stage you give the root document a title, a description and a first content block — and see the result render as your homepage.

In the browser

Open the base URL (e.g. https://localhost:4443/) and authenticate with the owner's WebID certificate. Switch the root document into edit mode, change the title to Northwind Traders, fill in the description, and add an XHTML content block with a short welcome text. The Edit content guide walks through the block editor in detail.

From the command line

The same change, expressed as data. Describe the root document in a root.ttl file:

@prefix def:    <https://w3id.org/atomgraph/linkeddatahub/default#> .
@prefix ldh:    <https://w3id.org/atomgraph/linkeddatahub#> .
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dct:    <http://purl.org/dc/terms/> .

<> a def:Root ;
    dct:title "Northwind Traders" ;
    dct:description "Knowledge Graph representation of the Northwind Traders sample database" ;
    rdf:_1 <#intro> .

<#intro> a ldh:XHTML ;
    rdf:value '''<div xmlns="http://www.w3.org/1999/xhtml">
        <div class="page-header">
            <h2>Northwind Traders</h2>
            <p class="lead">The iconic sample database converted to an RDF Knowledge Graph</p>
        </div>
    </div>'''^^rdf:XMLLiteral .

Then replace the root document's description with it using PUT. The turtle command resolves the relative URIs in the file against the document URL, so the same file installs against any base URI:

cat root.ttl | turtle --base="$base" | put.sh \
    -f "$cert_pem_file" \
    -p "$cert_password" \
    -t "application/n-triples" \
    "$base"

What you now see

Reload the base URL: the homepage now carries your title and welcome text. You have not touched a template, a controller or a database schema — you replaced the description of one document, and the UI is a rendering of that description.

How this works

  • Documents — the document hierarchy and how documents map to named graphs
  • Content blocks — how rdf:_1, rdf:_2, … sequence a document's content
  • HTTP API — the PUT semantics behind put.sh

Next: Structure