docs: def _process_phenotype_hpoa(self, raw, limit):
          """
          see info on format here:
          http://www.human-phenotype-ontology.org/contao/index.php/annotation-guide.html
  
          :param raw:
          :param limit:
          :return:
  
          """
          src_key = 'hpoa'
  
          if self.test_mode:
              graph = self.testgraph
          else:
              graph = self.graph
          model = Model(graph)
  
          filedate = datetime.utcfromtimestamp(
              os.stat(raw)[ST_CTIME]).strftime("%Y-%m-%d")
  
          # this will cause two dates to be attached to the dataset
          # (one from the filedate, and the other from here)
          # TODO when #112 is implemented,
          # this will result in only the whole dataset being versioned
  
          col = self.files[src_key]['columns']
          with open(raw, 'r', encoding="utf8") as tsvfile:
              reader = csv.reader(tsvfile, delimiter='\t', quotechar='\"')
              row = next(reader)  # drop Description
              row = str(next(reader))[9:19]
              LOG.info("Ingest from %s", row)
              date = datetime.strptime(
                  row.strip(), '%Y-%m-%d').strftime("%Y-%m-%d-%H-%M")
              self.dataset.setVersion(filedate, date)
  
              row = next(reader)  # drop tracker url
              row = next(reader)  # drop release url
              row = next(reader)  # headers
              row[0] = row[0][1:]  # uncomment
              if col != row:
                  LOG.info(
                      '%s\nExpected Headers:\t%s\nRecived Headers:\t%s\n',
                      src_key, col, row)
                  LOG.info(set(col) - set(row))
  
              for row in reader:
                  if row[0][0] == '#' or row[0] == 'DatabaseID':  # headers
                      continue
                  row = [str(col).strip() for col in row]
  
                  disease_id = row[col.index('DatabaseID')]
                  # 98246 OMIM
                  # 68646 ORPHA
                  # 297 DECIPHER
  
                  if self.test_mode:
                      try:
                          id_list = self.test_ids
                          if id_list is None or disease_id not in id_list:
                              continue
                      except AttributeError:
                          continue
  
                  # row[col.index('DiseaseName')]  unused
  
                  if row[col.index('Qualifier')] == 'NOT':
                      continue
  
                  pheno_id = row[col.index('HPO_ID')]
                  publist = row[col.index('Reference')]
                  eco_id = self.resolve(row[col.index('Evidence')])
                  onset = row[col.index('Onset')]
                  freq = row[col.index('Frequency')]
                  sex = row[col.index('Sex')].lower()
                  # row[col.index('Modifier')]   unused
                  asp = row[col.index('Aspect')]
                  # row[col.index('Biocuration')]  unused
  
                  # LOG.info(
                  #    'adding <%s>-to-<%s> because <%s>', disease_id, pheno_id, eco_id)
  
                  model.addClassToGraph(disease_id)
                  model.addClassToGraph(pheno_id)
                  model.addClassToGraph(eco_id)
                  if onset is not None and onset != '':
                      model.addClassToGraph(onset)
  
                  if asp in ('P', 'M'):  # phenotype? abnormality or mortality
                      assoc = D2PAssoc(  # default rel=self.globaltt['has phenotype']
                          graph, self.name, disease_id, pheno_id,
                          onset, freq)
                  elif asp in ('I', 'C'):  # inheritance pattern or clinical course/onset
                      assoc = D2PAssoc(
                          graph, self.name, disease_id, pheno_id,
                          rel=self.globaltt['has disposition'])
                  else:
                      LOG.error("Unknown aspect : %s at line %i", asp, reader.line_num)
  
                  assoc.add_evidence(eco_id)
                  if sex is not None and sex != '':
                      self.graph.addTriple(
                          assoc.get_association_id(),
                          self.globaltt['has_sex_specificty'],
                          self.globaltt[sex])
  
                  # Publication
                  # cut -f 5 phenotype.hpoa | grep ";" | tr ';' '\n' | cut -f1 -d ':' |\
                  # sort | uniq -c | sort -nr
                  # 629 PMID
                  # 63 OMIM
                  # 42 ISBN-13
                  # 36 http
  
                  for pub in publist.split(';'):
                      pub = pub.strip()
  
                      # there have been several malformed PMIDs
                      if pub[:4] != 'http' and \
                              graph.curie_regexp.fullmatch(pub) is None:
                          LOG.warning(
                              'Record %s has a malformed Reference %s', disease_id, pub)
                          continue
  
                      pubtype = None
  
                      if pub[:5] == 'PMID:':
                          pubtype = self.globaltt['journal article']
  
                      elif pub[:4] == 'ISBN':
                          pubtype = self.globaltt['publication']
  
                      elif pub[:5] == 'OMIM:':
                          pub = 'http://omim.org/entry/' + pub[5:]
                          pubtype = self.globaltt['web page']
  
                      elif pub[:9] == 'DECIPHER:':
                          pubtype = self.globaltt['web page']
  
                      elif pub[:6] == 'ORPHA:':
                          pubtype = self.globaltt['web page']
  
                      elif pub[:4] == 'http':
                          pubtype = self.globaltt['web page']
  
                      else:
                          LOG.error(
                              'Unknown pub type for disease %s from "%s"',
                              disease_id, pub)
                          continue
  
                      if pub is not None:
                          assoc.add_source(pub)
                          if pubtype is not None:
                              ref = Reference(graph, pub, pubtype)
                              # ref.setTitle('');  ref.setYear()
  
                              ref.addRefToGraph()
                      # TODO add curator
  
                      # pprint.pprint(assoc)
  
                      assoc.add_association_to_graph()
  
                  if not self.test_mode and limit is not None and reader.line_num > limit:
                      break
          return