sphinx-skos
A Sphinx extension that builds SKOS vocabularies into a documentation site. Point it at your vocabulary files and Sphinx publishes one page for every vocabulary, every concept and every collection, with the RDF for each page beside it.
Why
A controlled vocabulary is published so that people can read it and machines can resolve it. Each concept has a URI, and that URI should lead somewhere useful: a page a person can read, and the same concept in RDF for software that asks for it.
Most tools that render a SKOS vocabulary produce one long page for the whole vocabulary, or are a
site generator of their own with their own templates and theming. sphinx-skos does neither. It
turns each concept into an ordinary Sphinx document, so a vocabulary site is a Sphinx site: it can
hold prose pages next to the generated ones, link between them, and look however its Sphinx theme
makes it look.
Status
Early. The package reads your vocabulary files and writes one Sphinx page for every vocabulary,
concept and collection, each with its facts and links, and writes that resource's own RDF beside
it in Turtle, JSON-LD, RDF/XML and N-Triples, named in the page's head with <link rel="alternate">
elements. Your own pages can show any resource with the skos:vocabulary, skos:concept and
skos:collection directives.
Usage
# conf.py
extensions = ["sphinx_skos"]
skos_vocabularies = ["../vocabularies/*.ttl"]
skos_base_uri = "https://w3id.org/example/vocabularies/"
Build with the dirhtml builder:
sphinx-build -b dirhtml docs docs/_build/dirhtml
A concept's page lives at its URI with skos_base_uri removed, so a redirect from the URI's
domain to the site maps one address directly onto the other. See Publish vocabulary files as a
site
for the steps, RDF
copies for the
files written beside each page and
Settings for what
each setting accepts.
To publish the site to GitHub Pages, call the workflow this repository ships from a job in your own:
jobs:
site:
uses: FAIR-DM/sphinx-skos/.github/workflows/build-site.yml@v0.3.2
permissions:
contents: read
pages: write
id-token: write
See Publish a site to GitHub Pages for its inputs and for building pull requests without deploying them.
Scope & philosophy
What it is. A Sphinx extension that reads SKOS vocabulary files and turns them into Sphinx documents: one page per vocabulary, concept and collection, each with its RDF copies. It works for any vocabulary from any organisation.
What it is not.
- Not a theme. Logos, colours, fonts and layout come from Sphinx's own theme settings in your
conf.py:html_theme,html_logo,html_theme_optionsand the rest. The extension renders content only. Requests to add a logo, a colour scheme or a layout option to this package will be closed with a pointer to Sphinx's HTML theming documentation. - Not a vocabulary editor. The Turtle files are the source. The extension reads them and never writes them back.
- Not a SKOS validator. It renders what the files say. Checking a vocabulary's quality is the job of tools built for it.
- Not a server. It writes static files. Resolving a URI to a page is done by a redirect service such as w3id.org or by your web server.
When choices collide:
- The vocabulary files are the truth. A page shows what they say, and the RDF copies contain what they contain, without anything added or dropped.
- A concept's address never changes because the extension changed.
- Anything a site can set in Sphinx itself stays in Sphinx.
Prior art
pyLODE renders a SKOS vocabulary or an OWL ontology as HTML
and is well maintained. It produces a single page per vocabulary, which does not give each concept
a page of its own to resolve to. sphinx-skos exists for the one-page-per-concept case.
Contributing
See CONTRIBUTING.md. The rules every change follows are in CONSTITUTION.md.
License
MIT. See LICENSE.
Metadata
Release files for sphinx-skos 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sphinx_skos-0.3.2.tar.gz | 18.3 kB | With provenance | Details for sphinx_skos-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sphinx_skos-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for sphinx_skos-0.3.2-py3-none-any.whl |
Total release size: 39.3 kB
Release files / sphinx_skos-0.3.2.tar.gz
| Download URL | sphinx_skos-0.3.2.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1fb8adf7f1ad4badc5eefcad2f2f029fba4e9501598038003a9d72921f55129
|
|
BLAKE2b-256 checksum How to use checksums |
0be344e6ed8b8db9b2d788867bbb855d088e560d843935f2b2920bdc1191fb32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / sphinx_skos-0.3.2-py3-none-any.whl
| Download URL | sphinx_skos-0.3.2-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2dcc844a937e517a38f858d628ade9f1a4a4e9e8c42b141dc7bb13163a53bab6
|
|
BLAKE2b-256 checksum How to use checksums |
d5ed041bd6d3638428ec3aea0313f35dca08d352f27c16a20cd4aec877fa72b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for sphinx-skos 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sphinx_skos-0.3.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.