LODE 2.0 is an open source service that automatically extracts entities from semantic artefacts (OWL, RDF/RDFS, SKOS) and renders them, together with their textual definitions, as a human-readable HTML page designed for browsing and navigation through embedded links. Depending on the parameters specified, the generated page takes into account both ontological axioms and annotations; its stylesheets are based on the W3C CSSs for Recommendation documents. LODE 2.0 is the successor of LODE.
Endpoints
/extract— returns the HTML documentation page, or an RDF serialization whenformatis set./build— returns a ZIP with the complete static site: one HTML page per resource, Turtle/RDF-XML/N3 serializations and stylesheets, ready for any web server or GitHub Pages.
/build is intended for interactive, one-off use. For automated
workflows (CI/CD, GitHub Actions) install LODE locally and use the
lode build command instead.
Only read_as=owl is currently enabled. RDF/RDFS
(read_as=rdf) and SKOS (read_as=skos) are under
development; requesting them returns an error.
Parameters
| Parameter | Type | Required | Endpoint | Description | Example |
|---|---|---|---|---|---|
url | string | Yes, mutually exclusive with file |
/extract, /build |
Full URL of the semantic artefact to process. Both semantic artefact URIs and direct links to RDF files (e.g. .ttl, .rdf, .owl) are accepted. Mutually exclusive with file. |
url=http://purl.org/spar/fabio.ttl |
file | file | Yes, mutually exclusive with url |
/extract, /build |
The semantic artefact file to upload and process. Accepted formats: .rdf, .owl, .ttl, .n3, .nt, .xml. Mutually exclusive with url. |
file={LOCAL_PATH} |
read_as | enum | No | /extract, /build |
How to interpret the RDF graph. One of owl, rdf, skos. Only owl is currently enabled. Defaults to owl. |
read_as=owl |
resource | string (URI) | No | /extract only |
URI of a specific resource to render. If omitted, the full artefact is documented. | resource=http://purl.org/spar/fabio/ArchivalDocument |
format | enum | No | /extract only |
Returns the RDF serialization instead of the HTML page. One of ttl (Turtle), rdf (RDF/XML), n3 (N3). When combined with resource, only the axioms of that resource are serialized. If omitted, the Accept header is honoured (text/turtle, application/rdf+xml, text/n3); otherwise HTML is returned. |
format=ttl |
lang | string | No | /extract, /build |
Preferred language code for annotations (e.g. en, it, fr). Defaults to en. |
lang=en |
warnings | boolean | No | /extract, /build |
When set to true, the documentation page also lists structural warnings raised during parsing (e.g. malformed restrictions, OWL 2 DL violations). Defaults to false. |
warnings=true |
imported | boolean | No | /extract, /build |
OWL only. When set to true, the axioms contained in the ontologies directly imported by the target artefact are included. If both imported and closure are specified, only imported is used. |
imported=true |
closure | boolean | No | /extract, /build |
OWL only. When set to true, the transitive closure of all imported ontologies is included. If both imported and closure are specified, only imported is used. |
closure=true |
cache | boolean | No | /extract, /build |
URL source only. When true (default), the processed URL is served from a 4-hour server-side cache when available. Set to false to discard the cached copy and re-fetch the URL; the fresh result then replaces the cache. |
cache=false |
Examples
Live documentation
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio.ttl&read_as=owl
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl
https://lode.opencitations.net/extract?url=http://www.w3.org/2004/09/fresnel&read_as=owl&warnings=true
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl&imported=true&lang=en
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl&closure=true
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl&resource=http://purl.org/spar/fabio/Abstract&lang=it
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl&cache=false
RDF content negotiation (format)
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl&format=ttl
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl&format=rdf
https://lode.opencitations.net/extract?url=http://purl.org/spar/fabio&read_as=owl&format=n3&resource=http://purl.org/spar/fabio/Abstract
Static documentation (ZIP)
https://lode.opencitations.net/build?url=http://purl.org/spar/fabio&read_as=owl
https://lode.opencitations.net/build?url=http://purl.org/spar/fabio&read_as=owl&lang=en
https://lode.opencitations.net/build?url=http://purl.org/spar/fabio&read_as=owl&imported=true
https://lode.opencitations.net/build?url=http://purl.org/spar/fabio&read_as=owl&closure=true&warnings=true
Content negotiation
LODE can be combined with content negotiation to serve this human-readable version to browsers and the raw artefact to ontology editors such as Protégé, following the Best Practice Recipes for Publishing RDF Vocabularies. An exemplar implementation of such content negotiation is given in the Best Practice Recipes for Publishing RDF Vocabularies by using the .htaccess file:
Example .htaccess
AddType application/rdf+xml .rdf
# Rewrite engine setup
RewriteEngine On
# Rewrite rule to serve HTML content
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
RewriteRule ^ontology\$ https://w3id.org/lode/http://www.mydomain.com/ontology [R=303,L]
# Rewrite rule to serve RDF/XML content if requested
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^ontology\$ ontology.owl [R=303]
# Choose the default response
RewriteRule ^ontology\$ ontology.owl [R=303]
Reporting bugs
LODE 2.0 is developed in the open. Open an issue at github.com/opencitations/lode/issues.