Backlinks
Content blocks and the actions for managing them
The content list is a layout mode that allows composition of rich, structured web documents from multiple types of content blocks.
The blocks are attached to the document resource using RDF sequence propertiesrdf:_1, rdf:_2 etc.
The index number in the property URI indicates the position of the content block on
the document's content list. The Northwind dashboard's root document, for example,
starts with:
<https://localhost:4443/>
rdf:_1 <https://localhost:4443/#overview-intro> ; # an XHTML block
rdf:_2 <https://localhost:4443/#sales-trend-block> . # an object block wrapping a chartSource: root.ttl · Live: the dashboard
Blocks come in two types: XHTML (ldh:XHTML) and object (ldh:Object). These are the only types allowed as content block values — anything that is not
XHTML markup, such as a query, a chart or an external resource, has to be wrapped
into an ldh:Object. A built-in constraint rejects other values.
Blocks can be rearranged by dragging a block's handle to a new position. Every block also offers a button that copies the block's URI to the clipboard.
XHTML blocks¶
An XHTML block is a fragment of XHTML, stored as a canonical XML literal (rdf:XMLLiteral) in the RDF document. It is edited in place using the rich-text editor, which also
supports RDFa annotations.
RDF serialization¶
@prefix ldh: <https://w3id.org/atomgraph/linkeddatahub#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<https://localhost:4443/#overview-intro>
a ldh:XHTML ;
rdf:value "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n<p>The iconic sample database, reborn as an RDF Knowledge Graph.</p>\n</div>"^^rdf:XMLLiteral .Object blocks¶
Blocks other than XHTML content are called objects and must have a dereferenceable URI. Objects are embedded (transcluded) into the HTML page. You can use any RDF resource or uploaded file as an object.
LinkedDataHub will first attempt to load RDF data from the object URI and render it
as a block. If that fails, it will simply embed it using the HTML <object> element. Object blocks can be used to embed queries, charts, and other LinkedDataHub
system resources.
An object can also be a page on the web, which LinkedDataHub reads as data when it
loads it. A web page that embeds JSON-LD in a <script type="application/ld+json"> element contributes that data: a product, an article, an event or a recipe the page
describes is rendered as a resource. A YouTube video, given by its https://www.youtube.com/watch?v=… or https://youtu.be/… URL, has its metadata translated to RDF on the fly as a schema:VideoObject with its title, channel and thumbnail, and the block shows the video's player. Support
for other video and media services is planned. To embed a video or a page from the
web, create an object block with the page's URL as its value rather than pasting an
<iframe> into an XHTML block: the object block is a resource LinkedDataHub describes and renders,
and the iframe is markup it knows nothing about.
Built-in block types render as cards: a header carries the block's title and actions such as the links popover and the copy-URI button, and the block's content follows below. Block-type-specific controls join the header area — a view block, for example, adds its facet toolbar and parallax row there. The layout of the content may depend on the active mode of the block.
A conversation with the assistant is an object block too: its value is an ldh:Chat resource, and the block
renders the conversation with its question field.
RDF serialization¶
@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/> .
<https://localhost:4443/#top-manager>
a ldh:Object ;
dct:title "Vice President, Sales" ;
rdf:value <https://localhost:4443/employees/2/#this> .This block from the Northwind dashboard embeds a plain data resource — the Vice President
of Sales, rendered with his description and photo.
The object can equally be a query, a chart, a
view, or an external Linked Data URI, and an optional ac:mode on the block picks the
layout mode it renders in.
The block reads the object's description from the object's own document, which for
an external URI means through the Linked Data proxy. An optional ldh:graph on the block names a document to read it from instead, so a dataspace can show an
external resource it describes in one of its own documents: one whose URI serves no
RDF, one the proxy cannot reach or is disabled for, or one whose remote description
is not the one the dataspace keeps. Editing the embedded resource writes to that document
too. From the command line it is the --graph option of ldh add object-block. The About page of these docs embeds its YouTube video this way, with the video's
schema:VideoObject description in the page itself:
<#overview-video> a ldh:Object ;
dct:title "LinkedDataHub 6 overview" ;
rdf:value <https://www.youtube.com/watch?v=g3i-yH95WZA> ;
ldh:graph <> .
<https://www.youtube.com/watch?v=g3i-yH95WZA> a schema:VideoObject ;
schema:name "LinkedDataHub 6 overview" .Source: root.ttl · Live: the dashboard
Management¶
Content blocks can only be managed when the Content layout mode is active. The edit and delete buttons only appear for agents with write access.
| Action | Description |
|---|---|
| Create XHTML block | Click the XHTML button at the bottom of the page. Create the XHTML content in the rich-text editor. |
| Create object block | Click the Object button at the bottom of the page. Enter the object's value URI. Click Save. |
| Update XHTML block | Click into the block's content and edit it in place. The changes are saved automatically when the focus leaves the block — there is no separate save button. |
| Update object block | Click the button in the top-right corner of the block (it will only appear when you move the mouse close to that corner). Change the object's value URI. Click Save. |
| Delete | Click the button in the top-right corner of the block (it will only appear when you move the mouse close to that corner). Confirm in the dialog that appears. |
| Reorder | Drag the block by its drag handle and drop it in a different position on the content list. |
| Copy URI | Click the copy button on the block to copy the block's URI to the clipboard. |
| Action | CLI command |
|---|---|
| Create XHTML block | ldh add xhtml-block |
| Create object block | ldh add object-block |
| Delete | ldh remove block |
Updating and reordering blocks has no dedicated command; use ldh patch with a SPARQL update on the document.
To compose content blocks step-by-step, follow the Create content guide