PREFIX st: <http://ns.inria.fr/sparql-template/>
PREFIX doc: <https://w3id.org/seas/documentation/html/loweringRule#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
BASE <https://saref.etsi.org/documentation/>

TEMPLATE doc:classes-more (?ontology, ?ns, ?class){ 
    
    str(?header) # first time


    st:call-template(doc:label, ?s)
    "\n\n"
    "**IRI:** " str(?slink) "\n"
    st:call-template(doc:comment, ?s)
    st:call-template(doc:subject-of, ?ns, ?s, rdfs:subClassOf, "_sub class of:_")
    st:call-template(doc:object-of, ?ns, ?s, rdfs:domain, "_domain of:_")
    st:call-template(doc:object-of, ?ns, ?s, rdfs:range, "_range of:_")
    st:call-template(doc:object-of, ?ns, ?s, rdf:type, "_known instances:_")
    st:call-template(doc:subject-of, ?ns, ?s, rdfs:subPropertyOf, "_sub property of:_")
    st:call-template(doc:subject-of, ?ns, ?s, rdfs:domain, "_domain:_")
    st:call-template(doc:subject-of, ?ns, ?s, rdfs:range, "_range:_")
    st:call-template(doc:subject-of, ?ns, ?s, rdf:seeAlso, "_see also:_")
    st:call-template(doc:classes-more, ?ontology, ?ns, ?class)
} WHERE { 
    ?s a ?class ; 
       rdfs:isDefinedBy ?ontology .
     BIND( CONCAT( "[", str(IRI(?s)), "](", str(?s), ")") AS ?slink)
} 