Skip to content

Commit a893416

Browse files
Remi-Gauyibeichan
andauthored
[DOC] extract some sections from tutorial into "how to guide" (#506)
* refactor * tmp * update visualize section --------- Co-authored-by: Yibei Chen <[email protected]>
1 parent f0eb3b0 commit a893416

File tree

5 files changed

+125
-80
lines changed

5 files changed

+125
-80
lines changed

docs/FAQ.md

+5-18
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,14 @@
3131
**🛠 Work in progress 🛠**
3232
-->
3333

34-
### How can I visualize the schema for a `protocol` or an `activity`?
34+
### Which assessments tools will/are supporting this standard?
3535

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).
36+
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).
3737

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:
38+
If you want to see those different tools in action using our user interface,
39+
you can explore them on [schema.repronim.org/](https://schema.repronim.org/rl/).
4040

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).
41+
The ReproSchema is also used to develop a checklist to [improve methods and results reporting in neuroimaging](https://github.com/ohbm/cobidas).
5542

5643
## Linked data and semantic web
5744

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/tutorials/tips-to-make-your-life-easier.md

-60
This file was deleted.

mkdocs.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ nav:
5454
- Create new items: "tutorials/create-new-items.md"
5555
- Finalize the protocol: "tutorials/finalizing-the-protocol.md"
5656
- Translate a questionnaire: "tutorials/translating-an-activity.md"
57-
- Tips: tutorials/tips-to-make-your-life-easier.md
58-
- Library: library.md
57+
- Demographic information : "tutorials/collecting-demographics-information.md"
58+
- How to guides:
59+
- Validation: "how-to/validation.md"
60+
- Visualize: "how-to/visualize.md"
61+
5962
- FAQ: "FAQ.md"
6063
- Contributing: "CONTRIBUTING.md"
6164

0 commit comments

Comments
 (0)