<https://docs.linkeddatahub.com/reference/administration/packages/>
        a       <https://www.w3.org/ns/ldt/document-hierarchy#Item>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1>
                <https://docs.linkeddatahub.com/reference/administration/packages/#content>;
        <http://purl.org/dc/terms/created>
                "2026-06-16T20:34:04.699Z"^^<http://www.w3.org/2001/XMLSchema#dateTime>;
        <http://purl.org/dc/terms/creator>
                <https://admin.linkeddatahub.com/acl/agents/0ab4a0f7-1ab0-4d0c-8efc-63a79a2e9a10/#this>;
        <http://purl.org/dc/terms/description>
                "Package management for LinkedDataHub applications";
        <http://purl.org/dc/terms/title>
                "Packages";
        <http://rdfs.org/sioc/ns#has_container>
                <https://docs.linkeddatahub.com/reference/administration/>;
        <http://www.w3.org/ns/auth/acl#owner>
                <https://admin.linkeddatahub.com/acl/agents/0ab4a0f7-1ab0-4d0c-8efc-63a79a2e9a10/#this> .

<https://docs.linkeddatahub.com/reference/administration/packages/#content>
        a       <https://w3id.org/atomgraph/linkeddatahub#XHTML>;
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#value>
                "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n  <p class=\"lead\">Packages are reusable bundles of ontologies and stylesheets that provide vocabulary support with custom rendering for specific RDF vocabularies.</p>\n  <div class=\"alert alert-info\">\n    <p><strong>Version:</strong> Packages were introduced in LinkedDataHub 5.2.</p>\n  </div>\n  <div class=\"alert alert-info\">\n    <p><strong>Note:</strong> Packages are <strong>declarative only</strong> (RDF + XSLT). They contain no Java code and integrate at installation-time, not runtime.</p>\n  </div>\n  <div>\n    <h2 id=\"what-are-packages\">What are packages?</h2>\n    <p>A LinkedDataHub package is a reusable component that bundles together a vocabulary ontology and XSLT templates into a single installable unit. Packages enable:</p>\n    <ul>\n      <li>Rapid application setup with pre-configured domain vocabularies</li>\n      <li>Sharing and reusing common vocabulary definitions</li>\n      <li>Custom rendering for vocabulary-specific resources</li>\n      <li>Modular extension of dataspace functionality</li>\n    </ul>\n  </div>\n  <div>\n    <h2 id=\"package-structure\">Package structure</h2>\n    <p>Each package consists of two files:</p>\n    <dl>\n      <dt><code>ns.ttl</code> — Package ontology</dt>\n      <dd>An RDF ontology file that imports the external vocabulary using <code>owl:imports</code> and attaches blocks to properties using <code>ldh:view</code> (forward relationships) or <code>ldh:inverseView</code> (inverse relationships). Blocks are typically <code>ldh:View</code> resources with SPARQL queries that render related data for property values.</dd>\n      <dt><code>layout.xsl</code> — XSLT stylesheet</dt>\n      <dd>XSLT transformation file with templates that override default rendering using system modes like <code>bs2:*</code> (Bootstrap 2.3.2 components) and <code>xhtml:*</code> (XHTML elements). See <a href=\"../../stylesheets/\" target=\"_blank\">Stylesheets reference</a> for details on XSLT customization.</dd>\n    </dl>\n    <p>Package files are organized in the LinkedDataHub-Apps repository:</p>\n    <pre>packages/\n├── package-name/\n│   ├── ns.ttl         # Ontology with views\n│   └── layout.xsl     # XSLT stylesheet</pre>\n    <p>Package metadata is published as Linked Data that resolves from the package URI (e.g., <code>https://packages.linkeddatahub.com/skos/#this</code>).</p>\n  </div>\n  <div>\n    <h2 id=\"package-metadata\">Package metadata</h2>\n    <p>Package metadata is published as Linked Data that resolves from the package URI using standard LinkedDataHub properties:</p>\n    <dl>\n      <dt><code>lapp:Package</code></dt>\n      <dd>The RDF class for package descriptors</dd>\n      <dt><code>rdfs:label</code></dt>\n      <dd>Human-readable package name</dd>\n      <dt><code>dct:description</code></dt>\n      <dd>Package description and purpose</dd>\n      <dt><code>ldt:ontology</code></dt>\n      <dd>Points to the package ontology URI (from LDT vocabulary)</dd>\n      <dt><code>ac:stylesheet</code></dt>\n      <dd>Points to the package stylesheet URI (from AtomGraph Client vocabulary)</dd>\n    </dl>\n    <p>Example package metadata:</p>\n    <pre>@prefix lapp: &lt;https://w3id.org/atomgraph/linkeddatahub/apps#&gt; .\n@prefix ldt:  &lt;https://www.w3.org/ns/ldt#&gt; .\n@prefix ac:   &lt;https://w3id.org/atomgraph/client#&gt; .\n\n&lt;https://packages.linkeddatahub.com/skos/#this&gt; a lapp:Package ;\n    rdfs:label \"SKOS Package\" ;\n    dct:description \"SKOS vocabulary support with custom templates\" ;\n    ldt:ontology &lt;https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/master/packages/skos/ns.ttl#&gt; ;\n    ac:stylesheet &lt;https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/master/packages/skos/layout.xsl&gt; .</pre>\n  </div>\n  <div>\n    <h2 id=\"package-ontology\">Package ontology</h2>\n    <p>The package ontology file contains two layers:</p>\n    <h3 id=\"vocabulary-import\">Vocabulary import</h3>\n    <p>Imports the external vocabulary using <code>owl:imports</code>. See <a href=\"../ontologies/\" target=\"_blank\">Ontologies reference</a> for ontology management details.</p>\n    <pre>&lt;https://raw.githubusercontent.com/AtomGraph/LinkedDataHub-Apps/master/packages/skos/ns.ttl#&gt; a owl:Ontology ;\n    owl:imports &lt;http://www.w3.org/2004/02/skos/core&gt; .</pre>\n    <h3 id=\"property-views\">Property views</h3>\n    <p>SPARQL-based views attached to properties from the imported vocabulary:</p>\n    <pre>skos:narrower ldh:view ns:NarrowerConcepts .\n\nns:NarrowerConcepts a ldh:View ;\n    dct:title \"Narrower concepts\" ;\n    spin:query ns:SelectNarrowerConcepts .\n\nns:SelectNarrowerConcepts a sp:Select ;\n    sp:text \"\"\"SELECT DISTINCT ?narrower\n    WHERE { GRAPH ?graph { $about skos:narrower ?narrower } }\n    ORDER BY ?narrower\"\"\" .</pre>\n    <p>Views are rendered when displaying resources that have the specified property. Use <code>ldh:view</code> for forward relationships (resource has property) or <code>ldh:inverseView</code> for inverse relationships (other resources point to this resource via property).</p>\n  </div>\n  <div>\n    <h2 id=\"package-stylesheet\">Package stylesheet</h2>\n    <p>XSLT templates using system modes to override default rendering:</p>\n    <pre>&lt;!-- Hide properties from default property list --&gt;\n&lt;xsl:template match=\"skos:narrower | skos:broader\" mode=\"bs2:PropertyList\"/&gt;\n\n&lt;!-- Override XHTML head elements --&gt;\n&lt;xsl:template match=\"*\" mode=\"xhtml:Style\"&gt;\n    &lt;!-- Custom styles --&gt;\n&lt;/xsl:template&gt;</pre>\n    <p>Available system modes include:</p>\n    <ul>\n      <li><code>bs2:*</code> — Bootstrap 2.3.2 components (PropertyList, Form, etc.)</li>\n      <li><code>xhtml:*</code> — XHTML elements (Style, Script, etc.)</li>\n      <li>Additional modes documented in the <a href=\"../../stylesheets/\" target=\"_blank\">Stylesheets reference</a></li>\n    </ul>\n  </div>\n  <div>\n    <h2 id=\"installing-packages\">Installing packages</h2>\n    <p>Installation requires Control access to the administration application. See the <a href=\"../../../user-guide/manage-packages/\" target=\"_blank\">step-by-step installation guide</a> for detailed instructions.</p>\n    <p>Installation will fail if these files do not exist.</p>\n    <h3 id=\"installation-process\">Installation process</h3>\n    <p>When you install a package, the system performs the following steps:</p>\n    <ol>\n      <li><strong>Fetches package metadata</strong> from the package URI</li>\n      <li><strong>Hashes the package ontology URI</strong> using SHA-1 to create a unique document slug</li>\n      <li><strong>Downloads package ontology</strong> (<code>ns.ttl</code>) and PUTs it as a document to <code>${admin_base}ontologies/{hash}/</code> where <code>{hash}</code> is the SHA-1 hash of the ontology URI</li>\n      <li><strong>Adds owl:imports</strong> from the namespace ontology to the package ontology in the namespace graph (<code>${admin_base}ontologies/namespace/</code>)</li>\n      <li><strong>Clears and reloads</strong> the namespace ontology from cache to pick up the new imports</li>\n      <li><strong>Downloads package stylesheet</strong> (<code>layout.xsl</code>) and saves it to <code>/static/{package-path}/layout.xsl</code> where <code>{package-path}</code> is derived from the package URI (e.g., <code>com/linkeddatahub/packages/skos/</code> for <code>https://packages.linkeddatahub.com/skos/</code>)</li>\n      <li><strong>Updates master stylesheet</strong> at <code>/static/xsl/layout.xsl</code> by adding import:\n        <pre>&lt;xsl:import href=\"../com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/layout.xsl\"/&gt;  &lt;!-- System --&gt;\n&lt;xsl:import href=\"../com/linkeddatahub/packages/skos/layout.xsl\"/&gt;  &lt;!-- Package (added) --&gt;</pre>\n      </li>\n    </ol>\n    <div class=\"alert alert-warning\">\n      <p><strong>Important:</strong> After installing or uninstalling a package, you must restart the Docker service for XSLT stylesheet changes to take effect:</p>\n      <pre>docker-compose restart linkeddatahub</pre>\n      <p>Do not use <code>--force-recreate</code> as that would overwrite the stylesheet file changes.</p>\n    </div>\n  </div>\n  <div>\n    <h2 id=\"uninstalling-packages\">Uninstalling packages</h2>\n    <p>Packages can be safely uninstalled, which removes:</p>\n    <ul>\n      <li>Package ontology imports from the application</li>\n      <li>Package-specific data and resources</li>\n      <li>Associated queries and stylesheets</li>\n    </ul>\n    <div class=\"alert alert-info\">\n      <p><strong>Note:</strong> Uninstalling a package does not remove user-created data that uses the package's vocabulary.</p>\n    </div>\n  </div>\n  <div>\n    <h2 id=\"architecture\">Architecture</h2>\n    <h3 id=\"installation-time-composition\">Installation-time vs runtime</h3>\n    <p>Packages use <strong>installation-time composition</strong>, NOT runtime composition:</p>\n    <ul>\n      <li>✅ Package content is integrated during installation (via JAX-RS endpoints)</li>\n      <li>✅ Ontology and XSLT are pre-composed before being loaded</li>\n      <li>✅ No runtime overhead</li>\n      <li>❌ No dynamic package loading at request time</li>\n    </ul>\n    <h3 id=\"http-endpoints\">HTTP endpoints</h3>\n    <p>Package installation and uninstallation is performed via <a href=\"../../http-api/#system-endpoints\" target=\"_blank\">system endpoints</a> on the admin application. See <code>packages/install</code> and <code>packages/uninstall</code> in the HTTP API reference.</p>\n    <h3 id=\"file-system-structure\">File system structure</h3>\n    <p>After installing the SKOS package:</p>\n    <pre>webapp/\n├── static/\n│   ├── com/\n│   │   └── linkeddatahub/\n│   │       └── packages/\n│   │           └── skos/\n│   │               └── layout.xsl          # Package stylesheet\n│   └── xsl/\n│       ├── layout.xsl                      # End-user master stylesheet\n│       └── admin/\n│           └── layout.xsl                  # Admin master stylesheet</pre>\n  </div>\n  <div>\n    <h2 id=\"creating-packages\">Creating custom packages</h2>\n    <p>Developers can create custom packages for their own domain vocabularies. The process involves:</p>\n    <h3 id=\"write-ontology\">Write package ontology</h3>\n    <p>Create <code>ns.ttl</code> with vocabulary import and views:</p>\n    <pre>&lt;https://raw.githubusercontent.com/you/repo/master/packages/schema.org/ns.ttl#&gt; a owl:Ontology ;\n    owl:imports &lt;http://schema.org/&gt; .\n\n# Attach view to a property\nschema:knows ldh:view :PersonKnows .\n\n:PersonKnows a ldh:View ;\n    dct:title \"Knows\" ;\n    spin:query :SelectPersonKnows .\n\n:SelectPersonKnows a sp:Select ;\n    sp:text \"\"\"\n    SELECT DISTINCT ?person\n    WHERE { GRAPH ?graph { $about schema:knows ?person } }\n    ORDER BY ?person\n    \"\"\" .</pre>\n    <h3 id=\"write-stylesheet\">Write XSLT stylesheet</h3>\n    <p>Create <code>layout.xsl</code> with XSLT templates using system modes like <code>bs2:*</code> and <code>xhtml:*</code>. See the <a href=\"../../stylesheets/\" target=\"_blank\">Stylesheets reference</a> for template customization patterns.</p>\n    <pre>&lt;xsl:template match=\"schema:knows\" mode=\"bs2:PropertyList\"/&gt;</pre>\n    <h3 id=\"publish-metadata\">Publish package metadata</h3>\n    <p>Publish package metadata as Linked Data at your package URI:</p>\n    <pre>&lt;https://packages.linkeddatahub.com/schema.org/#this&gt; a lapp:Package ;\n    rdfs:label \"Schema.org Package\" ;\n    dct:description \"Schema.org vocabulary support\" ;\n    ldt:ontology &lt;https://raw.githubusercontent.com/you/repo/master/packages/schema.org/ns.ttl#&gt; ;\n    ac:stylesheet &lt;https://raw.githubusercontent.com/you/repo/master/packages/schema.org/layout.xsl&gt; .</pre>\n    <p>Ensure the metadata contains <code>ldt:ontology</code> and <code>ac:stylesheet</code> properties pointing to the package resources.</p>\n    <h3 id=\"test-installation\">Test installation</h3>\n    <p>Use the CLI to test your package installation:</p>\n    <pre>install-package.sh \\\n  -b \"https://localhost:4443/\" \\\n  -f ssl/owner/cert.pem \\\n  -p \"$cert_password\" \\\n  --package \"https://packages.linkeddatahub.com/schema.org/#this\"</pre>\n  </div>\n  <div>\n    <h2 id=\"available-packages\">Available packages</h2>\n    <p>A curated list of available packages can be found in the <a href=\"https://github.com/AtomGraph/LinkedDataHub-Apps/tree/master/packages\" target=\"_blank\">LinkedDataHub-Apps repository</a>. Each package directory contains the package ontology (<code>ns.ttl</code>) and stylesheet (<code>layout.xsl</code>) files.</p>\n  </div>\n</div>"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
