VirtualFlyBrain / vfb-pipeline-dumps

Pipeline that creates dumps from the triplestore for consumption by the downstream services
Apache License 2.0
0 stars 0 forks source link

New ReasondConstruct SPARQL tag #49

Open dosumis opened 1 year ago

dosumis commented 1 year ago

has_neuron/region_connectivity

Currently added via Neo4J query:

https://github.com/VirtualFlyBrain/vfb-pipeline-polishing/blob/main/finalStep.py#L9

    MATCH p=(a:Neuron)-[r:synapsed_to]->(b:Neuron) WHERE exists(r.weight) SET a:has_neuron_connectivity SET b:has_neuron_connectivity,
    MATCH (n:Neuron)-[r:has_presynaptic_terminals_in]->(c:Synaptic_neuropil) SET n:has_region_connectivity,
    MATCH (n:Neuron)-[r:has_postsynaptic_terminal_in]->(c:Synaptic_neuropil) SET n:has_region_connectivity
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

CONSTRUCT {
    ?x <http://n2o.neo/property/nodeLabel> "has_neuron_connectivity" .
}
WHERE {
  ?y synapsed_to: ?x . 
  ?y  rdfs:type owl:NamedIndividual .
  ?x  rdfs:type owl:NamedIndividual
}
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>

CONSTRUCT {
    ?x <http://n2o.neo/property/nodeLabel> "has_neuron_connectivity" .
}
WHERE {
  ?y has_presynaptic_terminals_in: ?x . 
  ?y  rdfs:type owl:NamedIndividual
}

has_postsynaptic_terminal_in follows same pattern as has_presynaptic_terminals_in

dosumis commented 1 year ago

Depends on #48

dosumis commented 1 year ago

Once this is implemented, the Neo4j Code should be removed from here