Skip to content

Commit

Permalink
Added a lot of comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
apdavison committed Aug 7, 2024
1 parent 700da50 commit dc0eca5
Show file tree
Hide file tree
Showing 19 changed files with 406 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ This repository previously contained substantial other material, such as metadat
such as [openMINDS](https://openminds-documentation.readthedocs.io/).

### Acknowledgements
This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements 720270, 785907 and 945539 (Human Brain Project SGA1, SGA2 and SGA3).
This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements 720270, 785907 and 945539 (Human Brain Project SGA1, SGA2 and SGA3), and in EBRAINS 2.0, funded from the EU Horizon Europe programme under grant agreement 101147319.
32 changes: 32 additions & 0 deletions apps/nar-v3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Neural Activity Resource app

Code for the Neural Activity Resource app.

This is an experimental interface for in-depth metadata in the [EBRAINS Knowledge Graph](https://kg.ebrains.eu).
It is not yet intended for public use.

Copyright 2017, Centre National de la Recherche Scientifique and Forschungszentrum Jülich;
Copyright 2018-2024 Centre National de la Recherche Scientifique

Code is licenced under the Apache 2.0 licence.

## Developers' Guide

The main code repository is https://gitlab.ebrains.eu/data-services/neural-activity-resource.

The app is implemented using React Router v6, with Material UI for layout and design.
Data are retrieved from the EBRAINS Knowledge Graph using the [KG Core API](https://docs.kg.ebrains.eu/).

To run a development server, you will need to obtain an EBRAINS IAM authorization token,
paste it into src/main.jsx, then run:

$ npm run dev

### Deployment

The app is deployed to https://nar.apps.tc.humanbrainproject.eu using Kubernetes.
See the "deployment" folder and .gitlab-ci.yml for more details.


## Acknowledgements
This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreement 945539 (Human Brain Project SGA3), and in EBRAINS 2.0, funded from the EU Horizon Europe programme under grant agreement 101147319.
22 changes: 22 additions & 0 deletions apps/nar-v3/src/auth.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/*
This file contains functions for authentication.
It is based on code written by the Collaboratory team at EBRAINS AISBL, formerly at EPFL.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import Keycloak from "keycloak-js";

// We start by configuring the Keycloak javascript client
Expand Down
25 changes: 25 additions & 0 deletions apps/nar-v3/src/components/ControlledTerm.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
/*
The Controlled Term component provides a rich display of information
about a term from the openMINDS controlled terminologies.
At present, it displays the standardised name of the term.
TODO: add links to external resources, such an ontology definitions.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import Tooltip from "@mui/material/Tooltip";

function ControlledTerm(props) {
Expand Down
19 changes: 19 additions & 0 deletions apps/nar-v3/src/components/DatasetList.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
The DatasetList component displays a table with summary information
about datasets, and links to the individual dataset views.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import { Link as RouterLink } from "react-router-dom";
import Table from "@mui/material/Table";
import TableBody from "@mui/material/TableBody";
Expand Down
21 changes: 21 additions & 0 deletions apps/nar-v3/src/components/KeyValueTable.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
The KeyValueTable component represents the content of a dictionary
as a table.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import { isValidElement } from "react";
import { Table, TableBody, TableRow, TableCell } from "@mui/material";

Expand Down
24 changes: 24 additions & 0 deletions apps/nar-v3/src/components/Navigation.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
This file provides several components used in navigating the app:
Navigation - a "breadcrumb" style bar showing where the user is in the app
NavigateNext - a CSS button for moving to the next item in a list
NavigatePrevious - a CSS button for moving to the previous item in a list
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import { Link, Typography, Toolbar, Breadcrumbs } from "@mui/material";
import { Link as RouterLink, useLocation } from "react-router-dom";

Expand Down
21 changes: 21 additions & 0 deletions apps/nar-v3/src/components/PatchClampRecordingCard.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
The PatchClampRecordingCard component displays metadata about recordings
from an individual neuron using the patch clamp technique.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import Link from "@mui/material/Link";

import { uuidFromUri } from "../utility.js";
Expand Down
20 changes: 20 additions & 0 deletions apps/nar-v3/src/components/PatchClampRecordingList.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
The PatchClampRecordinList component displays a list of neurons
whose activity has been recorded using the patch clamp technique.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import { Link as RouterLink } from "react-router-dom";

function uuidFromUri(uri) {
Expand Down
20 changes: 20 additions & 0 deletions apps/nar-v3/src/datastore.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
This file contains functions for retrieving data from the KG Core API of the
EBRAINS Knowledge Graph. It also contains a cache, to reduce the number of requests.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import { kgUrl, kgDefaultStage } from "./globals";
//import examplePatchClampData from "./example_data/example_patch_clamp_dataset.json";

Expand Down
21 changes: 21 additions & 0 deletions apps/nar-v3/src/main.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
This is the main entry point to the Neural Activity Resource app,
which is built with React Router v6, using the data loader pattern.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import React from "react";
import ReactDOM from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
Expand Down
24 changes: 24 additions & 0 deletions apps/nar-v3/src/queries.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
This file contains functions for building queries for the KG Core API
of the EBRAINS Knowledge Graph.
These functions are used in routes/queryLibrary.js to create a library
of pre-defined queries, which are then used by the functions in datastore.js
to retrieve data from the KG.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

function buildKGQuery(baseType, structure) {
return {
"@context": {
Expand Down
20 changes: 20 additions & 0 deletions apps/nar-v3/src/routes/dataset.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
The dataset route displays the metadata for a single dataset.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import React from "react";
import { Await, defer, useLoaderData } from "react-router-dom";

Expand Down
21 changes: 21 additions & 0 deletions apps/nar-v3/src/routes/datasets.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
The datasets route displays a table with summary information
from all suitable "neural activity" datasets in the EBRAINS Knowledge Graph.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import React from "react";
import { Await, defer, useLoaderData } from "react-router-dom";

Expand Down
21 changes: 21 additions & 0 deletions apps/nar-v3/src/routes/home.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
The home route is the entry point to the Neural Activity Resource app.
It has links to different ways of viewing the metadata in the EBRAINS Knowledge Graph.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import React from "react";
import { Await, defer, useLoaderData, Link as RouterLink } from "react-router-dom";

Expand Down
21 changes: 21 additions & 0 deletions apps/nar-v3/src/routes/patchClampRecording.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/*
The "patch clamp recording" route displays metadata about recordings from
single neurons. Each page shows the recordings from one individual neuron.
Copyright 2024 Andrew P. Davison, CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/


import React from "react";
import { Await, defer, useLoaderData } from "react-router-dom";

Expand Down
Loading

0 comments on commit dc0eca5

Please sign in to comment.