├── .flake8
├── .github
├── dependabot.yml
└── workflows
│ ├── check_md_links.yml
│ ├── publishdocs.yaml
│ ├── push_reproschema_py.yml
│ ├── run_precommit.yml
│ ├── update_precommit_hooks.yml
│ ├── validate_and_release.yml
│ └── validate_cff.yml
├── .gitignore
├── .gitmodules
├── .pre-commit-config.yaml
├── .remarkrc
├── CITATION.cff
├── LICENSE
├── README.md
├── contexts
└── reproschema
├── docs
├── CONTRIBUTING.md
├── FAQ.md
├── how-to
│ ├── validation.md
│ └── visualize.md
├── img
│ ├── favicon.png
│ ├── favicon_on_white.png
│ ├── phq-9_ui.png
│ ├── reproschema.png
│ ├── reproschema.svg
│ └── reproschema_logo.png
├── index.md
├── introduction.md
├── library.md
├── project-structure.md
├── schema
│ └── schema.md
├── tutorials
│ ├── create-new-activity.md
│ ├── create-new-items.md
│ ├── create-new-protocol.md
│ ├── finalizing-the-protocol.md
│ ├── translating-an-activity.md
│ └── using-reproschema.md
└── user-guide
│ ├── adopt-assessments.md
│ ├── create-new-assess.md
│ ├── create-new-protocol.md
│ ├── finalize-protocol.md
│ ├── setup-feedback.md
│ └── tools.md
├── examples
├── activities
│ ├── EHI
│ │ ├── edinburgh_handedness_inventory_short.jsonld
│ │ ├── edinburgh_handedness_inventory_short_multi_lang.jsonld
│ │ ├── items
│ │ │ ├── EHI_results.jsonld
│ │ │ ├── throwing.jsonld
│ │ │ └── writing.jsonld
│ │ ├── leftRightValueConstraints.jsonld
│ │ └── leftRightValueConstraintsMultiLang.jsonld
│ ├── activity1.jsonld
│ ├── activity1_embed.jsonld
│ ├── items
│ │ ├── activity1_total_score
│ │ ├── item1.jsonld
│ │ └── item2.jsonld
│ └── user_guide
│ │ └── items
│ │ └── feedback.jsonld
├── protocols
│ ├── README.md
│ ├── depression_nimg_schema.jsonld
│ ├── protocol1.jsonld
│ └── protocol1_embed.jsonld
└── responses
│ ├── response1.jsonld
│ └── responseActivity1.jsonld
├── includes
└── abbreviations.md
├── linkml-schema
└── reproschema.yaml
├── macros
├── __init__.py
├── macros.py
└── main.py
├── makefile
├── mkdocs.yml
├── mlc_config.json
├── npm-requirements.txt
├── pyproject.toml
├── releases
├── 1.0.0-rc1
│ ├── base
│ ├── generic
│ ├── reproschema-shacl.ttl
│ ├── reproschema.jsonld
│ ├── reproschema.nt
│ └── reproschema.ttl
├── 1.0.0-rc2
│ ├── base
│ ├── generic
│ ├── reproschema-shacl.ttl
│ ├── reproschema.jsonld
│ ├── reproschema.nt
│ └── reproschema.ttl
├── 1.0.0-rc3
│ ├── base
│ ├── generic
│ ├── reproschema-shacl.ttl
│ ├── reproschema.jsonld
│ ├── reproschema.nt
│ └── reproschema.ttl
├── 1.0.0-rc4
│ ├── base
│ ├── generic
│ ├── reproschema-shacl.ttl
│ ├── reproschema.jsonld
│ ├── reproschema.nt
│ └── reproschema.ttl
└── 1.0.0
│ ├── reproschema
│ ├── reproschema.jsonld
│ ├── reproschema.nt
│ ├── reproschema.ttl
│ └── reproschema_model.py
├── requirements.txt
├── scripts
├── fix_pydantic.py
└── jsonParser.py
├── templates
└── library_table.jinja
└── terms
├── Activity
├── AdditionalNoteObj
├── AdditionalProperty
├── AllowExport
├── AllowReplay
├── AutoAdvance
├── Choice
├── ComputeSpecification
├── DisableBack
├── DontKnow
├── Field
├── MessageSpecification
├── OverrideProperty
├── Participant
├── Protocol
├── Response
├── ResponseActivity
├── ResponseOption
├── Skipped
├── SoftwareAgent
├── TimedOut
├── UnitOption
├── addProperties
├── additionalNotesObj
├── allow
├── choices
├── column
├── compute
├── datumType
├── inputType
├── isAbout
├── isVis
├── jsExpression
├── landingPage
├── limit
├── maxRetakes
├── message
├── messages
├── multipleChoice
├── order
├── overrideProperties
├── preamble
├── randomMaxDelay
├── responseOptions
├── schedule
├── shuffle
├── source
├── statusOptions
├── unitOptions
├── value
├── valueType
└── variableName
/.flake8:
--------------------------------------------------------------------------------
1 | [flake8]
2 | max-line-length=79
3 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # Documentation
3 | # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
4 | version: 2
5 | updates:
6 | - package-ecosystem: github-actions
7 | directory: /
8 | schedule:
9 | interval: monthly
10 |
--------------------------------------------------------------------------------
/.github/workflows/check_md_links.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Check Markdown links
3 |
4 | # checking for any dead links in markdown files
5 |
6 | concurrency:
7 | group: ${{ github.workflow }}-${{ github.ref }}
8 | cancel-in-progress: true
9 |
10 | on:
11 | push:
12 | branches:
13 | - main
14 | pull_request:
15 | branches: ['*']
16 |
17 | jobs:
18 | markdown-link-check:
19 | runs-on: ubuntu-latest
20 | steps:
21 | - uses: actions/checkout@v4
22 | - uses: gaurav-nelson/github-action-markdown-link-check@v1
23 | with:
24 | config-file: ./mlc_config.json
25 | folder-path: ./docs/
26 | use-verbose-mode: yes
27 | max-depth: -1
28 | file-path: ./README.md,
29 |
--------------------------------------------------------------------------------
/.github/workflows/publishdocs.yaml:
--------------------------------------------------------------------------------
1 | name: Publish docs via GitHub Pages
2 | on:
3 | push:
4 | branches:
5 | - main
6 |
7 | jobs:
8 | build:
9 | name: Deploy docs
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: Checkout
13 | uses: actions/checkout@v4
14 |
15 | - name: Set up Python
16 | uses: actions/setup-python@v5
17 | with:
18 | python-version: 3.9
19 |
20 | - name: Install the required python packages
21 | run: python -m pip install linkml
22 |
23 | - name: Generating docs
24 | run: |
25 | gen-doc -d docs/schema/doc-linkml-autogen linkml-schema/reproschema.yaml
26 | gen-erdiagram linkml-schema/reproschema.yaml > docs/schema/erdiagram-autogen.md
27 |
28 | - name: Deploy docs
29 | uses: mhausenblas/mkdocs-deploy-gh-pages@master
30 | env:
31 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 |
--------------------------------------------------------------------------------
/.github/workflows/push_reproschema_py.yml:
--------------------------------------------------------------------------------
1 | name: Create Pull Request to reproschema-py
2 | on:
3 | workflow_dispatch:
4 | inputs:
5 | version:
6 | description: 'version number'
7 | required: true
8 | type: string
9 |
10 | jobs:
11 | create-pull-request:
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - name: Check out the repository
16 | uses: actions/checkout@v4
17 | - name: Set up Git and cloning repository
18 | env:
19 | TARGET_REPO: repronim/reproschema-py
20 | PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
21 | run: |
22 | git config --global user.name "djarecka"
23 | git config --global user.email "djarecka@gmail.com"
24 | git clone https://x-access-token:${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/$TARGET_REPO.git
25 | - name: Make changes to target repository
26 | id: changes
27 | run: |
28 | # updating pydantic model
29 | cp releases/${{ inputs.version }}/reproschema_model.py reproschema-py/reproschema/models/model.py
30 | cd reproschema-py
31 | # updating url to context
32 | echo "# this is automatically updated after reproschema new release" > reproschema/context_url.py
33 | echo "CONTEXTFILE_URL = 'https://raw.githubusercontent.com/ReproNim/reproschema/main/releases/${{ inputs.version }}/reproschema'" >> reproschema/context_url.py
34 | git checkout -b release_${{ inputs.version }}
35 | git add reproschema/models/model.py
36 | git add reproschema/context_url.py
37 | git commit -m "Add new version of the pydantic model and new context url"
38 | cd ..
39 | - name: Push changes to reproschema-py
40 | env:
41 | TARGET_REPO: repronim/reproschema-py
42 | PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
43 | run: |
44 | cd reproschema-py
45 | git push origin release_${{ inputs.version }}
46 | - name: Create pull request to reproschema-py
47 | env:
48 | TARGET_REPO: repronim/reproschema-py
49 | PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
50 | run: |
51 | curl -X POST -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
52 | -d '{"title":"Automated PR: Add new version of the model: ${{ inputs.version }}", "head":"release_${{ inputs.version }}", "base":"main"}' \
53 | https://api.github.com/repos/$TARGET_REPO/pulls
54 |
--------------------------------------------------------------------------------
/.github/workflows/run_precommit.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: pre-commit
3 |
4 | on:
5 | pull_request:
6 | push:
7 | branches: [main]
8 |
9 | jobs:
10 | pre-commit:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v4
14 | - uses: actions/setup-python@v5
15 | - uses: pre-commit/action@v3.0.1
16 |
--------------------------------------------------------------------------------
/.github/workflows/update_precommit_hooks.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Update precommit hooks
3 |
4 |
5 | on:
6 |
7 | # Uses the cron schedule for github actions
8 | #
9 | # https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events
10 | #
11 | # ┌───────────── minute (0 - 59)
12 | # │ ┌───────────── hour (0 - 23)
13 | # │ │ ┌───────────── day of the month (1 - 31)
14 | # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
15 | # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
16 | # │ │ │ │ │
17 | # │ │ │ │ │
18 | # │ │ │ │ │
19 | # * * * * *
20 | schedule:
21 | - cron: 0 0 * 1,7 * # january and july
22 |
23 | # Allows you to run this workflow manually from the Actions tab
24 | workflow_dispatch:
25 |
26 | jobs:
27 | update_precommit_hooks:
28 |
29 | # only run on upstream repo
30 | if: github.repository_owner == 'SIMEXP'
31 |
32 | runs-on: ubuntu-latest
33 | steps:
34 | - name: Checkout repo
35 | uses: actions/checkout@v4
36 | - name: Set up Python
37 | uses: actions/setup-python@v5
38 | with:
39 | python-version: '3.12'
40 | allow-prereleases: false
41 | - name: Install pre-commit
42 | run: pip install pre-commit
43 | - name: Update pre-commit hooks
44 | run: pre-commit autoupdate
45 | - name: Create Pull Request
46 | uses: peter-evans/create-pull-request@v7
47 | with:
48 | commit-message: pre-commit hooks auto-update
49 | base: main
50 | token: ${{ secrets.GITHUB_TOKEN }}
51 | delete-branch: true
52 | title: '[BOT] update pre-commit hooks'
53 | body: done via this [GitHub Action](https://github.com/${{ github.repository_owner }}/reproschema /blob/main/.github/workflows/update_precommit_hooks.yml)
54 |
--------------------------------------------------------------------------------
/.github/workflows/validate_and_release.yml:
--------------------------------------------------------------------------------
1 | # - validate the protocol and activities in the repo with reproschema.py
2 | # - triggers a release when a github release is published
3 | name: validate and release
4 |
5 | on:
6 | push:
7 | branches:
8 | - main
9 | pull_request:
10 | branches: ['*']
11 | # Allow to trigger the generation of release files automatically
12 | workflow_dispatch:
13 | inputs:
14 | version:
15 | description: 'version number'
16 | required: true
17 | type: string
18 |
19 | jobs:
20 | validate:
21 | runs-on: ubuntu-latest
22 | steps:
23 | - uses: actions/checkout@v4
24 | - name: Set up Python
25 | uses: actions/setup-python@v5
26 | with:
27 | python-version: 3.12
28 | - name: Install dependencies
29 | # TODO This installs reproschema from source and not from pypi
30 | # This may not be the optimal way of doing it.
31 | run: |
32 | python -m pip install --upgrade pip setuptools
33 | pip install git+https://github.com/ReproNim/reproschema-py.git
34 | - name: Validate content
35 | run: |
36 | python scripts/jsonParser.py
37 | reproschema validate examples
38 |
39 | release:
40 | needs: [validate]
41 | if: github.event_name == 'workflow_dispatch'
42 | runs-on: ubuntu-latest
43 | steps:
44 | - uses: actions/checkout@v4
45 | - name: Set up Python
46 | uses: actions/setup-python@v5
47 | with:
48 | python-version: 3.12
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
66 | - name: Make a release
67 | run: |
68 | echo "Making a release ${{ inputs.version }}"
69 | mkdir releases/${{ inputs.version }}
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
75 |
76 | - name: Open pull requests to add files
77 | uses: peter-evans/create-pull-request@v7
78 | with:
79 | commit-message: "[REL] adding files to for release ${{ inputs.version }}"
80 | base: main
81 | token: ${{ secrets.GITHUB_TOKEN }}
82 | delete-branch: true
83 | title: "[REL] adding files to for release ${{ inputs.version }}"
84 | body: done via this [GitHub Action](https://github.com/${{ github.repository_owner }}/reproschema/blob/main/.github/workflows/validate_and_release.yml)
85 |
--------------------------------------------------------------------------------
/.github/workflows/validate_cff.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: validation CITATION.cff
3 |
4 | on:
5 | pull_request:
6 | push:
7 | branches: [main]
8 |
9 | concurrency:
10 | group: ${{ github.workflow }}-${{ github.ref }}
11 | cancel-in-progress: true
12 |
13 | jobs:
14 |
15 | validate_cff:
16 | runs-on: ubuntu-latest
17 | steps:
18 | - uses: actions/checkout@v4
19 | - name: Check whether the citation metadata from CITATION.cff is valid
20 | uses: citation-file-format/cffconvert-github-action@2.0.0
21 | with:
22 | args: --validate
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | activities/.DS_Store
3 | protocols/.DS_Store
4 |
5 | __pycache__
6 |
7 | .idea/
8 |
9 | local_data
10 |
11 | # ignore linkml auto generated doc
12 | docs/schema/doc-linkml-autogen
13 | docs/schema/erdiagram-autogen.md
14 |
15 | node_modules
16 | package-lock.json
17 | package.json
18 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
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
5 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | # See https://pre-commit.com for more information
2 | # See https://pre-commit.com/hooks.html for more hooks
3 | repos:
4 | - repo: https://github.com/pre-commit/pre-commit-hooks
5 | rev: v4.5.0
6 | hooks:
7 | - id: trailing-whitespace
8 | - id: end-of-file-fixer
9 | - id: check-yaml
10 | exclude: |
11 | (?x)^(
12 | docs/specification/.*
13 | | mkdocs.yml
14 | | releases/*/*.ttl
15 | | releases/*/*.nt
16 | | releases/*/*.jsonld
17 | )$
18 | - id: check-json
19 | - id: check-ast
20 | - id: check-added-large-files
21 | - id: check-merge-conflict
22 |
23 | # Sorts Python imports alphabetically and by section with `isort`.
24 | - repo: https://github.com/pycqa/isort
25 | rev: 5.13.2
26 | hooks:
27 | - id: isort
28 | args: [--settings-path, pyproject.toml]
29 |
30 | - repo: https://github.com/psf/black
31 | rev: 24.3.0
32 | hooks:
33 | - id: black
34 |
35 | - repo: https://github.com/codespell-project/codespell
36 | rev: v2.2.6
37 | hooks:
38 | - id: codespell
39 | args: [--toml, pyproject.toml]
40 | additional_dependencies: [tomli]
41 |
42 | - repo: https://github.com/pyCQA/flake8
43 | rev: 7.1.0
44 | hooks:
45 | - id: flake8
46 | args: [--config, .flake8, --verbose, --exclude=releases/*]
47 | additional_dependencies: [flake8-bugbear]
48 |
--------------------------------------------------------------------------------
/.remarkrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "preset-lint-markdown-style-guide",
4 | "preset-lint-recommended",
5 | "remark-gfm",
6 | [
7 | "lint-no-duplicate-headings",
8 | false
9 | ],
10 | [
11 | "lint-list-item-indent",
12 | "tab-size"
13 | ],
14 | [
15 | "lint-emphasis-marker",
16 | "consistent"
17 | ],
18 | [
19 | "lint-maximum-line-length",
20 | 500
21 | ],
22 | [
23 | "lint-maximum-heading-length",
24 | false
25 | ],
26 | [
27 | "lint-no-shortcut-reference-link",
28 | false
29 | ],
30 | [
31 | "remark-lint-unordered-list-marker-style",
32 | "-"
33 | ],
34 | [
35 | "lint-no-trailing-spaces"
36 | ],
37 | [
38 | "remark-lint-code-block-style",
39 | false
40 | ],
41 | [
42 | "lint-no-undefined-references",
43 | false
44 | ],
45 | [
46 | "remark-lint-heading-style",
47 | false
48 | ]
49 | ]
50 | }
51 |
--------------------------------------------------------------------------------
/CITATION.cff:
--------------------------------------------------------------------------------
1 | # schema: https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md
2 |
3 | cff-version: 1.2.0
4 |
5 | title: reproschema
6 |
7 | abstract: >-
8 | A standardized form generation and data collection schema to harmonize results by design across projects.
9 |
10 | version: 1.0.0-rc4
11 |
12 | license: CC-BY-4.0
13 |
14 | repository-code: https://github.com/ReproNim/reproschema.git
15 |
16 | message: >-
17 | To cite the reproschema, please follow the instructions here:
18 | https://zenodo.org/doi/10.5281/zenodo.4064939
19 |
20 | identifiers:
21 | - description: PDFs of the BIDS specification for versions 1.9.0 and above
22 | type: doi
23 | value: 10.5281/zenodo.4064939
24 |
25 | keywords:
26 | - "schema"
27 | - "assessment"
28 | - "jsonld"
29 | - "rdf"
30 | - "repronim"
31 |
32 | authors:
33 | - family-names: Reproschema Contributors
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2020 ReproNim developers
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 | [](https://doi.org/10.5281/zenodo.4064940)
3 |
4 |
5 |
6 | # ReproSchema: Enhancing Research Reproducibility through Standardized Survey Data Collection
7 |
8 | The ReproSchema project integrates five key components designed to standardize research protocols and enhance consistency across various stages of data collection.
9 | - Foundational Schema ([reproschema](https://github.com/ReproNim/reproschema)): This core schema delineates the content and relationships of protocols, assessments, and items to ensure consistency and facilitate data harmonization across studies.
10 | - Assessment Library ([reproschema-library](https://github.com/ReproNim/reproschema-library)): This library provides a comprehensive collection of standardized questionnaires, supporting the application of uniform assessments across time and different studies.
11 | - Python-based CLI Tool ([reproschema-py](https://github.com/ReproNim/reproschema-py)): This command-line interface tool facilitates schema development and validation, aiding researchers in efficiently creating and refining data collection frameworks.
12 | - User Interface ([reproschema-ui](https://github.com/ReproNim/reproschema-ui)): This intuitive user interface simplifies the visualization and interaction with data, enhancing the manageability of the data collection process for researchers.
13 | - Protocol Template ([reproschema-protocol-cookiecutter](https://github.com/ReproNim/reproschema-protocol-cookiecutter)): This customizable template supports the design and implementation of research protocols tailored to specific study requirements.
14 |
15 | This repository contains:
16 |
17 | - the [different terms of the ReproSchema](./terms)
18 | - the [corresponding context files](./contexts)
19 | - a example of [a protocol based on the reproschema](./examples)
20 | - the [documentation](./docs)
21 |
22 | ## Developing ReproSchema
23 |
24 | ### Updating the schema
25 |
26 | As of release 1.0.0, a linked data modeling language, [LinkML](https://linkml.io/linkml/), is used to create
27 | a [YAML file](linkml-schema/reproschema.yaml) with the schema.
28 |
29 | The [context file](contexts/reproschema) was automatically generated using LinkML,
30 | and then manually curated in order to support all the reproschema feature.
31 |
32 | #### Style
33 |
34 | This repo uses pre-commit to check styling.
35 | - Install pre-commit with pip: `pip install pre-commit`
36 | - In order to use it with the repository, you have to run `run pre-commit install` in the root directory the first time you use it.
37 |
38 |
39 | ### Release
40 | Upon release, there are additional formats, `jsonsld`, `turtle`, `n-triples`
41 | and `pydantic` that are created using `LinkML` tools, `reproschema-py`,
42 | and [reproschema-specific script](./scripts/fix_pydantic.py) to "fix" the `pydantic` format.
43 | The entire process is automated in the GitHub Action Workflow:
44 | [Validate and Release](.github/workflows/validate_and_release.yml).
45 | This workflow must be manually triggered by the core developers once a new release is ready.
46 | All the releases can be found in [releases directory](./releases).
47 |
48 | ### Updating model in reproschema-py
49 | Another GitHub Action Workflow: [ Create Pull Request to reproschema-py](.github/workflows/push_reproschema_py.yml)
50 | is responsible for creating pull request to the `reproschema-py` Python library with
51 | the new version of pydantic model and context.
52 | The workflow is currently also triggered manually by the core developers.
53 |
54 |
55 | ## Licenses
56 |
57 | ### Code
58 |
59 | The content of this repository is distributed under the [Apache 2.0 license](./LICENSE).
60 |
61 | ### Documentation
62 |
63 | 
The corresponding documentation is licensed under a Creative Commons Attribution 4.0 International License.
64 |
65 | ## Contributors
66 |
67 | https://github.com/ReproNim/reproschema/graphs/contributors
68 |
--------------------------------------------------------------------------------
/contexts/reproschema:
--------------------------------------------------------------------------------
1 | {
2 | "comments": {
3 | "description": "Auto generated by LinkML jsonld context generator",
4 | "generation_date": "2024-02-16T13:37:16",
5 | "source": "reproschema.yaml"
6 | },
7 | "@context": {
8 | "linkml": "https://w3id.org/linkml/",
9 | "nidm": "http://purl.org/nidash/nidm#",
10 | "owl": "http://www.w3.org/2002/07/owl#",
11 | "prov": "http://www.w3.org/ns/prov#",
12 | "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
13 | "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
14 | "reproschema": "http://schema.repronim.org/",
15 | "schema": "http://schema.org/",
16 | "skos": "http://www.w3.org/2004/02/skos/core#",
17 | "xml": {
18 | "@id": "http://www.w3.org/XML/1998/namespace",
19 | "@prefix": true
20 | },
21 | "xsd": "http://www.w3.org/2001/XMLSchema#",
22 | "@vocab": "http://schema.repronim.org/",
23 | "@version": 1.1,
24 | "@language": "en",
25 | "id": "@id",
26 | "category": "@type",
27 | "ui": "@nest",
28 | "about": {
29 | "@id": "schema:about"
30 | },
31 | "addProperties": {
32 | "@container": "@set",
33 | "@nest": "ui"
34 | },
35 | "additionalNotesObj": {
36 | "@container": "@set"
37 | },
38 | "allow": {
39 | "@type": "@id",
40 | "@container": "@set",
41 | "@nest": "ui"
42 | },
43 | "altLabel": {
44 | "@id": "skos:altLabel",
45 | "@container": "@language"
46 | },
47 | "associatedMedia": {
48 | "@id": "schema:associatedMedia"
49 | },
50 | "audio": {
51 | "@type": "@id",
52 | "@id": "schema:audio"
53 | },
54 | "choices": {
55 | "@container": "@set"
56 | },
57 | "citation": {
58 | "@id": "schema:citation",
59 | "@container": "@language"
60 | },
61 | "column": {
62 | "@type": "xsd:string"
63 | },
64 | "compute": {
65 | "@id": "reproschema:compute",
66 | "@container": "@set"
67 | },
68 | "contentUrl": {
69 | "@type": "@id",
70 | "@id": "schema:contentUrl"
71 | },
72 | "cronTable": {
73 | "@id": "reproschema:cronTable"
74 | },
75 | "datumType": {
76 | "@id": "reproschema:datumType"
77 | },
78 | "description": {
79 | "@id": "schema:description",
80 | "@container": "@language"
81 | },
82 | "endedAtTime": {
83 | "@type": "xsd:dateTime",
84 | "@id": "prov:endedAtTime"
85 | },
86 | "generated": {
87 | "@id": "prov:generated"
88 | },
89 | "image": {
90 | "@type": "@id",
91 | "@id": "schema:image"
92 | },
93 | "inLanguage": {
94 | "@id": "schema:inLanguage",
95 | "@language": null
96 | },
97 | "inputType": {
98 | "@type": "xsd:string",
99 | "@nest": "ui"
100 | },
101 | "isAbout": {
102 | "@type": "@id"
103 | },
104 | "isPartOf": {
105 | "@type": "@id",
106 | "@id": "schema:isPartOf"
107 | },
108 | "landingPage": {
109 | "@type": "@id",
110 | "@container": "@set"
111 | },
112 | "limit": {
113 | "@language": null
114 | },
115 | "maxValue": {
116 | "@id": "schema:maxValue"
117 | },
118 | "message": {
119 | "@container": "@language"
120 | },
121 | "messages": {
122 | "@container": "@set"
123 | },
124 | "minValue": {
125 | "@id": "schema:minValue"
126 | },
127 | "multipleChoice": {
128 | "@type": "xsd:boolean"
129 | },
130 | "name": {
131 | "@id": "schema:name",
132 | "@container": "@language"
133 | },
134 | "order": {
135 | "@type": "@id",
136 | "@container": "@list",
137 | "@nest": "ui"
138 | },
139 | "overrideProperties": {
140 | "@container": "@set",
141 | "@nest": "ui"
142 | },
143 | "preamble": {
144 | "@id": "reproschema:preamble",
145 | "@container": "@language"
146 | },
147 | "prefLabel": {
148 | "@id": "skos:prefLabel",
149 | "@container": "@language"
150 | },
151 | "question": {
152 | "@id": "schema:question",
153 | "@container": "@language"
154 | },
155 | "randomMaxDelay": {
156 | "@language": null
157 | },
158 | "readonlyValue": {
159 | "@type": "xsd:boolean",
160 | "@id": "schema:readonlyValue",
161 | "@nest": "ui"
162 | },
163 | "responseOptions": {
164 | "@type": "@id"
165 | },
166 | "schedule": {
167 | "@language": null
168 | },
169 | "schemaVersion": {
170 | "@id": "schema:schemaVersion",
171 | "@language": null
172 | },
173 | "shuffle": {
174 | "@type": "xsd:boolean",
175 | "@nest": "ui"
176 | },
177 | "source": {
178 | "@type": "xsd:string"
179 | },
180 | "startedAtTime": {
181 | "@type": "xsd:dateTime",
182 | "@id": "prov:startedAtTime"
183 | },
184 | "subject_id": {
185 | "@id": "nidm:subject_id"
186 | },
187 | "unitOptions": {
188 | "@type": "@id",
189 | "@container": "@set"
190 | },
191 | "url": {
192 | "@type": "@id",
193 | "@id": "schema:url"
194 | },
195 | "used": {
196 | "@type": "@id",
197 | "@container": "@set",
198 | "@id": "prov:used"
199 | },
200 | "valueRequired": {
201 | "@type": "xsd:boolean",
202 | "@id": "schema:valueRequired"
203 | },
204 | "valueType": {
205 | "@type": "@id",
206 | "@container": "@set"
207 | },
208 | "version": {
209 | "@id": "schema:version",
210 | "@language": null
211 | },
212 | "video": {
213 | "@type": "@id",
214 | "@id": "schema:video"
215 | },
216 | "wasAssociatedWith": {
217 | "@type": "@id",
218 | "@id": "prov:wasAssociatedWith"
219 | },
220 | "wasAttributedTo": {
221 | "@type": "@id",
222 | "@id": "prov:wasAttributedTo"
223 | },
224 | "Activity": {
225 | "@id": "reproschema:Activity"
226 | },
227 | "Agent": {
228 | "@id": "prov:Agent"
229 | },
230 | "LangString": {
231 | "@id": "rdf:langString"
232 | },
233 | "MediaObject": {
234 | "@id": "schema:MediaObject"
235 | },
236 | "StructuredValue": {
237 | "@id": "schema:StructuredValue"
238 | },
239 | "Thing": {
240 | "@id": "schema:Thing"
241 | },
242 | "VideoObject": {
243 | "@id": "schema:VideoObject"
244 | }
245 | }
246 | }
247 |
--------------------------------------------------------------------------------
/docs/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Contributing to the documentation
4 |
5 | This documentation is a work in progress and we wellcome any input:
6 | if something is missing or unclear, let us know by opening an issue on our repository.
7 |
8 | ### Serving the doc locally
9 |
10 | This project uses [MkDocs](https://www.mkdocs.org/) tool with [Material theme](https://squidfunk.github.io/mkdocs-material/)
11 | and extra plugins to generate the website.
12 |
13 | To test locally, you will need to install the Python dependencies. To do that, type the following commands:
14 |
15 | ```bash
16 | git clone https://github.com/ReproNim/reproschema.git
17 | cd reproschema
18 | pip install -r requirements.txt
19 | ```
20 |
21 | If you are working on your *fork*, simply replace `https://github.com/ReproNim/reproschema.git`
22 | by `git clone git@github.com//reproschema.git` where `` is your GitHub username
23 |
24 | Once done, you need to run MkDocs. Simply type:
25 |
26 | ```bash
27 | mkdocs serve
28 | ```
29 |
30 | Finally, open up [`http://127.0.0.1:8000/`](http://127.0.0.1:8000/) in your browser, and you
31 | should see the default home page of the being displayed.
32 |
--------------------------------------------------------------------------------
/docs/how-to/validation.md:
--------------------------------------------------------------------------------
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.
90 |
--------------------------------------------------------------------------------
/docs/how-to/visualize.md:
--------------------------------------------------------------------------------
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)
27 |
--------------------------------------------------------------------------------
/docs/img/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReproNim/reproschema/9a6c14f7a730bc9e9cb81e2474fe622b4657f8fe/docs/img/favicon.png
--------------------------------------------------------------------------------
/docs/img/favicon_on_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReproNim/reproschema/9a6c14f7a730bc9e9cb81e2474fe622b4657f8fe/docs/img/favicon_on_white.png
--------------------------------------------------------------------------------
/docs/img/phq-9_ui.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReproNim/reproschema/9a6c14f7a730bc9e9cb81e2474fe622b4657f8fe/docs/img/phq-9_ui.png
--------------------------------------------------------------------------------
/docs/img/reproschema.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReproNim/reproschema/9a6c14f7a730bc9e9cb81e2474fe622b4657f8fe/docs/img/reproschema.png
--------------------------------------------------------------------------------
/docs/img/reproschema_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ReproNim/reproschema/9a6c14f7a730bc9e9cb81e2474fe622b4657f8fe/docs/img/reproschema_logo.png
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # Welcome to the ReproSchema documentation
2 |
3 |
7 |
8 | ## How to use this documentation
9 |
10 | - If you want to know more about the ReproSchema project, its goals and the problems
11 | it tries to solve: check out our [introduction](./introduction.md).
12 |
13 | - The ReproSchema is related to the `Semantic Web` and relies on `linked data`
14 | and the `JSON-LD` format. If you are unfamiliar with such things, head over to
15 | our [FAQ](./FAQ.md). You do not need an in depth understanding of what those
16 | things are to use the ReproSchema but some "big picture" conceptual understanding
17 | could save you from a lot of confusion. 😉
18 |
19 | - Not sure how the project is organized? Check out the [project structure](./project-structure.md) page.
20 | - Want more details on how the `Reproschema` itself is structured: check out our [schema page](./schema/schema.md)
21 |
22 |
25 |
26 | ## How to cite
27 |
28 | If you need to cite ReproSchema, you can use this DOI:
29 |
30 | - [doi:10.5281/zenodo.4064940](https://doi.org/10.5281/zenodo.4064940).
31 |
32 | ## Licence
33 |
34 | 
This work is licensed under a Creative Commons Attribution 4.0 International License.
35 |
36 | ## Contributing and feedback
37 |
38 | We are looking for people to give us feedback on this documentation if anything
39 | is unclear by [opening an issue on our repository](https://github.com/ReproNim/reproschema/issues).
40 |
41 | You can also get in touch on [our channel on the mattermost Brainhack](https://mattermost.brainhack.org/brainhack/channels/repronim-reproschema).
42 |
43 | If you want to get started right away and contribute directly to this
44 | documentation,you can find references and how-to in the [about section](./CONTRIBUTING.md).
45 |
--------------------------------------------------------------------------------
/docs/introduction.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | !!! example "Tl;DR - Advantages of the current schema representation"
4 |
5 | - Rich contexts for a questionnaire with JSON-LD rather than a "flat" csv file.
6 | - A single source of curated assessments from [ReproSchema Library](https://github.com/ReproNim/reproschema-library)
7 | - Each `item` (i.e question), `activity` (i.e questionnaire), and `protocol` (i.e set of questionnaires) provides unique and persistent identifiers.
8 | - Versions of a given questionnaire can be tracked (e.g., PHQ-9, PHQ-8).
9 | - Allows, supports, and tracks internationalization (e.g. ABCD requires Spanish and English forms).
10 | - Implementation agnostic – the schema can be used by several different software packages
11 | - Uses a linked data graph that can be validated using [SHACL](https://www.w3.org/TR/shacl/).
12 |
13 | ## The problem
14 |
15 | Cognitive and clinical questionnaires and assessments are used throughout
16 | neuroscience. There is little consistency in assessment data acquisition or response
17 | representation across studies or laboratories. Each project tends to use its own
18 | format and data collection tool (e.g., paper, survey tools, RedCap, LORIS). In the
19 | long run, this can be a source of a lot inefficiencies not only in terms data
20 | curation but also by diminishing the value of the data less interoperable and
21 | reusable. Imagine for example a researcher wanting to run a meta or mega-analysis
22 | across several studies. To do this each one would not only need to know which
23 | specific assessments were collected, but also how to relate different column names in
24 | data spreadsheets to these assessments and across projects.
25 |
26 | Several efforts have focused on linking the assessments themselves
27 | through consistent terminologies and relationships that map to human cognition
28 | (e.g., [Cognitive Atlas](https://www.cognitiveatlas.org/),
29 | [Cognitive Paradigm Ontology](http://www.cogpo.org/)). Other efforts such as the
30 | National Institute for Mental Health (NIMH) Data Archive (NDA) and the National
31 | Library of Medicine (NLM) [Common Data Elements](https://www.nlm.nih.gov/cde/index.html)
32 | have curated data elements corresponding to the items and calculated scores from
33 | these questionnaires. However, these resources are often used to make data
34 | consistent and reusable after, rather than during data collection. However,
35 | harmonizing data after acquisition is resource intensive and this approach can
36 | create a mismatch between collected and submitted data due to human error during
37 | the harmonization process. To facilitate tedious harmonization efforts, several
38 | projects, over the last two decades, have developed technologies to automatically
39 | or interactively align and harmonize data elements (e.g., BIRN mediator, OpenRefine).
40 |
41 | Given the dynamic and evolving nature of scientific investigation, many
42 | questionnaires are altered when used to suit the requirements of a particular
43 | study (e.g., different language, selective and new questions). This information
44 | linking the specific information used when asking a question is often decoupled
45 | from the data element representing the response to the question. When questions
46 | are changed, researchers often shoehorn the response into an existing data
47 | element, thus creating additional noise. Another drawback to these data elements
48 | is that there is often no way to find out which version of a questionnaire was
49 | used or how exactly it was scored.
50 |
51 | ## Our solution
52 |
53 | Our simpler solution is to enforce consistency directly at the data acquisition
54 | stage by relying on a common `schema` that encodes how the different elements of
55 | the data and / or the metadata relate to one another. This way, all this relational
56 | information between these elements is captured from the very start as it is already
57 | embedded in the formal description of the assessment. This solution was inspired
58 | by the work of [CEDAR Metadata Model](https://more.metadatacenter.org/tools-training/outreach/cedar-template-model).
59 |
60 | In this project we provide a comprehensive set of tools to create and use the
61 | schemas, while tracking the source of the schema, and changes to it over time.
62 | The ReproSchema project covers:
63 |
64 | 1. a schema that can be found [in the present repository](https://github.com/ReproNim/reproschema)
65 | that describes the content and relations of the different elements of a questionnaire or set of assessment tools,
66 |
67 | 1. an [associated curated library of reusable common assessments and questionnaires](https://github.com/ReproNim/reproschema-library),
68 |
69 | 1. a [python package](https://github.com/ReproNim/reproschema-py) to help create and validate the schemas of new assessments,
70 |
71 | 1. a [user interface](https://github.com/ReproNim/reproschema-ui) to visualize questionnaire and collect data locally,
72 |
73 | 1. a [backend server](https://github.com/sensein/voice-backend) to capture the data remotely.
74 |
75 | In brief, ReproSchema offers a way to standardize the underlying representation
76 | of assessment tools. It comes with an open and accessible library of questionnaires
77 | with appropriate conversion (e.g., from/to [RedCap](https://www.project-redcap.org/))
78 | and data collection tools (e.g., [MindLogger](https://mindlogger.org/),
79 | [RedCap](https://www.project-redcap.org/), [LORIS - future work](https://loris.ca))
80 | to enable a more consistent acquisition across projects, with data being
81 | harmonized by design.
82 |
83 | ## General description
84 |
85 | With this schema we can represent:
86 |
87 | - at the `item` level, the elements of an individual assessment,
88 | like the questions in a questionnaire
89 |
90 | - at the `activity` level, an individual assessment that contains a set of `items`,
91 | like for example a whole questionnaire with a several questions
92 |
93 | - at the `protocols` level, a collection of `activities` performed by a participant,
94 | e.g a set of questionnaires used in a study
95 |
96 | All those elements are specified text files in a `JSON-LD` format (JavaScript
97 | Object Notation for Linked Data) and each `item`, `activity`, and `protocol` provides
98 | unique and persistent identifiers.
99 |
100 | Below we show an example of one of the possible ways a questionnaire with 3 questions
101 | for a study could be organized with a `protocol` for that study, one `activity`
102 | and 3 `items`.
103 |
104 | ```json
105 | ├── activities
106 | │ └── activity1
107 | │ ├── activity1_schema.jsonld
108 | │ └── items
109 | │ ├── item1.jsonld
110 | │ ├── item2.jsonld
111 | │ └── item3.jsonld
112 | └── protocol
113 | └── protocol1_schema.jsonld
114 | ```
115 |
116 | The ReproSchema can also easily and flexibly specify details how the schema
117 | for an assessment should be used. Independently of what solution is chosen in the
118 | end by a researcher, a lab, or an institute to display the assessment to their
119 | participants or patients (for example whether using an Web-app written in javascript
120 | or a mobile app written in React-native), the schema can already specify:
121 |
122 | - the `input type` to choose among several user-interface rendering options e.g.,
123 | a Likert scale, a dropdown menu, a multiple choice...
124 |
125 | - the `visibility` to decide whether a given `item` or `activity` should be
126 | displayed to the user and under which conditions,
127 |
128 | - the `compute logic` of how the total score to the responses on a questionnaire
129 | should be computed
130 |
131 | The ReproSchema also allows for internationalization and multiple languages support
132 | by making it very easy to keep everything the same
133 | except the language displayed by the user interface.
134 |
135 | Finally ReproSchema allows tracking of variations and version of different assessments
136 | tools (e.g., PHQ-9, PHQ-8).
137 |
--------------------------------------------------------------------------------
/docs/library.md:
--------------------------------------------------------------------------------
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() }}
15 |
--------------------------------------------------------------------------------
/docs/project-structure.md:
--------------------------------------------------------------------------------
1 | # Project structure
2 |
3 | The ReproSchema project is organized around several github repositories. The
4 | main ones are the following.
5 |
6 | - [reproschema](https://github.com/ReproNim/reproschema)
7 | - [reproschema-library](https://github.com/ReproNim/reproschema-library)
8 | - [reproschema-py](https://github.com/ReproNim/reproschema-py)
9 | - [reproschema-ui](https://github.com/ReproNim/reproschema-ui)
10 | - [reproschema-protocol-cookiecutter](https://github.com/ReproNim/reproschema-protocol-cookiecutter)
11 |
12 | A brief description of how they all interact could be along the following lines:
13 |
14 | > If you're gearing up to launch a research project that requires standardized questionnaires, starting with **reproschema-protocol-cookiecutter** is your best first step. This tool sets you up with a custom protocol for your study, integrating handy features for a smooth setup right from the get-go. You'll have two main paths for adding questionnaires, or activities, to your study:
15 |
16 | > Option 1: Dive into **reproschema-library** where we've got a stash of ready-made questionnaires. Pick what fits your study, and you're good to go.
17 |
18 | > Option 2: Feeling creative? Craft your own activities with **reproschema-py**. This tool not only lets you design new activities but also checks that they meet all the ReproSchema standards.
19 |
20 | > Once your protocol is packed with all the activities you need, **reproschema-ui** automatically steps in. This part of the toolkit lets you see your study in action before you even start, making sure everything's set up just right for gathering data.
21 |
22 | ## [reproschema](https://github.com/ReproNim/reproschema)
23 |
24 | The ReproSchema is like a blueprint for research projects, ensuring everyone collects data in a consistent way, which makes it easier to compare results from different studies. Here’s a simpler breakdown of what’s inside:
25 |
26 | - **Key Terms:** These are the building blocks, like common types of answers and data formats, that help everyone understand and use data the same way.
27 |
28 | - **How Data is Organized:** ReproSchema sorts information into three main layers to keep things neat:
29 |
30 | - **Item Level:** This is where individual questions or parts of a survey are detailed, allowing for close examination of each element.
31 | - **Activity Level:** At this stage, an entire survey or tool, made up of many items, is grouped together as an "Activity." It gives a complete overview of what the survey involves.
32 | - **Protocols Level:** The highest level, a "Protocol," bundles together all the activities a participant will do in a study, providing a comprehensive plan.
33 |
34 | - **Validation:** The schema uses special standards (like SHACL files) to make sure the data and forms are up to standard and consistent.
35 |
36 | - **Context Files:** These files ([`contexts`](https://github.com/ReproNim/reproschema/tree/master/contexts)and [`terms`](https://github.com/ReproNim/reproschema/tree/master/terms)) specify user-interface details and enhance schema flexibility. They define elements like input types, visibility conditions, and response options, supporting a tailored user experience. Additionally, they enable internationalization and multiple language support for broad applicability.
37 |
38 | There is also an [`example`](https://github.com/ReproNim/reproschema/tree/master/examples)
39 | schema that can help give you a quick overview of what the protocol and activity
40 | for a study might look like. For more details see the [schema section](./schema/schema.md).
41 |
42 | ## [reproschema-library](https://github.com/ReproNim/reproschema-library)
43 |
44 | This [repository](https://github.com/ReproNim/reproschema-library) hosts all the
45 | community curated assessments and questionnaires that support the ReproSchema
46 | standard.
47 |
48 | Imagine this as curated library of reusable assessments and questionnaires, from
49 | where you can easily pull a copy from rather than having to photocopy a new
50 | questionnaire for your next participant or patient. Also you can mix and match
51 | items from this library, knowing that the information is tracked in your protocol.
52 |
53 | 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 them.
55 |
56 | - **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.
57 | - **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.
58 | - **Collaborative Expansion:** The library supports expansion through researcher contributions, allowing adding new, relevant assessments. These contributions are automatically validated using reproschema-py, maintaining the library’s standardization and relevance to evolving research demands.
59 |
60 | ## [reproschema-py](https://github.com/ReproNim/reproschema-py)
61 |
62 | This is the ReproSchema python library. This is a python Command Line Interface (CLI)
63 | that allows you to help create and validate the schemas of new assessments.
64 |
65 | - **Schema Development and Validation:** This tool streamlines the creation and validation of new assessment schemas, verifying their alignment with ReproSchema's standards. It rigorously tests protocols, activities, and items to meet predefined specifications.
66 | - **Consistency Assurance:** Integrated with the ReproSchema-library and ReproSchema-Protocol-Cookiecutter, reproschema-py validates library assessments for quality and uniformity. It also automatically ensures the consistency of research protocols generated through the ReproSchema-Protocol-Cookiecutter.
67 | - **Interoperability with REDCap:** Its capability to convert between REDCap and ReproSchema formats exemplifies its role in harmonizing diverse data collection methods in complex, multi-faceted research environments.
68 |
69 | ## [reproschema-ui](https://github.com/ReproNim/reproschema-ui)
70 |
71 | This repository contains the code for the user-interface for the ReproSchema to
72 | visualize questionnaires and collect data.
73 |
74 | You can see it in action [here](https://www.repronim.org/reproschema-ui/)
75 |
76 | ## [reproschema-protocol-cookiecutter](https://github.com/ReproNim/reproschema-protocol-cookiecutter)
77 |
78 | The reproschema-protocol-cookiecutter is a straightforward tool that helps you quickly set up a research study. It offers a ready-to-use template for organizing your study's structure and surveys, ensuring everything meets standard guidelines. Think of it as a quick-start guide to get your research project up and running smoothly.
79 | A step-by-step guide see [here](./user-guide/create-new-protocol.md).
80 |
81 | ## Other repositories
82 |
83 | ### [Demo-protocol](https://github.com/ReproNim/demo-protocol)
84 |
85 | This repository contain a full fledge protocol that can be used as demonstration.
86 |
87 | ### [Reprolib-server](https://github.com/ReproNim/reprolib-server)
88 |
89 | This contains some additional information on how the activities are served on
90 | [https://schema.repronim.org/rl/](https://schema.repronim.org/rl/).
91 |
--------------------------------------------------------------------------------
/docs/schema/schema.md:
--------------------------------------------------------------------------------
1 | # The schema
2 |
3 | ## Overview
4 |
5 | A simplistic way to describe the Reprochema is to say it is organized in a hierarchical manner with roughly 3 levels with a schema describing each level.
6 |
7 | 1. The highest level is the `protocol` level that originally define a set of assessments or questionnaires to be
8 | included in a given study.
9 | This schema is defined by the [Protocol schema](https://raw.githubusercontent.com/ReproNim/reproschema/master/terms/Protocol).
10 |
11 | 1. The second level is the `activity` level that describe a given questionnaire. This level would describe all the questions of this assessment: for example all the items of the Edinburgh handedness inventory would constitute one activity.
12 | This schema is defined by the [Activity schema](https://raw.githubusercontent.com/ReproNim/reproschema/master/terms/Activity).
13 |
14 | 1. At a lower level we have the `item` level where each `item` represents a question from a given assessment.
15 | On top of containing the text of the actual question, the schema at this level can contain additional
16 | information such as the expected format of the item for the user interface: a boolean
17 | (if this is a yes/no question), a multiple choice (with a list of the response choices),
18 | a float or an integer (if a numerical value is expected)...
19 | This schema is defined by the [Field schema](https://raw.githubusercontent.com/ReproNim/reproschema/master/terms/Field).
20 |
21 |
25 |
26 | You can see an example of those in the [examples folder](https://github.com/ReproNim/reproschema/tree/master/examples)
27 |
28 | There are in fact more levels than this each and each level has its own schema:
29 |
30 | - all of the schemas can be found in the [`terms` folder](https://github.com/ReproNim/reproschema/tree/master/terms)
31 | - 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`)
32 | - all the properties of each level are described below in the [Properties of ReproSchema objects section](#properties-of-reproschema-objects)
33 |
34 | ## Detailed description
35 |
36 | The core model of ReproSchema was initially derived from the [CEDAR Metadata Model](https://more.metadatacenter.org/tools-training/outreach/cedar-template-model).
37 | To accommodate the needs of neuroimaging and other clinical and behavioral
38 | protocols and assessments the schema has evolved significantly. These changes
39 | include:
40 |
41 | 1. Alignment with [schema.org](https://schema.org) and [NIDM](https://nidm.nidash.org).
42 | We have used schema.org classes and properties where it maps on to the needs of
43 | the model and extended the model with NIDM elements to harmonize across ReproNim projects.
44 |
45 | 1. Allowing for structured nested elements in a schema
46 | `Protocol > Activity > [Activity | Field > ResponseOption]`. This nested
47 | structure provides a flexible schema to represent nested activities, which are
48 | common in biomedical and other domains.
49 |
50 | ```text
51 | Protocol
52 | ├── Activity
53 | │ ├── Field
54 | │ │ └── ResponseOption
55 | │ └── Field
56 | │ │ └── ResponseOption
57 | │ ├── Activity
58 | │ │ ├── Field
59 | │ │ │ └── ResponseOption
60 | │ │ ...
61 | │ ...
62 | ├── Activity
63 | │ ...
64 | ...
65 | ```
66 |
67 | 1. Interaction with Git/Github or another Web service to deliver a new `protocol`,
68 | `ativity` or `field` with a persistent URI, while tracking changes associated with
69 | any of these elements. By making every `field` represented through a persistent URI,
70 | a data collection instrument can link the responses to the exact `field` that was
71 | used.
72 |
73 | 1. Addition of computable elements that are derived from the values entered by a participant.
74 |
75 | 1. Allowing for user interface (UI) elements that allow interaction between the schema
76 | and any implementation that allows collecting data using the schema. By providing
77 | some additional UI elements the provider can guide an implementer to allow for
78 | more complex data collection behavior.
79 |
80 | The [ReproSchema-UI](https://repronim.org/reproschema-ui) is a prototype implementation of an UI that leverages these
81 | different elements of the schema.
82 |
83 | ## ReproSchema Model
84 |
85 | The model was written using a linked data modeling language [LinkML](https://linkml.io/linkml/).
86 |
87 | There are multiple ways of accessing the content:
88 |
89 | - [The LinkML YAML file that defines the model](https://github.com/ReproNim/reproschema/blob/main/linkml-schema/reproschema.yaml)
90 | - [Automatically generated documentation](./doc-linkml-autogen/index.md) using LinkML tools
91 | - [Automatically generated Entity-Relationship (ER) Diagrams](./erdiagram-autogen.md)) to visualize the model.
92 |
93 | The context was created semi-automatically: the initial version was generated using LinkML tools,
94 | but manual curation was necessary to support all Reeproschema features.
95 |
--------------------------------------------------------------------------------
/docs/tutorials/create-new-activity.md:
--------------------------------------------------------------------------------
1 | # Create a new activity
2 |
3 | Now you would like to add a small questionnaire to estimate the handedness of
4 | each participant. We can use the Edinburgh handedness inventory for this.
5 |
6 | This tool is not part of the set of questionnaires included in the repronim
7 | library so we are going to have to create it ourselves.
8 |
9 | There are 2 version for this questionnaire a long and a short version.
10 |
11 | - Oldfield, R.C. (1971). The assessment and analysis of handedness: The
12 | Edinburgh inventory. Neuropsychologia, 9, 97-113.
13 | doi:[10.1016/0028-3932(71)90067-4](https://doi.org/10.1016/0028-3932(71)90067-4)
14 |
15 | - Veale, J.F. (2014). Edinburgh Handedness Inventory - Short Form: A revised
16 | version based on confirmatory factor analysis. Laterality, 19, 164-177.
17 | doi:[10.1080/1357650X.2013.783045](https://doi.org/10.1080/1357650X.2013.783045)
18 |
19 | The participant is given one question and a set of activities:
20 |
21 | ```text
22 | Please indicate your preferences in the use of hands in the following activities or objects:
23 |
24 | 1) Writing (*)
25 | 2) Drawing
26 | 3) Throwing (*)
27 | 4) Using Scissors
28 | 5) Using a Toothbrush (*)
29 | 6) Using a Knife (without a fork)
30 | 7) Using a Spoon (*)
31 | 8) Using a broom (upper hand)
32 | 9) Striking a Match (holds the match)
33 | 10) Opening a Box (holding the lid)
34 |
35 | i) Which foot do you prefer to kick with ?
36 | ii) Which eye do you use when using only one?
37 | ```
38 |
39 | The asterisks denote the subset of items that belong to the short form of the questionnaire.
40 |
41 | The scoring for each item follows the following scheme:
42 |
43 | - Always right = 100
44 | - Usually right = 50
45 | - Both equally = 0
46 | - Usually left = -50
47 | - Always left = -100
48 |
49 | The Laterality Quotient is given by the mean score over items. And the final
50 | classification according to the Laterality Quotient score goes as follow:
51 |
52 | - Left handers: -100 to -61
53 | - Mixed handers: -60 to 60
54 | - Right handers: 61 to 100
55 |
56 |
67 |
68 | ## Preparing the JSON for the activity
69 |
70 | Now let's create the `activities` folder, an activity file for the new assessment tool we want to create.
71 | For this tutorial we will be using the short form of the Edinburgh handedness inventory.
72 |
73 | ```bash
74 | # Type this in a terminal window
75 | mkdir activities
76 | touch activities/EHI/edinburgh_handedness_inventory_short.jsonld
77 | ```
78 |
79 | Now let's start by adding the following content in the activity file we have just created.
80 |
81 | ```json linenums="1"
82 | {
83 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
84 | "@type": "reproschema:Activity",
85 | "@id": "edinburgh_handedness_inventory_short.jsonld",
86 | "prefLabel": "Edinburgh handedness inventory - short form",
87 | "description": "Short version of the Edinburgh handedness inventory",
88 | "schemaVersion": "1.0.0-rc1",
89 | "version": "0.0.1"
90 | }
91 | ```
92 |
93 | The content is for now very similar to the JSON-LD that defines our protocol.
94 | The main difference is for the `@type` field that mentions
95 | that we are now describing an activity as defined in the Reproschema.
96 |
97 | Two other things we can add right away are:
98 |
99 | - the references for this questionnaire,
100 | - the `"preamble"` that is common to all items in this questionnaire.
101 |
102 | ```json linenums="1" hl_lines="9-10"
103 | {
104 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
105 | "@type": "reproschema:Activity",
106 | "@id": "edinburgh_handedness_inventory_short.jsonld",
107 | "prefLabel": "Edinburgh handedness inventory - short form",
108 | "description": "Short version of the Edinburgh handedness inventory",
109 | "schemaVersion": "1.0.0-rc1",
110 | "version": "0.0.1",
111 | "citation": "10.1080/1357650X.2013.783045",
112 | "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:"
113 | }
114 | ```
115 |
--------------------------------------------------------------------------------
/docs/tutorials/create-new-items.md:
--------------------------------------------------------------------------------
1 | ## Creating items
2 |
3 | Now that we have a basic structure for this new activity, let us start adding some items.
4 |
5 | Let's first start with the item for `writing`
6 |
7 | ```bash
8 | # Type this in a terminal window
9 | mkdir activities/EHI/items
10 | touch activities/EHI/items/writing.jsonld
11 | ```
12 |
13 | The content for items starts like the ones we have seen so far but
14 | `"reproschema:Field"` for the `@type` field.
15 |
16 | ```json linenums="1"
17 | {
18 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
19 | "@type": "reproschema:Field",
20 | "@id": "writing.jsonld",
21 | "prefLabel": "writing",
22 | "description": "writing item of the EHI",
23 | "schemaVersion": "1.0.0-rc1",
24 | "version": "0.0.1"
25 | }
26 | ```
27 |
28 | We can now add:
29 |
30 | - the question for this item
31 | - the `inputType` for for the user interface that will decide how this item will displayed to the user.
32 | - the response options
33 |
34 | ```json linenums="1" hl_lines="9 10 11-38"
35 | --8<-- "examples/activities/EHI/items/writing.jsonld"
36 | ```
37 |
38 |
41 |
42 | ## In your own time: create a second item
43 |
44 | For next step you can create on your own the `throwing` item of the questionnaire.
45 |
46 | ## Add the items to the activity
47 |
48 | ```json linenums="1" hl_lines="11-26"
49 | {
50 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
51 | "@type": "reproschema:Activity",
52 | "@id": "edinburgh_handedness_inventory_short.jsonld",
53 | "prefLabel": "Edinburgh handedness inventory - short form",
54 | "description": "Short version of the Edinburgh handedness inventory",
55 | "schemaVersion": "1.0.0-rc1",
56 | "version": "0.0.1",
57 | "citation": "10.1080/1357650X.2013.783045",
58 | "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:",
59 | "ui": {
60 | "order": ["items/writing.jsonld", "items/throwing.jsonld"],
61 | "shuffle": false,
62 | "addProperties": [
63 | {
64 | "variableName": "writing",jsonld
65 | "isAbout": "items/writing.jsonld",
66 | "isVis": true
67 | },
68 | {
69 | "variableName": "throwing",
70 | "isAbout": "items/throwing.jsonld",
71 | "isVis": true
72 | }
73 | ]
74 | }
75 | }
76 | ```
77 |
78 | ## Viewing the results
79 |
80 | ### Creating an item for the results
81 |
82 | ```bash
83 | # Type this in a terminal window
84 | touch activities/EHI/items/EHI_results.jsonld
85 | ```
86 |
87 | Add the following content to it.
88 |
89 | ```json linenums="1"
90 | --8<-- "examples/activities/EHI/items/EHI_results.jsonld"
91 | ```
92 |
93 | Add it to the activity.
94 |
95 | ```json linenums="1" hl_lines="15 31-35 38-42"
96 | --8<-- "examples/activities/EHI/edinburgh_handedness_inventory_short.jsonld"
97 | ```
98 |
99 | ## Using presets response options
100 |
101 | If you have to create several items that always have the same set of response options,
102 | then it might be easier to create a separate file with those response options and point each item to that file instead.
103 | This way, if you need to change the characteristics of one response,
104 | you only have to change things in one file rather than in many.
105 |
106 | For example, you could create response set file to constrains the possible answers
107 | on the questions of the Edinburgh Handedness Inventory we have been working on by organizing things this way.
108 |
109 | ```text
110 | activities
111 | ├── edinburgh_handedness_inventory_short.jsonld
112 | ├── leftRightValueConstraints.jsonld
113 | └── items
114 | ├── writing.jsonld
115 | ├ ...
116 | ...
117 | ```
118 |
119 | The content of the `leftRightValueConstraints.jsonld` file would look like this:
120 |
121 | ```json linenums="1"
122 | --8<-- "examples/activities/EHI/leftRightValueConstraints.jsonld"
123 | ```
124 |
125 | And you can point each item to it by referring to the local file in the `responseOptions` field.
126 |
127 | ```json linenums="1" hl_lines="11"
128 | {
129 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
130 | "@type": "reproschema:Field",
131 | "@id": "writing",
132 | "prefLabel": "writing",
133 | "description": "writing item of the EHI",
134 | "schemaVersion": "1.0.0-rc1",
135 | "version": "0.0.1",
136 | "question": "Writing",
137 | "ui": { "inputType": "radio" },
138 | "responseOptions": "../leftRightValueConstraints.jsonld"
139 | }
140 | ```
141 |
142 |
148 |
--------------------------------------------------------------------------------
/docs/tutorials/finalizing-the-protocol.md:
--------------------------------------------------------------------------------
1 | ## Viewing the activity
2 |
3 | Push the content you have created on your repository on github
4 |
5 | ```bash
6 | # Type this in a terminal window
7 | git add --all
8 | git commit -m 'adding the EHI activity'
9 | git push
10 | ```
11 |
12 | Use the UI to visualize just the activity.
13 |
14 | ```text
15 | https://www.repronim.org/reproschema-ui/#/activities/0?url=url-to-activity-schema
16 | ```
17 |
18 | ```text
19 | https://www.repronim.org/reproschema-ui/#/activities/0?url=https://raw.githubusercontent.com//depression_nimg_schema/activities/edinburgh_handedness_inventory_short.jsonld
20 | ```
21 |
22 | ## Adding the activity to the protocol
23 |
24 | ```json linenums="1" hl_lines="25-29 33"
25 | --8<-- "examples/protocols/depression_nimg_schema.jsonld"
26 | ```
27 |
--------------------------------------------------------------------------------
/docs/tutorials/translating-an-activity.md:
--------------------------------------------------------------------------------
1 | # Translating a questionnaire
2 |
3 | Imagine that a colleague of yours has heard that you have created this online tool
4 | based on the Edinburgh handedness inventory and she wants to use it for her own work.
5 | But she would need a French version of the questionnaire.
6 |
7 | Well there is an easy way to reuse the work we have already done to have the tool support several languages.
8 |
9 | First here is the list of the questions of the EHI in French.
10 |
11 | ```text
12 | Quelle main utilisez vous de préférence pour:
13 |
14 | 1) Écrire (*)
15 | 2) Dessiner
16 | 3) Lancer (*)
17 | 4) Utiliser une paire de ciseaux
18 | 5) Utiliser une brosse à dents (*)
19 | 6) Tenir un couteau (sans fourchette)
20 | 7) Tenir une cuillère (*)
21 | 8) Utiliser un balai (main supérieure)
22 | 9) Tenir une allumette pour l'allumer
23 | 10) Ouvrir une boîte (prendre le couvercle)
24 |
25 | i) Quel est le pied avec lequel vous préférez shooter?
26 | ii) Quel oeil utiliser-vous pour viser?
27 | ```
28 |
29 | ## Updating the items
30 |
31 | ```json linenums="1" hl_lines="5-8 12-15"
32 | {
33 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
34 | "@type": "reproschema:Field",
35 | "@id": "writing",
36 | "prefLabel": {
37 | "en": "writing",
38 | "fr": "écrire"
39 | },
40 | "description": "writing item of the EHI",
41 | "schemaVersion": "1.0.0-rc1",
42 | "version": "0.0.1",
43 | "question": {
44 | "en": "Writing",
45 | "fr": "Écrire"
46 | },
47 | "ui": { "inputType": "radio" },
48 | "responseOptions": "../leftRightValueConstraintsMultiLang.jsonld"
49 | }
50 | ```
51 |
52 | ## Updating the response options
53 |
54 | ```json linenums="1" hl_lines="10-14 17-21 24-28 31-35 38-42"
55 | --8<-- "examples/activities/EHI/leftRightValueConstraintsMultiLang.jsonld"
56 | ```
57 |
58 | ## Updating the activity
59 |
60 | We need to update the `edinburgh_handedness_inventory_short.jsonld` so that the preamble question has both languages:
61 |
62 | ```json linenums="1" hl_lines="5-8 13-16"
63 | --8<-- "examples/activities/EHI/edinburgh_handedness_inventory_short_multi_lang.jsonld"
64 | ```
65 |
--------------------------------------------------------------------------------
/docs/tutorials/using-reproschema.md:
--------------------------------------------------------------------------------
1 | # How can I use reproschema to create my own questionnaire?
2 |
3 | Broadly speaking, there are two ways to create new assessments (`actitivies`) or combinations of assessments (`protocols`).
4 | 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.
5 | 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.
6 |
7 | ## Manual schema generation
8 |
9 | Here we will show a step by step approach to create a new protocol that includes activities that already exist and how to create a brand new activity.
10 |
11 | ## Requirements
12 |
13 | For this tutorial you will be using some other tools to put your work online. Here is what you will need to install or set up.
14 |
15 | - [Git](https://git-scm.com/downloads)
16 | - a [Github account](https://github.com/)
17 | - 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.
18 |
19 | 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.
20 | 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.
21 |
22 | !!! note "For Windows users"
23 | 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.
24 |
25 | ## Context
26 |
27 | To make this a bit less abstract, we will imagine we want to create a new protocol for a new neuroimaging study we are starting to investigate some aspects of linguistic processing is affected in patients with depression.
28 |
29 | So we would want to have a set of questionnaires:
30 |
31 | - to assess the severity of the depression of our participants,
32 | - check which participants can go in an MRI scanner,
33 | - estimate the handedness of the participants (because of the language lateralization organization of the brain).
34 |
35 | ## A note about this tutorial
36 |
37 | We will be creating several JSON-LD files in this tutorial.
38 | 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.
39 | This gets even more confusing when you know that the order of the lines does not really matter.
40 | 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.
41 |
42 | So if step 1 looked like this:
43 |
44 | ```json linenums="1"
45 | {
46 | "@context": "some_URL",
47 | "@type": "reproschema:Protocol",
48 | "@id": "some_id",
49 | "schemaVersion": "1.0.0",
50 | "version": "0.0.1",
51 | }
52 | ```
53 |
54 | We will make sure that step 2 where we add a `landingPage` field looks like this:
55 |
56 | ```json linenums="1" hl_lines="7"
57 | {
58 | "@context": "some_URL",
59 | "@type": "reproschema:Protocol",
60 | "@id": "some_id",
61 | "schemaVersion": "1.0.0",
62 | "version": "0.0.1",
63 | "landingPage": {"@id": "README.md"}
64 | }
65 | ```
66 |
67 | Although some other possibility would be equivalent:
68 |
69 | ```json linenums="1" hl_lines="2"
70 | {
71 | "landingPage": {"@id": "README.md"},
72 | "@context": "some_URL",
73 | "@type": "reproschema:Protocol",
74 | "@id": "some_id",
75 | "schemaVersion": "1.0.0",
76 | "version": "0.0.1",
77 | }
78 | ```
79 |
80 | ```json linenums="1" hl_lines="5"
81 | {
82 | "@context": "some_URL",
83 | "@type": "reproschema:Protocol",
84 | "@id": "some_id",
85 | "landingPage": {"@id": "README.md"},
86 | "schemaVersion": "1.0.0",
87 | "version": "0.0.1",
88 | }
89 | ```
90 |
--------------------------------------------------------------------------------
/docs/user-guide/create-new-assess.md:
--------------------------------------------------------------------------------
1 | # Creating New Assessments for Unique Research Needs
2 |
3 | This section provides the customized new assessments tailored to specific research needs. Our focus is on creating three distinct types of activities that are not readily available in the reproschema-library.
4 | These include:
5 |
6 | 1. clinical questions to gather clinical background information,
7 | 1. a speech task designed to collect audio data, and
8 | 1. an audio check to facilitate the speech task.
9 |
10 | For each of these new assessments, the folder structure within the repository will differ slightly from those directly adopted from the reproschema-library. Specifically, each activity has its own dedicated folder within the `activities` directory.
11 | For instance, the speech task resides in [`activities/4_speech`](https://github.com/ReproNim/reproschema-demo-protocol/tree/main/activities/4_speech).
12 | Within this folder, besides the primary schema file (e.g., `speech_schema`), there is an additional subfolder named `items`.
13 | This `items` folder contains individual questions or tasks pertaining to that specific activity.
14 |
15 | In the case of the speech task, the `items` folder might include a single task designed to prompt the participant to provide a speech sample. Similarly, for the clinical questions, their respective folders will contain `items` subfolders with corresponding questions tailored to elicit the required information.
16 |
17 | The structure of an item within the `items` folder of a ReproSchema activity is similar to the schema template, but with key differences that cater to the specifics of individual data collection elements. Here's an explanation of the provided template for a `country item`:
18 |
19 | 1. **Context and type (@context, @type)**:
20 | The `@context` remains the same, pointing to the generic context of ReproSchema.
21 | The `@type` is now "reproschema:Field" instead of "reproschema:Activity".
22 | This change signifies that this template defines a single data collection field or question within an activity, as opposed to the overall structure of an activity.
23 |
24 | 1. **Identifier and descriptive fields (@id, prefLabel, description, etc.)**:
25 | `@id` serves as a unique identifier for the item, here named "country_item".
26 | prefLabel and description provide a human-readable name and a brief description of the item, similar to their use in the schema template.
27 |
28 | 1. **Question field (question)**:
29 | This field contains the actual question or prompt that will be presented to the participant.
30 | In this template, it reads: "This is an item where the user can select a country."
31 |
32 | 1. **UI configuration (ui)**:
33 | The ui section in the item template differs from the schema template.
34 | It specifies how the question will be presented to the user.
35 | The inputType is set to "selectCountry", indicating that the user interface will provide a country selection method.
36 |
37 | 1. **Response options (responseOptions)**:
38 | This section defines the nature and structure of the responses allowed for the item.
39 | In this example, it specifies the valueType as "xsd:string" and a maxLength of 50 characters.
40 | It also provides a URL to a list of choices, in this case, a JSON file containing country names.
41 | This link allows the questionnaire to dynamically fetch and display a list of countries as response options.
42 |
43 | ```json
44 | "responseOptions": {
45 | "valueType": "xsd:string",
46 | "maxLength": 50,
47 | "choices": "https://raw.githubusercontent.com/samayo/country-json/master/src/country-by-name.json"
48 | }
49 | ```
50 |
51 | ## Step 1: Specifying `inputType` and `responseOption` to gather precise data
52 |
53 | We have crafted ten items in the 'items' folder for the clinical questions assessment. Each item, such as `alcohol_consumption`, `height`, `weight`, etc., has its `ui` inputType and `responseOptions` specifically defined to suit the nature of the question.
54 |
55 | Take 'alcohol_consumption' as an example.
56 | The UI configuration and response options for this question are tailored to capture a straightforward piece of information:
57 |
58 | ```json
59 | "question": {
60 | "en": "Have you drunk alcohol today?",
61 | "es": "¿Has bebido alcohol hoy?"
62 | },
63 | "ui": {
64 | "inputType": "radio"
65 | },
66 | "responseOptions": {
67 | "valueType": "xsd:string",
68 | "multipleChoice": false,
69 | "choices": [
70 | {
71 | "name": {
72 | "en": "Yes",
73 | "es": "Sí"
74 | },
75 | "value": 1
76 | },
77 | {
78 | "name": {
79 | "en": "No",
80 | "es": "No"
81 | },
82 | "value": 2
83 | }
84 | ]
85 | }
86 | ```
87 |
88 | - The ui section sets the `inputType` to `"radio"`.
89 | This choice indicates that the question will be presented to the participant as a radio button selection,
90 | providing a simple and clear interface for response selection.
91 |
92 | - In the responseOptions, the `valueType` is defined as `"xsd:string"`, signifying that the expected type of response is a string.
93 | The multipleChoice field is set to false, indicating that participants can only select one of the provided options.
94 |
95 | - The `choices` array lists the possible responses.
96 | In this case, there are two: "Yes" and "No", each with a corresponding value (1 for Yes, 2 for No)
97 | and translations provided for English ("en") and Spanish ("es").
98 |
99 | - For the speech task in our demo project, the configuration of ui `inputType` and `responseOptions` is distinctively tailored
100 | to facilitate audio data collection:
101 |
102 | ```json
103 | "ui": {
104 | "inputType": "audioPassageRecord"
105 | },
106 | "responseOptions": {
107 | "valueType": "schema:AudioObject",
108 | "minValue": 0,
109 | "maxValue": 60000
110 | }
111 | ```
112 |
113 | - In the ui section, the `inputType` is set to `"audioPassageRecord"`.
114 | This specific input type is designed to enable participants to record an audio passage directly within the questionnaire interface.
115 |
116 | - The `responseOptions` are configured to accommodate the nature of audio data.
117 |
118 | - The `valueType` is specified as "schema:AudioObject", indicating that the response will be an audio file.
119 |
120 | - The fields `minValue` and `maxValue` define the allowable duration of the audio recording in milliseconds.
121 | In this case, the maximum duration is set to 60,000 milliseconds (or 1 minute).
122 |
123 | ## Step 2: Integrating additional components for activity-specific needs
124 |
125 | We can integrate additional components tailored to the unique requirements of specific activities. For instance, considering the unique needs of our speech task, we add an 'audio check' component to confirm the functionality of the audio recording feature.
126 |
127 | 1. Setting up an audio check for the speech task
128 |
129 | To ensure the effectiveness of our speech task, we create an activity for audio verification within the `activities` folder, naming it [`0_audio`](https://github.com/ReproNim/reproschema-demo-protocol/blob/main/activities/0_audio/).
130 | This folder contains the [`audio_check_schema`](https://github.com/ReproNim/reproschema-demo-protocol/blob/main/activities/0_audio/audio_check_schema), a schema specifically designed to test and confirm that the audio recording system is operational and effective for participants.
131 |
132 | 1. Contextual and properties configuration for audio check
133 |
134 | ```json
135 | "@context": [
136 | "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc4/contexts/generic",
137 | {
138 | "voice": "https://github.com/ReproNim/reproschema-library/tree/master/activities/VoiceTask/items"
139 | }
140 | ]
141 | ```
142 |
143 | The `@context` section includes a specific context link under "voice",
144 | pointing to the repository with items relevant to voice and audio tasks:
145 | `https://github.com/ReproNim/reproschema-library/tree/master/activities/VoiceTask/items`
146 | This targeted link ensures that the audio check activity aligns with the specific requirements of voice-related tasks.
147 |
148 | The ui's `addProperties` array is tailored for the audio check.
149 | We define a property `"variableName": "audio_check"` linked to `"isAbout": "voice:audio_check"`.
150 |
--------------------------------------------------------------------------------
/docs/user-guide/create-new-protocol.md:
--------------------------------------------------------------------------------
1 | # Creating a Research Protocol Using Cookiecutter
2 |
3 | Ready for your first ReproSchema project?! We are going to use the [Reproschema Protocol Cookiecutter](https://github.com/ReproNim/reproschema-protocol-cookiecutter) to create a demo protocol.
4 |
5 | ## Getting Started
6 |
7 | 1. **Prerequisite:**
8 | Ensure you have Git and Cookiecutter installed on your system. If not, please refer to the installation guides for Git and Cookiecutter.
9 |
10 | 1. **Generate your Repository:**
11 | Use the Reproschema Protocol Cookiecutter to create a new repository for your research protocol.
12 | Run the following command in your terminal:
13 |
14 | ```bash
15 | cookiecutter gh:ReproNim/reproschema-protocol-cookiecutter
16 | ```
17 |
18 | 1. Follow the prompts to customize your new protocol,
19 | more details see [here](https://github.com/ReproNim/reproschema-protocol-cookiecutter#step-1-generate-the-protocol-files)
20 |
21 | ## Customizing Your Protocol
22 |
23 | Once you run the Cookiecutter command, you will be prompted to make choices for your protocol, ranging from 1-5. These choices generate corresponding activities in your repository. Here's what you can do with these activities:
24 |
25 | 1. **Use as templates:**
26 | The activities created based on your choices serve as templates.
27 | You can use these to understand the structure and elements within the activities folder.
28 | This is particularly useful if you're new to ReproSchema.
29 | By exploring these templates, you'll get a clearer picture of how activities are structured and what kind of information they contain.
30 |
31 | 1. **Delete and start fresh:**
32 | Alternatively, if you already have a clear idea of what your protocol needs, you can delete these generated activities.
33 | This allows you to start from scratch, creating activities that are tailored specifically to your research needs.
34 |
35 | The inclusion of activity choices aims to provide users with a practical understanding of how activities are structured within ReproSchema protocols. Whether you use these as a starting point or prefer to create your own from the ground up, these templates are there to guide you in structuring your research protocol effectively.
36 |
37 | We provide more detailed instructions for customizing your protocol in the following pages using [reproschema-demo-protocol](https://github.com/ReproNim/reproschema-demo-protocol) as an example.
38 |
--------------------------------------------------------------------------------
/docs/user-guide/finalize-protocol.md:
--------------------------------------------------------------------------------
1 | # Finalizing the Protocol
2 |
3 | After setting up individual activities, we return to the main [protocol schema](https://github.com/ReproNim/reproschema-demo-protocol/blob/main/reproschema_demo_protocol/reproschema_demo_protocol_schema) to organize everything cohesively.
4 | This step involves structuring the 'DemoProtocol_schema' to include all the activities we have developed, defining their sequence and presentation within the overall research protocol.
5 | In the 'DemoProtocol_schema', located in the 'DemoProtocol' folder, we integrate each activity schema using the following approach:
6 |
7 | 1. Context and protocol definition
8 |
9 | The `@context`, `@type`, `@id`, and descriptive fields (`prefLabel`, `description`, etc.) provide the foundational information about the protocol.
10 |
11 | 1. Inclusion of activities
12 |
13 | The ui section's addProperties array is crucial. Here, each activity schema we've created is referenced under `isAbout`, with its respective `variableName` and `prefLabel`. For example, the `audio` activity is linked as
14 |
15 | ```json
16 | {
17 | "isAbout": "../activities/0_audio/audio_check_schema",
18 | "variableName": "audio_check_schema",
19 | "prefLabel": {"en": "Audio Check"}
20 | }
21 | ```
22 |
23 | This structure is repeated for each activity, including audio check, demographics, psychological questions, clinical questions, speech task, and feedback.
24 |
25 | 1. [Order of presentation](https://github.com/ReproNim/reproschema-demo-protocol/blob/454ea9b65ef563c70cd496de7c8f22fbbc18ba5a/reproschema_demo_protocol/reproschema_demo_protocol_schema#L50)
26 |
27 | The order array within ui specifies the sequence in which these activities will appear in the protocol.
28 | It's arranged to flow logically from consent, through various assessments, to the final feedback, ensuring a structured participant experience. For instance, the order starts with `../activities/0_audio/audio_check_schema` and progresses through to `../activities/5_feedback/feedback_schema`.
29 |
30 | 1. [Additional UI settings](https://github.com/ReproNim/reproschema-demo-protocol/blob/454ea9b65ef563c70cd496de7c8f22fbbc18ba5a/reproschema_demo_protocol/reproschema_demo_protocol_schema#L23)
31 | - `"shuffle"` is set to false to maintain the specified order.
32 | - `"allow"` includes functionalities such as `"reproschema:AllowExport"` for data exporting options.
33 |
34 | 1. Update [README.md](https://github.com/ReproNim/reproschema-demo-protocol/blob/main/reproschema_demo_protocol/README.md)
35 |
36 | Give clear and concise instructions on what this protocol is about and how participants should use it.
37 |
38 | Upon finalizing our protocol with the integrated activities, the end result is a fully interactive research tool hosted on our GitHub repository. For data collection, this tool can be linked to a backend server, or participants can be given the option to export their data directly.
39 |
--------------------------------------------------------------------------------
/docs/user-guide/setup-feedback.md:
--------------------------------------------------------------------------------
1 | # Adding a customized feedback section
2 |
3 | To conclude our protocol, we integrate a customized feedback activity. This
4 | choice of ending with participant feedback is just one of many possibilities,
5 | demonstrating the adaptability of ReproSchema to diverse research needs.
6 |
7 | ```json linenums="1"
8 | --8<-- "examples/activities/user_guide/items/feedback.jsonld"
9 | ```
10 |
11 | The `feedback` item in this activity
12 | ([`5_feedback`](https://github.com/ReproNim/reproschema-demo-protocol/blob/main/activities/5_feedback/items/feedback))
13 | is specifically designed to gather open-ended responses, allowing participants
14 | to share their thoughts and suggestions:
15 |
16 | - Item Structure: The item `feedback` is set up with an identification and
17 | purpose, indicated by its `@id` and descriptive fields.
18 |
19 | - Question Prompt: The `question` is presented in both English and Spanish,
20 | encouraging participants to provide comments on their study experience. It’s
21 | formatted to be inclusive, giving participants the option to skip if they
22 | choose.
23 |
24 | - UI Configuration for Open Responses: The choice of `textarea` as the
25 | `inputType` in the ui configuration facilitates extended text input, enabling
26 | participants to express detailed feedback comfortably. Accordingly,
27 | `valueType` in the `responseOptions` has been set as `"xsd:string"`.
28 |
--------------------------------------------------------------------------------
/docs/user-guide/tools.md:
--------------------------------------------------------------------------------
1 | # Toolkit
2 |
3 | In the world of research data management, flexibility and compatibility are key. Understanding this, we provide specialized tools designed to create, validate schemas, and convert data between ReproSchema format and REDCap CSV format. Whether you're transitioning from REDCap to ReproSchema or vice versa, these tools ensure a smooth and efficient conversion process, preserving the integrity and structure of your data.
4 |
5 | ## Install reproschema-py
6 |
7 | ```bash
8 | pip install reproschema
9 | ```
10 |
11 | ## CLI usage
12 |
13 | `reproschema-py` can be used as a Commend-Line Interface.
14 |
15 | ```bash
16 | $ reproschema
17 | Usage: reproschema [OPTIONS] COMMAND [ARGS]...
18 |
19 | A client to support interactions with ReproSchema
20 |
21 | To see help for a specific command, run
22 |
23 | reproschema COMMAND --help e.g. reproschema validate --help
24 |
25 | Options:
26 | --version
27 | -l, --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]
28 | Log level name [default: INFO]
29 | --help Show this message and exit.
30 |
31 | Commands:
32 | convert
33 | create
34 | redcap2reproschema Convert REDCap CSV files to Reproschema format.
35 | reproschema2redcap Convert reproschema protocol to REDCap CSV format.
36 | serve
37 | validate
38 | ```
39 |
40 | ## `reproschema2redcap` Usage
41 |
42 | To convert ReproSchema protocol to REDCap CSV format, use the following command
43 |
44 | ```bash
45 | reproschema reproschema2redcap
46 | ```
47 |
48 | - ``: The path to the root folder of a protocol. For example, to convert the reproschema-demo-protocol provided by ReproNim, you can use the following commands:
49 |
50 | ```bash
51 | git clone https://github.com/ReproNim/reproschema-demo-protocol.git
52 | cd reproschema-demo-protocol
53 | pwd
54 | ```
55 |
56 | In this case, the output from `pwd` (which shows your current directory path)should be your ``.
57 |
58 | - ``: The name of the output CSV file where the converted data will be saved.
59 |
60 | ## `redcap2reproschema` Usage
61 |
62 | The `redcap2reproschema` function is designed to process a given REDCap CSV file and YAML configuration to generate the output in the reproschema format.
63 |
64 | ### Prerequisites
65 |
66 | Before the conversion, ensure you have the following:
67 |
68 | **YAML Configuration File**:
69 |
70 | - Download [templates/redcap2rs.yaml](https://github.com/ReproNim/reproschema-py/blob/ab7c051dbd4ebfce92917ce154a8053343a011e7/templates/redcap2rs.yaml) and fill it out with your protocol details.
71 |
72 | ### YAML File Configuration
73 |
74 | In the `templates/redcap2rs.yaml` file, provide the following information:
75 |
76 | - **protocol_name**: This is a unique identifier for your protocol. Use underscores for spaces and avoid special characters.
77 | - **protocol_display_name**: The name that will appear in the application.
78 | - **protocol_description**: A brief description of your protocol.
79 |
80 | Example:
81 |
82 | ```yaml
83 | protocol_name: "My_Protocol"
84 | protocol_display_name: "Assessment Protocol"
85 | protocol_description: "This protocol is for assessing cognitive skills."
86 | ```
87 |
88 | The `redcap2reproschema` function has been integrated into a CLI tool, use the following command:
89 |
90 | ```bash
91 | reproschema redcap2reproschema path/to/your_redcap_data_dic.csv path/to/your_redcap2rs.yaml
92 | ```
93 |
94 | Those tools can also be used as Python functions. For detailed instructions, please visit [reproschema-py](https://github.com/ReproNim/reproschema-py).
95 |
--------------------------------------------------------------------------------
/examples/activities/EHI/edinburgh_handedness_inventory_short.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
3 | "@type": "reproschema:Activity",
4 | "@id": "edinburgh_handedness_inventory_short.jsonld",
5 | "prefLabel": "Edinburgh handedness inventory - short form",
6 | "description": "Short version of the Edinburgh handedness inventory",
7 | "schemaVersion": "1.0.0-rc1",
8 | "version": "0.0.1",
9 | "citation": "10.1080/1357650X.2013.783045",
10 | "preamble": "Please indicate your preferences in the use of hands in the following activities or objects:",
11 | "ui": {
12 | "order": [
13 | "items/writing.jsonld",
14 | "items/throwing.jsonld",
15 | "items/EHI_results.jsonld"
16 | ],
17 | "shuffle": false,
18 | "addProperties": [
19 | {
20 | "variableName": "writing",
21 | "isAbout": "items/writing.jsonld",
22 | "valueRequired": true,
23 | "isVis": true
24 | },
25 | {
26 | "variableName": "throwing",
27 | "isAbout": "items/throwing.jsonld",
28 | "valueRequired": true,
29 | "isVis": true
30 | },
31 | {
32 | "isAbout": "items/EHI_results.jsonld",
33 | "variableName": "EHI_results",
34 | "isVis": true
35 | }
36 | ]
37 | },
38 | "compute": [
39 | {
40 | "variableName": "EHI_results",
41 | "jsExpression": "( writing + throwing ) / 2"
42 | }
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/examples/activities/EHI/edinburgh_handedness_inventory_short_multi_lang.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
3 | "@type": "reproschema:Activity",
4 | "@id": "edinburgh_handedness_inventory_short_multi_lang.jsonld",
5 | "prefLabel": {
6 | "en": "Edinburgh handedness inventory - short form",
7 | "fr": "Version abrégée du test Edinburgh"
8 | },
9 | "description": "Short version of the Edinburgh handedness inventory",
10 | "schemaVersion": "1.0.0-rc1",
11 | "version": "0.0.1",
12 | "citation": "10.1080/1357650X.2013.783045",
13 | "preamble": {
14 | "en": "Please indicate your preferences in the use of hands in the following activities or objects:",
15 | "fr": "Quelle main utilisez-vous de préférence pour :"
16 | },
17 | "ui": {
18 | "order": [
19 | "items/writing.jsonld",
20 | "items/throwing.jsonld",
21 | "items/EHI_results.jsonld"
22 | ],
23 | "shuffle": false,
24 | "addProperties": [
25 | {
26 | "variableName": "writing",
27 | "isAbout": "items/writing.jsonld",
28 | "valueRequired": true,
29 | "isVis": true
30 | },
31 | {
32 | "variableName": "throwing",
33 | "isAbout": "items/throwing.jsonld",
34 | "valueRequired": true,
35 | "isVis": true
36 | },
37 | {
38 | "isAbout": "items/EHI_results.jsonld",
39 | "variableName": "EHI_results",
40 | "isVis": true
41 | }
42 | ]
43 | },
44 | "compute": [
45 | {
46 | "variableName": "EHI_results",
47 | "jsExpression": "( writing + throwing ) / 2"
48 | }
49 | ]
50 | }
51 |
--------------------------------------------------------------------------------
/examples/activities/EHI/items/EHI_results.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
3 | "@type": "reproschema:Field",
4 | "@id": "EHI_results.jsonld",
5 | "prefLabel": "EHI results",
6 | "description": "Edinburgh handedness inventory",
7 | "schemaVersion": "1.0.0-rc1",
8 | "version": "0.0.1",
9 | "ui": {
10 | "inputType": "number",
11 | "readonlyValue": true
12 | },
13 | "responseOptions": {
14 | "valueType": "xsd:integer",
15 | "minValue": -100,
16 | "maxValue": 100
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/activities/EHI/items/throwing.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
3 | "@type": "reproschema:Field",
4 | "@id": "throwing.jsonld",
5 | "prefLabel": "throwing",
6 | "description": "throwing item of the EHI",
7 | "schemaVersion": "1.0.0-rc1",
8 | "version": "0.0.1",
9 | "question": "Throwing",
10 | "ui": {
11 | "inputType": "radio"
12 | },
13 | "responseOptions": {
14 | "valueType": "xsd:integer",
15 | "minValue": -100,
16 | "maxValue": 100,
17 | "multipleChoice": false,
18 | "choices": [
19 | {
20 | "name": "Always right",
21 | "value": 100
22 | },
23 | {
24 | "name": "Usually right",
25 | "value": 50
26 | },
27 | {
28 | "name": "Both equally",
29 | "value": 0
30 | },
31 | {
32 | "name": "Usually left",
33 | "value": -50
34 | },
35 | {
36 | "name": "Always left",
37 | "value": -100
38 | }
39 | ]
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/examples/activities/EHI/items/writing.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
3 | "@type": "reproschema:Field",
4 | "@id": "writing.jsonld",
5 | "prefLabel": "writing",
6 | "description": "writing item of the EHI",
7 | "schemaVersion": "1.0.0-rc1",
8 | "version": "0.0.1",
9 | "question": "Writing",
10 | "ui": {
11 | "inputType": "radio"
12 | },
13 | "responseOptions": {
14 | "valueType": "xsd:integer",
15 | "minValue": -100,
16 | "maxValue": 100,
17 | "multipleChoice": false,
18 | "choices": [
19 | {
20 | "name": "Always right",
21 | "value": 100
22 | },
23 | {
24 | "name": "Usually right",
25 | "value": 50
26 | },
27 | {
28 | "name": "Both equally",
29 | "value": 0
30 | },
31 | {
32 | "name": "Usually left",
33 | "value": -50
34 | },
35 | {
36 | "name": "Always left",
37 | "value": -100
38 | }
39 | ]
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/examples/activities/EHI/leftRightValueConstraints.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
3 | "@id": "leftRightValueConstraints.jsonld",
4 | "@type": "reproschema:ResponseOption",
5 | "valueType": "xsd:integer",
6 | "minValue": -100,
7 | "maxValue": 100,
8 | "multipleChoice": false,
9 | "choices": [
10 | {
11 | "name": "Always right",
12 | "value": 100
13 | },
14 | {
15 | "name": "Usually right",
16 | "value": 50
17 | },
18 | {
19 | "name": "Both equally",
20 | "value": 0
21 | },
22 | {
23 | "name": "Usually left",
24 | "value": -50
25 | },
26 | {
27 | "name": "Always left",
28 | "value": -100
29 | }
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/examples/activities/EHI/leftRightValueConstraintsMultiLang.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
3 | "@id": "leftRightValueConstraintsMultiLang.jsonld",
4 | "@type": "reproschema:ResponseOption",
5 | "valueType": "xsd:integer",
6 | "minValue": -100,
7 | "maxValue": 100,
8 | "multipleChoice": false,
9 | "choices": [
10 | {
11 | "name": {
12 | "en": "Always right",
13 | "fr": "Toujours la main droite"
14 | },
15 | "value": 100
16 | },
17 | {
18 | "name": {
19 | "en": "Usually right",
20 | "fr": "En général la main droite"
21 | },
22 | "value": 50
23 | },
24 | {
25 | "name": {
26 | "en": "Both equally",
27 | "fr": "Les deux"
28 | },
29 | "value": 0
30 | },
31 | {
32 | "name": {
33 | "en": "Usually left",
34 | "fr": "En général la main gauche"
35 | },
36 | "value": -50
37 | },
38 | {
39 | "name": {
40 | "en": "Always left",
41 | "fr": "Toujours la main gauche"
42 | },
43 | "value": -100
44 | }
45 | ]
46 | }
47 |
--------------------------------------------------------------------------------
/examples/activities/activity1.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../contexts/reproschema",
3 | "@type": "reproschema:Activity",
4 | "@id": "activity1.jsonld",
5 | "prefLabel": "Example 1",
6 | "description": "Activity example 1",
7 | "schemaVersion": "1.0.0-rc4",
8 | "version": "0.0.1",
9 | "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
10 | "image": {
11 | "@type": "AudioObject",
12 | "contentUrl": "http://example.com/sample-image.png"
13 | },
14 | "preamble": {
15 | "en": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
16 | "es": "Durante las últimas 2 semanas, ¿con qué frecuencia le han molestado los siguintes problemas?"
17 | },
18 | "compute": [
19 | {
20 | "variableName": "activity1_total_score",
21 | "jsExpression": "item1 + item2"
22 | }
23 | ],
24 | "messages": [
25 | {
26 | "message": "Test message: Triggered when item1 value is greater than 1",
27 | "jsExpression": "item1 > 1"
28 | }
29 | ],
30 | "ui": {
31 | "addProperties": [
32 | { "isAbout": "items/item1.jsonld",
33 | "variableName": "item1",
34 | "valueRequired": true,
35 | "isVis": true,
36 | "randomMaxDelay": "PT2H",
37 | "limit": "P2D",
38 | "schedule": "R/2020-08-01T08:00:00Z/P1D"
39 | },
40 | { "isAbout": "items/item2.jsonld",
41 | "variableName": "item2",
42 | "valueRequired": true,
43 | "isVis": true,
44 | "allow": ["reproschema:AllowSkip"]
45 | },
46 | { "isAbout": "items/activity1_total_score",
47 | "variableName": "activity1_total_score",
48 | "valueRequired": true,
49 | "isVis": false
50 | }
51 | ],
52 | "order": [
53 | "items/item1.jsonld",
54 | "items/item2.jsonld",
55 | "items/activity1_total_score"
56 | ],
57 | "shuffle": false
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/examples/activities/activity1_embed.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../contexts/reproschema",
3 | "@type": "reproschema:Activity",
4 | "@id": "activity1_embed.jsonld",
5 | "prefLabel": "Example 1",
6 | "description": "Activity example 1",
7 | "schemaVersion": "1.0.0-rc4",
8 | "version": "0.0.1",
9 | "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
10 | "preamble": {
11 | "en": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
12 | "es": "Durante las últimas 2 semanas, ¿con qué frecuencia le han molestado los siguintes problemas?"
13 | },
14 | "ui": {
15 | "addProperties": [
16 | { "isAbout": "items/item1.jsonld",
17 | "variableName": "item1",
18 | "valueRequired": true,
19 | "isVis": true}
20 | ],
21 | "order": [
22 | {
23 | "@type": "reproschema:Field",
24 | "@id": "items/item1.jsonld",
25 | "prefLabel": "item1",
26 | "description": "Q1 of example 1",
27 | "schemaVersion": "1.0.0-rc4",
28 | "version": "0.0.1",
29 | "question": {
30 | "en": "Little interest or pleasure in doing things",
31 | "es": "Poco interés o placer en hacer cosas"
32 | },
33 | "ui": {
34 | "inputType": "radio"
35 | },
36 | "responseOptions": {
37 | "valueType": "xsd:integer",
38 | "minValue": 0,
39 | "maxValue": 3,
40 | "multipleChoice": false,
41 | "choices": [
42 | {
43 | "name": {
44 | "en": "Not at all",
45 | "es": "Para nada"
46 | },
47 | "value": 0
48 | },
49 | {
50 | "name": {
51 | "en": "Several days",
52 | "es": "Varios días"
53 | },
54 | "value": 1
55 | },
56 | {
57 | "name": {
58 | "en": "More than half the days",
59 | "es": "Más de la mitad de los días"
60 | },
61 | "value": 2
62 | },
63 | {
64 | "name": {
65 | "en": "Nearly everyday",
66 | "es": "Casi todos los días"
67 | },
68 | "value": 3
69 | }
70 | ]
71 | }
72 | }
73 | ],
74 | "shuffle": false
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/examples/activities/items/activity1_total_score:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../../contexts/reproschema",
3 | "@type": "reproschema:Field",
4 | "@id": "activity1_total_score",
5 | "prefLabel": "activity1_total_score",
6 | "description": "Score item for Activity 1",
7 | "schemaVersion": "1.0.0-rc4",
8 | "version": "0.0.1",
9 | "ui": {
10 | "inputType": "number",
11 | "readonlyValue": true
12 | },
13 | "responseOptions": {
14 | "valueType": "xsd:integer",
15 | "minValue": 0,
16 | "maxValue": 3
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/activities/items/item1.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../../contexts/reproschema",
3 | "@type": "reproschema:Field",
4 | "@id": "item1.jsonld",
5 | "prefLabel": "item1",
6 | "altLabel": "item1_alt",
7 | "description": "Q1 of example 1",
8 | "schemaVersion": "1.0.0-rc4",
9 | "version": "0.0.1",
10 | "audio": {
11 | "@type": "AudioObject",
12 | "contentUrl": "http://media.freesound.org/sample-file.mp4"
13 | },
14 | "image": {
15 | "@type": "ImageObject",
16 | "contentUrl": "http://example.com/sample-image.jpg"
17 | },
18 | "question": {
19 | "en": "Little interest or pleasure in doing things",
20 | "es": "Poco interés o placer en hacer cosas"
21 | },
22 | "ui": {
23 | "inputType": "radio"
24 | },
25 | "responseOptions": {
26 | "valueType": "xsd:integer",
27 | "minValue": 0,
28 | "maxValue": 3,
29 | "multipleChoice": false,
30 | "choices": [
31 | {
32 | "name": {
33 | "en": "Not at all",
34 | "es": "Para nada"
35 | },
36 | "value": 0
37 | },
38 | {
39 | "name": {
40 | "en": "Several days",
41 | "es": "Varios días"
42 | },
43 | "value": "a"
44 | },
45 | {
46 | "name": {
47 | "en": "More than half the days",
48 | "es": "Más de la mitad de los días"
49 | },
50 | "value": {"@id": "http://example.com/choice3" }
51 | },
52 | {
53 | "name": {
54 | "en": "Nearly everyday",
55 | "es": "Casi todos los días"
56 | },
57 | "value": {"@value": "choice-with-lang", "@language": "en"}
58 | }
59 | ]
60 | },
61 | "additionalNotesObj": [
62 | {
63 | "source": "redcap",
64 | "column": "notes",
65 | "value": "some extra note"
66 | },
67 | {
68 | "source": "redcap",
69 | "column": "notes",
70 | "value": {"@id": "http://example.com/iri-example"}
71 | }
72 | ]
73 | }
74 |
--------------------------------------------------------------------------------
/examples/activities/items/item2.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../../contexts/reproschema",
3 | "@type": "reproschema:Field",
4 | "@id": "item2.jsonld",
5 | "prefLabel": "item2",
6 | "description": "Q2 of example 1",
7 | "schemaVersion": "1.0.0-rc4",
8 | "version": "0.0.1",
9 | "question": {
10 | "en": "Current temperature.",
11 | "es": "Fiebre actual."
12 | },
13 | "video": {
14 | "@type": "VideoObject",
15 | "contentUrl": "http://media.freesound.org/data/0/previews/719__elmomo__12oclock_girona_preview.mp4"
16 | },
17 | "ui": {
18 | "inputType": "float"
19 | },
20 | "responseOptions": {
21 | "valueType": "xsd:float",
22 | "unitOptions": [
23 | {
24 | "prefLabel": {
25 | "en": "Fahrenheit",
26 | "es": "Fahrenheit"
27 | },
28 | "value": "°F"
29 | },
30 | {
31 | "prefLabel": {
32 | "en": "Celsius",
33 | "es": "Celsius"
34 | },
35 | "value": "°C"
36 | }
37 | ]
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/examples/activities/user_guide/items/feedback.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc4/contexts/generic",
3 | "@type": "reproschema:Field",
4 | "@id": "feedback.jsonld",
5 | "prefLabel": "Feedback",
6 | "description": "schema to record text response of overall feedback of the protocol",
7 | "schemaVersion": "1.0.0-rc4",
8 | "version": "0.0.1",
9 | "question": {
10 | "en": "Please leave any comments or suggestions on the study so we can improve it (or skip):",
11 | "es": "Deje cualquier comentario o sugerencia sobre el estudio para que podamos mejorarlo (u omitir):"
12 | },
13 | "ui": {
14 | "inputType": "textarea"
15 | },
16 | "responseOptions": {
17 | "valueType": "xsd:string"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/protocols/README.md:
--------------------------------------------------------------------------------
1 | # README
2 |
3 | Hello world
4 |
--------------------------------------------------------------------------------
/examples/protocols/depression_nimg_schema.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [
3 | "https://raw.githubusercontent.com/ReproNim/reproschema/1.0.0-rc1/contexts/generic",
4 | {
5 | "rl": "https://raw.githubusercontent.com/ReproNim/reproschema-library/master/activities/"
6 | }
7 | ],
8 | "@type": "reproschema:Protocol",
9 | "@id": "depression_nimg_schema.jsonld",
10 | "prefLabel": "depression neuroimaging study",
11 | "description": "a study on linguistic processing in depression",
12 | "schemaVersion": "1.0.0-rc1",
13 | "version": "0.0.1",
14 | "landingPage": {
15 | "@id": "README.md",
16 | "inLanguage": "en"
17 | },
18 | "ui": {
19 | "addProperties": [
20 | {
21 | "isAbout": "rl:PHQ-9/PHQ9_schema",
22 | "variableName": "PHQ9_schema",
23 | "prefLabel": { "en": "Depression" }
24 | },
25 | {
26 | "isAbout": "../activities/EHI/edinburgh_handedness_inventory_short.jsonld",
27 | "variableName": "EHI_short_schema",
28 | "prefLabel": { "en": "EHI" }
29 | }
30 | ],
31 | "order": [
32 | "rl:PHQ-9/PHQ9_schema",
33 | "EHI_short_schema"
34 | ]
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/examples/protocols/protocol1.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../contexts/reproschema",
3 | "@type": "reproschema:Protocol",
4 | "@id": "protocol1.jsonld",
5 | "prefLabel": {
6 | "en": "Protocol1",
7 | "es": "Protocol1_es"
8 | },
9 | "description": "example Protocol",
10 | "schemaVersion": "1.0.0-rc4",
11 | "version": "0.0.1",
12 | "landingPage": {"@id": "http://example.com/sample-readme.md",
13 | "inLanguage": "en"},
14 | "messages": [
15 | {
16 | "message": "Test message: Triggered when item1 value is greater than 0",
17 | "jsExpression": "item1 > 0"
18 | }
19 | ],
20 | "ui": {
21 | "addProperties": [
22 | {
23 | "isAbout": "../activities/activity1.jsonld",
24 | "variableName": "activity1",
25 | "prefLabel": {
26 | "en": "Screening",
27 | "es": "Screening_es"
28 | },
29 | "isVis": true,
30 | "schedule": "R5/2008-01-01T13:00:00Z/P1Y2M10DT2H30M",
31 | "randomMaxDelay": "PT12H",
32 | "limit": "P1W/2020-08-01T13:00:00Z"
33 | }
34 | ],
35 | "order": [
36 | "../activities/activity1.jsonld"
37 | ],
38 | "shuffle": false,
39 | "allow": [
40 | "reproschema:AutoAdvance",
41 | "reproschema:DisableBack",
42 | "reproschema:AllowExport"
43 | ]
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/examples/protocols/protocol1_embed.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../contexts/reproschema",
3 | "@type": "reproschema:Protocol",
4 | "@id": "protocol1_embed.jsonld",
5 | "prefLabel": {
6 | "en": "Protocol1",
7 | "es": "Protocol1_es"
8 | },
9 | "description": "example Protocol",
10 | "schemaVersion": "1.0.0-rc4",
11 | "version": "0.0.1",
12 | "ui": {
13 | "addProperties": [
14 | {
15 | "isAbout": "../activities/activity1.jsonld",
16 | "variableName": "activity1",
17 | "prefLabel": {
18 | "en": "Screening",
19 | "es": "Screening_es"
20 | },
21 | "isVis": true
22 | }
23 | ],
24 | "order": [
25 | {
26 | "@type": "reproschema:Activity",
27 | "@id": "../activities/activity1.jsonld",
28 | "prefLabel": "Example 1",
29 | "description": "Activity example 1",
30 | "schemaVersion": "1.0.0-rc4",
31 | "version": "0.0.1",
32 | "citation": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1495268/",
33 | "preamble": {
34 | "en": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
35 | "es": "Durante las últimas 2 semanas, ¿con qué frecuencia le han molestado los siguintes problemas?"
36 | },
37 | "ui": {
38 | "addProperties": [
39 | {
40 | "isAbout": "../activities/items/item1.jsonld",
41 | "variableName": "item1",
42 | "valueRequired": true,
43 | "isVis": true
44 | }
45 | ],
46 | "order": [
47 | {
48 | "@type": "reproschema:Field",
49 | "@id": "../activities/items/item1.jsonld",
50 | "prefLabel": "item1",
51 | "description": "Q1 of example 1",
52 | "schemaVersion": "1.0.0-rc4",
53 | "version": "0.0.1",
54 | "question": {
55 | "en": "Little interest or pleasure in doing things",
56 | "es": "Poco interés o placer en hacer cosas"
57 | },
58 | "ui": {
59 | "inputType": "radio"
60 | },
61 | "responseOptions": {
62 | "valueType": "xsd:integer",
63 | "minValue": 0,
64 | "maxValue": 3,
65 | "multipleChoice": false,
66 | "choices": [
67 | {
68 | "name": {
69 | "en": "Not at all",
70 | "es": "Para nada"
71 | },
72 | "value": 0
73 | },
74 | {
75 | "name": {
76 | "en": "Several days",
77 | "es": "Varios días"
78 | },
79 | "value": 1
80 | },
81 | {
82 | "name": {
83 | "en": "More than half the days",
84 | "es": "Más de la mitad de los días"
85 | },
86 | "value": 2
87 | },
88 | {
89 | "name": {
90 | "en": "Nearly everyday",
91 | "es": "Casi todos los días"
92 | },
93 | "value": 3
94 | }
95 | ]
96 | }
97 | }
98 | ],
99 | "shuffle": false
100 | }
101 | }
102 | ],
103 | "shuffle": false,
104 | "allow": [
105 | "reproschema:AutoAdvance",
106 | "reproschema:DisableBack",
107 | "reproschema:AllowExport"
108 | ]
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/examples/responses/response1.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../contexts/reproschema",
3 | "@type": "reproschema:Response",
4 | "@id": "response1.jsonld",
5 | "wasAttributedTo": {
6 | "@id": "uuid:2b0aab3d-495f-4eee-98a5-4284b3268a56",
7 | "subject_id": "6aabb03d-9e5f-ae5e-c4a5-21b9b326868a"
8 | },
9 | "isAbout": "../activities/items/item1.jsonld",
10 | "value": 1
11 | }
12 |
--------------------------------------------------------------------------------
/examples/responses/responseActivity1.jsonld:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../../contexts/reproschema",
3 | "@type": "reproschema:ResponseActivity",
4 | "@id": "responseActivity1.jsonld",
5 | "used": [
6 | "../activities/items/item1.jsonld",
7 | "../activities/activity1.jsonld",
8 | "../protocols/protocol1.jsonld"
9 | ],
10 | "inLanguage": "en",
11 | "startedAtTime": "2020-07-23T22:15:37.675Z",
12 | "endedAtTime": "2020-07-23T22:15:50.293Z",
13 | "wasAssociatedWith": {
14 | "version": "0.0.1",
15 | "url": "https://schema.repronim.org/ui/#/",
16 | "@id": "https://github.com/ReproNim/reproschema-ui"
17 | },
18 | "prov:generated": "uuid:85d18360-1787-4d3d-b72e-b543ca9b4b1a"
19 | }
20 |
--------------------------------------------------------------------------------
/includes/abbreviations.md:
--------------------------------------------------------------------------------
1 | *[JSON]: JavaScript Object Notation
2 | *[JSON-LD]: JavaScript Object Notation - Linked Data
3 | *[SHACL]: Shapes Constraint Language
4 |
--------------------------------------------------------------------------------
/macros/__init__.py:
--------------------------------------------------------------------------------
1 | from .macros import library_table
2 | from .main import define_env
3 |
4 | __all__ = [
5 | "define_env",
6 | "library_table",
7 | ]
8 |
--------------------------------------------------------------------------------
/macros/macros.py:
--------------------------------------------------------------------------------
1 | import json
2 | from pathlib import Path
3 |
4 | import ruamel.yaml
5 | from jinja2 import Environment, FileSystemLoader, select_autoescape
6 |
7 | yaml = ruamel.yaml.YAML()
8 | yaml.indent(mapping=2, sequence=4, offset=2)
9 |
10 | ROOT = Path(__file__).parents[1]
11 |
12 | TEMPLATES_DIR = ROOT / "templates"
13 |
14 | LIBRARY_DIR = ROOT / "library"
15 |
16 | SCHEMA_DIR = ROOT / "linkml-schema"
17 |
18 |
19 | def return_jinja_env() -> Environment:
20 | return Environment(
21 | loader=FileSystemLoader(TEMPLATES_DIR),
22 | autoescape=select_autoescape(),
23 | lstrip_blocks=True,
24 | trim_blocks=True,
25 | )
26 |
27 |
28 | def library_table() -> str:
29 |
30 | LIBRARY_URL = "https://github.com/ReproNim/reproschema-library"
31 |
32 | activities = []
33 |
34 | for activity_path in (LIBRARY_DIR / "activities").iterdir():
35 |
36 | if not activity_path:
37 | continue
38 |
39 | for file in activity_path.glob("*"):
40 |
41 | if (
42 | file.is_dir()
43 | or file is None
44 | or "valueConstraints" in file.stem
45 | ):
46 | continue
47 |
48 | with open(file) as f:
49 | content = json.load(f)
50 |
51 | activities.append(
52 | {
53 | "name": content["@id"],
54 | "description": (
55 | content["description"]
56 | if "description" in content
57 | else ""
58 | ),
59 | "uri": (
60 | f"{LIBRARY_URL}/tree/master/activities/"
61 | f"{activity_path.stem}/{file.stem}{file.suffix}"
62 | ),
63 | }
64 | )
65 |
66 | env = return_jinja_env()
67 | template = env.get_template("library_table.jinja")
68 |
69 | return template.render(activities=activities)
70 |
71 |
72 | def main():
73 | print(library_table())
74 |
75 |
76 | if __name__ == "__main__":
77 | main()
78 |
--------------------------------------------------------------------------------
/macros/main.py:
--------------------------------------------------------------------------------
1 | """This package is used to build elements from data into
2 | MarkDown format for the specification text.
3 |
4 | Functions decorated in "define_env()" are callable throughout the
5 | specification and are run/rendered with the mkdocs plugin "macros".
6 | """
7 |
8 | import os
9 | import sys
10 |
11 | code_path = os.path.abspath(os.path.join(os.path.dirname(__file__)))
12 | sys.path.append(code_path)
13 |
14 | import macros # noqa E402
15 |
16 |
17 | def define_env(env):
18 | """Define variables, macros and filters for the mkdocs-macros plugin.
19 |
20 | Parameters
21 | ----------
22 | env : :obj:`macros.plugin.MacrosPlugin`
23 | An object in which to inject macros, variables, and filters.
24 |
25 | Notes
26 | -----
27 | "variables" are the dictionary that contains the environment variables
28 | "macro" is a decorator function, to declare a macro.
29 |
30 | Macro aliases must start with "MACROS___"
31 | """
32 | env.macro(macros.library_table, "MACROS___library_table")
33 |
--------------------------------------------------------------------------------
/makefile:
--------------------------------------------------------------------------------
1 | remark: package.json
2 | npx remark ./docs/*.md ./docs/**/*.md --rc-path .remarkrc
3 |
4 | package.json:
5 | npm install `cat npm-requirements.txt`
6 |
--------------------------------------------------------------------------------
/mkdocs.yml:
--------------------------------------------------------------------------------
1 | site_name: ReproSchema documentation
2 | repo_name: "ReproNim/reproschema"
3 | repo_url: "https://github.com/ReproNim/reproschema"
4 | copyright: "CC-BY 4.0"
5 |
6 | # This will use Material them
7 | theme:
8 | name: "material"
9 | language: "en"
10 | favicon: img/favicon.png
11 | logo: img/favicon_on_white.png
12 | features:
13 | - content.code.copy
14 | - content.code.annotate
15 | icon:
16 | repo: fontawesome/brands/github
17 | edit: material/pencil
18 | palette:
19 | # Palette toggle for automatic mode
20 | - media: (prefers-color-scheme)
21 | toggle:
22 | icon: material/brightness-auto
23 | name: Switch to light mode
24 | # Palette toggle for light mode
25 | - media: "(prefers-color-scheme: light)"
26 | scheme: default
27 | toggle:
28 | icon: material/brightness-7
29 | name: Switch to dark mode
30 | # Palette toggle for dark mode
31 | - media: "(prefers-color-scheme: dark)"
32 | scheme: slate
33 | toggle:
34 | icon: material/brightness-4
35 | name: Switch to system preference
36 |
37 | # Pages
38 | nav:
39 | - Welcome: "index.md"
40 | - Introduction: "introduction.md"
41 | - Project structure: "project-structure.md"
42 | - Schema:
43 | - Schema overview: "schema/schema.md"
44 | - Schema documentation: "schema/doc-linkml-autogen/index.md"
45 | - Schema diagram: schema/erdiagram-autogen.md
46 | - User Guide:
47 | - Create a research protocol: "user-guide/create-new-protocol.md"
48 | - Adopt assessments from the library: "user-guide/adopt-assessments.md"
49 | - Create new assessments for a protocol: "user-guide/create-new-assess.md"
50 | - Add a feedback section: "user-guide/setup-feedback.md"
51 | - Finalize the protocol: "user-guide/finalize-protocol.md"
52 | - Toolkit: "user-guide/tools.md"
53 | - Tutorial:
54 | - Intro: "tutorials/using-reproschema.md"
55 | - Create a protocol: "tutorials/create-new-protocol.md"
56 | - Create a new activity: "tutorials/create-new-activity.md"
57 | - Create new items: "tutorials/create-new-items.md"
58 | - Finalize the protocol: "tutorials/finalizing-the-protocol.md"
59 | - Translate a questionnaire: "tutorials/translating-an-activity.md"
60 | - Demographic information : "tutorials/collecting-demographics-information.md"
61 | - How to guides:
62 | - Validation: "how-to/validation.md"
63 | - Visualize: "how-to/visualize.md"
64 |
65 | - FAQ: "FAQ.md"
66 | - Contributing: "CONTRIBUTING.md"
67 |
68 | # list of extension
69 | markdown_extensions:
70 | - abbr
71 | - attr_list
72 | - admonition
73 | - pymdownx.critic
74 | - pymdownx.details
75 | - pymdownx.highlight:
76 | anchor_linenums: true
77 | line_spans: __span
78 | pygments_lang_class: true
79 | - pymdownx.inlinehilite
80 | - pymdownx.superfences
81 | - pymdownx.snippets:
82 | auto_append:
83 | - includes/abbreviations.md
84 | - tables
85 | - toc:
86 | anchorlink: true
87 | - pymdownx.superfences:
88 | custom_fences:
89 | - name: mermaid
90 | class: mermaid
91 | format: !!python/name:pymdownx.superfences.fence_code_format
92 |
93 | watch:
94 | - includes
95 | - linkml-schema
96 |
97 | plugins:
98 | - search
99 | - tags
100 | - macros:
101 | module_name: macros/main
102 |
--------------------------------------------------------------------------------
/mlc_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "ignorePatterns": [
3 | {
4 | "pattern": "http://127.0.0.1:8000/"
5 | },
6 | {
7 | "pattern": "^https://jsonformatter.curiousconcept.com/"
8 | },
9 | {
10 | "pattern": "^http.*://schema.repronim.org/.*"
11 | },
12 | {
13 | "pattern": "^http://schema.org/version/2.0/"
14 | },
15 | {
16 | "pattern": "^https://doi.org/10.1080/1357650X.2013.783045"
17 | },
18 | {
19 | "pattern": "^./doc-linkml-autogen/index.md"
20 | },
21 | {
22 | "pattern": "^./erdiagram-autogen.md"
23 | },
24 | {
25 | "pattern": "http://www.cogpo.org/"
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/npm-requirements.txt:
--------------------------------------------------------------------------------
1 | remark-cli@9.0.0
2 | remark-gfm@1
3 | remark-preset-lint-recommended@5.0.0
4 | remark-preset-lint-markdown-style-guide@4.0.0
5 | remark-lint-no-trailing-spaces@2
6 |
--------------------------------------------------------------------------------
/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool.black]
2 | line-length = 79
3 |
4 | [tool.codespell]
5 | skip = "env,venv,*.svg,pyproject.toml"
6 | ignore-words-list = "HSI"
7 | builtin = "clear,rare"
8 |
9 | [tool.isort]
10 | combine_as_imports = true
11 | line_length = 79
12 | profile = "black"
13 | skip_gitignore = true
14 |
--------------------------------------------------------------------------------
/releases/1.0.0-rc1/base:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "@version": 1.1,
4 | "dct": "http://purl.org/dc/terms/",
5 | "owl": "http://www.w3.org/2002/07/owl#",
6 | "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
7 | "rdfa": "http://www.w3.org/ns/rdfa#",
8 | "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
9 | "schema": "http://schema.org/",
10 | "xsd": "http://www.w3.org/2001/XMLSchema#",
11 | "skos": "http://www.w3.org/2004/02/skos/core#",
12 | "prov": "http://www.w3.org/ns/prov#",
13 | "pav": "http://purl.org/pav/",
14 | "nidm": "http://purl.org/nidash/nidm#",
15 | "uuid": "http://uuid.repronim.org/",
16 | "reproschema": "http://schema.repronim.org/"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/releases/1.0.0-rc1/generic:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [ "base",
3 | {
4 | "@version": 1.1,
5 | "@language": "en",
6 | "description": {
7 | "@id": "schema:description",
8 | "@container": "@language"
9 | },
10 | "name": {
11 | "@id": "schema:name",
12 | "@container": "@language"
13 | },
14 | "value": {
15 | "@id": "reproschema:value",
16 | "@type": "@id",
17 | "@container": "@language"
18 | },
19 | "image": {
20 | "@id": "schema:image",
21 | "@type": "@id"
22 | },
23 | "inLanguage": {
24 | "@id": "schema:inLanguage"
25 | },
26 | "url": {
27 | "@id": "schema:url",
28 | "@type": "@id"
29 | },
30 | "citation": {
31 | "@id": "schema:citation",
32 | "@container": "@language"
33 | },
34 | "version": {
35 | "@id": "schema:version",
36 | "@container": "@language"
37 | },
38 | "schemaVersion": {
39 | "@id": "schema:schemaVersion",
40 | "@container": "@language"
41 | },
42 | "prefLabel": {
43 | "@id": "skos:prefLabel",
44 | "@container": "@language"
45 | },
46 | "altLabel": {
47 | "@id": "skos:altLabel",
48 | "@container": "@language"
49 | },
50 | "preamble": {
51 | "@id": "reproschema:preamble",
52 | "@container": "@language"
53 | },
54 | "valueType": {
55 | "@id": "reproschema:valueType",
56 | "@type": "@id",
57 | "@container": "@set"
58 | },
59 | "landingPage": {
60 | "@id": "reproschema:landingPage",
61 | "@container": "@set"
62 | },
63 | "question": {
64 | "@id": "schema:question",
65 | "@container": "@language"
66 | },
67 | "choices": {
68 | "@id": "reproschema:choices"
69 | },
70 | "valueRequired": "schema:valueRequired",
71 | "multipleChoice": {
72 | "@id": "reproschema:multipleChoice",
73 | "@type": "schema:Boolean"
74 | },
75 | "responseOptions": {
76 | "@id": "reproschema:responseOptions",
77 | "@container": "@set",
78 | "@type": "@id"
79 | },
80 | "dataType": {
81 | "@id": "schema:DataType",
82 | "@type": "@id"
83 | },
84 | "minValue": {
85 | "@id": "schema:minValue"
86 | },
87 | "maxValue": {
88 | "@id": "schema:maxValue"
89 | },
90 | "unitCode": {
91 | "@id": "schema:unitCode",
92 | "@container": "@set"
93 | },
94 | "ui" : "@nest",
95 | "order": {
96 | "@id": "reproschema:order",
97 | "@container": "@list",
98 | "@type": "@id",
99 | "@nest": "ui"
100 | },
101 | "addProperties": {
102 | "@id": "reproschema:addProperties",
103 | "@type": "reproschema:AdditionalProperty",
104 | "@container": "@set",
105 | "@nest": "ui"
106 | },
107 | "shuffle": {
108 | "@id": "reproschema:shuffle",
109 | "@type": "schema:Boolean",
110 | "@nest": "ui"
111 | },
112 | "inputOptions": {
113 | "@id": "reproschema:inputs",
114 | "@container": "@index",
115 | "@nest": "ui"
116 | },
117 | "inputType": {
118 | "@id": "reproschema:inputType",
119 | "@type": "xsd:string",
120 | "@nest": "ui"
121 | },
122 | "readonlyValue": {
123 | "@id": "schema:readonlyValue",
124 | "@nest": "ui"
125 | },
126 | "compute": {
127 | "@id": "reproschema:compute",
128 | "@container": "@index"
129 | },
130 | "jsExpression": {
131 | "@id": "reproschema:jsExpression"
132 | },
133 | "isVis": {
134 | "@id": "reproschema:isVis"
135 | },
136 | "variableName": "reproschema:variableName",
137 | "isAbout": {
138 | "@id": "reproschema:isAbout",
139 | "@type": "@id"
140 | },
141 | "allow": {
142 | "@id": "reproschema:allow",
143 | "@container": "@set",
144 | "@type": "@id",
145 | "@nest": "ui"
146 | },
147 | "reproschema:Skipped": {"@id": "reproschema:Skipped"},
148 | "reproschema:DontKnow": {"@id": "reproschema:DontKnow"},
149 | "reproschema:TimedOut": {"@id": "reproschema:TimedOut"},
150 | "reproschema:AutoAdvance": {"@id": "reproschema:AutoAdvance"},
151 | "reproschema:DisableBack": {"@id": "reproschema:DisableBack"},
152 | "reproschema:AllowExport": {"@id": "reproschema:AllowExport"},
153 | "reproschema:AllowReplay": {"@id": "reproschema:AllowReplay"},
154 | "timer": {
155 | "@id": "reproschema:timer",
156 | "@type": "@id",
157 | "@nest": "ui"
158 | },
159 | "delay": {
160 | "@id": "reproschema:delay",
161 | "@type": "@id",
162 | "@nest": "ui"
163 | },
164 | "additionalNotesObj": {
165 | "@id": "reproschema:additionalNotesObj",
166 | "@container": "@set"
167 | },
168 | "source": {
169 | "@id": "reproschema:source",
170 | "@type": "xsd:string"
171 | },
172 | "column": {
173 | "@id": "reproschema:column",
174 | "@type": "xsd:string"
175 | },
176 | "randomMaxDelay": {
177 | "@id": "reproschema:randomMaxDelay"
178 | },
179 | "schedule": {
180 | "@id": "reproschema:schedule"
181 | },
182 | "limit": {
183 | "@id": "reproschema:limit"
184 | },
185 | "maxRetakes": {
186 | "@id": "reproschema:maxRetakes"
187 | },
188 | "importedFrom": {
189 | "@id": "pav:importedFrom",
190 | "@type": "@id"
191 | },
192 | "importedBy": {
193 | "@id": "pav:importedBy",
194 | "@type": "@id"
195 | },
196 | "createdWith": {
197 | "@id": "pav:createdWith",
198 | "@type": "@id"
199 | },
200 | "createdBy": {
201 | "@id": "pav:createdBy",
202 | "@type": "@id"
203 | },
204 | "createdOn": {
205 | "@id": "pav:createdOn",
206 | "@type": "xsd:dateTime"
207 | },
208 | "previousVersion": {
209 | "@id": "pav:previousVersion",
210 | "@type": "@id"
211 | },
212 | "lastUpdateOn": {
213 | "@id": "pav:lastUpdateOn",
214 | "@type": "xsd:dateTime"
215 | },
216 | "derivedFrom": {
217 | "@id": "prov:wasDerivedFrom",
218 | "@type": "@id"
219 | },
220 | "used": {
221 | "@id": "prov:used",
222 | "@container": "@set",
223 | "@type": "@id"
224 | },
225 | "wasAttributedTo": {
226 | "@id": "prov:wasAttributedTo",
227 | "@type": "reproschema:Participant",
228 | "@container": "@set"
229 | },
230 | "wasAssociatedWith": {
231 | "@id": "prov:wasAssociatedWith",
232 | "@type": "reproschema:SoftwareAgent",
233 | "@container": "@set"
234 | },
235 | "subject_id": {
236 | "@id": "nidm:subject_id"
237 | },
238 | "startedAtTime": {
239 | "@id": "prov:startedAtTime",
240 | "@type": "xsd:dateTime"
241 | },
242 | "endedAtTime": {
243 | "@id": "prov:endedAtTime",
244 | "@type": "xsd:dateTime"
245 | }
246 | }
247 | ]
248 | }
249 |
--------------------------------------------------------------------------------
/releases/1.0.0-rc2/base:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "@version": 1.1,
4 | "dct": "http://purl.org/dc/terms/",
5 | "owl": "http://www.w3.org/2002/07/owl#",
6 | "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
7 | "rdfa": "http://www.w3.org/ns/rdfa#",
8 | "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
9 | "schema": "http://schema.org/",
10 | "xsd": "http://www.w3.org/2001/XMLSchema#",
11 | "skos": "http://www.w3.org/2004/02/skos/core#",
12 | "prov": "http://www.w3.org/ns/prov#",
13 | "pav": "http://purl.org/pav/",
14 | "nidm": "http://purl.org/nidash/nidm#",
15 | "uuid": "http://uuid.repronim.org/",
16 | "reproschema": "http://schema.repronim.org/"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/releases/1.0.0-rc2/generic:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [ "base",
3 | {
4 | "@version": 1.1,
5 | "@language": "en",
6 | "description": {
7 | "@id": "schema:description",
8 | "@container": "@language"
9 | },
10 | "name": {
11 | "@id": "schema:name",
12 | "@container": "@language"
13 | },
14 | "value": {
15 | "@id": "reproschema:value",
16 | "@type": "@id",
17 | "@container": "@language"
18 | },
19 | "image": {
20 | "@id": "schema:image",
21 | "@type": "@id"
22 | },
23 | "inLanguage": {
24 | "@id": "schema:inLanguage"
25 | },
26 | "url": {
27 | "@id": "schema:url",
28 | "@type": "@id"
29 | },
30 | "citation": {
31 | "@id": "schema:citation",
32 | "@container": "@language"
33 | },
34 | "version": {
35 | "@id": "schema:version",
36 | "@container": "@language"
37 | },
38 | "schemaVersion": {
39 | "@id": "schema:schemaVersion",
40 | "@container": "@language"
41 | },
42 | "prefLabel": {
43 | "@id": "skos:prefLabel",
44 | "@container": "@language"
45 | },
46 | "altLabel": {
47 | "@id": "skos:altLabel",
48 | "@container": "@language"
49 | },
50 | "preamble": {
51 | "@id": "reproschema:preamble",
52 | "@container": "@language"
53 | },
54 | "valueType": {
55 | "@id": "reproschema:valueType",
56 | "@type": "@id",
57 | "@container": "@set"
58 | },
59 | "landingPage": {
60 | "@id": "reproschema:landingPage",
61 | "@container": "@set"
62 | },
63 | "question": {
64 | "@id": "schema:question",
65 | "@container": "@language"
66 | },
67 | "choices": {
68 | "@id": "reproschema:choices"
69 | },
70 | "valueRequired": "schema:valueRequired",
71 | "multipleChoice": {
72 | "@id": "reproschema:multipleChoice",
73 | "@type": "schema:Boolean"
74 | },
75 | "responseOptions": {
76 | "@id": "reproschema:responseOptions",
77 | "@container": "@set",
78 | "@type": "@id"
79 | },
80 | "dataType": {
81 | "@id": "schema:DataType",
82 | "@type": "@id"
83 | },
84 | "minValue": {
85 | "@id": "schema:minValue"
86 | },
87 | "maxValue": {
88 | "@id": "schema:maxValue"
89 | },
90 | "unitCode": {
91 | "@id": "schema:unitCode",
92 | "@container": "@set"
93 | },
94 | "unitOptions": {
95 | "@id": "reproschema:unitOptions",
96 | "@container": "@set"
97 | },
98 | "ui" : "@nest",
99 | "order": {
100 | "@id": "reproschema:order",
101 | "@container": "@list",
102 | "@type": "@id",
103 | "@nest": "ui"
104 | },
105 | "addProperties": {
106 | "@id": "reproschema:addProperties",
107 | "@type": "reproschema:AdditionalProperty",
108 | "@container": "@set",
109 | "@nest": "ui"
110 | },
111 | "overrideProperties": {
112 | "@id": "reproschema:overrideProperties",
113 | "@type": "reproschema:OverrideProperty",
114 | "@container": "@set",
115 | "@nest": "ui"
116 | },
117 | "message": {
118 | "@id": "reproschema:message",
119 | "@container": "@language"
120 | },
121 | "shuffle": {
122 | "@id": "reproschema:shuffle",
123 | "@type": "schema:Boolean",
124 | "@nest": "ui"
125 | },
126 | "inputOptions": {
127 | "@id": "reproschema:inputs",
128 | "@container": "@index",
129 | "@nest": "ui"
130 | },
131 | "inputType": {
132 | "@id": "reproschema:inputType",
133 | "@type": "xsd:string",
134 | "@nest": "ui"
135 | },
136 | "readonlyValue": {
137 | "@id": "schema:readonlyValue",
138 | "@nest": "ui"
139 | },
140 | "compute": {
141 | "@id": "reproschema:compute",
142 | "@container": "@index"
143 | },
144 | "messages": {
145 | "@id": "reproschema:messages",
146 | "@container": "@index"
147 | },
148 | "jsExpression": {
149 | "@id": "reproschema:jsExpression"
150 | },
151 | "isVis": {
152 | "@id": "reproschema:isVis"
153 | },
154 | "variableName": "reproschema:variableName",
155 | "isAbout": {
156 | "@id": "reproschema:isAbout",
157 | "@type": "@id"
158 | },
159 | "allow": {
160 | "@id": "reproschema:allow",
161 | "@container": "@set",
162 | "@type": "@id",
163 | "@nest": "ui"
164 | },
165 | "reproschema:Skipped": {"@id": "reproschema:Skipped"},
166 | "reproschema:DontKnow": {"@id": "reproschema:DontKnow"},
167 | "reproschema:TimedOut": {"@id": "reproschema:TimedOut"},
168 | "reproschema:AutoAdvance": {"@id": "reproschema:AutoAdvance"},
169 | "reproschema:DisableBack": {"@id": "reproschema:DisableBack"},
170 | "reproschema:AllowExport": {"@id": "reproschema:AllowExport"},
171 | "reproschema:AllowReplay": {"@id": "reproschema:AllowReplay"},
172 | "timer": {
173 | "@id": "reproschema:timer",
174 | "@type": "@id",
175 | "@nest": "ui"
176 | },
177 | "delay": {
178 | "@id": "reproschema:delay",
179 | "@type": "@id",
180 | "@nest": "ui"
181 | },
182 | "additionalNotesObj": {
183 | "@id": "reproschema:additionalNotesObj",
184 | "@container": "@set"
185 | },
186 | "source": {
187 | "@id": "reproschema:source",
188 | "@type": "xsd:string"
189 | },
190 | "column": {
191 | "@id": "reproschema:column",
192 | "@type": "xsd:string"
193 | },
194 | "randomMaxDelay": {
195 | "@id": "reproschema:randomMaxDelay"
196 | },
197 | "schedule": {
198 | "@id": "reproschema:schedule"
199 | },
200 | "limit": {
201 | "@id": "reproschema:limit"
202 | },
203 | "maxRetakes": {
204 | "@id": "reproschema:maxRetakes"
205 | },
206 | "importedFrom": {
207 | "@id": "pav:importedFrom",
208 | "@type": "@id"
209 | },
210 | "importedBy": {
211 | "@id": "pav:importedBy",
212 | "@type": "@id"
213 | },
214 | "createdWith": {
215 | "@id": "pav:createdWith",
216 | "@type": "@id"
217 | },
218 | "createdBy": {
219 | "@id": "pav:createdBy",
220 | "@type": "@id"
221 | },
222 | "createdOn": {
223 | "@id": "pav:createdOn",
224 | "@type": "xsd:dateTime"
225 | },
226 | "previousVersion": {
227 | "@id": "pav:previousVersion",
228 | "@type": "@id"
229 | },
230 | "lastUpdateOn": {
231 | "@id": "pav:lastUpdateOn",
232 | "@type": "xsd:dateTime"
233 | },
234 | "derivedFrom": {
235 | "@id": "prov:wasDerivedFrom",
236 | "@type": "@id"
237 | },
238 | "used": {
239 | "@id": "prov:used",
240 | "@container": "@set",
241 | "@type": "@id"
242 | },
243 | "wasAttributedTo": {
244 | "@id": "prov:wasAttributedTo",
245 | "@type": "reproschema:Participant",
246 | "@container": "@set"
247 | },
248 | "wasAssociatedWith": {
249 | "@id": "prov:wasAssociatedWith",
250 | "@type": "reproschema:SoftwareAgent",
251 | "@container": "@set"
252 | },
253 | "subject_id": {
254 | "@id": "nidm:subject_id"
255 | },
256 | "startedAtTime": {
257 | "@id": "prov:startedAtTime",
258 | "@type": "xsd:dateTime"
259 | },
260 | "endedAtTime": {
261 | "@id": "prov:endedAtTime",
262 | "@type": "xsd:dateTime"
263 | }
264 | }
265 | ]
266 | }
267 |
--------------------------------------------------------------------------------
/releases/1.0.0-rc3/base:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "@version": 1.1,
4 | "dct": "http://purl.org/dc/terms/",
5 | "owl": "http://www.w3.org/2002/07/owl#",
6 | "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
7 | "rdfa": "http://www.w3.org/ns/rdfa#",
8 | "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
9 | "schema": "http://schema.org/",
10 | "xsd": "http://www.w3.org/2001/XMLSchema#",
11 | "skos": "http://www.w3.org/2004/02/skos/core#",
12 | "prov": "http://www.w3.org/ns/prov#",
13 | "pav": "http://purl.org/pav/",
14 | "nidm": "http://purl.org/nidash/nidm#",
15 | "uuid": "http://uuid.repronim.org/",
16 | "reproschema": "http://schema.repronim.org/"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/releases/1.0.0-rc4/base:
--------------------------------------------------------------------------------
1 | {
2 | "@context": {
3 | "@version": 1.1,
4 | "dct": "http://purl.org/dc/terms/",
5 | "owl": "http://www.w3.org/2002/07/owl#",
6 | "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
7 | "rdfa": "http://www.w3.org/ns/rdfa#",
8 | "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
9 | "schema": "http://schema.org/",
10 | "xsd": "http://www.w3.org/2001/XMLSchema#",
11 | "skos": "http://www.w3.org/2004/02/skos/core#",
12 | "prov": "http://www.w3.org/ns/prov#",
13 | "pav": "http://purl.org/pav/",
14 | "nidm": "http://purl.org/nidash/nidm#",
15 | "uuid": "http://uuid.repronim.org/",
16 | "reproschema": "http://schema.repronim.org/"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/releases/1.0.0-rc4/generic:
--------------------------------------------------------------------------------
1 | {
2 | "@context": [ "base",
3 | {
4 | "@version": 1.1,
5 | "@language": "en",
6 | "description": {
7 | "@id": "schema:description",
8 | "@container": "@language"
9 | },
10 | "name": {
11 | "@id": "schema:name",
12 | "@container": "@language"
13 | },
14 | "value": {
15 | "@id": "reproschema:value"
16 | },
17 | "image": {
18 | "@id": "schema:image"
19 | },
20 | "imageUrl": {
21 | "@id": "schema:image",
22 | "@type": "@id"
23 | },
24 | "audio": {
25 | "@id": "schema:audio"
26 | },
27 | "video": {
28 | "@id": "schema:video"
29 | },
30 | "contentUrl": {
31 | "@id": "schema:contentUrl",
32 | "@type": "@id"
33 | },
34 | "VideoObject": "schema:VideoObject",
35 | "AudioObject": "schema:AudioObject",
36 | "inLanguage": {
37 | "@id": "schema:inLanguage"
38 | },
39 | "url": {
40 | "@id": "schema:url",
41 | "@type": "@id"
42 | },
43 | "citation": {
44 | "@id": "schema:citation",
45 | "@container": "@language"
46 | },
47 | "version": {
48 | "@id": "schema:version"
49 | },
50 | "schemaVersion": {
51 | "@id": "schema:schemaVersion"
52 | },
53 | "prefLabel": {
54 | "@id": "skos:prefLabel",
55 | "@container": "@language"
56 | },
57 | "altLabel": {
58 | "@id": "skos:altLabel",
59 | "@container": "@language"
60 | },
61 | "preamble": {
62 | "@id": "reproschema:preamble",
63 | "@container": "@language"
64 | },
65 | "valueType": {
66 | "@id": "reproschema:valueType",
67 | "@type": "@id",
68 | "@container": "@set"
69 | },
70 | "landingPage": {
71 | "@id": "reproschema:landingPage",
72 | "@type": "@id",
73 | "@container": "@set"
74 | },
75 | "question": {
76 | "@id": "schema:question",
77 | "@container": "@language"
78 | },
79 | "choices": {
80 | "@id": "reproschema:choices"
81 | },
82 | "valueRequired": "schema:valueRequired",
83 | "multipleChoice": {
84 | "@id": "reproschema:multipleChoice",
85 | "@type": "schema:Boolean"
86 | },
87 | "responseOptions": {
88 | "@id": "reproschema:responseOptions",
89 | "@container": "@set",
90 | "@type": "@id"
91 | },
92 | "dataType": {
93 | "@id": "schema:DataType",
94 | "@type": "@id"
95 | },
96 | "minValue": {
97 | "@id": "schema:minValue"
98 | },
99 | "maxValue": {
100 | "@id": "schema:maxValue"
101 | },
102 | "unitCode": {
103 | "@id": "schema:unitCode",
104 | "@container": "@set"
105 | },
106 | "unitOptions": {
107 | "@id": "reproschema:unitOptions",
108 | "@container": "@set"
109 | },
110 | "ui" : "@nest",
111 | "order": {
112 | "@id": "reproschema:order",
113 | "@container": "@list",
114 | "@type": "@id",
115 | "@nest": "ui"
116 | },
117 | "addProperties": {
118 | "@id": "reproschema:addProperties",
119 | "@type": "reproschema:AdditionalProperty",
120 | "@container": "@set",
121 | "@nest": "ui"
122 | },
123 | "overrideProperties": {
124 | "@id": "reproschema:overrideProperties",
125 | "@type": "reproschema:OverrideProperty",
126 | "@container": "@set",
127 | "@nest": "ui"
128 | },
129 | "message": {
130 | "@id": "reproschema:message",
131 | "@container": "@language"
132 | },
133 | "shuffle": {
134 | "@id": "reproschema:shuffle",
135 | "@type": "schema:Boolean",
136 | "@nest": "ui"
137 | },
138 | "inputOptions": {
139 | "@id": "reproschema:inputs",
140 | "@container": "@index",
141 | "@nest": "ui"
142 | },
143 | "inputType": {
144 | "@id": "reproschema:inputType",
145 | "@type": "xsd:string",
146 | "@nest": "ui"
147 | },
148 | "readonlyValue": {
149 | "@id": "schema:readonlyValue",
150 | "@nest": "ui"
151 | },
152 | "compute": {
153 | "@id": "reproschema:compute",
154 | "@container": "@set"
155 | },
156 | "messages": {
157 | "@id": "reproschema:messages",
158 | "@container": "@set"
159 | },
160 | "jsExpression": {
161 | "@id": "reproschema:jsExpression"
162 | },
163 | "isVis": {
164 | "@id": "reproschema:isVis"
165 | },
166 | "variableName": "reproschema:variableName",
167 | "isAbout": {
168 | "@id": "reproschema:isAbout",
169 | "@type": "@id"
170 | },
171 | "allow": {
172 | "@id": "reproschema:allow",
173 | "@container": "@set",
174 | "@type": "@id",
175 | "@nest": "ui"
176 | },
177 | "reproschema:Skipped": {"@id": "reproschema:Skipped"},
178 | "reproschema:DontKnow": {"@id": "reproschema:DontKnow"},
179 | "reproschema:TimedOut": {"@id": "reproschema:TimedOut"},
180 | "reproschema:AutoAdvance": {"@id": "reproschema:AutoAdvance"},
181 | "reproschema:DisableBack": {"@id": "reproschema:DisableBack"},
182 | "reproschema:AllowExport": {"@id": "reproschema:AllowExport"},
183 | "reproschema:AllowReplay": {"@id": "reproschema:AllowReplay"},
184 | "timer": {
185 | "@id": "reproschema:timer",
186 | "@type": "@id",
187 | "@nest": "ui"
188 | },
189 | "delay": {
190 | "@id": "reproschema:delay",
191 | "@type": "@id",
192 | "@nest": "ui"
193 | },
194 | "additionalNotesObj": {
195 | "@id": "reproschema:additionalNotesObj",
196 | "@type": "reproschema:AdditionalNoteObj",
197 | "@container": "@set"
198 | },
199 | "source": {
200 | "@id": "reproschema:source",
201 | "@type": "xsd:string"
202 | },
203 | "column": {
204 | "@id": "reproschema:column",
205 | "@type": "xsd:string"
206 | },
207 | "randomMaxDelay": {
208 | "@id": "reproschema:randomMaxDelay"
209 | },
210 | "schedule": {
211 | "@id": "reproschema:schedule"
212 | },
213 | "limit": {
214 | "@id": "reproschema:limit"
215 | },
216 | "maxRetakes": {
217 | "@id": "reproschema:maxRetakes"
218 | },
219 | "importedFrom": {
220 | "@id": "pav:importedFrom",
221 | "@type": "@id"
222 | },
223 | "importedBy": {
224 | "@id": "pav:importedBy",
225 | "@type": "@id"
226 | },
227 | "createdWith": {
228 | "@id": "pav:createdWith",
229 | "@type": "@id"
230 | },
231 | "createdBy": {
232 | "@id": "pav:createdBy",
233 | "@type": "@id"
234 | },
235 | "createdOn": {
236 | "@id": "pav:createdOn",
237 | "@type": "xsd:dateTime"
238 | },
239 | "previousVersion": {
240 | "@id": "pav:previousVersion",
241 | "@type": "@id"
242 | },
243 | "lastUpdateOn": {
244 | "@id": "pav:lastUpdateOn",
245 | "@type": "xsd:dateTime"
246 | },
247 | "derivedFrom": {
248 | "@id": "prov:wasDerivedFrom",
249 | "@type": "@id"
250 | },
251 | "used": {
252 | "@id": "prov:used",
253 | "@container": "@set",
254 | "@type": "@id"
255 | },
256 | "wasAttributedTo": {
257 | "@id": "prov:wasAttributedTo",
258 | "@type": "reproschema:Participant",
259 | "@container": "@set"
260 | },
261 | "wasAssociatedWith": {
262 | "@id": "prov:wasAssociatedWith",
263 | "@type": "reproschema:SoftwareAgent",
264 | "@container": "@set"
265 | },
266 | "subject_id": {
267 | "@id": "nidm:subject_id"
268 | },
269 | "startedAtTime": {
270 | "@id": "prov:startedAtTime",
271 | "@type": "xsd:dateTime"
272 | },
273 | "endedAtTime": {
274 | "@id": "prov:endedAtTime",
275 | "@type": "xsd:dateTime"
276 | }
277 | }
278 | ]
279 | }
280 |
--------------------------------------------------------------------------------
/releases/1.0.0/reproschema:
--------------------------------------------------------------------------------
1 | {
2 | "comments": {
3 | "description": "Auto generated by LinkML jsonld context generator",
4 | "generation_date": "2024-02-16T13:37:16",
5 | "source": "reproschema.yaml"
6 | },
7 | "@context": {
8 | "linkml": "https://w3id.org/linkml/",
9 | "nidm": "http://purl.org/nidash/nidm#",
10 | "owl": "http://www.w3.org/2002/07/owl#",
11 | "prov": "http://www.w3.org/ns/prov#",
12 | "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
13 | "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
14 | "reproschema": "http://schema.repronim.org/",
15 | "schema": "http://schema.org/",
16 | "skos": "http://www.w3.org/2004/02/skos/core#",
17 | "xml": {
18 | "@id": "http://www.w3.org/XML/1998/namespace",
19 | "@prefix": true
20 | },
21 | "xsd": "http://www.w3.org/2001/XMLSchema#",
22 | "@vocab": "http://schema.repronim.org/",
23 | "@version": 1.1,
24 | "@language": "en",
25 | "id": "@id",
26 | "category": "@type",
27 | "ui": "@nest",
28 | "about": {
29 | "@id": "schema:about"
30 | },
31 | "addProperties": {
32 | "@container": "@set",
33 | "@nest": "ui"
34 | },
35 | "additionalNotesObj": {
36 | "@container": "@set"
37 | },
38 | "allow": {
39 | "@type": "@id",
40 | "@container": "@set",
41 | "@nest": "ui"
42 | },
43 | "altLabel": {
44 | "@id": "skos:altLabel",
45 | "@container": "@language"
46 | },
47 | "associatedMedia": {
48 | "@id": "schema:associatedMedia"
49 | },
50 | "audio": {
51 | "@type": "@id",
52 | "@id": "schema:audio"
53 | },
54 | "choices": {
55 | "@container": "@set"
56 | },
57 | "citation": {
58 | "@id": "schema:citation",
59 | "@container": "@language"
60 | },
61 | "column": {
62 | "@type": "xsd:string"
63 | },
64 | "compute": {
65 | "@id": "reproschema:compute",
66 | "@container": "@set"
67 | },
68 | "contentUrl": {
69 | "@type": "@id",
70 | "@id": "schema:contentUrl"
71 | },
72 | "cronTable": {
73 | "@id": "reproschema:cronTable"
74 | },
75 | "datumType": {
76 | "@id": "reproschema:datumType"
77 | },
78 | "description": {
79 | "@id": "schema:description",
80 | "@container": "@language"
81 | },
82 | "endedAtTime": {
83 | "@type": "xsd:dateTime",
84 | "@id": "prov:endedAtTime"
85 | },
86 | "generated": {
87 | "@id": "prov:generated"
88 | },
89 | "image": {
90 | "@type": "@id",
91 | "@id": "schema:image"
92 | },
93 | "inLanguage": {
94 | "@id": "schema:inLanguage",
95 | "@language": null
96 | },
97 | "inputType": {
98 | "@type": "xsd:string",
99 | "@nest": "ui"
100 | },
101 | "isAbout": {
102 | "@type": "@id"
103 | },
104 | "isPartOf": {
105 | "@type": "@id",
106 | "@id": "schema:isPartOf"
107 | },
108 | "landingPage": {
109 | "@type": "@id",
110 | "@container": "@set"
111 | },
112 | "limit": {
113 | "@language": null
114 | },
115 | "maxValue": {
116 | "@id": "schema:maxValue"
117 | },
118 | "message": {
119 | "@container": "@language"
120 | },
121 | "messages": {
122 | "@container": "@set"
123 | },
124 | "minValue": {
125 | "@id": "schema:minValue"
126 | },
127 | "multipleChoice": {
128 | "@type": "xsd:boolean"
129 | },
130 | "name": {
131 | "@id": "schema:name",
132 | "@container": "@language"
133 | },
134 | "order": {
135 | "@type": "@id",
136 | "@container": "@list",
137 | "@nest": "ui"
138 | },
139 | "overrideProperties": {
140 | "@container": "@set",
141 | "@nest": "ui"
142 | },
143 | "preamble": {
144 | "@id": "reproschema:preamble",
145 | "@container": "@language"
146 | },
147 | "prefLabel": {
148 | "@id": "skos:prefLabel",
149 | "@container": "@language"
150 | },
151 | "question": {
152 | "@id": "schema:question",
153 | "@container": "@language"
154 | },
155 | "randomMaxDelay": {
156 | "@language": null
157 | },
158 | "readonlyValue": {
159 | "@type": "xsd:boolean",
160 | "@id": "schema:readonlyValue",
161 | "@nest": "ui"
162 | },
163 | "responseOptions": {
164 | "@type": "@id"
165 | },
166 | "schedule": {
167 | "@language": null
168 | },
169 | "schemaVersion": {
170 | "@id": "schema:schemaVersion",
171 | "@language": null
172 | },
173 | "shuffle": {
174 | "@type": "xsd:boolean",
175 | "@nest": "ui"
176 | },
177 | "source": {
178 | "@type": "xsd:string"
179 | },
180 | "startedAtTime": {
181 | "@type": "xsd:dateTime",
182 | "@id": "prov:startedAtTime"
183 | },
184 | "subject_id": {
185 | "@id": "nidm:subject_id"
186 | },
187 | "unitOptions": {
188 | "@type": "@id",
189 | "@container": "@set"
190 | },
191 | "url": {
192 | "@type": "@id",
193 | "@id": "schema:url"
194 | },
195 | "used": {
196 | "@type": "@id",
197 | "@container": "@set",
198 | "@id": "prov:used"
199 | },
200 | "valueRequired": {
201 | "@type": "xsd:boolean",
202 | "@id": "schema:valueRequired"
203 | },
204 | "valueType": {
205 | "@type": "@id",
206 | "@container": "@set"
207 | },
208 | "version": {
209 | "@id": "schema:version",
210 | "@language": null
211 | },
212 | "video": {
213 | "@type": "@id",
214 | "@id": "schema:video"
215 | },
216 | "wasAssociatedWith": {
217 | "@type": "@id",
218 | "@id": "prov:wasAssociatedWith"
219 | },
220 | "wasAttributedTo": {
221 | "@type": "@id",
222 | "@id": "prov:wasAttributedTo"
223 | },
224 | "Activity": {
225 | "@id": "reproschema:Activity"
226 | },
227 | "Agent": {
228 | "@id": "prov:Agent"
229 | },
230 | "LangString": {
231 | "@id": "rdf:langString"
232 | },
233 | "MediaObject": {
234 | "@id": "schema:MediaObject"
235 | },
236 | "StructuredValue": {
237 | "@id": "schema:StructuredValue"
238 | },
239 | "Thing": {
240 | "@id": "schema:Thing"
241 | },
242 | "VideoObject": {
243 | "@id": "schema:VideoObject"
244 | }
245 | }
246 | }
247 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | mkdocs-macros-plugin
2 | mkdocs-material
3 | pymdown-extensions
4 | rdflib==5.0.0
5 | ruamel.yaml
6 | mkdocs-mermaid2-plugin
7 |
--------------------------------------------------------------------------------
/scripts/fix_pydantic.py:
--------------------------------------------------------------------------------
1 | """ Using ast transformer to fix issues with automatic pydantic generation
2 | Currently the main issue is with the LangString representation in the pydantic
3 | model, I'm changing it to Dict[str, str].
4 | Perhaps in the future this script will not be required.
5 | """
6 |
7 | import ast
8 | import sys
9 |
10 | import astor
11 |
12 |
13 | class ClassRemover(ast.NodeTransformer):
14 | def __init__(self, class_name):
15 | self.class_name = class_name
16 |
17 | def visit_ClassDef(self, node):
18 | # Remove the class if its name matches the class_to_remove
19 | if node.name == self.class_name:
20 | return None
21 | return node
22 |
23 | def visit_Expr(self, node):
24 | # Check if the node is a call expression
25 | if isinstance(node.value, ast.Call):
26 | # Check if the call expression is an attribute (method call)
27 | if isinstance(node.value.func, ast.Attribute):
28 | # Check if the method call matches the specified class
29 | if (
30 | isinstance(node.value.func.value, ast.Name)
31 | and node.value.func.value.id == self.class_name
32 | ):
33 | return None # Remove this node
34 | return self.generic_visit(node)
35 |
36 |
37 | class TypeReplacer(ast.NodeTransformer):
38 | def __init__(self, old_type, new_type):
39 | self.old_type = old_type
40 | self.new_type = new_type
41 |
42 | def visit_FunctionDef(self, node):
43 | # Check all arguments in the function definition
44 | for arg in node.args.args:
45 | if arg.annotation:
46 | arg.annotation = self.visit(arg.annotation)
47 | return self.generic_visit(node)
48 |
49 | def visit_AsyncFunctionDef(self, node):
50 | # Handle async function definitions similarly
51 | for arg in node.args.args:
52 | if arg.annotation:
53 | arg.annotation = self.visit(arg.annotation)
54 | return self.generic_visit(node)
55 |
56 | def visit_Name(self, node):
57 | # Replace the old type with the new type
58 | if node.id == self.old_type:
59 | node.id = self.new_type
60 | return node
61 |
62 | def visit_Subscript(self, node):
63 | # Handle Union, Optional, and other subscripted types
64 | node.value = self.visit(node.value)
65 | node.slice = self.visit(node.slice)
66 | return node
67 |
68 | def visit_Index(self, node):
69 | # Handle the index part of subscripted types
70 | node.value = self.visit(node.value)
71 | return node
72 |
73 | def visit_Tuple(self, node):
74 | # Handle tuples in type annotations
75 | node.elts = [self.visit(elt) for elt in node.elts]
76 | return node
77 |
78 |
79 | def edit_pydantic(input_file, output_file):
80 |
81 | with open(input_file, "r") as file:
82 | tree = ast.parse(file.read())
83 |
84 | transformer_class = ClassRemover(class_name="LangString")
85 | tree_modclass = transformer_class.visit(tree)
86 |
87 | transformer_tp = TypeReplacer(
88 | old_type="LangString", new_type="Dict[str, str]"
89 | )
90 | tree_modclass_modtype = transformer_tp.visit(tree_modclass)
91 |
92 | with open(output_file, "w") as file:
93 | file.write(astor.to_source(tree_modclass_modtype))
94 |
95 |
96 | if __name__ == "__main__":
97 | input_file = sys.argv[1]
98 | if len(sys.argv) < 3:
99 | output_file = input_file
100 | else:
101 | output_file = sys.argv[2]
102 | print(
103 | f"Fixing automatically generated pydantic file {input_file} "
104 | f"and saving to {output_file}"
105 | )
106 | edit_pydantic(input_file, output_file)
107 |
--------------------------------------------------------------------------------
/scripts/jsonParser.py:
--------------------------------------------------------------------------------
1 | import json
2 | import os
3 |
4 | schema_dirs = ["contexts", "schemas", "terms"]
5 | tested = 0
6 | for root, _, files in os.walk(".", topdown=True):
7 | if os.path.basename(root) in schema_dirs:
8 | for name in files:
9 | with open(os.path.join(root, name)) as fp:
10 | print(f" trying parsing {root}/{name} as json")
11 | try:
12 | tested += 1
13 | json.load(fp)
14 | except json.decoder.JSONDecodeError:
15 | print(f"{root}/{name} could not be loaded")
16 | raise
17 | if tested == 0:
18 | raise ValueError("Zero files tested")
19 |
--------------------------------------------------------------------------------
/templates/library_table.jinja:
--------------------------------------------------------------------------------
1 | | Activity | Description | URI |
2 | | :------ | :---------- | :-- |
3 | {% for activity in activities %}
4 | | {{ activity.name }} | {{ activity.description }} | [link]({{ activity.uri }}) |
5 | {% endfor %}
6 |
--------------------------------------------------------------------------------
/terms/Activity:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "skos:prefLabel",
6 | "@type": "rdf:Property",
7 | "rdfs:comment": "The preferred label.",
8 | "rdfs:label": "preferred label",
9 | "schema:domainIncludes": {
10 | "@id": "reproschema:Activity"
11 | },
12 | "schema:rangeIncludes": {
13 | "@id": "schema:Text"
14 | }
15 | },
16 | {
17 | "@id": "skos:altLabel",
18 | "@type": "rdf:Property",
19 | "rdfs:comment": "The alternate label.",
20 | "rdfs:label": "alternate label",
21 | "schema:domainIncludes": {
22 | "@id": "reproschema:Activity"
23 | },
24 | "schema:rangeIncludes": {
25 | "@id": "schema:Text"
26 | }
27 | },
28 | {
29 | "@id": "schema:description",
30 | "schema:domainIncludes": {
31 | "@id": "reproschema:Activity"
32 | }
33 | },
34 | {
35 | "@id": "schema:schemaVersion",
36 | "schema:domainIncludes": {
37 | "@id": "reproschema:Activity"
38 | }
39 | },
40 | {
41 | "@id": "schema:version",
42 | "schema:domainIncludes": {
43 | "@id": "reproschema:Activity"
44 | }
45 | },
46 | {
47 | "@id": "schema:citation",
48 | "schema:domainIncludes": {
49 | "@id": "reproschema:Activity"
50 | }
51 | },
52 | {
53 | "@id": "schema:associatedMedia",
54 | "@type": "rdf:Property",
55 | "rdfs:comment": "A media object that encodes this CreativeWork. This property is a synonym for encoding.",
56 | "rdfs:label": "associatedMedia",
57 | "schema:domainIncludes": {
58 | "@id": "reproschema:Activity"
59 | }
60 | },
61 | {
62 | "@id": "reproschema:preamble",
63 | "schema:domainIncludes": {
64 | "@id": "reproschema:Activity"
65 | }
66 | },
67 | {
68 | "@id": "reproschema:order",
69 | "schema:domainIncludes": {
70 | "@id": "reproschema:Activity"
71 | }
72 | },
73 | {
74 | "@id": "reproschema:shuffle",
75 | "schema:domainIncludes": {
76 | "@id": "reproschema:Activity"
77 | }
78 | },
79 | {
80 | "@id": "reproschema:addProperties",
81 | "schema:domainIncludes": {
82 | "@id": "reproschema:Activity"
83 | }
84 | },
85 | {
86 | "@id": "reproschema:overrideProperties",
87 | "schema:domainIncludes": {
88 | "@id": "reproschema:Activity"
89 | }
90 | },
91 | {
92 | "@id": "reproschema:messages",
93 | "schema:domainIncludes": {
94 | "@id": "reproschema:Activity"
95 | }
96 | },
97 | {
98 | "@id": "reproschema:allow",
99 | "schema:domainIncludes": {
100 | "@id": "reproschema:Activity"
101 | }
102 | },
103 | {
104 | "@id": "reproschema:compute",
105 | "schema:domainIncludes": {
106 | "@id": "reproschema:Activity"
107 | }
108 | },
109 | {
110 | "@id": "reproschema:cronTable",
111 | "schema:domainIncludes": {
112 | "@id": "reproschema:Activity"
113 | }
114 | },
115 | {
116 | "@id": "schema:about",
117 | "schema:domainIncludes": {
118 | "@id": "reproschema:Activity"
119 | }
120 | },
121 | {
122 | "@id": "reproschema:Activity",
123 | "@type": [
124 | "rdfs:Class",
125 | "prov:Entity",
126 | "prov:Plan",
127 | "nidm:Assessment"
128 | ],
129 | "rdfs:comment": "An assessment in a protocol.",
130 | "rdfs:label": "Activity",
131 | "rdfs:subClassOf": {
132 | "@id": "schema:CreativeWork"
133 | }
134 | }
135 | ]
136 | }
137 |
--------------------------------------------------------------------------------
/terms/AdditionalNoteObj:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "reproschema:source",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:AdditionalNoteObj"
8 | }
9 | },
10 | {
11 | "@id": "reproschema:column",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:AdditionalNoteObj"
14 | }
15 | },
16 | {
17 | "@id": "reproschema:value",
18 | "schema:domainIncludes": {
19 | "@id": "reproschema:AdditionalNoteObj"
20 | }
21 | },
22 | {
23 | "@id": "reproschema:AdditionalNoteObj",
24 | "@type": "rdfs:Class",
25 | "rdfs:comment": "A set of objects to define notes in a field. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema",
26 | "rdfs:label": "Additional Notes Object"
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/terms/AdditionalProperty:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "reproschema:variableName",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:AdditionalProperty"
8 | }
9 | },
10 | {
11 | "@id": "reproschema:isAbout",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:AdditionalProperty"
14 | }
15 | },
16 | {
17 | "@id": "schema:valueRequired",
18 | "schema:domainIncludes": {
19 | "@id": "reproschema:AdditionalProperty"
20 | }
21 | },
22 | {
23 | "@id": "skos:prefLabel",
24 | "@type": "rdf:Property",
25 | "rdfs:comment": "The preferred label.",
26 | "rdfs:label": "preferred label",
27 | "schema:domainIncludes": {
28 | "@id": "reproschema:AdditionalProperty"
29 | }
30 | },
31 | {
32 | "@id": "reproschema:isVis",
33 | "schema:domainIncludes": {
34 | "@id": "reproschema:AdditionalProperty"
35 | }
36 | },
37 | {
38 | "@id": "reproschema:randomMaxDelay",
39 | "@type": "rdf:Property",
40 | "schema:domainIncludes": {
41 | "@id": "reproschema:AdditionalProperty"
42 | }
43 | },
44 | {
45 | "@id": "reproschema:schedule",
46 | "@type": "rdf:Property",
47 | "schema:domainIncludes": {
48 | "@id": "reproschema:AdditionalProperty"
49 | }
50 | },
51 | {
52 | "@id": "reproschema:limit",
53 | "@type": "rdf:Property",
54 | "schema:domainIncludes": {
55 | "@id": "reproschema:AdditionalProperty"
56 | }
57 | },
58 | {
59 | "@id": "reproschema:maxRetakes",
60 | "@type": "rdf:Property",
61 | "schema:domainIncludes": {
62 | "@id": "reproschema:AdditionalProperty"
63 | }
64 | },
65 | {
66 | "@id": "reproschema:AdditionalProperty",
67 | "@type": "rdfs:Class",
68 | "rdfs:comment": "An object to describe the various properties added to assessments and fields.",
69 | "rdfs:label": "Additional properties"
70 | }
71 | ]
72 | }
73 |
--------------------------------------------------------------------------------
/terms/AllowExport:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:AllowExport",
4 | "@type": "rdfs:Class",
5 | "rdfs:comment": "Indicates (by boolean) if data can be exported or not.",
6 | "rdfs:label": "Allow export"
7 | }
8 |
--------------------------------------------------------------------------------
/terms/AllowReplay:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:AllowReplay",
4 | "@type": "rdfs:Class",
5 | "rdfs:comment": "Indicates (by boolean) if items can be replayed or not.",
6 | "rdfs:label": "Allow replay"
7 | }
8 |
--------------------------------------------------------------------------------
/terms/AutoAdvance:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:AutoAdvance",
4 | "@type": "rdfs:Class",
5 | "rdfs:comment": "Indicates (by boolean) if assessments in a protocol can auto advance or not.",
6 | "rdfs:label": "Auto advance"
7 | }
8 |
--------------------------------------------------------------------------------
/terms/Choice:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "schema:image",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:Choice"
8 | }
9 | },
10 | {
11 | "@id": "schema:name",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:Choice"
14 | }
15 | },
16 | {
17 | "@id": "schema:value",
18 | "schema:domainIncludes": {
19 | "@id": "reproschema:Choice"
20 | },
21 | "schema:rangeIncludes": [
22 | {
23 | "@id": "reproschema:Skipped"
24 | },
25 | {
26 | "@id": "reproschema:DontKnow"
27 | }
28 | ]
29 | },
30 | {
31 | "@id": "reproschema:Choice",
32 | "@type": "rdfs:Class",
33 | "rdfs:comment": "An object to describe a response option.",
34 | "rdfs:label": "Response choice"
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/terms/ComputeSpecification:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "reproschema:variableName",
6 | "@type": "rdf:Property",
7 | "rdfs:comment": "The name used to represent an item.",
8 | "rdfs:label": "variableName",
9 | "schema:domainIncludes": {
10 | "@id": "reproschema:ComputeSpecification"
11 | }
12 | },
13 | {
14 | "@id": "reproschema:jsExpression",
15 | "@type": "rdf:Property",
16 | "rdfs:comment": "A JavaScript expression for computations.",
17 | "rdfs:label": "JavaScript Expression",
18 | "schema:domainIncludes": {
19 | "@id": "reproschema:ComputeSpecification"
20 | }
21 | },
22 | {
23 | "@id": "reproschema:ComputeSpecification",
24 | "@type": "rdfs:Class",
25 | "rdfs:comment": "An object to define computations in an activity or protocol.",
26 | "rdfs:label": "Compute Specification"
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/terms/DisableBack:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:DisableBack",
4 | "@type": "rdfs:Class",
5 | "rdfs:comment": "Indicates (by boolean) if we can go back to a completed assessment in a protocol.",
6 | "rdfs:label": "Disable redo"
7 | }
8 |
--------------------------------------------------------------------------------
/terms/DontKnow:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:DontKnow",
4 | "@type": "rdfs:Class",
5 | "rdfs:comment": "An element to describe the choice when response is not known.",
6 | "rdfs:label": "Do not know"
7 | }
8 |
--------------------------------------------------------------------------------
/terms/Field:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "skos:prefLabel",
6 | "@type": "rdf:Property",
7 | "rdfs:comment": "The preferred label.",
8 | "rdfs:label": "preferred label",
9 | "schema:domainIncludes": {
10 | "@id": "reproschema:Field"
11 | },
12 | "schema:rangeIncludes": {
13 | "@id": "schema:Text"
14 | }
15 | },
16 | {
17 | "@id": "skos:altLabel",
18 | "@type": "rdf:Property",
19 | "rdfs:comment": "The alternate label.",
20 | "rdfs:label": "alternate label",
21 | "schema:domainIncludes": {
22 | "@id": "reproschema:Field"
23 | },
24 | "schema:rangeIncludes": {
25 | "@id": "schema:Text"
26 | }
27 | },
28 | {
29 | "@id": "schema:description",
30 | "schema:domainIncludes": {
31 | "@id": "reproschema:Field"
32 | }
33 | },
34 | {
35 | "@id": "schema:schemaVersion",
36 | "@type": "rdf:Property",
37 | "schema:domainIncludes": {
38 | "@id": "reproschema:Field"
39 | }
40 | },
41 | {
42 | "@id": "schema:version",
43 | "@type": "rdf:Property",
44 | "schema:domainIncludes": {
45 | "@id": "reproschema:Field"
46 | }
47 | },
48 | {
49 | "@id": "reproschema:preamble",
50 | "@type": "rdf:Property",
51 | "schema:domainIncludes": {
52 | "@id": "reproschema:Field"
53 | }
54 | },
55 | {
56 | "@id": "schema:question",
57 | "@type": "rdf:Property",
58 | "schema:domainIncludes": {
59 | "@id": "reproschema:Field"
60 | }
61 | },
62 | {
63 | "@id": "schema:image",
64 | "@type": "rdf:Property",
65 | "rdfs:comment": "An image of the item. This can be a URL or a fully described ImageObject.",
66 | "rdfs:label": "image",
67 | "schema:domainIncludes": {
68 | "@id": "reproschema:Field"
69 | }
70 | },
71 | {
72 | "@id": "reproschema:inputType",
73 | "@type": "rdf:Property",
74 | "schema:domainIncludes": {
75 | "@id": "reproschema:Field"
76 | }
77 | },
78 | {
79 | "@id": "schema:readonlyValue",
80 | "@type": "rdf:Property",
81 | "schema:domainIncludes": {
82 | "@id": "reproschema:Field"
83 | }
84 | },
85 | {
86 | "@id": "schema:isPartOf",
87 | "@type": "rdf:Property",
88 | "schema:domainIncludes": {
89 | "@id": "reproschema:Field"
90 | },
91 | "schema:rangeIncludes": {
92 | "@id": "reproschema:Activity"
93 | }
94 | },
95 | {
96 | "@id": "reproschema:responseOptions",
97 | "@type": "rdf:Property",
98 | "schema:domainIncludes": {
99 | "@id": "reproschema:Field"
100 | }
101 | },
102 | {
103 | "@id": "reproschema:additionalNotesObj",
104 | "@type": "rdf:Property",
105 | "rdfs:comment": "A set of objects to define notes in a field. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema.",
106 | "schema:domainIncludes": {
107 | "@id": "reproschema:Field"
108 | }
109 | },
110 | {
111 | "@id": "schema:associatedMedia",
112 | "@type": "rdf:Property",
113 | "rdfs:comment": "A media object that encodes this CreativeWork. This property is a synonym for encoding.",
114 | "rdfs:label": "associatedMedia",
115 | "schema:domainIncludes": {
116 | "@id": "reproschema:Field"
117 | }
118 | },
119 | {
120 | "@id": "schema:about",
121 | "@type": "rdf:Property",
122 | "rdfs:comment": "The subject matter of the Field.",
123 | "schema:domainIncludes": {
124 | "@id": "reproschema:Field"
125 | }
126 | },
127 | {
128 | "@id": "reproschema:Field",
129 | "@type": [
130 | "rdfs:Class",
131 | "prov:Entity",
132 | "nidm:DataElement"
133 | ],
134 | "rdfs:comment": "An item in an assessment.",
135 | "rdfs:label": "Field",
136 | "rdfs:subClassOf": {
137 | "@id": "schema:CreativeWork"
138 | }
139 | }
140 | ]
141 | }
142 |
--------------------------------------------------------------------------------
/terms/MessageSpecification:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "reproschema:message",
6 | "@type": "rdf:Property",
7 | "schema:domainIncludes": {
8 | "@id": "reproschema:MessageSpecification"
9 | }
10 | },
11 | {
12 | "@id": "reproschema:jsExpression",
13 | "@type": "rdf:Property",
14 | "schema:domainIncludes": {
15 | "@id": "reproschema:MessageSpecification"
16 | }
17 | },
18 | {
19 | "@id": "reproschema:MessageSpecification",
20 | "@type": "rdfs:Class",
21 | "rdfs:comment": "An object to define messages in an activity or protocol.",
22 | "rdfs:label": "Message Specification"
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/terms/OverrideProperty:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "reproschema:variableName",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:OverrideProperty"
8 | }
9 | },
10 | {
11 | "@id": "reproschema:isAbout",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:OverrideProperty"
14 | }
15 | },
16 | {
17 | "@id": "schema:valueRequired",
18 | "schema:domainIncludes": {
19 | "@id": "reproschema:OverrideProperty"
20 | }
21 | },
22 | {
23 | "@id": "skos:prefLabel",
24 | "@type": "rdf:Property",
25 | "rdfs:comment": "The preferred label.",
26 | "rdfs:label": "preferred label",
27 | "schema:domainIncludes": {
28 | "@id": "reproschema:OverrideProperty"
29 | }
30 | },
31 | {
32 | "@id": "reproschema:isVis",
33 | "schema:domainIncludes": {
34 | "@id": "reproschema:OverrideProperty"
35 | }
36 | },
37 | {
38 | "@id": "reproschema:randomMaxDelay",
39 | "@type": "rdf:Property",
40 | "schema:domainIncludes": {
41 | "@id": "reproschema:OverrideProperty"
42 | }
43 | },
44 | {
45 | "@id": "reproschema:schedule",
46 | "@type": "rdf:Property",
47 | "schema:domainIncludes": {
48 | "@id": "reproschema:OverrideProperty"
49 | }
50 | },
51 | {
52 | "@id": "reproschema:limit",
53 | "@type": "rdf:Property",
54 | "schema:domainIncludes": {
55 | "@id": "reproschema:OverrideProperty"
56 | }
57 | },
58 | {
59 | "@id": "reproschema:maxRetakes",
60 | "@type": "rdf:Property",
61 | "schema:domainIncludes": {
62 | "@id": "reproschema:OverrideProperty"
63 | }
64 | },
65 | {
66 | "@id": "reproschema:OverrideProperty",
67 | "@type": "rdfs:Class",
68 | "rdfs:comment": "An object to override the various properties added to assessments and fields.",
69 | "rdfs:label": "Additional properties"
70 | }
71 | ]
72 | }
73 |
--------------------------------------------------------------------------------
/terms/Participant:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "nidm:subject_id",
6 | "rdfs:comment": "The identifier of a participant",
7 | "rdfs:label": "Participant identifier",
8 | "schema:domainIncludes": {
9 | "@id": "reproschema:Participant"
10 | }
11 | },
12 | {
13 | "@id": "reproschema:Participant",
14 | "@type": [
15 | "rdfs:Class",
16 | "prov:Person"
17 | ],
18 | "rdfs:comment": "An Agent describing characteristics associated with a participant.",
19 | "rdfs:label": "Participant",
20 | "rdfs:subClassOf": {
21 | "@id": "prov:Agent"
22 | }
23 | }
24 | ]
25 | }
26 |
--------------------------------------------------------------------------------
/terms/Protocol:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "skos:prefLabel",
6 | "@type": "rdf:Property",
7 | "rdfs:comment": "The preferred label.",
8 | "rdfs:label": "preferred label",
9 | "schema:domainIncludes": {
10 | "@id": "reproschema:Protocol"
11 | },
12 | "schema:rangeIncludes": {
13 | "@id": "schema:Text"
14 | }
15 | },
16 | {
17 | "@id": "skos:altLabel",
18 | "@type": "rdf:Property",
19 | "rdfs:comment": "The alternate label.",
20 | "rdfs:label": "alternate label",
21 | "schema:domainIncludes": {
22 | "@id": "reproschema:Protocol"
23 | },
24 | "schema:rangeIncludes": {
25 | "@id": "schema:Text"
26 | }
27 | },
28 | {
29 | "@id": "schema:description",
30 | "schema:domainIncludes": {
31 | "@id": "reproschema:Protocol"
32 | }
33 | },
34 | {
35 | "@id": "schema:schemaVersion",
36 | "schema:domainIncludes": {
37 | "@id": "reproschema:Protocol"
38 | }
39 | },
40 | {
41 | "@id": "schema:version",
42 | "schema:domainIncludes": {
43 | "@id": "reproschema:Protocol"
44 | }
45 | },
46 | {
47 | "@id": "schema:associatedMedia",
48 | "@type": "rdf:Property",
49 | "rdfs:comment": "A media object that encodes this CreativeWork. This property is a synonym for encoding.",
50 | "rdfs:label": "associatedMedia",
51 | "schema:domainIncludes": {
52 | "@id": "reproschema:Protocol"
53 | }
54 | },
55 | {
56 | "@id": "reproschema:order",
57 | "schema:domainIncludes": {
58 | "@id": "reproschema:Protocol"
59 | }
60 | },
61 | {
62 | "@id": "reproschema:shuffle",
63 | "schema:domainIncludes": {
64 | "@id": "reproschema:Protocol"
65 | }
66 | },
67 | {
68 | "@id": "reproschema:messages",
69 | "schema:domainIncludes": {
70 | "@id": "reproschema:Protocol"
71 | }
72 | },
73 | {
74 | "@id": "reproschema:addProperties",
75 | "schema:domainIncludes": {
76 | "@id": "reproschema:Protocol"
77 | }
78 | },
79 | {
80 | "@id": "reproschema:overrideProperties",
81 | "schema:domainIncludes": {
82 | "@id": "reproschema:Protocol"
83 | }
84 | },
85 | {
86 | "@id": "reproschema:allow",
87 | "schema:domainIncludes": {
88 | "@id": "reproschema:Protocol"
89 | }
90 | },
91 | {
92 | "@id": "reproschema:landingPage",
93 | "schema:domainIncludes": {
94 | "@id": "reproschema:Protocol"
95 | }
96 | },
97 | {
98 | "@id": "reproschema:compute",
99 | "schema:domainIncludes": {
100 | "@id": "reproschema:Protocol"
101 | }
102 | },
103 | {
104 | "@id": "reproschema:cronTable",
105 | "schema:domainIncludes": {
106 | "@id": "reproschema:Protocol"
107 | }
108 | },
109 | {
110 | "@id": "schema:about",
111 | "schema:domainIncludes": {
112 | "@id": "reproschema:Protocol"
113 | }
114 | },
115 | {
116 | "@id": "reproschema:Protocol",
117 | "@type": [
118 | "rdfs:Class",
119 | "prov:Plan",
120 | "prov:Entity"
121 | ],
122 | "rdfs:comment": "A representation of a study which comprises one or more assessments.",
123 | "rdfs:label": "Protocol",
124 | "rdfs:subClassOf": {
125 | "@id": "http://schema.org/CreativeWork"
126 | }
127 | }
128 | ]
129 | }
130 |
--------------------------------------------------------------------------------
/terms/Response:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "reproschema:isAbout",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:Response"
8 | }
9 | },
10 | {
11 | "@id": "schema:value",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:Response"
14 | },
15 | "schema:rangeIncludes": [
16 | {
17 | "@id": "reproschema:Skipped"
18 | },
19 | {
20 | "@id": "reproschema:DontKnow"
21 | },
22 | {
23 | "@id": "schema:Number"
24 | },
25 | {
26 | "@id": "schema:Text"
27 | },
28 | {
29 | "@id": "schema:URL"
30 | },
31 | {
32 | "@id": "schema:Boolean"
33 | },
34 | {
35 | "@id": "schema:StructuredValue"
36 | }
37 | ]
38 | },
39 | {
40 | "@id": "prov:wasAttributedTo",
41 | "schema:domainIncludes": {
42 | "@id": "reproschema:Response"
43 | },
44 | "schema:rangeIncludes": [
45 | {
46 | "@id": "reproschema:Participant"
47 | }]
48 | },
49 | {
50 | "@id": "reproschema:Response",
51 | "@type": [
52 | "rdfs:Class",
53 | "prov:Entity"
54 | ],
55 | "rdfs:comment": "Describes the response of an item.",
56 | "rdfs:label": "Response",
57 | "rdfs:subClassOf": {
58 | "@id": "schema:CreativeWork"
59 | }
60 | }
61 | ]
62 | }
63 |
--------------------------------------------------------------------------------
/terms/ResponseActivity:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "prov:used",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:ResponseActivity"
8 | }
9 | },
10 | {
11 | "@id": "schema:inLanguage",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:ResponseActivity"
14 | }
15 | },
16 | {
17 | "@id": "prov:startedAtTime",
18 | "schema:domainIncludes": {
19 | "@id": "reproschema:ResponseActivity"
20 | }
21 | },
22 | {
23 | "@id": "prov:endedAtTime",
24 | "schema:domainIncludes": {
25 | "@id": "reproschema:ResponseActivity"
26 | }
27 | },
28 | {
29 | "@id": "prov:endedAtTime",
30 | "schema:domainIncludes": {
31 | "@id": "reproschema:ResponseActivity"
32 | }
33 | },
34 | {
35 | "@id": "prov:generated",
36 | "schema:domainIncludes": {
37 | "@id": "reproschema:ResponseActivity"
38 | }
39 | },
40 | {
41 | "@id": "reproschema:ResponseActivity",
42 | "@type": [
43 | "rdfs:Class",
44 | "prov:Activity"
45 | ],
46 | "rdfs:comment": "Captures information about some action that took place. It also links to information (entities) that were used during the activity",
47 | "rdfs:label": "ResponseActivity",
48 | "rdfs:subClassOf": {
49 | "@id": "schema:CreativeWork"
50 | }
51 | }
52 | ]
53 | }
54 |
--------------------------------------------------------------------------------
/terms/ResponseOption:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "reproschema:valueType",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:ResponseOption"
8 | }
9 | },
10 | {
11 | "@id": "schema:minValue",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:ResponseOption"
14 | }
15 | },
16 | {
17 | "@id": "schema:maxValue",
18 | "schema:domainIncludes": {
19 | "@id": "reproschema:ResponseOption"
20 | }
21 | },
22 | {
23 | "@id": "reproschema:multipleChoice",
24 | "schema:domainIncludes": {
25 | "@id": "reproschema:ResponseOption"
26 | }
27 | },
28 | {
29 | "@id": "reproschema:datumType",
30 | "schema:domainIncludes": {
31 | "@id": "reproschema:ResponseOption"
32 | }
33 | },
34 | {
35 | "@id": "reproschema:unitOptions",
36 | "schema:domainIncludes": {
37 | "@id": "reproschema:ResponseOption"
38 | }
39 | },
40 | {
41 | "@id": "reproschema:choices",
42 | "schema:domainIncludes": {
43 | "@id": "reproschema:ResponseOption"
44 | }
45 | },
46 | {
47 | "@id": "reproschema:ResponseOption",
48 | "@type": "rdfs:Class",
49 | "rdfs:comment": "An element (object or by URL)to describe the properties of response of the Field item.",
50 | "rdfs:label": "Response option"
51 | }
52 | ]
53 | }
54 |
--------------------------------------------------------------------------------
/terms/Skipped:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:Skipped",
4 | "@type": "rdfs:Class",
5 | "rdfs:comment": "An element to describe the choice when the item is skipped.",
6 | "rdfs:label": "Skipped"
7 | }
8 |
--------------------------------------------------------------------------------
/terms/SoftwareAgent:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "schema:version",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:SoftwareAgent"
8 | }
9 | },
10 | {
11 | "@id": "schema:url",
12 | "schema:domainIncludes": {
13 | "@id": "reproschema:SoftwareAgent"
14 | }
15 | },
16 | {
17 | "@id": "reproschema:SoftwareAgent",
18 | "@type": [
19 | "rdfs:Class",
20 | "prov:SoftwareAgent"
21 | ],
22 | "rdfs:comment": "Captures information about some action that took place. It also links to information (entities) that were used during the activity",
23 | "rdfs:label": "Software Agent"
24 | }
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/terms/TimedOut:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:TimedOut",
4 | "@type": "rdfs:Class",
5 | "rdfs:comment": "A boolean element to describe if the response did not occur within the prescribed time.",
6 | "rdfs:label": "Response timed out"
7 | }
8 |
--------------------------------------------------------------------------------
/terms/UnitOption:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@graph": [
4 | {
5 | "@id": "skos:prefLabel",
6 | "schema:domainIncludes": {
7 | "@id": "reproschema:UnitOption"
8 | },
9 | "schema:rangeIncludes": {
10 | "@id": "schema:Text"
11 | }
12 | },
13 | {
14 | "@id": "reproschema:value",
15 | "schema:domainIncludes": {
16 | "@id": "reproschema:UnitOption"
17 | },
18 | "schema:rangeIncludes": [
19 | {
20 | "@id": "schema:URL"
21 | },
22 | {
23 | "@id": "schema:Text"
24 | }
25 | ]
26 | },
27 | {
28 | "@id": "reproschema:UnitOption",
29 | "@type": "rdfs:Class",
30 | "rdfs:comment": "An object to represent a human displayable name alongside the more formal value for units.",
31 | "rdfs:label": "Unit options"
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/terms/addProperties:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:addProperties",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An array of objects to describe the various properties added to assessments and fields.",
6 | "rdfs:label": "addProperties",
7 | "schema:rangeIncludes": {
8 | "@id": "reproschema:AdditionalProperty"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/additionalNotesObj:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@type": "rdf:Property",
4 | "@id": "reproschema:additionalNotesObj",
5 | "rdfs:comment": "A set of objects to define notes in a field. For example, most Redcap and NDA data dictionaries have notes for each item which needs to be captured in reproschema.",
6 | "rdfs:label": "additional notes",
7 | "schema:rangeIncludes": {
8 | "@id": "reproschema:AdditionalNoteObj"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/allow:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:allow",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An array of items indicating properties allowed on an activity or protocol ",
6 | "rdfs:label": "allow",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Thing"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/choices:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:choices",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An array to list the available options for response of the Field item.",
6 | "rdfs:label": "choices",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "reproschema:Choice"
10 | },
11 | {
12 | "@id": "schema:URL"
13 | }
14 | ],
15 | "schema:sameAs": {
16 | "@id": "schema:itemListElement"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/terms/column:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@type": "rdf:Property",
4 | "@id": "reproschema:column",
5 | "rdfs:comment": "An element to define the column name where the note was taken from.",
6 | "rdfs:label": "column",
7 | "schema:rangeIncludes": {
8 | "@id": "rdf:langString"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/compute:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:compute",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An array of objects indicating computations in an activity or protocol and maps it to the corresponding Field item. scoring logic is a subset of all computations that could be performed and not all computations will be scoring. For example, one may want to do conversion from one unit to another. ",
6 | "rdfs:label": "computation",
7 | "schema:rangeIncludes": {
8 | "@id": "reproschema:ComputeSpecification"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/datumType:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:datumType",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "Indicates what type of datum the response is (e.g. range,count,scalar etc.) for the Field item.",
6 | "rdfs:label": "datumType",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "schema:URL"
10 | },
11 | {
12 | "@id": "schema:Text"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/inputType:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:inputType",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An element to describe the input type of a Field item.",
6 | "rdfs:label": "inputType",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Text"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/isAbout:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:isAbout",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "A pointer to the node describing the item.",
6 | "rdfs:label": "isAbout",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "reproschema:Activity"
10 | },
11 | {
12 | "@id": "reproschema:Field"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/isVis:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:isVis",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An element to describe (by boolean or conditional statement) visibility conditions of items in an assessment.",
6 | "rdfs:label": "visibility",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "schema:Boolean"
10 | },
11 | {
12 | "@id": "schema:Text"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/jsExpression:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:jsExpression",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "A JavaScript expression to compute a score from other variables.",
6 | "rdfs:label": "JavaScript Expression",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "schema:Text"
10 | },
11 | {
12 | "@id": "schema:Boolean"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/landingPage:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@type": "rdf:Property",
4 | "@id": "reproschema:landingPage",
5 | "rdfs:comment": "An element (by URL) to point to the protocol readme or landing page.",
6 | "rdfs:label": "Landing page content",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "schema:URL"
10 | },
11 | {
12 | "@id": "schema:Text"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/limit:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:limit",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An element to limit the duration (uses ISO 8601) this activity is allowed to be completed by once activity is available.",
6 | "rdfs:label": "limit",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Text"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/maxRetakes:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:maxRetakes",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "Defines number of times the item is allowed to be redone.",
6 | "rdfs:label": "maxRetakes",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Number"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/message:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@type": "rdf:Property",
4 | "@id": "reproschema:message",
5 | "rdfs:comment": "The message to be conditionally displayed for an item. ",
6 | "rdfs:label": "Message",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "schema:Text"
10 | },
11 | {
12 | "@id": "rdf:langString"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/messages:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:messages",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An array of objects to define conditional messages in an activity or protocol.",
6 | "rdfs:label": "messages",
7 | "schema:rangeIncludes": {
8 | "@id": "reproschema:MessageSpecification"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/multipleChoice:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:multipleChoice",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "Indicates (by bool) if response for the Field item has one or more answer.",
6 | "rdfs:label": "Multiple choice response expectation",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Boolean"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/order:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:order",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An ordered list to describe the order in which the items of an assessment or protocol appear in the user interface.",
6 | "rdfs:label": "Order",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "reproschema:Activity"
10 | },
11 | {
12 | "@id": "reproschema:Field"
13 | },
14 | {
15 | "@id": "schema:URL"
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/terms/overrideProperties:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:overrideProperties",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An array of objects to override the various properties added to assessments and fields.",
6 | "rdfs:label": "overrideProperties",
7 | "schema:rangeIncludes": {
8 | "@id": "reproschema:OverrideProperty"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/preamble:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@type": "rdf:Property",
4 | "@id": "reproschema:preamble",
5 | "rdfs:comment": "The preamble for an assessment",
6 | "rdfs:label": "Preamble",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "schema:Text"
10 | },
11 | {
12 | "@id": "rdf:langString"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/randomMaxDelay:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:randomMaxDelay",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "Present activity/item within some random offset of activity available time up to the maximum specified by this ISO 8601 duration",
6 | "rdfs:label": "randomMaxDelay",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Text"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/responseOptions:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:responseOptions",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An element (object or by URL)to describe the properties of response of the Field item.",
6 | "rdfs:label": "Response options",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "reproschema:ResponseOption"
10 | },
11 | {
12 | "@id": "schema:URL"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/schedule:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:schedule",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An element to set make activity available/repeat info using ISO 8601 repeating interval format.",
6 | "rdfs:label": "Schedule",
7 | "schema:rangeIncludes": [{
8 | "@id": "schema:Text"
9 | },
10 | {
11 | "@id": "schema:Schedule"
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/terms/shuffle:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:shuffle",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "An element (bool) to determine if the list of items is shuffled or in order.",
6 | "rdfs:label": "Shuffle",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:boolean"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/source:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@type": "rdf:Property",
4 | "@id": "reproschema:source",
5 | "rdfs:comment": "An element to define the source (eg. RedCap, NDA) where the note was taken from.",
6 | "rdfs:label": "source",
7 | "schema:rangeIncludes": {
8 | "@id": "rdf:langString"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/statusOptions:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:statusOptions",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "Provides information on whether or not a field item wants to be accompanied by the additional status option(s) defined in “statusOptions”",
6 | "rdfs:label": "Status options",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Text"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/terms/unitOptions:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:unitOptions",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "A list of objects to represent a human displayable name alongside the more formal value for units.",
6 | "rdfs:label": "unitOptions",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "reproschema:UnitOption"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/terms/value:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:value",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "The value for each option in choices or in additionalNotesObj",
6 | "rdfs:label": "value",
7 | "http://schema.org/rangeIncludes": [
8 | {
9 | "@id": "schema:Boolean"
10 | },
11 | {
12 | "@id": "schema:StructuredValue"
13 | },
14 | {
15 | "@id": "schema:Number"
16 | },
17 | {
18 | "@id": "schema:Text"
19 | },
20 | {
21 | "@id": "schema:URL"
22 | }
23 | ],
24 | "schema:sameAs": {
25 | "@id": "schema:value"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/terms/valueType:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@type": "rdf:Property",
4 | "@id": "reproschema:valueType",
5 | "rdfs:comment": "The type of the response of an item. For example, string, integer, etc.",
6 | "rdfs:label": "The type of the response",
7 | "schema:rangeIncludes": [
8 | {
9 | "@id": "schema:Text"
10 | },
11 | {
12 | "@id": "rdf:langString"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/terms/variableName:
--------------------------------------------------------------------------------
1 | {
2 | "@context": "../contexts/base",
3 | "@id": "reproschema:variableName",
4 | "@type": "rdf:Property",
5 | "rdfs:comment": "The name used to represent an item.",
6 | "rdfs:label": "variableName",
7 | "schema:rangeIncludes": {
8 | "@id": "schema:Text"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------