Adversarial review of #260. Latent, not live — filed so it is on the record.
q = f"(gene_exact:{symbol}) AND (taxonomy_id:{taxon_id}) AND (reviewed:true)"
The symbol goes into the query string unescaped and unvalidated. urlencode
escapes it for the URL, but not for UniProt's query syntax: a symbol
containing :, (, ), " or a space produces a malformed query and an HTTP
400.
Since the #263 fix, a 4xx is raised immediately rather than retried — correct in
itself, but it means one odd symbol aborts the entire corpus run at whatever
record it reaches, after writing some records and not others.
Not currently reachable: every gene_symbols value in the corpus matches
[A-Za-z0-9_-]+ (checked across all 53 records, all components). It becomes
reachable the first time someone curates a symbol like atpB/E.
Fix: validate the symbol against that character class before querying and report
it as a decline, the way every other shortfall in this adapter is reported.
Adversarial review of #260. Latent, not live — filed so it is on the record.
The symbol goes into the query string unescaped and unvalidated.
urlencodeescapes it for the URL, but not for UniProt's query syntax: a symbol
containing
:,(,),"or a space produces a malformed query and an HTTP400.
Since the #263 fix, a 4xx is raised immediately rather than retried — correct in
itself, but it means one odd symbol aborts the entire corpus run at whatever
record it reaches, after writing some records and not others.
Not currently reachable: every
gene_symbolsvalue in the corpus matches[A-Za-z0-9_-]+(checked across all 53 records, all components). It becomesreachable the first time someone curates a symbol like
atpB/E.Fix: validate the symbol against that character class before querying and report
it as a decline, the way every other shortfall in this adapter is reported.