From ce7c4ed42cb478158e2fcc6fc18c0436b203cc5e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Fri, 10 May 2024 18:29:29 -0400 Subject: [PATCH] refactor jsonld snippets out of doc --- .github/workflows/pythonpackage.yml | 4 +- .github/workflows/validate.yml | 53 +++ .pre-commit-config.yaml | 14 + docs/glossary.md | 3 - docs/introduction.md | 2 +- docs/tutorials/create-new-activity.md | 388 +----------------- docs/tutorials/create-new-items.md | 220 ++++++++++ docs/tutorials/create-new-protocol.md | 47 ++- docs/tutorials/finalizing-the-protocol.md | 27 ++ .../tips-to-make-your-life-easier.md | 179 +------- docs/tutorials/translating-an-activity.md | 47 +-- docs/tutorials/using-reproschema.md | 25 +- docs/user_guide/finalize-protocol.md | 2 +- ...dinburgh_handedness_inventory_short.jsonld | 44 ++ .../activities/EHI/items/EHI_results.jsonld | 18 + .../activities/EHI/items/throwing.jsonld | 39 ++ .../activities/EHI/items/writing.jsonld | 39 ++ .../EHI/leftRightValueConstraints.jsonld | 31 ++ .../protocols/depression_nimg_schema.jsonld | 36 ++ includes/abbreviations.md | 3 + mkdocs.yml | 35 +- 21 files changed, 613 insertions(+), 643 deletions(-) create mode 100644 .github/workflows/validate.yml create mode 100644 docs/tutorials/create-new-items.md create mode 100644 docs/tutorials/finalizing-the-protocol.md create mode 100644 example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld create mode 100644 example_ehi/activities/EHI/items/EHI_results.jsonld create mode 100644 example_ehi/activities/EHI/items/throwing.jsonld create mode 100644 example_ehi/activities/EHI/items/writing.jsonld create mode 100644 example_ehi/activities/EHI/leftRightValueConstraints.jsonld create mode 100644 example_ehi/protocols/depression_nimg_schema.jsonld create mode 100644 includes/abbreviations.md diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 02a2762eb7..d484a62548 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip setuptools diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000000..7708a81ca4 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,53 @@ +name: validate protocol and activities + +# describes when this workfllow is triggered +on: + push: # when pushing to a branch + branches: [master] # on which branch + pull_request: # when opening a new pull request + branches: "*" # * refers to all branches + +jobs: + build: + # describes the operating system that will #be used + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks executed as part of the job + steps: + - name: Setup Node # installing Node.js for all the javascript part + uses: actions/setup-node@v4.0.2 + + # Checks-out your repository under $GITHUB_WORKSPACE, + # so your job can access it + - uses: actions/checkout@v2 + + # Checks that our JSON are valid + # Installing `jsonlint` to validate the JSON files + # Looking recursively through the directories `protocol` + # and `activities` for any file with "@context" in them + # (that makes them JSON-LD files) and validate their content + # with jsonlint + - name: Check for syntax errors + run: | + npm install -g jsonlint + grep -r "@context" activities | cut -d: -f1 | xargs -I fname jsonlint -q fname + grep -r "@context" protocols | cut -d: -f1 | xargs -I fname jsonlint -q fname + + # Checks that the schemas are valid + # Using python and the installing the reproschema tools + # from the reproschema-py repository to then validate + # the content of the `activities` and `protocols` folders. + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip setuptools + pip install reproschema requests_cache + + - name: Test with pyshacl + run: | + reproschema -l DEBUG validate activities + reproschema -l DEBUG validate protocols diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e38b9c78d..f238012efb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,3 +19,17 @@ repos: rev: v2.2.6 hooks: - id: codespell +# Check formatting of CSS and HTML +# prettier: https://prettier.io/ +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + types_or: [json] + # exclude files that + # - are skipped for other hooks + # - are still involved in some PR + exclude: | + (?x)^( + releases/.* + )$ diff --git a/docs/glossary.md b/docs/glossary.md index 898197690a..9e29a06953 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -4,8 +4,5 @@ - compute specification - input type - item -- JSON -- JSON-LD - protocol -- SHACL - visibility diff --git a/docs/introduction.md b/docs/introduction.md index f85ffee037..dca4e48c0a 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -1,6 +1,6 @@ # Introduction -??? example "Tl;DR - Advantages of the current schema representation" +!!! example "Tl;DR - Advantages of the current schema representation" - Rich contexts for a questionnaire with JSON-LD rather than a "flat" csv file. - A single source of curated assessments from [ReproSchema Library](https://github.com/ReproNim/reproschema-library) diff --git a/docs/tutorials/create-new-activity.md b/docs/tutorials/create-new-activity.md index 54c07729d3..533c0203d9 100644 --- a/docs/tutorials/create-new-activity.md +++ b/docs/tutorials/create-new-activity.md @@ -36,8 +36,7 @@ i) Which foot do you prefer to kick with ? ii) Which eye do you use when using only one? ``` -The asterisks denote the subset of items that belong to the short form of the -questionnaire. +The asterisks denote the subset of items that belong to the short form of the questionnaire. The scoring for each item follows the following scheme: @@ -55,7 +54,6 @@ classification according to the Laterality Quotient score goes as follow: - Right handers: 61 to 100 +Source: http://www.brainmapping.org/shared/Edinburgh.php +--> ## Preparing the JSON for the activity -Now let's create the `activities` folder, an activity file for the new -assessment tool we want to create. +Now let's create the `activities` folder, an activity file for the new assessment tool we want to create. For this tutorial we will be using the short form of the Edinburgh handedness inventory. ```bash @@ -80,7 +78,7 @@ touch activities/EHI/edinburgh_handedness_inventory_short.jsonld Now let's start by adding the following content in the activity file we have just created. -```json +```json linenums="1" { "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", "@type": "reproschema:Activity", @@ -92,16 +90,16 @@ Now let's start by adding the following content in the activity file we have jus } ``` -The content is for now very similar to the jsonld that defines our protocol. +The content is for now very similar to the JSON-LD that defines our protocol. The main difference is for the `@type` field that mentions that we are now describing an activity as defined in the Reproschema. Two other things we can add right away are: - the references for this questionnaire, -- the "preamble" that is common to all items in this questionnaire. +- the `"preamble"` that is common to all items in this questionnaire. -```json +```json linenums="1" hl_lines="9-10" { "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", "@type": "reproschema:Activity", @@ -114,373 +112,3 @@ Two other things we can add right away are: "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:" } ``` - -## Creating items - -Now that we have a basic structure for this new activity, let us start adding some items. - -Let's first start with the item for `writing` - -```bash -# Type this in a terminal window -mkdir activities/EHI/items -touch activities/EHI/items/writing.jsonld -``` - -The content for items starts like the ones we have seen so far but -`"reproschema:Field"` for the `@type` field. - -```json -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "writing.jsonld", - "prefLabel": "writing", - "description": "writing item of the EHI", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1" -} -``` - -We can now add: - -- the question for this item -- the response options -- and the `inputType` for for the user interface that will decide how this item will displayed to the user. - -```json -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "writing", - "prefLabel": "writing", - "description": "writing item of the EHI", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "question": "Writing", - "ui": { "inputType": "radio" }, - "responseOptions": { - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100, - "multipleChoice": false, - "choices": [ - { - "name": "Always right", - "value": 100 - }, - { - "name": "Usually right", - "value": 50 - }, - { - "name": "Both equally", - "value": 0 - }, - { - "name": "Usually left", - "value": -50 - }, - { - "name": "Always left", - "value": -100 - } - ] - } -} -``` - -### What did we add ? - -```json -"question": "Writing", -``` - -```json -"ui": {"inputType": "radio"}, -``` - -```json -"responseOptions": { - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100, - "multipleChoice": false, - "choices": [ - { - "name": "Always right", - "value": 100 - }, - { - "name": "Usually right", - "value": 50 - }, - { - "name": "Both equally", - "value": 0 - }, - { - "name": "Usually left", - "value": -50 - }, - { - "name": "Always left", - "value": -100 - } - ] -} -``` - - - -## In your own time: create a second item - -For next step you can create on your own the `throwing` item of the questionnaire. - -## Add the items to the activity - -```json -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Activity", - "@id": "edinburgh_handedness_inventory_short.jsonld", - "prefLabel": "Edinburgh handedness inventory - short form", - "description": "Short version of the Edinburgh handedness inventory", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "citation": "10.1080/1357650X.2013.783045", - "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:", - "ui": { - "order": ["items/writing.jsonld", "items/throwing.jsonld"], - "shuffle": false, - "addProperties": [ - { - "variableName": "writing", - "isAbout": "items/writing.jsonld", - "isVis": true - }, - { - "variableName": "throwing", - "isAbout": "items/throwing.jsonld", - "isVis": true - } - ] - } -} -``` - -### What did we add ? - -```json -"ui": { - "order": [ - "items/writing.jsonld", - "items/throwing.jsonld" - ], - "shuffle": false, - "addProperties": [ - { - "variableName": "writing", - "isAbout": "items/writing.jsonld", - "isVis": true - }, - { - "variableName": "throwing", - "isAbout": "items/throwing.jsonld", - "isVis": true - } - ] -} -``` - -## Viewing the activity - -Push the content you have created on your repository on github - -```bash -# Type this in a terminal window -git add --all -git commit -m 'adding the EHI activity' -git push -``` - -Use the UI to visualize just the activity. - -```text -https://www.repronim.org/reproschema-ui/#/activities/0?url=url-to-activity-schema -``` - -```text -https://www.repronim.org/reproschema-ui/#/activities/0?url=https://raw.githubusercontent.com/your_user_name/depression_nimg_schema/activities/edinburgh_handedness_inventory_short.jsonld -``` - - - - - -## Viewing the results - -### Creating an item for the results - -```bash -# Type this in a terminal window -mkdir activities/items -touch activities/items/EHI_results.jsonld -``` - -```json -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "EHI_results.jsonld", - "prefLabel": "EHI results", - "description": "Edinburgh handedness inventory", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "ui": { - "inputType": "number", - "readonlyValue": true - }, - "responseOptions": { - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100 - } -} -``` - -```json -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Activity", - "@id": "edinburgh_handedness_inventory_short.jsonld", - "prefLabel": "Edinburgh handedness inventory - short form", - "description": "Short version of the Edinburgh handedness inventory", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "citation": "10.1080/1357650X.2013.783045", - "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:", - "ui": { - "order": [ - "items/writing.jsonld", - "items/throwing.jsonld", - "items/EHI_results.jsonld" - ], - "shuffle": false, - "addProperties": [ - { - "variableName": "writing", - "isAbout": "items/writing.jsonld", - "valueRequired": true, - "isVis": true - }, - { - "variableName": "throwing", - "isAbout": "items/throwing.jsonld", - "valueRequired": true, - "isVis": true - }, - { - "isAbout": "items/EHI_results.jsonld", - "variableName": "EHI_results", - "isVis": true - } - ] - }, - "compute": [ - { - "variableName": "EHI_results", - "jsExpression": "( writing + throwing ) / 2" - } - ] -} -``` - -### What did we add ? - -```json - "ui": { - "order": [ - ... - "items/EHI_results.jsonld" - ], - "addProperties": [ - ... - { - "isAbout": "items/EHI_results.jsonld", - "variableName": "EHI_results", - "isVis": true - } - ] - } -``` - -```json -"compute": [ - { - "variableName": "EHI_results", - "jsExpression": "( writing + throwing ) / 2" - } -] -``` - -## Adding the activity to the protocol - -```json -{ - "@context": [ - "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - { - "rl": "https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/" - } - ], - "@type": "reproschema:Protocol", - "@id": "depression_nimg_schema.jsonld", - "prefLabel": "depression neuroimaging study", - "description": "a study on linguistic processing in depression", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "landingPage": { - "@id": "README.md", - "@language": "en" - }, - "ui": { - "addProperties": [ - { - "isAbout": "rl:PHQ-9/PHQ9_schema", - "variableName": "PHQ9_schema", - "prefLabel": { "en": "Depression" } - }, - { - "isAbout": "../activities/EHI/edinburgh_handedness_inventory_short.jsonld", - "variableName": "EHI_short_schema", - "prefLabel": { "en": "EHI" } - } - ], - "order": [ - "rl:PHQ-9/PHQ9_schema", - "EHI_short_schema" - ] - } -} -``` - -### What did we add ? - -```json -"ui": { -"addProperties": [ - ... - { - "isAbout": "../activities/edinburgh_handedness_inventory_short.jsonld", - "variableName": "EHI_short_schema", - "prefLabel": { "en": "EHI" } - } -], -"order": [ - ... - "EHI_short_schema" - ] -} -``` diff --git a/docs/tutorials/create-new-items.md b/docs/tutorials/create-new-items.md new file mode 100644 index 0000000000..e5ee267edf --- /dev/null +++ b/docs/tutorials/create-new-items.md @@ -0,0 +1,220 @@ + +## Creating items + +Now that we have a basic structure for this new activity, let us start adding some items. + +Let's first start with the item for `writing` + +```bash +# Type this in a terminal window +mkdir activities/EHI/items +touch activities/EHI/items/writing.jsonld +``` + +The content for items starts like the ones we have seen so far but +`"reproschema:Field"` for the `@type` field. + +```json linenums="1" +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "writing.jsonld", + "prefLabel": "writing", + "description": "writing item of the EHI", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1" +} +``` + +We can now add: + +- the question for this item +- the `inputType` for for the user interface that will decide how this item will displayed to the user. +- the response options + +```json linenums="1" hl_lines="9 10 11-38" +--8<-- "example_ehi/activities/EHI/items/writing.jsonld" +``` + +### What did we add ? + +- the question for this item + +```json +"question": "Writing", +``` + +- the `inputType` for for the user interface that will decide how this item will displayed to the user. + +```json +"ui": {"inputType": "radio"}, +``` + +- the response options + +```json +"responseOptions": { + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100, + "multipleChoice": false, + "choices": [ + { + "name": "Always right", + "value": 100 + }, + { + "name": "Usually right", + "value": 50 + }, + { + "name": "Both equally", + "value": 0 + }, + { + "name": "Usually left", + "value": -50 + }, + { + "name": "Always left", + "value": -100 + } + ] +} +``` + + + +## In your own time: create a second item + +For next step you can create on your own the `throwing` item of the questionnaire. + +## Add the items to the activity + +```json linenums="1" hl_lines="11-26" +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Activity", + "@id": "edinburgh_handedness_inventory_short.jsonld", + "prefLabel": "Edinburgh handedness inventory - short form", + "description": "Short version of the Edinburgh handedness inventory", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "citation": "10.1080/1357650X.2013.783045", + "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:", + "ui": { + "order": ["items/writing.jsonld", "items/throwing.jsonld"], + "shuffle": false, + "addProperties": [ + { + "variableName": "writing", + "isAbout": "items/writing.jsonld", + "isVis": true + }, + { + "variableName": "throwing", + "isAbout": "items/throwing.jsonld", + "isVis": true + } + ] + } +} +``` + +### What did we add ? + +```json +"ui": { + "order": [ + "items/writing.jsonld", + "items/throwing.jsonld" + ], + "shuffle": false, + "addProperties": [ + { + "variableName": "writing", + "isAbout": "items/writing.jsonld", + "isVis": true + }, + { + "variableName": "throwing", + "isAbout": "items/throwing.jsonld", + "isVis": true + } + ] +} +``` + +## Viewing the results + +### Creating an item for the results + +```bash +# Type this in a terminal window +touch activities/EHI/items/EHI_results.jsonld +``` + +Add the following content to it. + +```json linenums="1" +--8<-- "example_ehi/activities/EHI/items/EHI_results.jsonld" +``` + +Add it to the activity. + +```json linenums="1" hl_lines="15 31-35 38-42" +--8<-- "example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld" +``` + + +## Using presets response options + +If you have to create several items that always have the same set of response options, +then it might be easier to create a separate file with those response options and point each item to that file instead. +This way, if you need to change the characteristics of one response, +you only have to change things in one file rather than in many. + +For example, you could create response set file to constrains the possible answers +on the questions of the Edinburgh Handedness Inventory we have been working on by organizing things this way. + +```text +activities +├── edinburgh_handedness_inventory_short.jsonld +├── leftRightValueConstraints.jsonld +└── items + ├── writing.jsonld + ├ ... + ... +``` + +The content of the `leftRightValueConstraints.jsonld` file would look like this: + +```json linenums="1" +--8<-- "example_ehi/activities/EHI/leftRightValueConstraints.jsonld" +``` + +And you can point each item to it by referring to the local file in the `responseOptions` field. + +```json linenums="1" hl_lines="11" +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "writing", + "prefLabel": "writing", + "description": "writing item of the EHI", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "question": "Writing", + "ui": { "inputType": "radio" }, + "responseOptions": "../leftRightValueConstraints.jsonld" +} +``` + + diff --git a/docs/tutorials/create-new-protocol.md b/docs/tutorials/create-new-protocol.md index 8f9205af2b..e98f683872 100644 --- a/docs/tutorials/create-new-protocol.md +++ b/docs/tutorials/create-new-protocol.md @@ -32,9 +32,9 @@ Ok so now we are ready to start putting some content into those files. Open the `depression_nimg_schema.jsonld` with a text editor and add the following content into it. -```json +```json linenums="1" { - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@context": ["https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic"], "@type": "reproschema:Protocol", "@id": "depression_nimg_schema.jsonld", "prefLabel": "depression neuroimaging study", @@ -46,8 +46,8 @@ Open the `depression_nimg_schema.jsonld` with a text editor and add the followin To explain a bit what all of this means: -- `@context` gives the URL where we can find the "definitions" of terms used in the reproschema. It is itself a json file that you [can view directly](https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic). -- `@type` just says what type of entity this jsonld file describes. In this case it is a `protocol` entity as defined by the reproschema. +- `@context` gives the URL where we can find the "definitions" of terms used in the reproschema. It is itself a JSON file that you [can view directly](https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic). +- `@type` just says what type of entity this JSON-LD file describes. In this case it is a `protocol` entity as defined by the reproschema. - `@id` is the identity of this entity, its unique identifier. You can then use the preferred label field and the description to give more human readable ways to describe this entity. @@ -75,9 +75,9 @@ Hello world Now we want to add this file to our protocol and make it the landing page for the english version of this study. So the content of your protocol file should now read like this. -```json +```json linenums="1" hl_lines="9-12" { - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@context": ["https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic"], "@type": "reproschema:Protocol", "@id": "depression_nimg_schema.jsonld", "prefLabel": "depression neuroimaging study", @@ -91,8 +91,9 @@ Now we want to add this file to our protocol and make it the landing page for th } ``` -??? "A note about relative paths" - Reproschema allows for the use of relative paths which means that in the example above the landing page `@id` being "README.md" means that the `README.md` and `depression_nimg_schema` are in the same folder. If the `README.md` had been in the parent directory, the `@id` of the `landingPage` section would have read `"@id": "../README.md"`. +!!! note "A note about relative paths" + Reproschema allows for the use of relative paths which means that in the example above the landing page `@id` being "README.md" means that the `README.md` and `depression_nimg_schema` are in the same folder. + If the `README.md` had been in the parent directory, the `@id` of the `landingPage` section would have read `"@id": "../README.md"`. ### Add a first assessment @@ -104,9 +105,11 @@ It seems that we can use the [PHQ-9](https://www.ncbi.nlm.nih.gov/pmc/articles/P The schema that describe the PHQ-9 activity can be found [here](https://github.com/ReproNim/reproschema-library/blob/master/activities/PHQ-9/PHQ9_schema). -If you want to visualize this activity on its own, you can use the [reproschema-ui](https://www.repronim.org/reproschema-ui/#/). To do that you can point the UI to the **raw** content of this activity. +If you want to visualize this activity on its own, you can use the [reproschema-ui](https://www.repronim.org/reproschema-ui/#/). +To do that you can point the UI to the **raw** content of this activity. -To get access to the raw content of that activity you must click on the `Raw` button on github once you have opened its [page](https://github.com/ReproNim/reproschema-library/blob/master/activities/PHQ-9/PHQ9_schema). This will open this URL: [https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/PHQ-9/PHQ9_schema](https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/PHQ-9/PHQ9_schema). +To get access to the raw content of that activity you must click on the `Raw` button on github once you have opened its [page](https://github.com/ReproNim/reproschema-library/blob/master/activities/PHQ-9/PHQ9_schema). +This will open this URL: [https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/PHQ-9/PHQ9_schema](https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/PHQ-9/PHQ9_schema). You can then pass the the URL of raw content to the UI using the following template: @@ -123,7 +126,7 @@ https://www.repronim.org/reproschema-ui/#/activities/0?url=https://raw.githubuse You should now be able to see something like this and browse directly through the content of the activity. phq-9_ui.png @@ -131,7 +134,7 @@ OK now that we know what we need to add to our protocol, let's add it our schema To do this, the content of your `depression_nimg_schema.jsonld` should now look like this. -```json +```json linenums="1" hl_lines="4-6 18-27" { "@context": [ "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", @@ -176,15 +179,17 @@ 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/). +!!! note "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-LD expansion" +!!! note "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/`. + Well this is because we have defined, in the `@context` part of our JSON-LD, 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. #### Starting to put things online to see how they look @@ -210,10 +215,10 @@ git commit -m 'add protocol and README' # make a first snapshot of your protocol Now to move things to a github repository, you need to go and create an empty repository to host the folder and files you have created. -The repository should have an URL that resembles this one where `your_user_name` is your actual Github username: +The repository should have an URL that resembles this one where `` is your actual Github username: ```text -https://github.com/your_user_name/depression_nimg_schema.git +https://github.com//depression_nimg_schema.git ``` You "push" the content of the `depression_nimg_schema` onto the empty "remote" repository you have just created. @@ -222,7 +227,7 @@ You "push" the content of the `depression_nimg_schema` onto the empty "remote" r # Type this in a terminal window # tell git about the existence of this new online repository you have just created -git remote add origin https://github.com/your_user_name/depression_nimg_schema.git +git remote add origin https://github.com//depression_nimg_schema.git # Transfer the content there git push -u origin master @@ -237,7 +242,7 @@ https://www.repronim.org/reproschema-ui/#/?url=url-to-protocol-schema So once again grab the URL of the **raw** content of your protocol and point the UI to it: ```text -https://www.repronim.org/reproschema-ui/#/?url=https://raw.githubusercontent.com/your_user_name/depression_nimg_schema/master/protocol/depression_nimg_schema.jsonld +https://www.repronim.org/reproschema-ui/#/?url=https://raw.githubusercontent.com//depression_nimg_schema/master/protocol/depression_nimg_schema.jsonld ``` ### In you own time: add the `thank-you` activity diff --git a/docs/tutorials/finalizing-the-protocol.md b/docs/tutorials/finalizing-the-protocol.md new file mode 100644 index 0000000000..e5776b1dae --- /dev/null +++ b/docs/tutorials/finalizing-the-protocol.md @@ -0,0 +1,27 @@ + +## Viewing the activity + +Push the content you have created on your repository on github + +```bash +# Type this in a terminal window +git add --all +git commit -m 'adding the EHI activity' +git push +``` + +Use the UI to visualize just the activity. + +```text +https://www.repronim.org/reproschema-ui/#/activities/0?url=url-to-activity-schema +``` + +```text +https://www.repronim.org/reproschema-ui/#/activities/0?url=https://raw.githubusercontent.com//depression_nimg_schema/activities/edinburgh_handedness_inventory_short.jsonld +``` + +## Adding the activity to the protocol + +```json linenums="1" hl_lines="25-29 33" +--8<-- "example_ehi/protocols/depression_nimg_schema.jsonld" +``` diff --git a/docs/tutorials/tips-to-make-your-life-easier.md b/docs/tutorials/tips-to-make-your-life-easier.md index 4be79df074..e5a6684215 100644 --- a/docs/tutorials/tips-to-make-your-life-easier.md +++ b/docs/tutorials/tips-to-make-your-life-easier.md @@ -1,13 +1,9 @@ # Tips to make your life easier -## Validating your json files +## Validating your JSON files - - -First, make sure your syntax is in correct jsonld format. Test all files with -`@context` from command line: +First, make sure your syntax is in correct JSON-LD format. +Test all files with `@context` from command line: ```bash npm install -g jsonlint @@ -18,11 +14,6 @@ Or test individual files on the [json linter website](https://jsonlint.com/). ## Validating your schema - - ```bash pip install reproschema requests_cache reproschema -l DEBUG validate activities @@ -41,14 +32,9 @@ into your workflow. They rely on using some of the features of Github or Git. The first one is using Github actions to let Github perform those checks for you 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 -described by a `yml` file. - - +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 described by a `yml` file. For example you could create a `validate.yml` file in this repository. @@ -56,7 +42,7 @@ For example you could create a `validate.yml` file in this repository. ├── .git # hidden git folder ├── .github # hidden github folder │ └── workflows -│ └── validate.xml # file the actions used to validate your schema +│ └── validate.yml # file the actions used to validate your schema ├── protocols │ ├── README-en.md │ └── protocol-1.jsonld @@ -70,154 +56,5 @@ For example you could create a `validate.yml` file in this repository. The content of `validate.yml` file would look like this. ```yaml -name: validate protocol and activities - -# describes when this workfllow is triggered -on: - push: # when pushing to a branch - branches: [master] # on which branch - pull_request: # when opening a new pull request - branches: "*" # * refers to all branches - -jobs: - build: - # describes the operating system that will #be used - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks executed as part of the job - steps: - - name: Setup Node # installing Node.js for all the javascript part - uses: actions/setup-node@v1 - with: - node-version: "12.x" - - # Checks-out your repository under $GITHUB_WORKSPACE, - # so your job can access it - - uses: actions/checkout@v2 - - # Checks that our JSON are valid - # Installing `jsonlint` to validate the JSON files - # Looking recursively through the directories `protocol` - # and `activities` for any file with "@context" in them - # (that makes them jsonld files) and validate their content - # with jsonlint - - name: Check for syntax errors - run: | - npm install -g jsonlint - grep -r "@context" activities | cut -d: -f1 | xargs -I fname jsonlint -q fname - grep -r "@context" protocols | cut -d: -f1 | xargs -I fname jsonlint -q fname - - # Checks that the schemas are valid - # Using python and the installing the reproschema tools - # from the reproschema-py repository to then validate - # the content of the `activities` and `protocols` folders. - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - pip install reproschema requests_cache - - - name: Test with pyshacl - run: | - reproschema -l DEBUG validate activities - reproschema -l DEBUG validate protocols +--8<-- ".github/workflows/validate.yml" ``` - -### Using git hooks and pre-commit - -## Using a template for a new protocol - -If you are starting a new study from scratch and already familiar with some of -the basics of reproschema, we recommend you use our template repository that -already has some basic set-up to to validate your files... - - - -## Using presets response options - -If you have to create several items that always have the same set of response -options, then it might be easier to create a separate file with those response -options and point each item to that file instead. This way, if you need to -change the characteristics of one response, you only have to change things in -one file rather than in many. - -For example, you could create response set file to constrains the possible -answers on the questions of the Edinburgh Handedness Inventory we have been -working on by organizing things this way. - -```text -activities -├── edinburgh_handedness_inventory_short.jsonld -├── leftRightValueConstraints.jsonld -└── items - ├── writing.jsonld - ├ ... - ... -``` - -The content of the `leftRightValueConstraints.jsonld` file would look like this: - -```json -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@id": "leftRightValueConstraints.jsonld", - "@type": "reproschema:ResponseOption", - "valueType": "xsd:integer", - "minValue": -100, - "maxValue": 100, - "multipleChoice": false, - "choices": [ - { - "name": "Always right", - "value": 100 - }, - { - "name": "Usually right", - "value": 50 - }, - { - "name": "Both equally", - "value": 0 - }, - { - "name": "Usually left", - "value": -50 - }, - { - "name": "Always left", - "value": -100 - } - ] -} -``` - -And you can point each item to it by referring to the local file in the -`responseOptions` field. - -```json -{ - "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", - "@type": "reproschema:Field", - "@id": "writing", - "prefLabel": "writing", - "description": "writing item of the EHI", - "schemaVersion": "1.0.0-rc1", - "version": "0.0.1", - "question": "Writing", - "ui": { "inputType": "radio" }, - "responseOptions": "../leftRightValueConstraints.jsonld" -} -``` - - diff --git a/docs/tutorials/translating-an-activity.md b/docs/tutorials/translating-an-activity.md index 2821261879..9a586f63ee 100644 --- a/docs/tutorials/translating-an-activity.md +++ b/docs/tutorials/translating-an-activity.md @@ -1,6 +1,7 @@ # Translating a questionnaire -Imagine that a colleague of yours has heard that you have created this online tool based on the Edinburgh handedness inventory and she wants to use it for her own work. But she would need a French version of the questionnaire. +Imagine that a colleague of yours has heard that you have created this online tool based on the Edinburgh handedness inventory +and she wants to use it for her own work. But she would need a French version of the questionnaire. Well there is an easy way to reuse the work we have already done to have the tool support several languages. @@ -24,25 +25,9 @@ i) Quel est le pied avec lequel vous préférez shooter? ii) Quel oeil utiliser-vous pour viser? ``` - - ## Updating the items -```json +```json linenums="1" hl_lines="5-8 12-15" { "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", "@type": "reproschema:Field", @@ -63,25 +48,9 @@ Quel main utilisez vous pour tenir votre canne (ou chien guide si pas de canne)? } ``` -### What did we change ? - -```json -"prefLabel": { - "en": "writing", - "fr": "écrire" -} -``` - -```json -"question": { - "en": "Writing", - "fr": "Écrire" -} -``` - ## Updating the response options -```json +```json linenums="1" hl_lines="5-8 12-15" { "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", "@id": "leftRightValueConstraints.jsonld", @@ -130,17 +99,11 @@ Quel main utilisez vous pour tenir votre canne (ou chien guide si pas de canne)? } ``` -### What did we change ? - -```json - -``` - ## Updating the activity We need to update the `edinburgh_handedness_inventory_short.jsonld` so that the preamble question has both languages: -```json +```json linenums="1" hl_lines="5-8 12-15" { "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", "@type": "reproschema:Activity", diff --git a/docs/tutorials/using-reproschema.md b/docs/tutorials/using-reproschema.md index dc3a1a8bb2..c1dde517b4 100644 --- a/docs/tutorials/using-reproschema.md +++ b/docs/tutorials/using-reproschema.md @@ -1,7 +1,8 @@ # How can I use reproschema to create my own questionnaire? -Broadly speaking, there are two ways to create new assessments (`actitivies`) or combinations -of assessments (`protocols`). IF you only have very few items to put in new activity or you simply want to create a protocol that reuses activities that already exist, you can do that manually by editing the files directly. But if you have to create complex activities or protocols, we suggest that for your own sanity and to avoid wasting time in the long run, you look into scripting the creation of your new tools. +Broadly speaking, there are two ways to create new assessments (`actitivies`) or combinations of assessments (`protocols`). +If you only have very few items to put in new activity or you simply want to create a protocol that reuses activities that already exist, you can do that manually by editing the files directly. +But if you have to create complex activities or protocols, we suggest that for your own sanity and to avoid wasting time in the long run, you look into scripting the creation of your new tools. ## Manual schema generation @@ -13,11 +14,12 @@ For this tutorial you will be using some other tools to put your work online. He - [Git](https://git-scm.com/downloads) - a [Github account](https://github.com/) -- a "decent" text editor like [atom](https://atom.io/) or [visual studio code](https://code.visualstudio.com/) and we do recommend that you look for extensions or packages that help you deal with json files. +- a "decent" text editor like [visual studio code](https://code.visualstudio.com/) and we do recommend that you look for extensions or packages that help you deal with JSON files. -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. +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" +!!! note "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 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 @@ -32,11 +34,14 @@ So we would want to have a set of questionnaires: ## A note about this tutorial -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. +We will be creating several JSON-LD 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: -```json +```json linenums="1" { "@context": "some_URL", "@type": "reproschema:Protocol", @@ -48,7 +53,7 @@ So if step 1 looked like this: We will make sure that step 2 where we add a `landingPage` field looks like this: -```json +```json linenums="1" hl_lines="7" { "@context": "some_URL", "@type": "reproschema:Protocol", @@ -61,7 +66,7 @@ We will make sure that step 2 where we add a `landingPage` field looks like this Although some other possibility would be equivalent: -```json +```json linenums="1" hl_lines="2" { "landingPage": {"@id": "README.md"}, "@context": "some_URL", @@ -72,7 +77,7 @@ Although some other possibility would be equivalent: } ``` -```json +```json linenums="1" hl_lines="5" { "@context": "some_URL", "@type": "reproschema:Protocol", diff --git a/docs/user_guide/finalize-protocol.md b/docs/user_guide/finalize-protocol.md index af9c0b06e8..465e3e39ab 100644 --- a/docs/user_guide/finalize-protocol.md +++ b/docs/user_guide/finalize-protocol.md @@ -20,7 +20,7 @@ In the 'DemoProtocol_schema', located in the 'DemoProtocol' folder, we integrate } ``` - This structure is repeated for each activity, including audio check, demographics, psychological questions, clinical questions, speech task, and feedback. +This structure is repeated for each activity, including audio check, demographics, psychological questions, clinical questions, speech task, and feedback. 1. [Order of presentation](https://github.com/ReproNim/reproschema-demo-protocol/blob/454ea9b65ef563c70cd496de7c8f22fbbc18ba5a/reproschema_demo_protocol/reproschema_demo_protocol_schema#L50) diff --git a/example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld b/example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld new file mode 100644 index 0000000000..73abba97fb --- /dev/null +++ b/example_ehi/activities/EHI/edinburgh_handedness_inventory_short.jsonld @@ -0,0 +1,44 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Activity", + "@id": "edinburgh_handedness_inventory_short.jsonld", + "prefLabel": "Edinburgh handedness inventory - short form", + "description": "Short version of the Edinburgh handedness inventory", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "citation": "10.1080/1357650X.2013.783045", + "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:", + "ui": { + "order": [ + "items/writing.jsonld", + "items/throwing.jsonld", + "items/EHI_results.jsonld" + ], + "shuffle": false, + "addProperties": [ + { + "variableName": "writing", + "isAbout": "items/writing.jsonld", + "valueRequired": true, + "isVis": true + }, + { + "variableName": "throwing", + "isAbout": "items/throwing.jsonld", + "valueRequired": true, + "isVis": true + }, + { + "isAbout": "items/EHI_results.jsonld", + "variableName": "EHI_results", + "isVis": true + } + ] + }, + "compute": [ + { + "variableName": "EHI_results", + "jsExpression": "( writing + throwing ) / 2" + } + ] +} diff --git a/example_ehi/activities/EHI/items/EHI_results.jsonld b/example_ehi/activities/EHI/items/EHI_results.jsonld new file mode 100644 index 0000000000..584494c28a --- /dev/null +++ b/example_ehi/activities/EHI/items/EHI_results.jsonld @@ -0,0 +1,18 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "EHI_results.jsonld", + "prefLabel": "EHI results", + "description": "Edinburgh handedness inventory", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "ui": { + "inputType": "number", + "readonlyValue": true + }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100 + } +} diff --git a/example_ehi/activities/EHI/items/throwing.jsonld b/example_ehi/activities/EHI/items/throwing.jsonld new file mode 100644 index 0000000000..228293709b --- /dev/null +++ b/example_ehi/activities/EHI/items/throwing.jsonld @@ -0,0 +1,39 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "throwing", + "prefLabel": "throwing", + "description": "throwing item of the EHI", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "question": "Throwing", + "ui": { "inputType": "radio" }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100, + "multipleChoice": false, + "choices": [ + { + "name": "Always right", + "value": 100 + }, + { + "name": "Usually right", + "value": 50 + }, + { + "name": "Both equally", + "value": 0 + }, + { + "name": "Usually left", + "value": -50 + }, + { + "name": "Always left", + "value": -100 + } + ] + } +} diff --git a/example_ehi/activities/EHI/items/writing.jsonld b/example_ehi/activities/EHI/items/writing.jsonld new file mode 100644 index 0000000000..7bc24969e1 --- /dev/null +++ b/example_ehi/activities/EHI/items/writing.jsonld @@ -0,0 +1,39 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@type": "reproschema:Field", + "@id": "writing", + "prefLabel": "writing", + "description": "writing item of the EHI", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "question": "Writing", + "ui": { "inputType": "radio" }, + "responseOptions": { + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100, + "multipleChoice": false, + "choices": [ + { + "name": "Always right", + "value": 100 + }, + { + "name": "Usually right", + "value": 50 + }, + { + "name": "Both equally", + "value": 0 + }, + { + "name": "Usually left", + "value": -50 + }, + { + "name": "Always left", + "value": -100 + } + ] + } +} diff --git a/example_ehi/activities/EHI/leftRightValueConstraints.jsonld b/example_ehi/activities/EHI/leftRightValueConstraints.jsonld new file mode 100644 index 0000000000..59afe82fb7 --- /dev/null +++ b/example_ehi/activities/EHI/leftRightValueConstraints.jsonld @@ -0,0 +1,31 @@ +{ + "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + "@id": "leftRightValueConstraints.jsonld", + "@type": "reproschema:ResponseOption", + "valueType": "xsd:integer", + "minValue": -100, + "maxValue": 100, + "multipleChoice": false, + "choices": [ + { + "name": "Always right", + "value": 100 + }, + { + "name": "Usually right", + "value": 50 + }, + { + "name": "Both equally", + "value": 0 + }, + { + "name": "Usually left", + "value": -50 + }, + { + "name": "Always left", + "value": -100 + } + ] +} diff --git a/example_ehi/protocols/depression_nimg_schema.jsonld b/example_ehi/protocols/depression_nimg_schema.jsonld new file mode 100644 index 0000000000..47ab49fd83 --- /dev/null +++ b/example_ehi/protocols/depression_nimg_schema.jsonld @@ -0,0 +1,36 @@ +{ + "@context": [ + "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic", + { + "rl": "https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/" + } + ], + "@type": "reproschema:Protocol", + "@id": "depression_nimg_schema.jsonld", + "prefLabel": "depression neuroimaging study", + "description": "a study on linguistic processing in depression", + "schemaVersion": "1.0.0-rc1", + "version": "0.0.1", + "landingPage": { + "@id": "README.md", + "@language": "en" + }, + "ui": { + "addProperties": [ + { + "isAbout": "rl:PHQ-9/PHQ9_schema", + "variableName": "PHQ9_schema", + "prefLabel": { "en": "Depression" } + }, + { + "isAbout": "../activities/EHI/edinburgh_handedness_inventory_short.jsonld", + "variableName": "EHI_short_schema", + "prefLabel": { "en": "EHI" } + } + ], + "order": [ + "rl:PHQ-9/PHQ9_schema", + "EHI_short_schema" + ] + } +} diff --git a/includes/abbreviations.md b/includes/abbreviations.md new file mode 100644 index 0000000000..1daeea9c3a --- /dev/null +++ b/includes/abbreviations.md @@ -0,0 +1,3 @@ +*[JSON]: JavaScript Object Notation +*[JSON-LD]: JavaScript Object Notation - Linked Data +*[SHACL]: Shapes Constraint Language diff --git a/mkdocs.yml b/mkdocs.yml index 2b774bc2ae..a92b331d2f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -9,6 +9,9 @@ theme: language: "en" favicon: img/favicon.png logo: img/favicon_on_white.png + features: + - content.code.copy + - content.code.annotate palette: primary: "dark blue" accent: "light blue" @@ -27,32 +30,40 @@ nav: - Finalize the protocol: "user_guide/finalize-protocol.md" - Toolkit: "user_guide/tools.md" - Tutorial: - - Intro: "tutorials/using_reproschema.md" - - Create a research protocol: "tutorials/create-new_protocol.md" - - Creating a new activity: "tutorials/create-new-activity.md" + - Intro: "tutorials/using-reproschema.md" + - Create a protocol: "tutorials/create-new-protocol.md" + - Create a new activity: "tutorials/create-new-activity.md" + - Create new items: "tutorials/create-new-items.md" + - Finalize the protocol: "tutorials/finalizing-the-protocol.md" - Tips to make your life easier: "tutorials/tips-to-make-your-life-easier.md" - Translate a questionnaire: "tutorials/translating-an-activity.md" - Demographic information : "tutorials/collecting-demographics-information.md" - # - Creating a new activity and protocol: "create_new_activity_protocol.md" - # - Testing your schema and collecting data: "testing_using_schema.md" - # - Contribute to the project: - # - ReproSchema: "81_contribute_to_schema.md" - # - Assesement library: "82_contribute_to_library.md" - # - Python package: "83_contribute_to_python.md" - # - User-interface: "84_contribute_to_ui.md" - FAQ: "FAQ.md" - Glossary: "glossary.md" - Contributing: "CONTRIBUTING.md" # list of extension markdown_extensions: + - abbr + - attr_list - admonition - - pymdownx.details - pymdownx.critic + - pymdownx.details - pymdownx.highlight: anchor_linenums: true line_spans: __span pygments_lang_class: true - pymdownx.inlinehilite - - pymdownx.snippets - pymdownx.superfences + - pymdownx.snippets: + auto_append: + - includes/abbreviations.md + - toc: + anchorlink: true + +watch: + - includes + +plugins: + - search + - tags