Start a new topic

Multiple cellular locations for target where API docs say single value

For target with URI http://www.conceptwiki.org/concept/00059958-a045-4581-9dc5-e5a08bb0c291 the cellularLocation in the 'drugbank' exactMatch block contains an array with 2 values. The API docs state that it should be a single value. Which is correct, the response or the API docs?


Example data: 

https://beta.openphacts.org/1.4/target?uri=http%3A%2F%2Fwww.conceptwiki.org%2Fconcept%2F00059958-a045-4581-9dc5-e5a08bb0c291&app_id=1c22cbe7&app_key=167a3a3d8539b5d85280e7178f4e62ab&_format=json

1 Comment

exactMatch will often match multiple values (as there could be multiple identifier across the datasets Open PHACTS index) - but sometimes it may just be a single value. Unfortunately the JSON returned by the API will vary between these depending on the exact query.  (One could argue that they should always be an array in the JSON for this reason).


For most of the API, the current documentation does not indicate the granularity of the result - for the client it is safest to assume that any nested object could be returned as either an array of values or a single value - this could vary depending on the parameters and how much information exists for that particular compound.

Login or Signup to post a comment