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#>
TEMPLATE doc:instance (?ontology, ?ns){
        "### Instances\n" ## this is prefix
        "\n"  ## this is prefix
    "\n\n" st:call-template(doc:label, ?s)
    "\n\n"
    "**IRI:**" str(?slink) "\n"
    st:call-template(doc:comment, ?s)
    "\n\n"
    st:call-template(doc:subject-of, ?ns, ?s, rdf:type, "_instance of:_")
    "\n\n"
    st:call-template(doc:subject-of, ?ns, ?s, rdf:seeAlso, "_see also:_")
    "\n\n"
    st:call-template(doc:instance, ?ontology, ?ns)
   
} WHERE { 
    ?s rdfs:isDefinedBy ?ontology .
     BIND( CONCAT( "[", str(IRI(?s)), "](", str(?s), ")") AS ?slink)
       FILTER NOT EXISTS {
        { ?s a owl:Class } UNION { ?s a owl:ObjectProperty } UNION { ?s a owl:DatatypeProperty } 
       }
}