openphacts / GLOBAL

Global project issues [private for now. owner lee harland]
3 stars 0 forks source link

Explorer: No compound information results when label is missing. #238

Closed danidi closed 9 years ago

danidi commented 9 years ago

It seems that when a label is missing from the Compound Information API call (compare with https://github.com/openphacts/GLOBAL/issues/212), no other information is displayed on the compound information page, even though it is available from the API.

http://explorer2.openphacts.org/compounds?uri=http%3A%2F%2Fwww.conceptwiki.org%2Fconcept%2F58124e75-a5b0-496c-b198-ff4529d9090a

The corresponding API call returns the following:

"primaryTopic": {
 "_about": "http://www.conceptwiki.org/concept/index/58124e75-a5b0-496c-b198-ff4529d9090a",
 "exactMatch": {
  "_about": "http://ops.rsc.org/OPS1415040",
  "inDataset": "http://ops.rsc.org",
  "inchi": "InChI=1S/C17H23NO3.H2O4S.H2O/c1-18-13-7-8-14(18)10-15(9-13)21-17(20)16(11-19)12-5-3-2-4-6-12;1-5(2,3)4;/h2-6,13-16,19H,7-11H2,1H3;(H2,1,2,3,4);1H2",
  "inchikey": "PVGPXGKNDGTPTD-UHFFFAOYSA-N",
  "molformula": "C17H27NO8S",
  "molweight": 405.463,
  "smiles": "CN1C2CCC1CC(C2)OC(=O)C(CO)C3=CC=CC=C3.O.OS(=O)(=O)O"
 },

So at least the properties from ops.rsc could be shown on the Explorer page.

(Raised in http://support.openphacts.org/helpdesk/tickets/93)

ianwdunlop commented 9 years ago

It's because the exactMatch block is a singleton and the code thinks it should be an array. I started fixing this in OPS.js (the library that parses the results) earlier in the week.

ianwdunlop commented 9 years ago

Opened https://github.com/openphacts/ops.js/issues/15 to track the OPS.js fix.

ianwdunlop commented 9 years ago

Opened https://github.com/openphacts/explorer2/issues/7 to track the explorer fix.