This commit is contained in:
sneakers-the-rat 2023-08-11 19:52:35 -07:00
parent 26242054e8
commit a69388ffb5
6 changed files with 4177 additions and 0 deletions

2
.gitignore vendored
View file

@ -158,3 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear # and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder. # option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/ #.idea/
nwb.schema.json

View file

@ -1,2 +1,23 @@
# translate-nwb # translate-nwb
Translating NWB schema language to linkml Translating NWB schema language to linkml
The [nwb specification language](https://schema-language.readthedocs.io/en/latest/description.html)
has several components
- Namespaces: subcollections of specifications
- Groups:
We want to translate the schema to LinkML so that we can export to other schema formats,
generate code for dealing with the data, and ultimately make it interoperable
with other formats.
To do that, we need to map:
- Namespaces: seem to operate like separate schema? Then within a namespace the
rest are top-level objects
- Inheritance: NWB has an odd inheritance system, where the same syntax is used for
inheritance, mixins, type declaration, and inclusion.
- `neurodata_type_inc` -> `is_a`
- Groups:
- Slots: Lots of properties are reused in the nwb spec, and LinkML lets us separate these out as slots
- dims, shape, and dtypes: these should have been just attributes rather than put in the spec
language, so we'll just make an Array class and use that.

4131
poetry.lock generated Normal file

File diff suppressed because it is too large Load diff

19
pyproject.toml Normal file
View file

@ -0,0 +1,19 @@
[tool.poetry]
name = "translate-nwb"
version = "0.1.0"
description = "Translating NWB schema language to LinkML"
authors = ["sneakers-the-rat <JLSaunders987@gmail.com>"]
license = "GPL-3.0"
readme = "README.md"
packages = [{include = "translate_nwb"}]
[tool.poetry.dependencies]
python = "^3.9"
schema-automator = "^0.3.0"
pydantic = "<2.0"
pyyaml = "^6.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

View file

View file

@ -0,0 +1,4 @@
NWB_SCHEMA_REPO = "https://github.com/NeurodataWithoutBorders/nwb-schema/"
JSON_SCHEMA = "nwb.schema.json"
SCHEMA_DIR = 'core/'
ROOT_NAMESPACE = 'core/nwb.namespace.yaml'