qiita icon indicating copy to clipboard operation
qiita copied to clipboard

example for publication

Open sjanssen2 opened this issue 1 year ago • 5 comments
trafficstars

I am struggling with coming up with the correct syntax to encode a "publication" in the configuration file for a plugin. I unfortunately couldn't find an example in the plugin configs. Could you give an example here in the code? https://github.com/qiita-spots/qiita/blob/58e15a470919b1183c6caf5af5f36f990f37f9ce/qiita_db/software.py#L1185-L1191

sjanssen2 avatar Feb 15 '24 17:02 sjanssen2

invalid PUBLICATIONS = [("doi", "pid"]) valid PUBLICATIONS = [["doi", "pid"]] i.e. the term "tuple" / the parenthesis were confusing me

sjanssen2 avatar Feb 15 '24 17:02 sjanssen2

The "publications" string seems to be read as json: https://github.com/qiita-spots/qiita/blob/57d1b146729223da9daa286a1cc75db6f2923746/qiita_db/software.py#L883-L884

sjanssen2 avatar Feb 23 '24 07:02 sjanssen2

This is a good question cause I haven't use it in a really long time. Note that this is the publication of a software and not the publication of a study; two different objects/uses. Anyway, looking at the code I think the expectation is to have a list of two-element tuples: [(doi, pubmed-id), ...]. Hope this helps.

antgonza avatar Feb 23 '24 22:02 antgonza

@sjanssen2, how should we solve this issue? Maybe another way to ask this is, how should we improve the information on how to add publications? Thank you.

antgonza avatar Apr 23 '24 17:04 antgonza

From the code, I agree, one would expect [(doi, pubmed-id), ...]. The correct syntax in the config file however is e.g. PUBLICATIONS = [["10.1093/nar/gkad527", "37326027"]] i.e. list of lists, not list of tuples! Unfortunately, there are no plugins with defined publications, i.e. no examples available. Not sure what the best place for documenting this is?! Maybe extend https://github.com/qiita-spots/qiita/blob/57d1b146729223da9daa286a1cc75db6f2923746/qiita_db/software.py#L1006-L1008 Note that correct syntax for publications in plugin configuration files is [[str, str]], not [(str, str)], for example [["10.1093/nar/gkad527", "37326027"]]

sjanssen2 avatar Apr 24 '24 08:04 sjanssen2