make linkml cookiecutter

This commit is contained in:
sneakers-the-rat 2023-08-16 16:07:36 -07:00
parent cee4f3146b
commit 5c69c48f35
39 changed files with 5715 additions and 0 deletions

View file

@ -0,0 +1,27 @@
{
"template": "https://github.com/linkml/linkml-project-cookiecutter",
"commit": "ef7ff16925321a2abdbaa5a2ba5db8aa83ebf24f",
"checkout": null,
"context": {
"cookiecutter": {
"project_name": "nwb-schema-language",
"__project_slug": "nwb_schema_language",
"github_org": "p2p_ld",
"__source_path": "src/nwb_schema_language/schema/nwb_schema_language.yaml",
"project_description": "Translation of the nwb-schema-language to LinkML",
"full_name": "Jonny Saunders",
"email": "j@nny.fyi",
"__author": "Jonny Saunders <j@nny.fyi>",
"license": "GNU GPL v3.0",
"main_schema_class": "Namespaces",
"create_python_classes": "Yes",
"use_schemasheets": "No",
"google_sheet_id": "1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ",
"google_sheet_tabs": "personinfo enums",
"__google_sheet_module": "personinfo_enums",
"github_token_for_pypi_deployment": "PYPI_PASSWORD",
"_template": "https://github.com/linkml/linkml-project-cookiecutter"
}
},
"directory": null
}

View file

@ -0,0 +1,35 @@
---
name: Auto-deployment of nwb_schema_language Documentation
on:
push:
branches: [main]
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Poetry.
uses: snok/install-poetry@v1.3
- name: Install dependencies.
run: poetry install -E docs
- name: Build documentation.
run: |
mkdir -p docs
touch docs/.nojekyll
make gendoc
([ ! -f docs/about.md ] && cp src/docs/about.md docs/) || true
make mkd-gh-deploy
...

View file

@ -0,0 +1,37 @@
# Built from:
# https://docs.github.com/en/actions/guides/building-and-testing-python
# https://github.com/snok/install-poetry#workflows-and-tips
---
name: Build and test nwb_schema_language
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1.3
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Run test suite
run: make test

View file

@ -0,0 +1,40 @@
---
name: Publish Python Package
on:
release:
types: [created]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Poetry
run: |
pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
# uses: snok/install-poetry@v1.1.6
# with:
# virtualenvs-create: true
# virtualenvs-in-project: true
# - name: Install dependencies
# run: poetry install --no-interaction
- name: Build source and wheel archives
run: poetry build
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@v1.2.2
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}

133
nwb-schema-linkml/.gitignore vendored Normal file
View file

@ -0,0 +1,133 @@
/docs/
/project/docs/
/tmp/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/

View file

