LODE logo
URL File

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

Parameters

ParameterTypeRequired EndpointDescriptionExample
urlstringYes, 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
filefileYes, 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_asenumNo /extract, /build How to interpret the RDF graph. One of owl, rdf, skos. Only owl is currently enabled. Defaults to owl. read_as=owl
resourcestring (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
formatenumNo /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
langstringNo /extract, /build Preferred language code for annotations (e.g. en, it, fr). Defaults to en. lang=en
warningsbooleanNo /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
importedbooleanNo /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
closurebooleanNo /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
cachebooleanNo /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.