openworm / owmeta

Unified, simple data access python library for data & facts about C. elegans anatomy
MIT License
152 stars 49 forks source link

Incorporate prolog inference code into a DataTranslator #234

Open slarson opened 9 years ago

slarson commented 9 years ago

Prolog inference code has been created to fill in gaps of unknown neurotransmitters and neuroreceptors for each neuron. Let's turn this into a DataTranslator:

mwatts15 commented 7 years ago

See this file for where this work has been started.

mwatts15 commented 7 years ago

@slarson is it possible we could use N3 for this? What is the advantage of adding this prolog code?

slarson commented 7 years ago

@mwatts15 If we switch to n3 for this; we'll need to port the Prolog script that is there. That particular script was built to do something pretty specific; so it will be a job to itself to port it and guarantee that it works the same. But if someone wants to do it that way, I'm not married to Prolog :)

mwatts15 commented 7 years ago

Yes, my main thought is that adding prolog to PyOpenWorm is going to increase the dependencies and maintenance overhead. If the script could be ported to n3 it would fit into the existing inference step in insert_worm.py. A pure Python translation would be good too.

clbarnes commented 7 years ago

I think problog does everything prolog does and has a python API. In particular, the facts should definitely be generated dynamically from the database so that changes to the connectome and expression data doesn't necessitate anyone touching that 5000 line script...

I'm not volunteering, though, I can't get my head around either of them.

mwatts15 commented 7 years ago

I gave the script a once over. It looks like it could be translated into Python pretty easily, though it would be in an imperative style. I'm less sure about N3, but it would be a pretty direct translation to SPARQL.

mwatts15 commented 7 years ago

I added tasks assuming that the neurons_nt_nr.pl file is the only thing to translate. Based on the paper referenced in that file, which discusses the "Problog" language, the data at the top of the file comes from some probabilistic analysis. Is it desired to perform that kind of analysis rather than the relatively simple calculation performed by the prolog file?

mwatts15 commented 5 years ago

Re-wrote the task to just be about running the script. Porting it to Python is a larger task and my concern about making a Prolog dependency in PyOpenWorm is no-longer a concern since the dependency would only be held by the DataTranslator which itself would only be run as-needed and not on every machine.