monarch-initiative / biolink-api

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

Add inheritance and onset to bioentity/{type}/{id} #241

Closed kshefchek closed 5 years ago

kshefchek commented 5 years ago

Adds inheritance and onset to bioentity/{type}/{id}. Note that I'm switching our default scigraph instance to our data graph and pulling all outgoing edges (this may scale poorly). An alternative would be to allow scigraph neighbors to accept multiple relationship types. I'm also overloading BioObject with these new fields - alternatively, we could create a disease object and dynamically pass api.models into marshal_with based on the type param.

deepakunni3 commented 5 years ago

I like the idea of dynamically passing api.models into marshal_with based on type. We can probably have that as part of another PR.

kshefchek commented 5 years ago

How does this look? https://github.com/biolink/biolink-api/pull/243/commits/a3294aecda368515fb82a02523a00748eac14893

deepakunni3 commented 5 years ago

Yes, that looks great. For a second there I thought the switch should apply to other types too, but then realized that bio_object pretty much applies to all the remaining types. 👍