PREFIX st:   <http://ns.inria.fr/sparql-template/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX fun: <http://w3id.org/sparql-generate/fn/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX obo: <http://purl.obolibrary.org/obo/>
 
TEMPLATE <main.rqg>() { 
  "<!DOCTYPE html>\n"
  "<html dir='ltr'>" BOX { "\n"

    st:call-template(<head.rqg>, ?ontology, ?lang, <en.properties>) "\n"

    st:call-template(<body.rqg>, ?ontology, ?lang, <en.properties>)

  } "\n" "</html>" 
}
WHERE {
  ?ontology rdf:type owl:Ontology .
  BIND( COALESCE( fun:property(<properties/preferences.properties>, "language"), "en" ) AS ?lang )
} LIMIT 1