PREFIX dc:   <http://purl.org/dc/terms/>
PREFIX st: <http://ns.inria.fr/sparql-template/>
PREFIX doc: <https://w3id.org/seas/documentation/html/loweringRule#>
TEMPLATE doc:subject-of-more (?ns, ?s, ?predicate, ?label){

    "- **" str(?label) "** " str(?olink) st:call-template(doc:subject-of-more, ?ns, ?s, ?predicate, ?label) " \n"   # first
 
    ", " str(?olink)   # rest

} WHERE { 
    ?s ?predicate ?o .
    BIND( IF( STRSTARTS( str(?o), str(?ns) ) , CONCAT( "[", STRAFTER(str(?o), str(?ns)), "](", str(?o), ")") , CONCAT( "[", str(IRI(?o)), "](", str(?o), ")" ) ) AS ?olink )
    FILTER( isIRI(?o) )
} 
