Skip to content

Commit 91f14dd

Browse files
committed
merge latest updates from other branch
2 parents 36d8a03 + a893416 commit 91f14dd

18 files changed

+388
-238
lines changed

.github/workflows/validate_and_release.yml

+22-2
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,32 @@ jobs:
4646
uses: actions/setup-python@v5
4747
with:
4848
python-version: 3.12
49-
49+
- name: Install dependencies
50+
run: |
51+
python -m pip install --upgrade pip setuptools
52+
pip install linkml astor pre-commit
53+
pip install git+https://github.com/ReproNim/reproschema-py.git
54+
- name: Generate pydantic using linml and fixing it with reproschema specific script
55+
run: |
56+
gen-pydantic --pydantic-version 2 linkml-schema/reproschema.yaml > reproschema_model.py
57+
python scripts/fix_pydantic.py reproschema_model.py
58+
pre-commit run --files reproschema_model.py || true
59+
- name: Generate jsonld format using linkml
60+
run: |
61+
gen-jsonld --context https://raw.githubusercontent.com/ReproNim/reproschema/main/contexts/reproschema linkml-schema/reproschema.yaml > reproschema.jsonld
62+
- name: Generate n-triples and turtle formats using reproschema
63+
run: |
64+
reproschema convert --format n-triples reproschema.jsonld > reproschema.nt
65+
reproschema convert --format turtle reproschema.jsonld > reproschema.ttl
5066
- name: Make a release
5167
run: |
5268
echo "Making a release ${{ inputs.version }}"
5369
mkdir releases/${{ inputs.version }}
54-
cp contexts/reproschema releases/${{ inputs.version }}/base
70+
cp contexts/reproschema releases/${{ inputs.version }}/reproschema
71+
mv reproschema_model.py releases/${{ inputs.version }}/reproschema_model.py
72+
mv reproschema.jsonld releases/${{ inputs.version }}/reproschema.jsonld
73+
mv reproschema.nt releases/${{ inputs.version }}/reproschema.nt
74+
mv reproschema.ttl releases/${{ inputs.version }}/reproschema.ttl
5575
# python scripts/makeRelease.py ${{ inputs.version }}
5676

5777
- name: Open pull requests to add files

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
activities/.DS_Store
33
protocols/.DS_Store
44

5+
__pycache__
6+
57
.idea/
68

79
local_data

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "library"]
2+
path = library
3+
url = https://github.com/ReproNim/reproschema-library.git
4+
datalad-url = https://github.com/ReproNim/reproschema-library.git

docs/FAQ.md

-24
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,6 @@
3131
**🛠 Work in progress 🛠**
3232
-->
3333

