PREFIX fun: <http://w3id.org/sparql-generate/fn/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

BASE <https://saref.etsi.org/documentation/>

TEMPLATE <ontology/toc-bar.rqg>( ?onto,  ?entity , ?property ) {
  before = "\n<ul>" ;
  BOX { "\n<li>"

    <function/hrefTitle.rqg>(fun:prefixedIRI(?entity), TEMPLATE <ontology/label.rqg>( ?onto,  ?entity ) . )

    TEMPLATE <ontology/toc-bar.rqg>( ?onto,  ?sub , ?property )
    WHERE {
      ?sub ?property ?entity
      FILTER( ISURI( ?sub ) )
    } ORDER BY ?sub . 

  "</li>" }
  ; after = "\n</ul>"
}