Skip to content

Commit

Permalink
Add synaptome properties, examples and tests (#5119)
Browse files Browse the repository at this point in the history
* Add synaptome properties, examples and tests

* fix name pf synaptomeSimulation in test

* little query typo

* fix memodel id

* fix id of synaptome in test

* fix other typos and a wrong id in query

* remove undeleted items from copy-pasting in test
  • Loading branch information
crisely09 authored Aug 23, 2024
1 parent d0ac5ee commit e41b0d5
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 10 deletions.
66 changes: 57 additions & 9 deletions tests/docker/config/construct-query.sparql
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,23 @@ CONSTRUCT {


# Object of study
?alias :objectOfStudy ?objectOfStudyId .
?alias :objectOfStudy ?objectOfStudyId .
?objectOfStudyId :identifier ?objectOfStudyId ;
:label ?objectOfStudyLabel .
# Properties specific to types

# MEModels and Synaptome
?alias :seed ?seed .

# Single cell simulations
?alias :injectionLocation ?injectionLocation ;
:recordingLocation ?recordingLocation .

## Bouton density
?alias :boutonDensity ?boutonDensityBN .
?boutonDensityBN :value ?boutonDensityValue ;
:unit ?boutonDensityUnit ;
:label ?boutonDensityLabel .
?alias :boutonDensity ?boutonDensityBN .
?boutonDensityBN :value ?boutonDensityValue ;
:unit ?boutonDensityUnit ;
:label ?boutonDensityLabel .

## Circuit
?alias :circuitType ?circuitType ;
Expand Down Expand Up @@ -237,6 +244,19 @@ CONSTRUCT {
?singleNeuronSimulation :recordingLocation ?recordingLocation .
?singleNeuronSimulation :emodel ?singleNeuronSimulationEmodelId .
?singleNeuronSimulationEmodelId :name ?singleNeuronSimulationEmodelName .
## SingleNeuronSynaptome
?alias :singleNeuronSynaptome ?singleNeuronSynaptome .
?singleNeuronSynaptome :seed ?seed .
?singleNeuronSynaptome :memodel ?singleNeuronSynaptomeMEModelId .
?singleNeuronSynaptomeMEModelId :name ?singleNeuronSynaptomeMEModelName .

## SynaptomeSimulation
?alias :synaptomeSimulation ?synaptomeSimulation .
?synaptomeSimulation :injectionLocation ?injectionLocation .
?synaptomeSimulation :recordingLocation ?recordingLocation .
?synaptomeSimulation :synaptome ?synaptomeId .
?synaptomeId :name ?synaptomeName .

} WHERE {
VALUES ?id { {resource_id} } .
BIND( IRI(concat(str(?id), '/', 'alias')) AS ?alias ) .
Expand Down Expand Up @@ -537,6 +557,13 @@ CONSTRUCT {
) .
} .

# MEModels and Synaptome
OPTIONAL { ?id bmo:seed ?seed . } .

# Simulations
OPTIONAL { ?id bmo:injectionLocation ?injectionLocation . } .
OPTIONAL { ?id nsg:recordingLocation ?recordingLocation . } .

# Bouton density
OPTIONAL {
?id a nsg:BoutonDensity ;
Expand Down Expand Up @@ -788,18 +815,39 @@ CONSTRUCT {
OPTIONAL { ?id bmo:validated ?memodelValidated . } .
}

# SingleNeuronSimulation
# SingleNeuronSimulation
OPTIONAL {
?id a bmo:SingleNeuronSimulation .

BIND(BNODE(CONCAT(STR(?id), '/singleNeuronSimulation')) as ?singleNeuronSimulation ) .

OPTIONAL { ?id bmo:injectionLocation ?injectionLocation . } .
OPTIONAL { ?id nsg:recordingLocation ?recordingLocation . } .

OPTIONAL {
?id prov:used ?singleNeuronSimulationEmodelId .
?singleNeuronSimulationEmodelId schema:name ?singleNeuronSimulationEmodelName .
} .
}

# SingleNeuronSynaptome
OPTIONAL {
?id a bmo:SingleNeuronSynaptome .

BIND(BNODE(CONCAT(STR(?id), '/singleNeuronSynaptome')) as ?singleNeuronSynaptome ) .

OPTIONAL {
?id prov:used ?singleNeuronSynaptomeMEModelId .
?singleNeuronSynaptomeMEModelId schema:name ?singleNeuronSynaptomeMEModelName .
} .
}

# SynaptomeSimulation
OPTIONAL {
?id a bmo:SynaptomeSimulation .

BIND(BNODE(CONCAT(STR(?id), '/synaptomeSimulation')) as ?synaptomeSimulation ) .

OPTIONAL {
?id prov:used ?synaptomeId .
?synaptomeId schema:name ?synaptomeName .
} .
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"@context": "https://bbp.neuroshapes.org",
"@type": "SingleNeuronSynaptome",
"@id": "https://bbp.epfl.ch/data/synapse/single-neuron-synaptome",
"brainLocation": {
"@type": "BrainLocation",
"brainRegion": {
"@id": "mba:322",
"label": "Primary somatosensory area"
},
"layer": {
"@id": "uberon:0005394",
"label": "layer 5"
}
},
"description": "desc",
"distribution": [
{
"@type": "DataDownload",
"contentSize": {
"unitCode": "bytes",
"value": 837
},
"contentUrl": "https://openbluebrain.com/api/nexus/v1/files/7fa6efce-8809-407f-b4a2-ff8b67e24c59/e582af75-0778-4970-b5a7-1b5bfa30448c/https:%2F%2Fopenbluebrain.com%2Fdata%2F7fa6efce-8809-407f-b4a2-ff8b67e24c59%2Fe582af75-0778-4970-b5a7-1b5bfa30448c%2F1fb96ceb-315a-4e40-ab06-3f689aaf824c",
"digest": {
"algorithm": "SHA-256",
"value": "2420a0025da673991ada98fe6f12bd74d51d77aa4720ea1d1f869f49a582a030"
},
"encodingFormat": "application/json",
"name": "synaptome_config.json"
}
],
"name": "synaptome-model-04",
"objectOfStudy": {
"@id": "http://bbp.epfl.ch/neurosciencegraph/taxonomies/objectsofstudy/singlecells",
"@type": "nsg:ObjectOfStudy",
"label": "Single Cell"
},
"seed": 100,
"used": {
"@id": "https://bbp.epfl.ch/data/memodel",
"@type": [
"Entity",
"MEModel"
]
}
}
48 changes: 48 additions & 0 deletions tests/src/test/resources/kg/search/data/synaptome-simulation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"@context": "https://bbp.neuroshapes.org",
"@id": "https://bbp.epfl.ch/data/synapse/synaptome-simulation",
"@type": [
"Entity",
"SynaptomeSimulation"
],
"brainLocation": {
"@type": "BrainLocation",
"brainRegion": {
"@id": "mba:322",
"label": "Primary somatosensory area"
},
"layer": {
"@id": "uberon:0005394",
"label": "layer 5"
}
},
"description": "sim",
"distribution": [
{
"@type": "DataDownload",
"contentSize": {
"unitCode": "bytes",
"value": 15776294
},
"contentUrl": "https://openbluebrain.com/api/nexus/v1/files/7fa6efce-8809-407f-b4a2-ff8b67e24c59/e582af75-0778-4970-b5a7-1b5bfa30448c/https%3A%2F%2Fopenbluebrain.com%2Fdata%2F7fa6efce-8809-407f-b4a2-ff8b67e24c59%2Fe582af75-0778-4970-b5a7-1b5bfa30448c%2F9af6a672-aa28-4caa-9c20-9e09410e5800?rev=1",
"digest": {
"algorithm": "SHA-256",
"value": "09a2e5708c7f053b1f36584c5555920e5def11b0753f87cc7690445e36bafd79"
},
"encodingFormat": "application/json",
"name": "simulation-config-synaptome.json"
}
],
"injectionLocation": "soma[0]",
"name": "synatome-sim-05",
"recordingLocation": [
"soma[0]_0.5",
"dend[38]_0.5",
"dend[1]_0.4",
"apic[53]_0.3"
],
"used": {
"@id": "https://bbp.epfl.ch/data/synapse/single-neuron-synaptome",
"@type": "SingleNeuronSynaptome"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class SearchConfigIndexingSpec extends BaseIntegrationSpec {
private val memodelId = "https://bbp.epfl.ch/data/memodel"
private val analysisSuitablememodelId = "https://bbp.epfl.ch/data/analysis-suitable-memodel"
private val singleNeuronSimulationId = "https://bbp.epfl.ch/data/synapse/single-neuron-simulation"
private val singleNeuronSynaptomeId = "https://bbp.epfl.ch/data/synapse/single-neuron-synaptome"
private val synaptomeSimulationId = "https://bbp.epfl.ch/data/synapse/synaptome-simulation"

// the resources that should appear in the search index
private val mainResources = List(
Expand Down Expand Up @@ -67,7 +69,9 @@ class SearchConfigIndexingSpec extends BaseIntegrationSpec {
"simulations/simulation-campaign.json",
"simulations/simulation.json",
"simulations/analysis-report-simulation.json",
"single-neuron-simulation.json"
"single-neuron-simulation.json",
"single-neuron-synaptome.json",
"synaptome-simulation.json"
)
private val otherResources = List(
"article.json",
Expand Down Expand Up @@ -1121,6 +1125,35 @@ class SearchConfigIndexingSpec extends BaseIntegrationSpec {
}
}

"have the correct single neuron synaptome information" in {
val expected =
json"""{
"singleNeuronSynaptome": {
"seed": 100,
"memodel": { "@id" : "https://bbp.epfl.ch/data/memodel", "name" : "me-model with status"}
}
}"""

assertOneSource(queryField(singleNeuronSynaptomeId, "singleNeuronSynaptome")) { json =>
json should equalIgnoreArrayOrder(expected)
}
}

"have the correct synaptome simulation information" in {
val expected =
json"""{
"synaptomeSimulation": {
"injectionLocation": "soma[0]",
"recordingLocation": ["soma[0]_0.5", "dend[38]_0.5", "dend[1]_0.4", "apic[53]_0.3"],
"synaptome": { "@id" : "https://bbp.epfl.ch/data/synapse/single-neuron-synaptome", "name" : "synaptome-model-04"}
}
}"""

assertOneSource(queryField(synaptomeSimulationId, "synaptomeSimulation")) { json =>
json should equalIgnoreArrayOrder(expected)
}
}

"full text search" should {
def fullTextQuery(q: String): Json =
json"""
Expand Down

0 comments on commit e41b0d5

Please sign in to comment.