scrook / neuroml-db

database of neuroml models
MIT License
4 stars 7 forks source link

Client side NeuroML-DB #115

Open russelljjarvis opened 5 years ago

russelljjarvis commented 5 years ago

I want to use NeuroML-DB to download some waveforms from a model to do NeuronUnit testing.

I want to do something like querying the DB like in the following but without downloading, and installing the repository locally.

# Get the remaining cell properties
cells = list(Cells\
    .select(Cells,Model_Waveforms.Spikes,Models.Name)\
    .join(Model_Waveforms, on=(Cells.Model_ID == Model_Waveforms.Model_id))\
    .join(Models, on=(Cells.Model_ID == Models.Model_ID))\
    .where((Model_Waveforms.Protocol == "STEADY_STATE") & (Model_Waveforms.Variable_Name == "Voltage"))\
    .order_by(Cells.Model_ID)
    .objects()
)

If I open this web page and follow the json https://neuroml-db.org/api/model?id=NMLCL001129

I can find the field ID after a lot of reading, although it's easy to get lost, as there are a lot of ID's, and finding the right ID requires searching for a landmark ID, like publication, and working your way forwards a bit. I found this waveform using that method: https://neuroml-db.org/api/waveform?id=398144

I wonder if there could be some kind of syntactic sugar for getting a list of all the appropriate waveform IDs, and making the proper json requests inside python?

JustasB commented 5 years ago

If you're using Chrome, this plugin makes it easier to read JSON responses. You might find similar plugins for other browsers.

Then, using the plugin, collapse all other child elements, and just leave the "waveform_list" open:

image

Let me know if that helps.