34-
### How can I visualize the schema for a `protocol` or an `activity`?
35-
36-
If you want to see what the assessment that are already supported by the ReproSchema would look like using our ReproSchema user-interface, you can visualize them directly on [schema.repronim.org](https://schema.repronim.org/rl).
37-
38-
If you just want to view a protocol or activity you are developing using the `reproschema-ui`,
39-
you can pass the URL of the schema to the `url` query parameter like this:
40-
41-
```https://schema.repronim.org/ui/#/?url=url-to-your-schema```
42-
43-
If you are hosting a schema on github, make sure that you are passing the URL of the **raw** content of the schema.
44-
For example, our demo protocol can be accessed at this URL:
45-
46-
[https://github.com/ReproNim/reproschema-demo-protocol/blob/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema](https://github.com/ReproNim/reproschema-demo-protocol/blob/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema)
47-
48-
But to get access to the raw content of that file you must click on the `Raw` button
49-
once you have opened that page on github that will open this URL:
50-
51-
[https://raw.githubusercontent.com/ReproNim/reproschema-demo-protocol/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema](https://raw.githubusercontent.com/ReproNim/reproschema-demo-protocol/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema).
52-
53-
If you want to visualize the graph represented by the JSON-LD file,
54-
we explain how to do this in [From JSON to JSON-LD](#from-json-to-json-ld).
55-
56-
5734
### Which assessments tools will/are supporting this standard?
5835

5936
At the moment, all the assessments that support this standard are listed in [this folder](https://github.com/ReproNim/reproschema-library/tree/master/activities) or the [reproschema-library repository](https://github.com/ReproNim/reproschema-library).
@@ -63,7 +40,6 @@ you can explore them on [schema.repronim.org/](https://schema.repronim.org/rl/).
6340

6441
The ReproSchema is also used to develop a checklist to [improve methods and results reporting in neuroimaging](https://github.com/ohbm/cobidas).
6542

66-
6743
## Linked data and semantic web
6844

6945
## What is the semantic web?

docs/how-to/validation.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Validation
2+
3+
### Validating your schema
4+
5+
If you want to validate a schema you have created:
6+
7+
- install the reproschema python tools
8+
9+
```bash
10+
pip install reproschema
11+
```
12+
13+
- run its `validate` command
14+
15+
```bash
16+
reproschema --log-level DEBUG validate PATH_TO_VALIDATE
17+
```
18+
19+
!!! note
20+
21+
You can validate a single file or all the files in a folder and its subfolder.
22+
23+
### Automating validation
24+
25+
If you are hosting your schema on a github repository,
26+
you can automate its validation with a with GitHub CI workflow.
27+
28+
For example if your repository is structured like this:
29+
30+
```text
31+
├── protocols
32+
│ └── protocol-1.jsonld
33+
├── activities
34+
│ ├── items
35+
│ │ └── item-1.jsonld
36+
│ └── activity-1.jsonld
37+
└── README.md
38+
```
39+
40+
create a `.github/workflows/validate.yml` file in this repository.
41+
42+
```text hl_lines="1-3"
43+
├── .github # hidden github folder
44+
│ └── workflows
45+
│ └── validate.yml # file the actions used to validate your schema
46+
├── protocols
47+
│ └── protocol-1.jsonld
48+
├── activities
49+
│ ├── items
50+
│ │ └── item-1.jsonld
51+
│ └── activity-1.jsonld
52+
└── README.md
53+
```
54+
55+
Content of `validate.yml`:
56+
57+
```yaml
58+
name: validation
59+
60+
on:
61+
push:
62+
branches: [ main ]
63+
64+
jobs:
65+
build:
66+
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Set up Python
72+
uses: actions/setup-python@v5
73+
with:
74+
python-version: 3.12
75+
- name: Install dependencies
76+
run: |
77+
python -m pip install --upgrade pip setuptools
78+
pip install reproschema-py
79+
- name: validate
80+
run: |
81+
reproschema validate protocols
82+
reproschema validate activities
83+
```
84+
85+
!!! note
86+
87+
Note that if you have created your schema
88+
using the [reproschema cookie cutter](../user-guide/create-new-protocol.md)
89+
then a validation workflow should already be included in your repository.

docs/how-to/visualize.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Visualize
2+
3+
If you want to visualize the graph represented by the JSON-LD file,
4+
we explain how to do this in [From JSON to JSON-LD](../FAQ.md#from-json-to-json-ld).
5+
6+
If you want to visualize the protocol or the activity you have created as a web form,
7+
you can use the [reproschema-ui](https://github.com/ReproNim/reproschema-ui) to preview it.
8+
To do so you can pass the URL to your protocol or activity as a query
9+
to the [reproschema-ui app](https://www.repronim.org/reproschema-ui/)
10+
11+
```https://www.repronim.org/reproschema-ui/#/?url=url-to-your-schema```
12+
13+
If you are hosting a schema on github, make sure that you are passing the URL of the **raw** content of the schema.
14+
For example, our demo protocol can be accessed at this URL:
15+
16+
[https://github.com/ReproNim/reproschema-demo-protocol/blob/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema](https://github.com/ReproNim/reproschema-demo-protocol/blob/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema)
17+
18+
But to get access to the raw content of that file you must click on the `Raw` button
19+
once you have opened that page on github that will open this URL:
20+
21+
[https://raw.githubusercontent.com/ReproNim/reproschema-demo-protocol/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema](https://raw.githubusercontent.com/ReproNim/reproschema-demo-protocol/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema).
22+
23+
So in the end the URL to preview this protocol as a web form would be:
24+
25+
[https://www.repronim.org/reproschema-ui/#/?url=https://raw.githubusercontent.com/ReproNim/reproschema-demo-protocol/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema](
26+
https://www.repronim.org/reproschema-ui/#/?url=https://raw.githubusercontent.com/ReproNim/reproschema-demo-protocol/7ed1ae49279f75acdd57380fff1f8aaff2c7b511/reproschema_demo_protocol/reproschema_demo_protocol_schema)

docs/library.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
hide:
3+
- toc
4+
---
5+
# Reproschema library
6+
7+
At the moment, all the assessments that support this standard are listed in [this folder](https://github.com/ReproNim/reproschema-library/tree/master/activities) of the [reproschema-library repository](https://github.com/ReproNim/reproschema-library).
8+
9+
For convenience we are listing them in the table below.
10+
11+
If you want to see those different tools in action using our user interface,
12+
you can explore them on [schema.repronim.org/](https://schema.repronim.org/rl/).
13+
14+
{{ MACROS___library_table() }}

docs/project-structure.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ questionnaire for your next participant or patient. Also you can mix and match
5151
items from this library, knowing that the information is tracked in your protocol.
5252

5353
All assessments are listed in [the `activity` folder](https://github.com/ReproNim/reproschema-library/tree/master/activities)
54-
and are served [here](https://schema.repronim.org/rl/) if you want to visualize
55-
them.
54+
and are served [here](https://schema.repronim.org/rl/) if you want to visualize them.
5655

5756
- **Standard Alignment:** Each element in the library aligns with the ReproSchema framework, ensuring uniformity in terms and structure and upholding validation protocols for consistency across the ecosystem.
5857
- **Research Protocol Integration:** Researchers can utilize these assessments in various combinations to align with specific protocol needs, customizing their application per study objectives. This process can be integrated using the reproschema-protocol-cookiecutter for constructing user interfaces.

docs/tutorials/collecting-demographics-information.md

-148
This file was deleted.

0 commit comments

Comments
 (0)