PREFIX schema: <http://schema.org/>

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

TEMPLATE <ontology/affiliation.rqg>( ?onto,  ?affiliation ) {

  IF( ISURI(?affiliation) && BOUND(?name) , " (<a href='{?affiliation}'>{ ?name }</a>)", "" )
  IF( ISURI(?affiliation) && !BOUND(?name), " (<a href='{?affiliation}'>&lt;{ ?affiliation }&gt;</a>)", "" )
  IF( ISBLANK(?affiliation) && BOUND(?name), " (<span>{ ?name }</span>)", "" )
  IF( ISBLANK(?affiliation) && !BOUND(?name), " - Violation of ETSI TS 103 673 Clause 9.4.3.3", "" )

} WHERE {
  OPTIONAL {
    ?affiliation a schema:Organization ;
      schema:name ?name .
  }
}