/ldh:dataspacefrom LinkedDataHub
Provisions a new LinkedDataHub dataspace (end-user + admin app on subdomains, each with its own Fuseki dataset) by editing config/dataspaces.trig, config/system.trig, and config/fuseki/config.ttl. Requires shell access to the deployment.
Ships in LinkedDataHub. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A dataspace is a pair of applications on one origin: the end-user app at https://<name>.<host>/
and its admin app at https://admin.<name>.<host>/ (always the admin. subdomain prefix, never an
/admin path). Each app is backed by a SPARQL service, by default a TDB2 dataset in the instance's
single Fuseki server. The admin app holds the dataspace's ontologies and access control; the
end-user app holds its documents.
Dataspace configuration is file-based and read at startup. There is no ldh command and no
HTTP request that creates one. You need shell access to the deployment (the LinkedDataHub
checkout its docker-compose.yml runs from). On a hosted instance you cannot provision a dataspace;
ask its operator.
Reference: https://docs.linkeddatahub.com/user-guide/manage-dataspaces/ and https://docs.linkeddatahub.com/reference/configuration/
<doc#this>, linked with
foaf:primaryTopic.ldh with
export LDH_BASE='${user_config.ldh_base}' LDH_CERT_FILE='${user_config.cert_file}';, the plugin's
settings (/plugin → ldh → configure); a variable set in one Bash command is gone by the next. ldh reads
the certificate's password from LDH_CERT_PASSWORD, which the user sets in their own environment, such as
the env block of ~/.claude/settings.json. If a setting or the password is missing, ask the user for it:
never read secrets/, search the disk for a certificate or a password, or guess one.
LDH_PROXY comes from the environment.
Commands that create a document print its URL as the only stdout line.ldh that matches the instance. Build it from the same LinkedDataHub checkout or release
as the running image (ldh --version). An instance whose end-user responses carry no
https://w3id.org/atomgraph/linkeddatahub/dataspaces#admin Link (check with ldh get --head --accept text/turtle "$LDH_BASE")
predates the CLI's admin discovery. There, ldh admin commands stop with "advertises no lds:admin link".
An admin base advertises itself as its lds:admin only from 6.2.1 on. Use the image built from the same checkout as the CLI.Pick a name, e.g. inventory. With the instance host localhost and port 4443, the origins are
https://inventory.localhost:4443 and https://admin.inventory.localhost:4443, and the Fuseki
datasets are named after the origin with the deployment host dropped and the role appended:
inventory.end-user and inventory.admin.
Read the existing entries in each file first and copy their shape exactly. The root dataspace and any demo dataspace already present are the templates.
config/dataspaces.trig — public metadataOne named graph per app, identified by a urn: URI (never a blank node):
<urn:linkeddatahub:apps/inventory/admin>
{
<urn:linkeddatahub:apps/inventory/admin> a lds:Dataspace ;
dct:title "Inventory admin" ;
lds:origin <https://admin.inventory.localhost:4443> ;
lds:ontology <https://w3id.org/atomgraph/linkeddatahub/admin#> ;
ac:stylesheet <https://admin.inventory.localhost:4443/static/xsl/admin/layout.xsl> .
}
<urn:linkeddatahub:apps/inventory/end-user>
{
<urn:linkeddatahub:apps/inventory/end-user> a lds:Dataspace ;
dct:title "Inventory" ;
lds:origin <https://inventory.localhost:4443> ;
lds:ontology <https://inventory.localhost:4443/ns#> ;
ac:stylesheet <https://inventory.localhost:4443/static/xsl/layout.xsl> ;
lds:public true .
}
lds:ontology is its namespace ontology, <origin>/ns#. The admin app always
uses the platform's admin ontology.ac:stylesheet must be an absolute URL on the app's own origin.lds:public true lists the dataspace publicly. It does not make documents readable; that is
ldh admin make-public (see ldh:app).<urn:…/end-user> ldh:import <package#this>.
ldh packages add is the live route but does not survive a restart.config/fuseki/config.ttl — the two datasetsAdd a fuseki:Service and a tdb2:DatasetTDB2 per role, copying an existing pair (keep the
arq:queryTimeout context on the query endpoint):
<#inventory.end-user> a fuseki:Service ;
fuseki:name "inventory.end-user" ;
fuseki:endpoint [ fuseki:operation fuseki:query ; ja:context [ ja:cxtName "arq:queryTimeout" ; ja:cxtValue "60000" ] ] ;
fuseki:endpoint [ fuseki:operation fuseki:update ] ;
fuseki:endpoint [ fuseki:operation fuseki:gsp-rw ] ;
fuseki:dataset <#inventory.end-user-dataset> .
<#inventory.end-user-dataset> a tdb2:DatasetTDB2 ;
tdb2:location "/fuseki/databases/inventory.end-user/DB2" .
and the same for inventory.admin.
config/system.trig — internal wiringType each app and bind it to an sd:Service pointing at its dataset. This file is internal; never
publish it.
<urn:linkeddatahub:apps/inventory/end-user>
{
<urn:linkeddatahub:apps/inventory/end-user> a lds:EndUserDataspace ;
lds:service <urn:linkeddatahub:services/inventory/end-user> .
}
<urn:linkeddatahub:services/inventory/end-user>
{
<urn:linkeddatahub:services/inventory/end-user> a sd:Service ;
dct:title "Inventory service" ;
sd:supportedLanguage sd:SPARQL11Query, sd:SPARQL11Update ;
sd:endpoint <http://fuseki:3030/inventory.end-user/> ;
a:graphStore <http://fuseki:3030/inventory.end-user/> ;
a:quadStore <http://fuseki:3030/inventory.end-user/> .
}
and the same pair for the admin app with lds:AdminDataspace and inventory.admin.
Several dataspaces may share one service, but then they share one dataset and see each other's documents. Give each dataspace its own pair unless that is the point.
riot --validate config/dataspaces.trig config/system.trig config/fuseki/config.ttl
A syntax error, or a dataspace with no matching service, stops the platform at startup.
The new datasets and apps only take effect after fuseki and linkeddatahub restart
(docker compose restart fuseki linkeddatahub from the checkout). Restarting is the
operator's decision — ask before doing it: it interrupts every dataspace on the instance, and it
drops package imports that were added live with ldh packages add rather than declared in
dataspaces.trig.
On first start the entrypoint seeds the new datasets: the root document, the namespace ontology, the
owner's and secretary's agent metadata and their authorizations. It does so only for an app without
the marker /var/linkeddatahub/based-datasets/<origin-folder>/.seeded, which it writes once every
upload has succeeded: an existing dataspace is never reseeded, and one whose seed failed partway is
seeded again on the next start.
Wait for Tomcat's startup to finish (the root URL can answer from cache before it does), then:
export LDH_BASE=https://inventory.localhost:4443/
ldh get --accept text/turtle "$LDH_BASE" # the seeded root document
ldh get --accept text/turtle https://admin.inventory.localhost:4443/ontologies/namespace/
ldh get --accept text/turtle "${LDH_BASE}context" # every dataspace, public
All three answer 200 with RDF. /context lists every dataspace of the instance: its type, title,
origin and ontology, and lds:admin on each end-user dataspace, the admin base the server pairs it
with. If the new dataspace is missing there, the config was not loaded. If it has no lds:admin, its
admin origin is not the admin. subdomain of its end-user origin. The services and credentials from
system.trig and secrets/ never appear in it. *.localhost resolves to the loopback address without a hosts entry;
any other host needs DNS (or /etc/hosts) for both subdomains. nginx routes every subdomain of the
host, so it needs no change.
PROTOCOL, HOST and HTTPS_PORT in .env. Changing the port
in .env alone makes the platform exit with "Root end-user app with origin … not found".urn: URIs for apps and services. A blank node breaks the lookup.bin/server-cert-gen.sh names the base host only, so browsers warn on
the new subdomains. ldh does not validate server certificates, so the CLI is unaffected.The dataspace is empty apart from its root document. Model and load data with ldh:dataset, then build the UI with ldh:app.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
linkeddatahub, dataspace-provisioning, fuseki, sparql, self-hosted
4 skills in this plugin
/appBuild a LinkedDataHub application declaratively with the ldh CLI — the document tree (containers and items), content blocks, SPARQL views in table/grid/list/map/graph layouts, charts, federated queries, public access, and an app directory installed with ldh push. Use when the task is to present data in an existing dataspace or to package an installable app. For the domain model and data imports use ldh:dataset; for rendering that data cannot declare (custom XSLT) use ldh:package./datasetModel and load data into a LinkedDataHub dataspace with the ldh CLI — write the namespace ontology (classes, constructors, constraints, property views), import vocabulary packages, and map CSV or RDF into documents with SPARQL CONSTRUCT imports, or build a large CSV, JSON or XML dataset standalone (CSV2RDF, JSON2RDF, Saxon XSLT, then a quad CONSTRUCT) and bulk-load it. Use when the task is to define a domain model or get data into an existing dataspace. For the documents, views and charts that present it use ldh:app; for a new dataspace use ldh:dataspace./packageWrite a reusable LinkedDataHub package — an ontology plus an XSLT 3 stylesheet whose templates customise rendering in the platform's open modes (property rows, form controls, value cells, tree nodes, a navigation column) — and publish it to a package registry so any dataspace imports it with ldh packages add. Use when a vocabulary needs rendering or editing behaviour that views, modes and blocks cannot declare. For declarative UI use ldh:app; for a dataspace's own model use ldh:dataset.npx claudepluginhub atomgraph/linkeddatahub --plugin ldhOther plugins' skills for the same job