Now that we've got the basics out of the way, we can start to build something that actually uses the FFBO system. We will create a pure JavaScript and HTML web page that is aware of the FFBO resources and interacts directly with the NeuroNLP and NeuroArch components.
This is a Work In Progress, see the Simple branch of the Skeleton_Interface.
Prerequisites
Processor Component Installed and Running
NeuroNLP Component Installed and Running
Neuroarch Component Installed and Running
What are we going to build?
A simple neuron viewer from start to finish
Project Direction
In order to complete this project, we will:
Connect to the FFBO project
Convert some Natural Language to the Neuroarch API
Query NeuroArch
Display the result TODO
Getting Started
We will build on the skeleton program, and first contact the NeuroNLP server
First, we need to make sure the FFBO servers are up and running.
We will then build on the skeleton app, which you can get with git with #todo
In this example, we will automatically start the query processing when we receive the server list.
First, we need to understand how to directly address the NLP server. In the server list, we have the keys of the Types of server,(ie nlp,na,nk...). Inside each object, we have a dictionary of servers of that type. Likely we will only have the one, but the FFBO supports multiple servers running for both improved functionality and redundancy.
So in this case, we will first get the first NLP server id, like so:
Then, we will have to write a function to neatly do the conversion for us. Before we do that, we will write the code to call this function, which we will call nlp_query:
We will pass in the server ID that we have found, and also pass along the session object, to enable the external function to access the current FFBO session.
Now, we can start to write the function, outside of the on_connect class:
git clone https://github.com/fruitflybrain/ffbo.skeleton_interface
var server_id = Object.keys(server_list['nlp'])[0]
var query_result = nlp_query(session,server_id);
// define a function to retrieve the neuron
function nlp_query(session,server_id){
var query = "Show L1 neurons in the Lamina"