code: def check_format(actual_file,    # type: Union[Dict[Text, Any], List, Text]
                   input_formats,  # type: Union[List[Text], Text]
                   ontology        # type: Optional[Graph]
                  ):  # type: (...) -> None
      
      for afile in aslist(actual_file):
          if not afile:
              continue
          if "format" not in afile:
              raise validate.ValidationException(
                  u"File has no 'format' defined: {}".format(
                      json_dumps(afile, indent=4)))
          for inpf in aslist(input_formats):
              if afile["format"] == inpf or \
                      formatSubclassOf(afile["format"], inpf, ontology, set()):
                  return
          raise validate.ValidationException(
              u"File has an incompatible format: {}".format(
                  json_dumps(afile, indent=4)))
docs: Confirms that the format present is valid for the allowed formats.