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>( ?entity , ?property ) {
  before = "\n<ul>" ;
  BOX { "\n<li>"

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

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

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