Closed dustine32 closed 3 years ago
This is great!
I was initially thinking we could even just use the original line you linked of mine with the list comprehension, but using tuple
explicitly and and ensuring we only split once are great improvements.
Turning into a string again will also still be super easy. The only thing that has to change in GoAssociation is the type signature I think?
For this GPAD 2.0 line:
Where annotation properties column (col 12) contains two
contributor-id
key-value pairs:Parsers, writers, and the
GoAssociation
model should support both of thesecontributor-id
values. But currently we just construct a dictionary by iterating through the properties, overwriting any previously encountered keys (e.g.contributor-id
,comment
): https://github.com/biolink/ontobio/blob/de97ea7a59ff3d7d3305e941742b5790b264c25f/ontobio/io/gpadparser.py#L462 This is kind of like:As @dougli1sqrd suggested, we could switch this dictionary to just be a list of key-value tuples, similar to a few lines before this: https://github.com/biolink/ontobio/blob/de97ea7a59ff3d7d3305e941742b5790b264c25f/ontobio/io/gpadparser.py#L446 But now like:
And this would retain the multiple
contributer-id
data:Of course, any code that uses annotation properties (e.g. GPAD writers, gocamgen) will have to adjust to the new DS.