@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age,
body size, disability, ethnicity, gender identity and expression, level of
experience, nationality, personal appearance, race, religion, or sexual
identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an
appointed representative at an online or offline event. Representation of a
project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by [contacting the project team](contact.md). All complaints will be
reviewed and investigated and will result in a response that is deemed
necessary and appropriate to the circumstances. The project team is obligated
to maintain confidentiality with regard to the reporter of an incident. Further
details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This code of conduct has been derived from the excellent code of conduct of the
[ATOM project](https://github.com/atom/atom/blob/master/CODE_OF_CONDUCT.md)
which in turn is adapted from the [Contributor Covenant][homepage], version
1.4, available at [https://contributor-covenant.org/version/1/4][version]
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/

View file

@ -0,0 +1,73 @@
# Contributing to nwb-schema-language
:+1: First of all: Thank you for taking the time to contribute!
The following is a set of guidelines for contributing to
nwb-schema-language. These guidelines are not strict rules.
Use your best judgment, and feel free to propose changes to this document
in a pull request.
## Table Of Contents
* [Code of Conduct](#code-of-conduct)
* [Guidelines for Contributions and Requests](#contributions)
* [Reporting problems with the data model](#reporting-bugs)
* [Requesting new terms](#requesting-terms)
* [Adding new terms yourself](#adding-terms)
* [Best Practices](#best-practices)
* [How to write a great issue](#great-issues)
* [How to create a great pull/merge request](#great-pulls)
<a id="code-of-conduct"></a>
## Code of Conduct
The nwb-schema-language team strives to create a
welcoming environment for editors, users and other contributors.
Please carefully read our [Code of Conduct](CODE_OF_CONDUCT.md).
<a id="contributions"></a>
## Guidelines for Contributions and Requests
<a id="reporting-bugs"></a>
### Reporting problems with the data model
Please use our [Issue Tracker][issues] to report problems with the ontology.
<a id="requesting-terms"></a>
### Requesting new terms
Please use our [Issue Tracker][issues] to request a new term for the ontology.
<a id="adding-terms"></a>
### Adding new terms yourself
Please submit a [Pull Request][pulls] to submit a new term for consideration.
<a id="best-practices"></a>
## Best Practices
<a id="great-issues"></a>
### How to write a great issue
Please review GitHub's overview article,
["Tracking Your Work with Issues"][about-issues].
<a id="great-pulls"></a>
### How to create a great pull/merge request
Please review GitHub's article, ["About Pull Requests"][about-pulls],
and make your changes on a [new branch][about-branches].
[about-branches]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches
[about-issues]: https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues
[about-pulls]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests
[issues]: https://github.com/p2p_ld/nwb-schema-language/issues/
[pulls]: https://github.com/p2p_ld/nwb-schema-language/pulls/

675
nwb-schema-linkml/LICENSE Normal file
View file

@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

190
nwb-schema-linkml/Makefile Normal file
View file

@ -0,0 +1,190 @@
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := help
.DELETE_ON_ERROR:
.SUFFIXES:
.SECONDARY:
RUN = poetry run
# get values from about.yaml file
SCHEMA_NAME = $(shell ${SHELL} ./utils/get-value.sh name)
SOURCE_SCHEMA_PATH = $(shell ${SHELL} ./utils/get-value.sh source_schema_path)
SOURCE_SCHEMA_DIR = $(dir $(SOURCE_SCHEMA_PATH))
SRC = src
DEST = project
PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel
DOCDIR = docs
EXAMPLEDIR = examples
SHEET_MODULE = personinfo_enums
SHEET_ID = $(shell ${SHELL} ./utils/get-value.sh google_sheet_id)
SHEET_TABS = $(shell ${SHELL} ./utils/get-value.sh google_sheet_tabs)
SHEET_MODULE_PATH = $(SOURCE_SCHEMA_DIR)/$(SHEET_MODULE).yaml
# environment variables
include config.env
GEN_PARGS =
ifdef LINKML_GENERATORS_PROJECT_ARGS
GEN_PARGS = ${LINKML_GENERATORS_PROJECT_ARGS}
endif
GEN_DARGS =
ifdef LINKML_GENERATORS_MARKDOWN_ARGS
GEN_DARGS = ${LINKML_GENERATORS_MARKDOWN_ARGS}
endif
# basename of a YAML file in model/
.PHONY: all clean
# note: "help" MUST be the first target in the file,
# when the user types "make" they should get help info
help: status
@echo ""
@echo "make setup -- initial setup (run this first)"
@echo "make site -- makes site locally"
@echo "make install -- install dependencies"
@echo "make test -- runs tests"
@echo "make lint -- perform linting"
@echo "make testdoc -- builds docs and runs local test server"
@echo "make deploy -- deploys site"
@echo "make update -- updates linkml version"
@echo "make help -- show this help"
@echo ""
status: check-config
@echo "Project: $(SCHEMA_NAME)"
@echo "Source: $(SOURCE_SCHEMA_PATH)"
# generate products and add everything to github
setup: install gen-project gen-examples gendoc git-init-add
# install any dependencies required for building
install:
git init
poetry install
.PHONY: install
# ---
# Project Synchronization
# ---
#
# check we are up to date
check: cruft-check
cruft-check:
cruft check
cruft-diff:
cruft diff
update: update-template update-linkml
update-template:
cruft update
# todo: consider pinning to template
update-linkml:
poetry add -D linkml@latest
# EXPERIMENTAL
create-data-harmonizer:
npm init data-harmonizer $(SOURCE_SCHEMA_PATH)
all: site
site: gen-project gendoc
%.yaml: gen-project
deploy: all mkd-gh-deploy
compile-sheets:
$(RUN) sheets2linkml --gsheet-id $(SHEET_ID) $(SHEET_TABS) > $(SHEET_MODULE_PATH).tmp && mv $(SHEET_MODULE_PATH).tmp $(SHEET_MODULE_PATH)
# In future this will be done by conversion
gen-examples:
cp src/data/examples/* $(EXAMPLEDIR)
# generates all project files
gen-project: $(PYMODEL)
$(RUN) gen-project ${GEN_PARGS} -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL)
test: test-schema test-python test-examples
test-schema:
$(RUN) gen-project ${GEN_PARGS} -d tmp $(SOURCE_SCHEMA_PATH)
test-python:
$(RUN) python -m unittest discover
lint:
$(RUN) linkml-lint $(SOURCE_SCHEMA_PATH)
check-config:
@(grep my-datamodel about.yaml > /dev/null && printf "\n**Project not configured**:\n\n - Remember to edit 'about.yaml'\n\n" || exit 0)
convert-examples-to-%:
$(patsubst %, $(RUN) linkml-convert % -s $(SOURCE_SCHEMA_PATH) -C Person, $(shell ${SHELL} find src/data/examples -name "*.yaml"))
examples/%.yaml: src/data/examples/%.yaml
$(RUN) linkml-convert -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@
examples/%.json: src/data/examples/%.yaml
$(RUN) linkml-convert -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@
examples/%.ttl: src/data/examples/%.yaml
$(RUN) linkml-convert -P EXAMPLE=http://example.org/ -s $(SOURCE_SCHEMA_PATH) -C Person $< -o $@
test-examples: examples/output
examples/output: src/nwb_schema_language/schema/nwb_schema_language.yaml
mkdir -p $@
$(RUN) linkml-run-examples \
--output-formats json \
--output-formats yaml \
--counter-example-input-directory src/data/examples/invalid \
--input-directory src/data/examples/valid \
--output-directory $@ \
--schema $< > $@/README.md
# Test documentation locally
serve: mkd-serve
# Python datamodel
$(PYMODEL):
mkdir -p $@
$(DOCDIR):
mkdir -p $@
gendoc: $(DOCDIR)
cp $(SRC)/docs/*md $(DOCDIR) ; \
$(RUN) gen-doc ${GEN_DARGS} -d $(DOCDIR) $(SOURCE_SCHEMA_PATH)
testdoc: gendoc serve
MKDOCS = $(RUN) mkdocs
mkd-%:
$(MKDOCS) $*
PROJECT_FOLDERS = sqlschema shex shacl protobuf prefixmap owl jsonschema jsonld graphql excel
git-init-add: git-init git-add git-commit git-status
git-init:
git init
git-add: .cruft.json
git add .gitignore .github .cruft.json Makefile LICENSE *.md examples utils about.yaml mkdocs.yml poetry.lock project.Makefile pyproject.toml src/nwb_schema_language/schema/*yaml src/*/datamodel/*py src/data src/docs tests src/*/_version.py
git add $(patsubst %, project/%, $(PROJECT_FOLDERS))
git-commit:
git commit -m 'chore: initial commit' -a
git-status:
git status
# only necessary if setting up via cookiecutter
.cruft.json:
echo "creating a stub for .cruft.json. IMPORTANT: setup via cruft not cookiecutter recommended!" ; \
touch $@
clean:
rm -rf $(DEST)
rm -rf tmp
rm -fr docs/*
rm -fr $(PYMODEL)/*
include project.Makefile

View file

@ -0,0 +1,33 @@
# nwb-schema-language
Translation of the nwb-schema-language to LinkML
## Website
[https://p2p_ld.github.io/nwb-schema-language](https://p2p_ld.github.io/nwb-schema-language)
## Repository Structure
* [examples/](examples/) - example data
* [project/](project/) - project files (do not edit these)
* [src/](src/) - source files (edit these)
* [nwb_schema_language](src/nwb_schema_language)
* [schema](src/nwb_schema_language/schema) -- LinkML schema
(edit this)
* [datamodel](src/nwb_schema_language/datamodel) -- generated
Python datamodel
* [tests/](tests/) - Python tests
## Developer Documentation
<details>
Use the `make` command to generate project artefacts:
* `make all`: make everything
* `make deploy`: deploys site
</details>
## Credits
This project was made with
[linkml-project-cookiecutter](https://github.com/linkml/linkml-project-cookiecutter).

View file

@ -0,0 +1,7 @@
---
name: nwb_schema_language
author: Jonny Saunders <j@nny.fyi>
description: Translation of the nwb-schema-language to LinkML
source_schema_path: src/nwb_schema_language/schema/nwb_schema_language.yaml
google_sheet_id: 1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ
google_sheet_tabs: personinfo enums

View file

@ -0,0 +1,8 @@
LINKML_GENERATORS_PROJECT_ARGS=--config-file config.yaml --exclude owl --exclude shacl
### Extra layer of configuration for Makefile beyond
### what 'gen-project --config-file config.yaml' provides.
### Uncomment and set environment variables as needed.
# LINKML_GENERATORS_MARKDOWN_ARGS=--no-mergeimports

View file

@ -0,0 +1,41 @@
# Configuration of generators (defaults illustrated)
---
generator_args:
excel:
mergeimports: true
owl:
mergeimports: true
metaclasses: true
type_objects: true
# throws 'Cannot handle metadata profile: rdfs'
# metadata_profile: rdfs
markdown:
mergeimports: true
graphql:
mergeimports: true
java:
mergeimports: true
metadata: true
jsonld:
mergeimports: true
jsonschema:
mergeimports: true
jsonldcontext:
mergeimports: true
python:
mergeimports: true
prefixmap:
mergeimports: true
proto:
mergeimports: true
shacl:
mergeimports: true
shex:
mergeimports: true
sqlddl:
mergeimports: true
typescript:
mergeimports: true
metadata: true
...

View file

@ -0,0 +1,7 @@
# Example data object
---
entries:
- id: example:Namespaces001
name: foo bar
primary_email: foo.bar@example.com
age_in_years: 33

View file

@ -0,0 +1,5 @@
# Examples of use of nwb_schema_language
This folder contains example data conforming to nwb_schema_language
The source for these is in [src/data](../src/data/examples)

View file

@ -0,0 +1,25 @@
---
site_name: "nwb-schema-language"
theme:
name: material
# palette:
# scheme: slate
# primary: cyan
features:
- content.tabs.link
plugins:
- search
- mermaid2
nav:
# - Home: home.md
- Index: index.md
- About: about.md
site_url: https://p2p_ld.github.io/nwb-schema-language
repo_url: https://github.com/p2p_ld/nwb-schema-language
# Uncomment this block to enable use of Google Analytics.
# Replace the property value with your own ID.
# extra:
# analytics:
# provider: google
# property: G-XXXXXXXXXX

2521
nwb-schema-linkml/poetry.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
## Add your own custom Makefile targets here

View file

@ -0,0 +1,23 @@
type NamedThing
{
id: Uriorcurie!
name: String
description: String
}
type Namespaces
{
id: Uriorcurie!
name: String
description: String
primaryEmail: String
birthDate: Date
ageInYears: Integer
vitalStatus: PersonStatus
}
type NamespacesCollection
{
entries: [Namespaces]
}

View file

@ -0,0 +1,51 @@
{
"comments": {
"description": "Auto generated by LinkML jsonld context generator",
"generation_date": "2023-08-16T15:57:40",
"source": "nwb_schema_language.yaml"
},
"@context": {
"PATO": {
"@id": "http://purl.obolibrary.org/obo/PATO_",
"@prefix": true
},
"biolink": "https://w3id.org/biolink/",
"example": "https://example.org/",
"linkml": "https://w3id.org/linkml/",
"nwb_schema_language": "https://w3id.org/p2p_ld/nwb-schema-language/",
"schema": "http://schema.org/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"@vocab": "https://w3id.org/p2p_ld/nwb-schema-language/",
"age_in_years": {
"@type": "xsd:integer"
},
"birth_date": {
"@type": "xsd:date",
"@id": "schema:birthDate"
},
"description": {
"@id": "schema:description"
},
"id": "@id",
"name": {
"@id": "schema:name"
},
"entries": {
"@type": "@id"
},
"primary_email": {
"@id": "schema:email"
},
"vital_status": {
"@context": {
"@vocab": "@null",
"text": "skos:notation",
"description": "skos:prefLabel",
"meaning": "@id"
}
},
"NamedThing": {
"@id": "schema:Thing"
}
}
}

View file

@ -0,0 +1,543 @@
{
"name": "nwb-schema-language",
"description": "Translation of the nwb-schema-language to LinkML",
"title": "nwb-schema-language",
"see_also": [
"https://p2p_ld.github.io/nwb-schema-language"
],
"id": "https://w3id.org/p2p_ld/nwb-schema-language",
"imports": [
"linkml:types"
],
"license": "GNU GPL v3.0",
"prefixes": [
{
"prefix_prefix": "nwb_schema_language",
"prefix_reference": "https://w3id.org/p2p_ld/nwb-schema-language/"
},
{
"prefix_prefix": "linkml",
"prefix_reference": "https://w3id.org/linkml/"
},
{
"prefix_prefix": "biolink",
"prefix_reference": "https://w3id.org/biolink/"
},
{
"prefix_prefix": "schema",
"prefix_reference": "http://schema.org/"
},
{
"prefix_prefix": "PATO",
"prefix_reference": "http://purl.obolibrary.org/obo/PATO_"
},
{
"prefix_prefix": "example",
"prefix_reference": "https://example.org/"
}
],
"default_prefix": "nwb_schema_language",
"default_range": "string",
"types": [
{
"name": "string",
"definition_uri": "https://w3id.org/linkml/String",
"description": "A character string",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"exact_mappings": [
"schema:Text"
],
"base": "str",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"@type": "TypeDefinition"
},
{
"name": "integer",
"definition_uri": "https://w3id.org/linkml/Integer",
"description": "An integer",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"exact_mappings": [
"schema:Integer"
],
"base": "int",
"uri": "http://www.w3.org/2001/XMLSchema#integer",
"@type": "TypeDefinition"
},
{
"name": "boolean",
"definition_uri": "https://w3id.org/linkml/Boolean",
"description": "A binary (true or false) value",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"exact_mappings": [
"schema:Boolean"
],
"base": "Bool",
"uri": "http://www.w3.org/2001/XMLSchema#boolean",
"repr": "bool",
"@type": "TypeDefinition"
},
{
"name": "float",
"definition_uri": "https://w3id.org/linkml/Float",
"description": "A real number that conforms to the xsd:float specification",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"exact_mappings": [
"schema:Float"
],
"base": "float",
"uri": "http://www.w3.org/2001/XMLSchema#float",
"@type": "TypeDefinition"
},
{
"name": "double",
"definition_uri": "https://w3id.org/linkml/Double",
"description": "A real number that conforms to the xsd:double specification",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"close_mappings": [
"schema:Float"
],
"base": "float",
"uri": "http://www.w3.org/2001/XMLSchema#double",
"@type": "TypeDefinition"
},
{
"name": "decimal",
"definition_uri": "https://w3id.org/linkml/Decimal",
"description": "A real number with arbitrary precision that conforms to the xsd:decimal specification",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"broad_mappings": [
"schema:Number"
],
"base": "Decimal",
"uri": "http://www.w3.org/2001/XMLSchema#decimal",
"@type": "TypeDefinition"
},
{
"name": "time",
"definition_uri": "https://w3id.org/linkml/Time",
"description": "A time object represents a (local) time of day, independent of any particular day",
"notes": [
"URI is dateTime because OWL reasoners do not work with straight date or time"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"exact_mappings": [
"schema:Time"
],
"base": "XSDTime",
"uri": "http://www.w3.org/2001/XMLSchema#time",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "date",
"definition_uri": "https://w3id.org/linkml/Date",
"description": "a date (year, month and day) in an idealized calendar",
"notes": [
"URI is dateTime because OWL reasoners don't work with straight date or time"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"exact_mappings": [
"schema:Date"
],
"base": "XSDDate",
"uri": "http://www.w3.org/2001/XMLSchema#date",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "datetime",
"definition_uri": "https://w3id.org/linkml/Datetime",
"description": "The combination of a date and time",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"exact_mappings": [
"schema:DateTime"
],
"base": "XSDDateTime",
"uri": "http://www.w3.org/2001/XMLSchema#dateTime",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "date_or_datetime",
"definition_uri": "https://w3id.org/linkml/DateOrDatetime",
"description": "Either a date or a datetime",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "str",
"uri": "https://w3id.org/linkml/DateOrDatetime",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "uriorcurie",
"definition_uri": "https://w3id.org/linkml/Uriorcurie",
"description": "a URI or a CURIE",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "URIorCURIE",
"uri": "http://www.w3.org/2001/XMLSchema#anyURI",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "curie",
"definition_uri": "https://w3id.org/linkml/Curie",
"conforms_to": "https://www.w3.org/TR/curie/",
"description": "a compact URI",
"comments": [
"in RDF serializations this MUST be expanded to a URI",
"in non-RDF serializations MAY be serialized as the compact representation"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "Curie",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "uri",
"definition_uri": "https://w3id.org/linkml/Uri",
"conforms_to": "https://www.ietf.org/rfc/rfc3987.txt",
"description": "a complete URI",
"comments": [
"in RDF serializations a slot with range of uri is treated as a literal or type xsd:anyURI unless it is an identifier or a reference to an identifier, in which case it is translated directly to a node"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"close_mappings": [
"schema:URL"
],
"base": "URI",
"uri": "http://www.w3.org/2001/XMLSchema#anyURI",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "ncname",
"definition_uri": "https://w3id.org/linkml/Ncname",
"description": "Prefix part of CURIE",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "NCName",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "objectidentifier",
"definition_uri": "https://w3id.org/linkml/Objectidentifier",
"description": "A URI or CURIE that represents an object in the model.",
"comments": [
"Used for inheritance and type checking"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "ElementIdentifier",
"uri": "http://www.w3.org/ns/shex#iri",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "nodeidentifier",
"definition_uri": "https://w3id.org/linkml/Nodeidentifier",
"description": "A URI, CURIE or BNODE that represents a node in a model.",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "NodeIdentifier",
"uri": "http://www.w3.org/ns/shex#nonLiteral",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "jsonpointer",
"definition_uri": "https://w3id.org/linkml/Jsonpointer",
"conforms_to": "https://datatracker.ietf.org/doc/html/rfc6901",
"description": "A string encoding a JSON Pointer. The value of the string MUST conform to JSON Point syntax and SHOULD dereference to a valid object within the current instance document when encoded in tree form.",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "str",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "jsonpath",
"definition_uri": "https://w3id.org/linkml/Jsonpath",
"conforms_to": "https://www.ietf.org/archive/id/draft-goessner-dispatch-jsonpath-00.html",
"description": "A string encoding a JSON Path. The value of the string MUST conform to JSON Point syntax and SHOULD dereference to zero or more valid objects within the current instance document when encoded in tree form.",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "str",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "sparqlpath",
"definition_uri": "https://w3id.org/linkml/Sparqlpath",
"conforms_to": "https://www.w3.org/TR/sparql11-query/#propertypaths",
"description": "A string encoding a SPARQL Property Path. The value of the string MUST conform to SPARQL syntax and SHOULD dereference to zero or more valid objects within the current instance document when encoded as RDF.",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "str",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"repr": "str",
"@type": "TypeDefinition"
}
],
"enums": [
{
"name": "PersonStatus",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/PersonStatus",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"permissible_values": [
{
"text": "ALIVE",
"description": "the person is living",
"meaning": "PATO:0001421"
},
{
"text": "DEAD",
"description": "the person is deceased",
"meaning": "PATO:0001422"
},
{
"text": "UNKNOWN",
"description": "the vital status is not known",
"todos": [
"map this to an ontology"
]
}
]
}
],
"slots": [
{
"name": "id",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/id",
"description": "A unique identifier for a thing",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"mappings": [
"http://schema.org/identifier"
],
"slot_uri": "http://schema.org/identifier",
"identifier": true,
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "uriorcurie",
"required": true,
"@type": "SlotDefinition"
},
{
"name": "name",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/name",
"description": "A human-readable name for a thing",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"mappings": [
"http://schema.org/name"
],
"slot_uri": "http://schema.org/name",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "description",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/description",
"description": "A human-readable description for a thing",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"mappings": [
"http://schema.org/description"
],
"slot_uri": "http://schema.org/description",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "primary_email",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/primary_email",
"description": "The main email address of a person",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"mappings": [
"http://schema.org/email"
],
"slot_uri": "http://schema.org/email",
"owner": "Namespaces",
"domain_of": [
"Namespaces"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "birth_date",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/birth_date",
"description": "Date on which a person is born",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"mappings": [
"http://schema.org/birthDate"
],
"slot_uri": "http://schema.org/birthDate",
"owner": "Namespaces",
"domain_of": [
"Namespaces"
],
"range": "date",
"@type": "SlotDefinition"
},
{
"name": "age_in_years",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/age_in_years",
"description": "Number of years since birth",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"slot_uri": "https://w3id.org/p2p_ld/nwb-schema-language/age_in_years",
"owner": "Namespaces",
"domain_of": [
"Namespaces"
],
"range": "integer",
"@type": "SlotDefinition"
},
{
"name": "vital_status",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/vital_status",
"description": "living or dead status",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"slot_uri": "https://w3id.org/p2p_ld/nwb-schema-language/vital_status",
"owner": "Namespaces",
"domain_of": [
"Namespaces"
],
"range": "PersonStatus",
"@type": "SlotDefinition"
},
{
"name": "namespacesCollection__entries",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"slot_uri": "https://w3id.org/p2p_ld/nwb-schema-language/entries",
"multivalued": true,
"alias": "entries",
"owner": "NamespacesCollection",
"domain_of": [
"NamespacesCollection"
],
"range": "Namespaces",
"inlined": true,
"@type": "SlotDefinition"
},
{
"name": "Namespaces_primary_email",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/primary_email",
"description": "The main email address of a person",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"mappings": [
"http://schema.org/email"
],
"is_a": "primary_email",
"domain": "Namespaces",
"slot_uri": "http://schema.org/email",
"alias": "primary_email",
"owner": "Namespaces",
"domain_of": [
"Namespaces"
],
"is_usage_slot": true,
"usage_slot_name": "primary_email",
"range": "string",
"pattern": "^\\S+@[\\S+\\.]+\\S+",
"@type": "SlotDefinition"
}
],
"classes": [
{
"name": "NamedThing",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/NamedThing",
"description": "A generic grouping for any identifiable entity",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"mappings": [
"schema:Thing"
],
"slots": [
"id",
"name",
"description"
],
"slot_usage": {},
"class_uri": "http://schema.org/Thing",
"@type": "ClassDefinition"
},
{
"name": "Namespaces",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/Namespaces",
"description": "Represents a Namespaces",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"is_a": "NamedThing",
"slots": [
"id",
"name",
"description",
"Namespaces_primary_email",
"birth_date",
"age_in_years",
"vital_status"
],
"slot_usage": {},
"class_uri": "https://w3id.org/p2p_ld/nwb-schema-language/Namespaces",
"@type": "ClassDefinition"
},
{
"name": "NamespacesCollection",
"definition_uri": "https://w3id.org/p2p_ld/nwb-schema-language/NamespacesCollection",
"description": "A holder for Namespaces objects",
"from_schema": "https://w3id.org/p2p_ld/nwb-schema-language",
"slots": [
"namespacesCollection__entries"
],
"slot_usage": {},
"attributes": [
{
"name": "entries",
"multivalued": true,
"range": "Namespaces",
"inlined": true,
"@type": "SlotDefinition"
}
],
"class_uri": "https://w3id.org/p2p_ld/nwb-schema-language/NamespacesCollection",
"tree_root": true,
"@type": "ClassDefinition"
}
],
"metamodel_version": "1.7.0",
"source_file": "nwb_schema_language.yaml",
"source_file_date": "2023-08-16T15:45:06",
"source_file_size": 2270,
"generation_date": "2023-08-16T15:57:40",
"@type": "SchemaDefinition",
"@context": [
"project/jsonld/nwb_schema_language.context.jsonld",
"https://w3id.org/linkml/types.context.jsonld",
{
"@base": "https://w3id.org/p2p_ld/nwb-schema-language/"
}
]
}

View file

@ -0,0 +1,161 @@
{
"$defs": {
"NamedThing": {
"additionalProperties": false,
"description": "A generic grouping for any identifiable entity",
"properties": {
"description": {
"description": "A human-readable description for a thing",
"type": "string"
},
"id": {
"description": "A unique identifier for a thing",
"type": "string"
},
"name": {
"description": "A human-readable name for a thing",
"type": "string"
}
},
"required": [
"id"
],
"title": "NamedThing",
"type": "object"
},
"Namespaces": {
"additionalProperties": false,
"description": "Represents a Namespaces",
"properties": {
"age_in_years": {
"description": "Number of years since birth",
"type": "integer"
},
"birth_date": {
"description": "Date on which a person is born",
"format": "date",
"type": "string"
},
"description": {
"description": "A human-readable description for a thing",
"type": "string"
},
"id": {
"description": "A unique identifier for a thing",
"type": "string"
},
"name": {
"description": "A human-readable name for a thing",
"type": "string"
},
"primary_email": {
"description": "The main email address of a person",
"pattern": "^\\S+@[\\S+\\.]+\\S+",
"type": "string"
},
"vital_status": {
"$ref": "#/$defs/PersonStatus",
"description": "living or dead status"
}
},
"required": [
"id"
],
"title": "Namespaces",
"type": "object"
},
"NamespacesCollection": {
"additionalProperties": false,
"description": "A holder for Namespaces objects",
"properties": {
"entries": {
"additionalProperties": {
"anyOf": [
{
"$ref": "#/$defs/Namespaces__identifier_optional"
},
{
"type": "null"
}
]
},
"type": "object"
}
},
"title": "NamespacesCollection",
"type": "object"
},
"Namespaces__identifier_optional": {
"additionalProperties": false,
"description": "Represents a Namespaces",
"properties": {
"age_in_years": {
"description": "Number of years since birth",
"type": "integer"
},
"birth_date": {
"description": "Date on which a person is born",
"format": "date",
"type": "string"
},
"description": {
"description": "A human-readable description for a thing",
"type": "string"
},
"id": {
"description": "A unique identifier for a thing",
"type": "string"
},
"name": {
"description": "A human-readable name for a thing",
"type": "string"
},
"primary_email": {
"description": "The main email address of a person",
"pattern": "^\\S+@[\\S+\\.]+\\S+",
"type": "string"
},
"vital_status": {
"$ref": "#/$defs/PersonStatus",
"description": "living or dead status"
}
},
"required": [],
"title": "Namespaces",
"type": "object"
},
"PersonStatus": {
"description": "",
"enum": [
"ALIVE",
"DEAD",
"UNKNOWN"
],
"title": "PersonStatus",
"type": "string"
}
},
"$id": "https://w3id.org/p2p_ld/nwb-schema-language",
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"description": "A holder for Namespaces objects",
"metamodel_version": "1.7.0",
"properties": {
"entries": {
"additionalProperties": {
"anyOf": [
{
"$ref": "#/$defs/Namespaces__identifier_optional"
},
{
"type": "null"
}
]
},
"type": "object"
}
},
"title": "nwb-schema-language",
"type": "object",
"version": null
}

View file

@ -0,0 +1,343 @@
@prefix IAO: <http://purl.obolibrary.org/obo/IAO_> .
@prefix PATO: <http://purl.obolibrary.org/obo/PATO_> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix famrel: <http://example.org/famrel/> .
@prefix linkml: <https://w3id.org/linkml/> .
@prefix my_datamodel: <https://w3id.org/my_org/my_datamodel> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
linkml:SubsetDefinition a owl:Class ;
rdfs:label "subset_definition" .
linkml:TypeDefinition a owl:Class ;
rdfs:label "type_definition" .
linkml:topValue a owl:DatatypeProperty ;
rdfs:label "value" .
my_datamodel: a owl:Ontology ;
rdfs:label "my_datamodel" ;
IAO:0000700 my_datamodel:Address,
my_datamodel:HasAliases,
my_datamodel:NamedThing,
my_datamodel:Registry,
my_datamodel:Relationship ;
dcterms:license "https://creativecommons.org/publicdomain/zero/1.0/" ;
dcterms:title "My Datamodel" ;
rdfs:seeAlso "https://example.org/" ;
linkml:generation_date "2022-09-06T10:01:46" ;
linkml:metamodel_version "1.7.0" ;
linkml:source_file "nwb_schema_language.yaml" ;
linkml:source_file_date "2022-09-06T10:00:58" ;
linkml:source_file_size 3771 .
my_datamodel:employed_at a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "employed_at" ;
rdfs:range my_datamodel:Organization .
my_datamodel:is_current a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "is_current" ;
rdfs:range linkml:Boolean .
my_datamodel:Registry a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Registry" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom my_datamodel:Person ;
owl:onProperty my_datamodel:persons ],
[ a owl:Restriction ;
owl:allValuesFrom my_datamodel:Organization ;
owl:onProperty my_datamodel:organizations ] ;
skos:definition "Top level data container" .
my_datamodel:age_in_years a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "age_in_years" ;
rdfs:range linkml:Integer .
my_datamodel:city a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "city" ;
rdfs:range linkml:String .
my_datamodel:current_address a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "current_address" ;
rdfs:range my_datamodel:Address ;
skos:definition "The address at which a person currently lives" .
my_datamodel:founding_date a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "founding_date" ;
rdfs:range linkml:String .
my_datamodel:has_familial_relationships a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "has_familial_relationships" ;
rdfs:range my_datamodel:FamilialRelationship .
my_datamodel:mission_statement a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "mission_statement" ;
rdfs:range linkml:String .
my_datamodel:organizations a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "organizations" ;
rdfs:range my_datamodel:Organization .
my_datamodel:persons a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "persons" ;
rdfs:range my_datamodel:Person .
my_datamodel:postal_code a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "postal_code" ;
rdfs:range linkml:String .
my_datamodel:street a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "street" ;
rdfs:range linkml:String .
famrel:02 a owl:Class,
my_datamodel:FamilialRelationshipType ;
rdfs:label "PARENT_OF" .
PATO:0001421 a owl:Class,
my_datamodel:PersonStatus ;
rdfs:label "ALIVE" .
PATO:0001422 a owl:Class,
my_datamodel:PersonStatus ;
rdfs:label "DEAD" .
schema:birthDate a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "birth_date" ;
rdfs:range linkml:String ;
skos:exactMatch schema:birthDate .
schema:description a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "description" ;
rdfs:range linkml:String ;
skos:exactMatch schema:description .
schema:email a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "primary_email" ;
rdfs:range linkml:String ;
skos:exactMatch schema:email .
schema:identifier a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "id" ;
rdfs:range linkml:String ;
skos:exactMatch schema:identifier .
schema:image a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "image" ;
rdfs:range linkml:String ;
skos:exactMatch schema:image .
schema:name a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "name" ;
rdfs:range linkml:String ;
skos:exactMatch schema:name .
<http://www.w3.org/ns/prov#endedAtTime> a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "ended_at_time" ;
rdfs:range linkml:Date ;
skos:exactMatch <http://www.w3.org/ns/prov#endedAtTime> .
<http://www.w3.org/ns/prov#startedAtTime> a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "started_at_time" ;
rdfs:range linkml:Date ;
skos:exactMatch <http://www.w3.org/ns/prov#startedAtTime> .
my_datamodel:FamilialRelationship a owl:Class,
linkml:ClassDefinition ;
rdfs:label "FamilialRelationship" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:onClass my_datamodel:FamilialRelationshipType ;
owl:onProperty my_datamodel:type ;
owl:qualifiedCardinality 1 ],
[ a owl:Restriction ;
owl:onClass my_datamodel:Person ;
owl:onProperty my_datamodel:related_to ;
owl:qualifiedCardinality 1 ],
my_datamodel:Relationship .
<https://w3id.org/my_org/my_datamodelPersonStatus#UNKNOWN> a owl:Class,
my_datamodel:PersonStatus ;
rdfs:label "UNKNOWN" .
my_datamodel:Relationship a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Relationship" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:related_to ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:type ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:Date ;
owl:onProperty <http://www.w3.org/ns/prov#endedAtTime> ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:Date ;
owl:onProperty <http://www.w3.org/ns/prov#startedAtTime> ] .
my_datamodel:related_to a owl:ObjectProperty,
linkml:SlotDefinition .
my_datamodel:type a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "type" ;
rdfs:range linkml:String .
famrel:01 a owl:Class,
my_datamodel:FamilialRelationshipType ;
rdfs:label "CHILD_OF",
"SIBLING_OF" .
my_datamodel:Address a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Address" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:city ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:street ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:postal_code ] ;
skos:exactMatch schema:PostalAddress .
my_datamodel:FamilialRelationshipType a owl:Class,
linkml:EnumDefinition ;
rdfs:label "FamilialRelationshipType" ;
owl:unionOf ( famrel:01 famrel:02 famrel:01 ) ;
linkml:permissible_values famrel:01,
famrel:02 .
my_datamodel:HasAliases a owl:Class,
linkml:ClassDefinition ;
rdfs:label "HasAliases" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty my_datamodel:aliases ],
linkml:mixin ;
skos:definition "A mixin applied to any class that can have aliases/alternateNames" .
my_datamodel:NamedThing a owl:Class,
linkml:ClassDefinition ;
rdfs:label "NamedThing" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty schema:description ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty schema:name ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty schema:image ],
[ a owl:Restriction ;
owl:onClass linkml:String ;
owl:onProperty schema:identifier ;
owl:qualifiedCardinality 1 ] ;
skos:closeMatch schema:Thing ;
skos:definition "A generic grouping for any identifiable entity" .
my_datamodel:Organization a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Organization" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:mission_statement ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:founding_date ],
[ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty my_datamodel:aliases ],
my_datamodel:HasAliases,
my_datamodel:NamedThing ;
skos:definition "An organization such as a company or university" ;
skos:exactMatch schema:Organization .
my_datamodel:Person a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Person" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty my_datamodel:aliases ],
[ a owl:Restriction ;
owl:allValuesFrom my_datamodel:FamilialRelationship ;
owl:onProperty my_datamodel:has_familial_relationships ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:Integer ;
owl:onProperty my_datamodel:age_in_years ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass my_datamodel:Address ;
owl:onProperty my_datamodel:current_address ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty schema:birthDate ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty schema:email ],
my_datamodel:HasAliases,
my_datamodel:NamedThing ;
skos:definition "A person (alive, dead, undead, or fictional)." ;
skos:exactMatch schema:Person .
my_datamodel:PersonStatus a owl:Class,
linkml:EnumDefinition ;
rdfs:label "PersonStatus" ;
owl:unionOf ( PATO:0001421 PATO:0001422 <https://w3id.org/my_org/my_datamodelPersonStatus#UNKNOWN> ) ;
linkml:permissible_values PATO:0001421,
PATO:0001422,
<https://w3id.org/my_org/my_datamodelPersonStatus#UNKNOWN> .
my_datamodel:aliases a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "aliases" ;
rdfs:range linkml:String ;
skos:exactMatch schema:alternateName .
linkml:ClassDefinition a owl:Class ;
rdfs:label "class_definition" .
linkml:SlotDefinition a owl:Class ;
rdfs:label "slot_definition" .

View file

@ -0,0 +1,11 @@
{
"PATO": "http://purl.obolibrary.org/obo/PATO_",
"biolink": "https://w3id.org/biolink/",
"example": "https://example.org/",
"linkml": "https://w3id.org/linkml/",
"nwb_schema_language": "https://w3id.org/p2p_ld/nwb-schema-language/",
"schema": "http://schema.org/",
"NamedThing": {
"@id": "schema:Thing"
}
}

View file

@ -0,0 +1,23 @@
// A generic grouping for any identifiable entity
message NamedThing
{
uriorcurie id = 0
string name = 0
string description = 0
}
// Represents a Namespaces
message Namespaces
{
uriorcurie id = 0
string name = 0
string description = 0
string primaryEmail = 0
date birthDate = 0
integer ageInYears = 0
personStatus vitalStatus = 0
}
// A holder for Namespaces objects
message NamespacesCollection
{
repeated namespaces entries = 0
}

View file

@ -0,0 +1,164 @@
@prefix famrel: <http://example.org/famrel/> .
@prefix my_datamodel: <https://w3id.org/my_org/my_datamodel> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
my_datamodel:HasAliases a sh:NodeShape ;
sh:closed true ;
sh:description "A mixin applied to any class that can have aliases/alternateNames" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:order 0 ;
sh:path my_datamodel:aliases ] ;
sh:targetClass my_datamodel:HasAliases .
my_datamodel:NamedThing a sh:NodeShape ;
sh:closed true ;
sh:description "A generic grouping for any identifiable entity" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 0 ;
sh:path schema:identifier ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path schema:name ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path schema:image ],
[ sh:maxCount 1 ;
sh:order 2 ;
sh:path schema:description ] ;
sh:targetClass my_datamodel:NamedThing .
my_datamodel:Registry a sh:NodeShape ;
sh:closed true ;
sh:description "Top level data container" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:class schema:Person ;
sh:nodeKind sh:IRI ;
sh:order 0 ;
sh:path my_datamodel:persons ],
[ sh:class schema:Organization ;
sh:nodeKind sh:IRI ;
sh:order 1 ;
sh:path my_datamodel:organizations ] ;
sh:targetClass my_datamodel:Registry .
my_datamodel:Relationship a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 0 ;
sh:path <http://www.w3.org/ns/prov#startedAtTime> ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path my_datamodel:type ],
[ sh:maxCount 1 ;
sh:order 2 ;
sh:path my_datamodel:related_to ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path <http://www.w3.org/ns/prov#endedAtTime> ] ;
sh:targetClass my_datamodel:Relationship .
schema:Organization a sh:NodeShape ;
sh:closed true ;
sh:description "An organization such as a company or university" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 1 ;
sh:path my_datamodel:founding_date ],
[ sh:maxCount 1 ;
sh:order 5 ;
sh:path schema:description ],
[ sh:order 2 ;
sh:path my_datamodel:aliases ],
[ sh:maxCount 1 ;
sh:order 6 ;
sh:path schema:image ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path my_datamodel:mission_statement ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path schema:identifier ],
[ sh:maxCount 1 ;
sh:order 4 ;
sh:path schema:name ] ;
sh:targetClass schema:Organization .
schema:Person a sh:NodeShape ;
sh:closed true ;
sh:description "A person (alive, dead, undead, or fictional)." ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 6 ;
sh:path schema:identifier ],
[ sh:maxCount 1 ;
sh:order 8 ;
sh:path schema:description ],
[ sh:maxCount 1 ;
sh:order 9 ;
sh:path schema:image ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path schema:email ;
sh:pattern "^\\S+@[\\S+\\.]+\\S+" ],
[ sh:maxCount 1 ;
sh:maxInclusive 999 ;
sh:minInclusive 0 ;
sh:order 2 ;
sh:path my_datamodel:age_in_years ],
[ sh:class schema:PostalAddress ;
sh:description "The address at which a person currently lives" ;
sh:maxCount 1 ;
sh:nodeKind sh:BlankNode ;
sh:order 3 ;
sh:path my_datamodel:current_address ],
[ sh:class my_datamodel:FamilialRelationship ;
sh:nodeKind sh:BlankNode ;
sh:order 4 ;
sh:path my_datamodel:has_familial_relationships ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path schema:birthDate ],
[ sh:maxCount 1 ;
sh:order 7 ;
sh:path schema:name ],
[ sh:order 5 ;
sh:path my_datamodel:aliases ] ;
sh:targetClass schema:Person .
schema:PostalAddress a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 1 ;
sh:path my_datamodel:city ],
[ sh:maxCount 1 ;
sh:order 2 ;
sh:path my_datamodel:postal_code ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path my_datamodel:street ] ;
sh:targetClass schema:PostalAddress .
my_datamodel:FamilialRelationship a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 1 ;
sh:path <http://www.w3.org/ns/prov#endedAtTime> ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path <http://www.w3.org/ns/prov#startedAtTime> ],
[ sh:in ( famrel:01 famrel:02 famrel:01 ) ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:order 3 ;
sh:path my_datamodel:type ],
[ sh:maxCount 1 ;
sh:order 2 ;
sh:path my_datamodel:related_to ] ;
sh:targetClass my_datamodel:FamilialRelationship .

View file

@ -0,0 +1,74 @@
BASE <https://w3id.org/p2p_ld/nwb-schema-language/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX schema1: <http://schema.org/>
linkml:String xsd:string
linkml:Integer xsd:integer
linkml:Boolean xsd:boolean
linkml:Float xsd:float
linkml:Double xsd:double
linkml:Decimal xsd:decimal
linkml:Time xsd:time
linkml:Date xsd:date
linkml:Datetime xsd:dateTime
linkml:DateOrDatetime linkml:DateOrDatetime
linkml:Uriorcurie IRI
linkml:Curie xsd:string
linkml:Uri IRI
linkml:Ncname xsd:string
linkml:Objectidentifier IRI
linkml:Nodeidentifier NONLITERAL
linkml:Jsonpointer xsd:string
linkml:Jsonpath xsd:string
linkml:Sparqlpath xsd:string
<NamedThing> (
CLOSED {
( $<NamedThing_tes> ( schema1:name @linkml:String ? ;
schema1:description @linkml:String ?
) ;
rdf:type [ schema1:Thing ]
)
} OR @<Namespaces>
)
<Namespaces> CLOSED {
( $<Namespaces_tes> ( &<NamedThing_tes> ;
rdf:type [ schema1:Thing ] ? ;
schema1:email @linkml:String ? ;
schema1:birthDate @linkml:Date ? ;
<age_in_years> @linkml:Integer ? ;
<vital_status> @<PersonStatus> ?
) ;
rdf:type [ <Namespaces> ]
)
}
<NamespacesCollection> CLOSED {
( $<NamespacesCollection_tes> <entries> @<Namespaces> * ;
rdf:type [ <NamespacesCollection> ] ?
)
}

View file

@ -0,0 +1,24 @@
CREATE TABLE "NamedThing" (
id TEXT NOT NULL,
name TEXT,
description TEXT,
PRIMARY KEY (id)
);
CREATE TABLE "Namespaces" (
id TEXT NOT NULL,
name TEXT,
description TEXT,
primary_email TEXT,
birth_date DATE,
age_in_years INTEGER,
vital_status VARCHAR(7),
PRIMARY KEY (id)
);
CREATE TABLE "NamespacesCollection" (
entries TEXT,
PRIMARY KEY (entries)
);

View file

@ -0,0 +1,30 @@
[tool.poetry]
name = "nwb_schema_linkml"
version = "0.1.0"
description = "Translation of the nwb-schema-language to LinkML"
authors = ["Jonny Saunders <j@nny.fyi>"]
license = "GNU GPL v3.0"
readme = "README.md"
include = ["README.md", "src/nwb_schema_language/schema", "project"]
[tool.poetry.dependencies]
python = "^3.9"
linkml-runtime = "^1.1.24"
[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "pep440"
[tool.poetry.dev-dependencies]
linkml = "^1.3.5"
mkdocs-material = "^8.2.8"
mkdocs-mermaid2-plugin = "^0.6.0"
schemasheets = "^0.1.14"
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"
[tool.poetry.extras]
docs = ["linkml", "mkdocs-material"]

View file

@ -0,0 +1,7 @@
# Example data object
---
entries:
- id: example:Namespaces001
name: foo bar
primary_email: foo.bar@example.com
age_in_years: 33

View file

@ -0,0 +1,3 @@
# nwb-schema-language
Translation of the nwb-schema-language to LinkML

View file

@ -0,0 +1,7 @@
from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version(__name__)
except PackageNotFoundError:
# package not installed
__version__ = "0.0.0"

View file

@ -0,0 +1 @@
from .nwb_schema_language import *

View file

@ -0,0 +1,193 @@
# Auto generated from nwb_schema_language.yaml by pythongen.py version: 0.0.1
# Generation date: 2023-08-16T15:57:41
# Schema: nwb-schema-language
#
# id: https://w3id.org/p2p_ld/nwb-schema-language
# description: Translation of the nwb-schema-language to LinkML
# license: GNU GPL v3.0
import dataclasses
import re
from jsonasobj2 import JsonObj, as_dict
from typing import Optional, List, Union, Dict, ClassVar, Any
from dataclasses import dataclass
from linkml_runtime.linkml_model.meta import EnumDefinition, PermissibleValue, PvFormulaOptions
from linkml_runtime.utils.slot import Slot
from linkml_runtime.utils.metamodelcore import empty_list, empty_dict, bnode
from linkml_runtime.utils.yamlutils import YAMLRoot, extended_str, extended_float, extended_int
from linkml_runtime.utils.dataclass_extensions_376 import dataclasses_init_fn_with_kwargs
from linkml_runtime.utils.formatutils import camelcase, underscore, sfx
from linkml_runtime.utils.enumerations import EnumDefinitionImpl
from rdflib import Namespace, URIRef
from linkml_runtime.utils.curienamespace import CurieNamespace
from linkml_runtime.linkml_model.types import Date, Integer, String, Uriorcurie
from linkml_runtime.utils.metamodelcore import URIorCURIE, XSDDate
metamodel_version = "1.7.0"
version = None
# Overwrite dataclasses _init_fn to add **kwargs in __init__
dataclasses._init_fn = dataclasses_init_fn_with_kwargs
# Namespaces
PATO = CurieNamespace('PATO', 'http://purl.obolibrary.org/obo/PATO_')
BIOLINK = CurieNamespace('biolink', 'https://w3id.org/biolink/')
EXAMPLE = CurieNamespace('example', 'https://example.org/')
LINKML = CurieNamespace('linkml', 'https://w3id.org/linkml/')
NWB_SCHEMA_LANGUAGE = CurieNamespace('nwb_schema_language', 'https://w3id.org/p2p_ld/nwb-schema-language/')
SCHEMA = CurieNamespace('schema', 'http://schema.org/')
DEFAULT_ = NWB_SCHEMA_LANGUAGE
# Types
# Class references
class NamedThingId(URIorCURIE):
pass
class NamespacesId(NamedThingId):
pass
@dataclass
class NamedThing(YAMLRoot):
"""
A generic grouping for any identifiable entity
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = SCHEMA.Thing
class_class_curie: ClassVar[str] = "schema:Thing"
class_name: ClassVar[str] = "NamedThing"
class_model_uri: ClassVar[URIRef] = NWB_SCHEMA_LANGUAGE.NamedThing
id: Union[str, NamedThingId] = None
name: Optional[str] = None
description: Optional[str] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.id):
self.MissingRequiredField("id")
if not isinstance(self.id, NamedThingId):
self.id = NamedThingId(self.id)
if self.name is not None and not isinstance(self.name, str):
self.name = str(self.name)
if self.description is not None and not isinstance(self.description, str):
self.description = str(self.description)
super().__post_init__(**kwargs)
@dataclass
class Namespaces(NamedThing):
"""
Represents a Namespaces
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = NWB_SCHEMA_LANGUAGE.Namespaces
class_class_curie: ClassVar[str] = "nwb_schema_language:Namespaces"
class_name: ClassVar[str] = "Namespaces"
class_model_uri: ClassVar[URIRef] = NWB_SCHEMA_LANGUAGE.Namespaces
id: Union[str, NamespacesId] = None
primary_email: Optional[str] = None
birth_date: Optional[Union[str, XSDDate]] = None
age_in_years: Optional[int] = None
vital_status: Optional[Union[str, "PersonStatus"]] = None
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
if self._is_empty(self.id):
self.MissingRequiredField("id")
if not isinstance(self.id, NamespacesId):
self.id = NamespacesId(self.id)
if self.primary_email is not None and not isinstance(self.primary_email, str):
self.primary_email = str(self.primary_email)
if self.birth_date is not None and not isinstance(self.birth_date, XSDDate):
self.birth_date = XSDDate(self.birth_date)
if self.age_in_years is not None and not isinstance(self.age_in_years, int):
self.age_in_years = int(self.age_in_years)
if self.vital_status is not None and not isinstance(self.vital_status, PersonStatus):
self.vital_status = PersonStatus(self.vital_status)
super().__post_init__(**kwargs)
@dataclass
class NamespacesCollection(YAMLRoot):
"""
A holder for Namespaces objects
"""
_inherited_slots: ClassVar[List[str]] = []
class_class_uri: ClassVar[URIRef] = NWB_SCHEMA_LANGUAGE.NamespacesCollection
class_class_curie: ClassVar[str] = "nwb_schema_language:NamespacesCollection"
class_name: ClassVar[str] = "NamespacesCollection"
class_model_uri: ClassVar[URIRef] = NWB_SCHEMA_LANGUAGE.NamespacesCollection
entries: Optional[Union[Dict[Union[str, NamespacesId], Union[dict, Namespaces]], List[Union[dict, Namespaces]]]] = empty_dict()
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
self._normalize_inlined_as_dict(slot_name="entries", slot_type=Namespaces, key_name="id", keyed=True)
super().__post_init__(**kwargs)
# Enumerations
class PersonStatus(EnumDefinitionImpl):
ALIVE = PermissibleValue(
text="ALIVE",
description="the person is living",
meaning=PATO["0001421"])
DEAD = PermissibleValue(
text="DEAD",
description="the person is deceased",
meaning=PATO["0001422"])
UNKNOWN = PermissibleValue(
text="UNKNOWN",
description="the vital status is not known")
_defn = EnumDefinition(
name="PersonStatus",
)
# Slots
class slots:
pass
slots.id = Slot(uri=SCHEMA.identifier, name="id", curie=SCHEMA.curie('identifier'),
model_uri=NWB_SCHEMA_LANGUAGE.id, domain=None, range=URIRef)
slots.name = Slot(uri=SCHEMA.name, name="name", curie=SCHEMA.curie('name'),
model_uri=NWB_SCHEMA_LANGUAGE.name, domain=None, range=Optional[str])
slots.description = Slot(uri=SCHEMA.description, name="description", curie=SCHEMA.curie('description'),
model_uri=NWB_SCHEMA_LANGUAGE.description, domain=None, range=Optional[str])
slots.primary_email = Slot(uri=SCHEMA.email, name="primary_email", curie=SCHEMA.curie('email'),
model_uri=NWB_SCHEMA_LANGUAGE.primary_email, domain=None, range=Optional[str])
slots.birth_date = Slot(uri=SCHEMA.birthDate, name="birth_date", curie=SCHEMA.curie('birthDate'),
model_uri=NWB_SCHEMA_LANGUAGE.birth_date, domain=None, range=Optional[Union[str, XSDDate]])
slots.age_in_years = Slot(uri=NWB_SCHEMA_LANGUAGE.age_in_years, name="age_in_years", curie=NWB_SCHEMA_LANGUAGE.curie('age_in_years'),
model_uri=NWB_SCHEMA_LANGUAGE.age_in_years, domain=None, range=Optional[int])
slots.vital_status = Slot(uri=NWB_SCHEMA_LANGUAGE.vital_status, name="vital_status", curie=NWB_SCHEMA_LANGUAGE.curie('vital_status'),
model_uri=NWB_SCHEMA_LANGUAGE.vital_status, domain=None, range=Optional[Union[str, "PersonStatus"]])
slots.namespacesCollection__entries = Slot(uri=NWB_SCHEMA_LANGUAGE.entries, name="namespacesCollection__entries", curie=NWB_SCHEMA_LANGUAGE.curie('entries'),
model_uri=NWB_SCHEMA_LANGUAGE.namespacesCollection__entries, domain=None, range=Optional[Union[Dict[Union[str, NamespacesId], Union[dict, Namespaces]], List[Union[dict, Namespaces]]]])
slots.Namespaces_primary_email = Slot(uri=SCHEMA.email, name="Namespaces_primary_email", curie=SCHEMA.curie('email'),
model_uri=NWB_SCHEMA_LANGUAGE.Namespaces_primary_email, domain=Namespaces, range=Optional[str],
pattern=re.compile(r'^\S+@[\S+\.]+\S+'))

View file

@ -0,0 +1,96 @@
---
id: https://w3id.org/p2p_ld/nwb-schema-language
name: nwb-schema-language
title: nwb-schema-language
description: |-
Translation of the nwb-schema-language to LinkML
license: GNU GPL v3.0
see_also:
- https://p2p_ld.github.io/nwb-schema-language
prefixes:
nwb_schema_language: https://w3id.org/p2p_ld/nwb-schema-language/
linkml: https://w3id.org/linkml/
biolink: https://w3id.org/biolink/
schema: http://schema.org/
PATO: http://purl.obolibrary.org/obo/PATO_
example: https://example.org/
default_prefix: nwb_schema_language
default_range: string
imports:
- linkml:types
classes:
NamedThing:
description: >-
A generic grouping for any identifiable entity
slots:
- id
- name
- description
class_uri: schema:Thing
Namespaces:
is_a: NamedThing
description: >-
Represents a Namespaces
slots:
- primary_email
- birth_date
- age_in_years
- vital_status
slot_usage:
primary_email:
pattern: "^\\S+@[\\S+\\.]+\\S+"
NamespacesCollection:
tree_root: true
description: >-
A holder for Namespaces objects
attributes:
entries:
range: Namespaces
multivalued: true
inlined: true
slots:
id:
identifier: true
slot_uri: schema:identifier
range: uriorcurie
description: A unique identifier for a thing
name:
slot_uri: schema:name
description: A human-readable name for a thing
description:
slot_uri: schema:description
description: A human-readable description for a thing
primary_email:
slot_uri: schema:email
description: The main email address of a person
birth_date:
slot_uri: schema:birthDate
range: date
description: Date on which a person is born
age_in_years:
range: integer
description: Number of years since birth
vital_status:
range: PersonStatus
description: living or dead status
enums:
PersonStatus:
permissible_values:
ALIVE:
description: the person is living
meaning: PATO:0001421
DEAD:
description: the person is deceased
meaning: PATO:0001422
UNKNOWN:
description: the vital status is not known
todos:
- map this to an ontology

View file

@ -0,0 +1 @@
"""Tests for nwb-schema-language."""

View file

@ -0,0 +1,22 @@
"""Data test."""
import os
import glob
import unittest
from linkml_runtime.loaders import yaml_loader
from nwb_schema_language.datamodel.nwb_schema_language import Namespaces
ROOT = os.path.join(os.path.dirname(__file__), '..')
DATA_DIR = os.path.join(ROOT, "src", "data", "examples")
EXAMPLE_FILES = glob.glob(os.path.join(DATA_DIR, '*.yaml'))
class TestData(unittest.TestCase):
"""Test data and datamodel."""
def test_data(self):
"""Date test."""
for path in EXAMPLE_FILES:
obj = yaml_loader.load(path, target_class=Namespaces)
assert obj

View file

@ -0,0 +1,4 @@
#!/bin/bash
# get the value of a key in the about.yaml file
# https://stackoverflow.com/questions/1221833/pipe-output-and-capture-exit-status-in-bash
grep "^$1:" about.yaml | sed "s/$1:[[:space:]]//" ; test "${PIPESTATUS[0]}" -eq 0