docs: def _process_phenstatement(self, limit):
          """
          The phenstatements are the genotype-to-phenotype associations,
          in the context of an environment.
          These are also curated to a publication. So we make oban associations,
          adding the pubs as a source.  We additionally add the internal key as
          a comment for tracking purposes.
          :param limit:
          :return:
  
          """
  
          if self.test_mode:
              graph = self.testgraph
          else:
              graph = self.graph
          model = Model(graph)
          raw = '/'.join((self.rawdir, 'phenstatement'))
          LOG.info("processing phenstatement")
  
          line_counter = 0
  
          with open(raw, 'r') as f:
              filereader = csv.reader(f, delimiter='\t', quotechar='\"')
              f.readline()  # read the header row; skip
              for line in filereader:
                  (phenstatement_id, genotype_id, environment_id, phenotype_id,
                   type_id, pub_id) = line
  
                  # 168549	166695	1	8507	60468	151256
                  # 168550	166695	1	8508	60468	151256
                  # 168551	166696	1	8509	60468	151256
                  # 168552	166696	1	8510	60468	151256
                  line_counter += 1
                  phenstatement_key = phenstatement_id
                  phenstatement_id = self._makeInternalIdentifier(
                      'phenstatement', phenstatement_key)
                  genotype_key = genotype_id
  
                  if self.test_mode and \
                          int(genotype_key) not in self.test_keys['genotype']:
                      continue
  
                  genotype_id = self.idhash['genotype'][genotype_key]
                  environment_key = environment_id
                  environment_id = self.idhash['environment'][environment_key]
                  phenotype_key = phenotype_id
                  phenotype_internal_id = self._makeInternalIdentifier(
                      'phenotype', phenotype_key)  # TEMP
                  phenotype_internal_label = self.label_hash[
                      phenotype_internal_id]
                  phenotype_id = self.idhash['phenotype'][phenotype_key]
                  pub_key = pub_id
                  pub_id = self.idhash['publication'][pub_key]
  
                  # figure out if there is a relevant stage
  
                  assoc = G2PAssoc(graph, self.name, genotype_id, phenotype_id)
                  if phenotype_id in self.phenocv:
                      stages = set(
                          s for s in
                          self.phenocv[phenotype_id] if re.match(r'FBdv', s))
                      if len(stages) == 1:
                          s = stages.pop()
                          assoc.set_stage(s, s)
                      elif len(stages) > 1:
                          LOG.warning(
                              "There's more than one stage specified per "
                              "phenotype. I don't know what to do. %s",
                              str(stages))
                      non_stage_ids = self.phenocv[phenotype_id] - stages
                      LOG.debug('Other non-stage bits: %s', str(non_stage_ids))
                      # TODO do something with the other parts
                      # of a pheno-cv relationship
                  assoc.set_environment(environment_id)
                  # TODO check remove unspecified environments?
                  assoc.add_source(pub_id)
                  assoc.add_association_to_graph()
                  assoc_id = assoc.get_association_id()
                  model.addComment(assoc_id, phenstatement_id)
                  model.addDescription(assoc_id, phenotype_internal_label)
  
                  if not self.test_mode and limit is not None and line_counter > limit:
                      break
  
          return