LODE logo
URL File

Live OWL Documentation Environment (LODE) is a service that automatically extracts classes, object properties, data properties, named individuals, annotation properties, general axioms and namespace declarations from an OWL and OWL2 ontology, and renders them as ordered lists, together with their textual definitions, in a human-readable HTML page designed for browsing and navigation by means of embedded links.

This LODE service is an open source development, and can be freely used, as described in this document. It may be used in conjunction with content negotiation to display this human-readable version of an OWL ontology when the user accesses the ontology using a web browser, or alternatively to deliver the OWL ontology itself when the user accesses the ontology using an ontology editing tool such as Protégé and NeOn Toolkit. An exemplar implementation of such content negotiation is given in the Best Practice Recipes for Publishing RDF Vocabularies by using the .htaccess file:

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]
            

Depending on the parameters specified, the HTML page created by LODE takes into account both ontological axioms and annotations. The CSSs used for the resulting HTML page are based on the W3C CSSs for Recommendation documents.

API Documentation

The LODE 2.0 API exposes a single endpoint — /extract — available via both GET (URL-based) and POST (file upload). It processes a semantic artefact and returns a human-readable HTML documentation page.

Parameters

Parameter Method Type Required Description Example
url GET string Yes Full URL of the semantic artefact to process. Both semantic artefacts URIs and direct links to RDF files (e.g. .ttl, .rdf, .owl) are accepted. url=http://purl.org/spar/fabio.ttl [or]
url=http://purl.org/spar/fabio/
file POST file Yes The semantic artefact file to upload and process. Accepted formats: .rdf, .owl, .ttl, .n3, .nt, .xml. file={LOCAL_PATH}
read_as GET POST enum No How to interpret the RDF graph. One of owl, rdf, skos. Defaults to owl. read_as=owl
resource GET POST string (URI) No URI of a specific resource to render. If omitted, the full artefact is documented. resource=http://purl.org/spar/fabio/ArchivalDocument
lang GET POST string No Preferred language code for annotations (e.g. en, it, fr). Defaults to en. lang=en
warnings GET POST boolean No 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 GET POST boolean No OWL only. When set to true, the axioms contained in the ontologies directly imported by the target artefact are included in the documentation. If both imported and closure are specified, only imported is used. imports=True
closure GET POST boolean No OWL only. When set to true, the transitive closure of all imported ontologies is included in the documentation. If both imported and closure are specified, only imported is used. closure=True
cache GET boolean No URL 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, so updates to the ontology are picked up immediately; the fresh result then replaces the cache. cache=false

Examples

/extract?url=http://purl.org/spar/fabio.ttl&read_as=owl
/extract?url=http://purl.org/spar/fabio&read_as=owl
/extract?url=http://www.w3.org/2004/09/fresnel&read_as=owl&warnings=true
/extract?url=http://purl.org/spar/fabio&read_as=owl&imported=true&lang=en
/extract?url=http://purl.org/spar/fabio&read_as=owl&closure=true
/extract?url=http://purl.org/spar/fabio&read_as=owl&resource=http://purl.org/spar/fabio/Abstract&lang=it
/extract?url=http://purl.org/spar/fabio&read_as=owl&cache=false