code: def formatSubclassOf(fmt, cls, ontology, visited):
      # type: (Text, Text, Optional[Graph], Set[Text]) -> bool
      
  
      if URIRef(fmt) == URIRef(cls):
          return True
  
      if ontology is None:
          return False
  
      if fmt in visited:
          return False
  
      visited.add(fmt)
  
      uriRefFmt = URIRef(fmt)
  
      for s, p, o in ontology.triples((uriRefFmt, RDFS.subClassOf, None)):
          # Find parent classes of `fmt` and search upward
          if formatSubclassOf(o, cls, ontology, visited):
              return True
  
      for s, p, o in ontology.triples((uriRefFmt, OWL.equivalentClass, None)):
          # Find equivalent classes of `fmt` and search horizontally
          if formatSubclassOf(o, cls, ontology, visited):
              return True
  
      for s, p, o in ontology.triples((None, OWL.equivalentClass, uriRefFmt)):
          # Find equivalent classes of `fmt` and search horizontally
          if formatSubclassOf(s, cls, ontology, visited):
              return True
  
      return False
docs: Determine if `fmt` is a subclass of `cls`.