Le Tue, Jan 19, 2010 at 08:58:04AM +0100, Andreas Tille a écrit : > On Tue, Jan 19, 2010 at 08:08:19AM +0900, Charles Plessy wrote: > > This is more or less what I meant by ???long??? format (in the sense of > > R???s > > reshape() function). In order to fit this information in a SQL table, I was > > more thinking about: > > > > package title text > > package authors text > > package published-in text > > package year text > > etc. > > Hmmm, I'm not comfortable enough with R's reshape function, but I can > tell that the 'package' stuff you was putting in front of the column > definitions are not SQL conform. I was thinking of the package name > as kind of a primary key.
Are you sure we need a primary key… For instance, to retreive a publication year, I have the impression that the following paraphrasing the python code of blends’ blendstasktools.py would be enough: # Obtain the year of publication of an article describing the software contained in the package: query = """PREPARE query_get_publication_year (text) AS SELECT value FROM biblio WHERE package = $1 AND key = "Reference-Year";""" curs.execute(query) … query = "EXECUTE query_get_publication_year ('%s')" % (self.pkg) curs.execute(query) if curs.rowcount > 0: self.publication_year = curs.fetchone()[0] With a table like: CREATE TABLE "biblio" (package, key, value); INSERT INTO "bib" VALUES('kalign','DOI','10.1093/nar/gkn1006'); INSERT INTO "bib" VALUES('seaview','DOI','10.1093/molbev/msp259'); INSERT INTO "bib" VALUES('ballview','DOI','10.1093/bioinformatics/bti818'); INSERT INTO "bib" VALUES('kalign','PMID','19103665'); INSERT INTO "bib" VALUES('seaview','PMID','19854763'); INSERT INTO "bib" VALUES('ballview','Reference-Year','2006'); INSERT INTO "bib" VALUES('kalign','Reference-Year','2009'); INSERT INTO "bib" VALUES('seaview','Reference-Year','2009'); Note that this is the first time I deal with Python code, so please be indulgent :) Cheers, -- Charles Plessy Debian Med packaging team, http://www.debian.org/devel/debian-med Tsurumi, Kanagawa, Japan -- To UNSUBSCRIBE, email to debian-qa-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org