Skip to content

Commit

Permalink
refactor jsonld snippets out of doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed May 10, 2024
1 parent 8f9039d commit ce7c4ed
Show file tree
Hide file tree
Showing 21 changed files with 613 additions and 643 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: validate protocol and activities

# describes when this workfllow is triggered
on:
push: # when pushing to a branch
branches: [master] # on which branch
pull_request: # when opening a new pull request
branches: "*" # * refers to all branches

jobs:
build:
# describes the operating system that will #be used
runs-on: ubuntu-latest

# Steps represent a sequence of tasks executed as part of the job
steps:
- name: Setup Node # installing Node.js for all the javascript part
uses: actions/[email protected]

# Checks-out your repository under $GITHUB_WORKSPACE,
# so your job can access it
- uses: actions/checkout@v2

# Checks that our JSON are valid
# Installing `jsonlint` to validate the JSON files
# Looking recursively through the directories `protocol`
# and `activities` for any file with "@context" in them
# (that makes them JSON-LD files) and validate their content
# with jsonlint
- name: Check for syntax errors
run: |
npm install -g jsonlint
grep -r "@context" activities | cut -d: -f1 | xargs -I fname jsonlint -q fname
grep -r "@context" protocols | cut -d: -f1 | xargs -I fname jsonlint -q fname
# Checks that the schemas are valid
# Using python and the installing the reproschema tools
# from the reproschema-py repository to then validate
# the content of the `activities` and `protocols` folders.
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install reproschema requests_cache
- name: Test with pyshacl
run: |
reproschema -l DEBUG validate activities
reproschema -l DEBUG validate protocols
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@ repos:
rev: v2.2.6
hooks:
- id: codespell
# Check formatting of CSS and HTML
# prettier: https://prettier.io/
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [json]
# exclude files that
# - are skipped for other hooks
# - are still involved in some PR
exclude: |
(?x)^(
releases/.*
)$
3 changes: 0 additions & 3 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@
- compute specification
- input type
- item
- JSON
- JSON-LD
- protocol
- SHACL
- visibility
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

??? example "Tl;DR - Advantages of the current schema representation"
!!! example "Tl;DR - Advantages of the current schema representation"

- Rich contexts for a questionnaire with JSON-LD rather than a "flat" csv file.
- A single source of curated assessments from [ReproSchema Library](https://github.com/ReproNim/reproschema-library)
Expand Down
Loading

0 comments on commit ce7c4ed

Please sign in to comment.