AnatomicMaps / map-knowledge

Flatmap SCKAN knowledge store
Apache License 2.0
0 stars 5 forks source link

make sure to retrieve neuron connectivity from NPO #9

Closed napakalas closed 1 year ago

napakalas commented 1 year ago

Mapknowledge 0.16.1 cannot retrive neuron type knowledge from NPO. The current call to example/npo.py returns:

    ...
    ilxtr:sparc-nlp/mmset1/3a:
    WARNING:root:Couldn't access https://scicrunch.org/api/1/sckan-scigraph/dynamic/demos/apinat/neru-7/ilxtr:sparc-nlp/mmset1/3a.json: Not Found
    WARNING:root:Unknown anatomical entity: ilxtr:sparc-nlp/mmset1/3a
    {'label': 'ilxtr:sparc-nlp/mmset1/3a'}
    ...

This is due to, connectivity_models() in NpoSparql just returns a list of models such as ilxtr:NeuronAacar and ilxtr:NeuronKblad.

Therefore

    npo_models = self.__npo_db.connectivity_models()
    self.__npo_entities = list(npo_models.keys())

at https://github.com/AnatomicMaps/map-knowledge/blob/be8ab3ae4cf315414d08bdb8214674e38ca05c3f/mapknowledge/__init__.py#L236C16-L236C17) is not loading all available neuron connectivities in NPO.

In this pull request, connectivity_models() in NpoSparql is modified.

dbrnz commented 1 year ago

This PR has broken things in mapmaker, which assumes that connectivity_models() returns just that -- a list of model URI such as ilxtr:NeuronAacar and ilxtr:NeuronKblad. Instead it is now returning a list of neuron path URIs (such as ilxtr:neuron-type-aacar-1.

What about revertinf connectivity_models() to how it was and add a new method, connectivity_paths(), to return neuron path URIs? ilxtr:sparc-nlp/mmset1/3a is a path URI so wouldn't be in the list of model URIs.

napakalas commented 1 year ago

I agree with you, creating connectivity_paths() method is a better solution. As you said, connectivity_models() should be consistent to the one using scicrunch. I'll create the function.