monarch-initiative / biolink-api

API for linked biological knowledge
https://api.monarchinitiative.org/api/
BSD 3-Clause "New" or "Revised" License
64 stars 25 forks source link

Should /$type/<id> return basic node info, or all associations #168

Open cmungall opened 6 years ago

cmungall commented 6 years ago

API is not consistent at the moment

Option 1

Option 2

cmungall commented 6 years ago

I favor option 1. Lends itself better to asyn calls to populate different parts of page etc

kshefchek commented 6 years ago

for /$type/, it might be useful to return basic node properties and stats on associations, but think all associations should be a different function

deepakunni3 commented 6 years ago

@kshefchek Do you mean something like this:

{  
   "taxon":{  
      "id":"NCBITaxon:9606",
      "label":"Homo sapiens"
   },
   "xrefs":null,
   "description":null,
   "categories":[  
      "gene",
      "sequence feature"
   ],
   "types":null,
   "synonyms":null,
   "deprecated":null,
   "replaced_by":null,
   "consider":null,
   "id":"HGNC:18603",
   "label":"COL25A1".
   "association_stats":{
        "genotype_associations":0,
        "phenotype_associations":10,
        "interaction_associations":0,
        "disease_associations":4,
        "homology_associations":10,
    }
}
kshefchek commented 6 years ago

yes exactly, we may also consider associations over homology (disease, phenotype) as well, but would require more computation. There might be a trade off on performance and comprehensiveness.

deepakunni3 commented 6 years ago

Even if its association stats, the number of queries to SciGraph and/or Solr remains the same. The difference is only in the way the results are parsed and sent back.