Skip to content

Commit

Permalink
Merge pull request #481 from Remi-Gau/patch-2
Browse files Browse the repository at this point in the history
[MAINT] ensures precommit is run on master
  • Loading branch information
yibeichan authored May 10, 2024
2 parents e81d9aa + 09d47a7 commit 41d2eba
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: pre-commit
on:
pull_request:
push:
branches: [main]
branches: [master]

jobs:
pre-commit:
Expand Down
6 changes: 3 additions & 3 deletions docs/30_schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ src="../img/reproschema.png"
alt="reproschema"
style="width: 800px; height: auto; display: block; margin-left: auto; margin-right: auto;"/>

You can see an example of those in the [examples folder](https://github.com/ReproNim/reproschema/examples)
You can see an example of those in the [examples folder](https://github.com/ReproNim/reproschema/tree/master/examples)

There are in fact more levels than this each and each level has its own schema:
- all of the schemas can be found in the [`terms` folder](https://github.com/ReproNim/reproschema/terms)
- the Reproschema actually allows for a more complex level nesting than the one described above (e.g you can have an `activity` wihtin an `activity`)
- all of the schemas can be found in the [`terms` folder](https://github.com/ReproNim/reproschema/tree/master/terms)
- the Reproschema actually allows for a more complex level nesting than the one described above (e.g you can have an `activity` within an `activity`)
- all the properties of each level are described below in the [Properties of ReproSchema objects section](#properties-of-reproschema-objects)

## Detailed description
Expand Down
6 changes: 3 additions & 3 deletions docs/50_using_reproschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For this tutorial you will be using some other tools to put your work online. He
We don't assume that you have in-depth knowledge of Git and Github for this tutorial so we will try to provide with the commands you need to type when it is required. Similarly, we will provide some of the commands to create directories and files though you could do many of those actions "by hand" with a couple of mouse clicks.

??? "For Windows users"
Most of the commands we will provide should work in the command line interface that will come on your computer when you isntall Git. But you could also look into using one the linux sub-system that provide you with Unix command line and that can be easily installed from the app-store on your computer.
Most of the commands we will provide should work in the command line interface that will come on your computer when you install Git. But you could also look into using one the linux sub-system that provide you with Unix command line and that can be easily installed from the app-store on your computer.

## Context

Expand All @@ -35,7 +35,7 @@ So we would want to have a set of questionnaires:

We will be creating several jsonld files in this tutorial. Those can quickly grow big and it can be hard to see what was added to a certain file from one step to the next. This gets even more confusing when you know that the order of the lines does not really matter. So to makes things easier to follow (and unless we explicitly say so) any new content we add to a file we have already worked on will be put at the end of this file.

So if step 1 looked like this:
So if step 1 looked like this:

```json
{
Expand Down Expand Up @@ -82,4 +82,4 @@ Although some other possibility would be equivalent:
"schemaVersion": "1.0.0",
"version": "0.0.1",
}
```
```
14 changes: 6 additions & 8 deletions docs/51_create_new_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We first need to create some folders to host the schema that will represent all
```bash
# Type this in a terminal window

# FYI: this line starts with #
# FYI: this line starts with #
# it is comment and it will not be executed
# if you copy paste it in the command line

Expand Down Expand Up @@ -168,21 +168,21 @@ Let's just highlight the things that have changed.

We have added a `ui` and an `order` fields.

`ui` is for things realted to the user interface and contains `addProperties` where we will be listing all the assessments that we add to our protocol.
`ui` is for things related to the user interface and contains `addProperties` where we will be listing all the assessments that we add to our protocol.

Each assessment is represented by an activity that is given a `variableName` and a `prefLabel`. The latter will be used as the name to display on the UI in english.

The field `isAbout` is the URL to point to the schema of that activity.
The field `isAbout` is the URL to point to the schema of that activity.

The field `order` is there to indicate which activity should be presented first, second...

??? "Making sure you have a valid json file"
Json files can get a bit long and you might sometimes forget a coma of a closing square brackets, so to make sure that your json file is correctly formatted you can use a linter. For example, you can test individual files on the [json linter website](`https://jsonlint.com/`).
Json files can get a bit long and you might sometimes forget a coma of a closing square brackets, so to make sure that your json file is correctly formatted you can use a linter. For example, you can test individual files on the [json linter website](https://jsonlint.com/).

??? "JSON-LD expansion"
You might notice that `rl:PHQ-9/PHQ9_schema` does not look like a typical URL and clearly does not match the one we fed the UI earlier (https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/PHQ-9/PHQ9_schema). Well this is because we have defined, in the `@context` part of our jsonld, that the `rl` from `rl:PHQ-9/PHQ9_schema` will actually stand for `https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/`. This shorthand makes it faster for us to write URL but the UI will know how to `expand` this into an actual URL.
Similarly the `reproschema:Protocol` in `"@type": "reproschema:Protocol"` expands in `http://schema.repronim.org/Protocol` because `reproschema` has been indirectly defined in the context of `depression_nimg_schema.jsonld`. To be more precise `reproschema` is defined in the [base file](https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/base) which is part of the context of the [generic file](https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic) that our protocol points to.

Similarly the `reproschema:Protocol` in `"@type": "reproschema:Protocol"` expands in `http://schema.repronim.org/Protocol` because `reproschema` has been indirectly defined in the context of `depression_nimg_schema.jsonld`. To be more precise `reproschema` is defined in the [base file](https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/base) which is part of the context of the [generic file](https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic) that our protocol points to.



Expand Down Expand Up @@ -254,5 +254,3 @@ git add --all
git commit -m 'add a thank you activity'
git push
```


4 changes: 2 additions & 2 deletions docs/53_tips_to_make_your_life_easier.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ grep -r "@context" . \
| cut -d: -f1 | xargs -I fname jsonlint -q fname
```

Or test individual files on the [json linter website](`https://jsonlint.com/`).
Or test individual files on the [json linter website](https://jsonlint.com/).

## Validating your schema

Expand Down Expand Up @@ -45,7 +45,7 @@ every time there some new content is added on a repository.
To set those up you simply need to create a `.github/workflows` folder inside
the repository where you are working. This will contain all the workflows (a set
of "actions") that Github has to run on this repository. Each workflow is
decribed by a `yml` file.
described by a `yml` file.

<!-- TODO
- add link to the turing-way section on yml files.
Expand Down
4 changes: 1 addition & 3 deletions docs/54_translating_an_activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Well there is an easy way to reuse the work we have already done to have the too
First here is the list of the questions of the EHI in French.

```
Quelle main utilisez vous de préférence pour:
Quelle main utilisez vous de préférence pour:
1) Écrire (*)
2) Dessiner
Expand Down Expand Up @@ -208,5 +208,3 @@ We need to update the `edinburgh_handedness_inventory_short.jsonld` so that the
"fr": "Quelle main utilisez vous de préférence pour :"
}
```


5 changes: 1 addition & 4 deletions docs/55_collecting_demographics_information.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Collecting information about your participant

Before you go and start creating new activities and items to collect the names, surnames and other demographics of your participants make sure you have had a look at these items on the reproschema library:
Before you go and start creating new activities and items to collect the names, surnames and other demographics of your participants make sure you have had a look at these items on the reproschema library:

See the [demographics_and_background_information_v1](https://github.com/ReproNim/reproschema-library/tree/master/activities/demographics_and_background_information_v1/items) folder:

Expand Down Expand Up @@ -146,6 +146,3 @@ demographics_and_background_information_v1/
}
}
```



2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ could save you from a lot of confusion. 😉
- Not sure how the project is organized? Check out the [project structure](./20_project_structure.md)
page.

- Want more details on how the `Reproschema` itself is structured: check out our [schema page](./30_schema)
- Want more details on how the `Reproschema` itself is structured: check out our [schema page](./30_schema.md)

<!-- - If you want to use the schema to create your own questionnaire: check out our
Expand Down
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ nav:
- Toolkit: "46_tools.md"
- Tutorial:
- Intro: "50_using_reproschema.md"
- Create a research protocol: "51_create_new_protocol.md"
- Create a research protocol: "51_create_new_protocol.md"
- Creating a new activity: "52_create_new_activity.md"
- Tips to make your life easier: "53_tips_to_make_your_life_easier.md"
- Translate a questionnaire: "54_translating_an_activity.md"
Expand All @@ -55,4 +55,4 @@ markdown_extensions:
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.superfences
4 changes: 2 additions & 2 deletions mlc_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{"pattern": "http://127.0.0.1:8000/"},
{"pattern": "^https://jsonformatter.curiousconcept.com/"},
{"pattern": "^http.*://schema.repronim.org/.*"},
{"pattern": "^http://schema.org/version/2.0/"}

{"pattern": "^http://schema.org/version/2.0/"},
{"pattern": "^https://doi.org/10.1080/1357650X.2013.783045"}
]
}

0 comments on commit 41d2eba

Please sign in to comment.