diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml new file mode 100644 index 0000000..d2e15dc --- /dev/null +++ b/.github/workflows/docbuild.yml @@ -0,0 +1,61 @@ +name: Build and deploy docs + +on: + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Pages + id: pages + uses: actions/configure-pages@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Build + run: | + export "SITEDIR=./build/upload/$(git branch --show-current)" + export "SITEURL=https://concepts.datalad.org/$(git branch --show-current)" + make mkdocs-site + mkdir -p $SITEDIR + mv ./build/mkdocs-site $SITEDIR + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload the directory created by mkdocs + path: ./build/upload + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..708362d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Generated +build/ +*-stamp +.*.swp diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..979fadb --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +all: mkdocs-site + +linkml-docs: linkml-docs-stamp +linkml-docs-stamp: + gen-doc \ + --mergeimports \ + --hierarchical-class-view \ + --use-slot-uris \ + --include-top-level-diagram \ + --diagram-type er_diagram \ + --metadata \ + --format markdown \ + -d build/linkml-docs \ + src/linkml/root.yaml + touch $@ + +extra-docs: extra-docs-stamp +extra-docs-stamp: + mkdir -p build/linkml-docs + cp -r src/extra-docs/* build/linkml-docs + +mkdocs-site: mkdocs-site-stamp +mkdocs-site-stamp: linkml-docs extra-docs + mkdocs build + touch $@ + +clean: + rm -rf build + rm -f *-stamp + +.PHONY: clean linkml-docs extra-docs mkdocs-site diff --git a/README.md b/README.md new file mode 100644 index 0000000..57396f6 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# The DataLad data model + +_WORK IN PROGRESS_ + +## How to... + +Install (in a virtualenv) + +``` +pip install -r requirements.txt +``` + +Build docs: + +``` +gen-doc -d docs src/abcdj_schema.yaml +``` + +Serve docs locally + +``` +mkdocs serve +``` diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..c637456 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,17 @@ +copyright: +docs_dir: build/linkml-docs +nav: + - Home: index.md + - About: about.md +plugins: + - mermaid2 +repo_url: https://github.com/psychoinformatics-de/datalad-concepts +site_author: +site_description: +site_dir: build/mkdocs-site +site_name: DataLad Concepts Ontology (DLCO) +site_url: !ENV [SITEURL, 'https://concepts.datalad.org'] +strict: true +theme: + name: gitbook + locale: en diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..20847b6 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +linkml +mkdocs +mkdocs-gitbook +mkdocs-mermaid2-plugin diff --git a/src/extra-docs/about.md b/src/extra-docs/about.md new file mode 100644 index 0000000..e69de29 diff --git a/src/linkml/classes/author.yaml b/src/linkml/classes/author.yaml new file mode 100644 index 0000000..c280f1f --- /dev/null +++ b/src/linkml/classes/author.yaml @@ -0,0 +1,47 @@ +id: https://w3id.org/abcdj/author +name: abcdj-author +title: abcdj-author +description: |- + A schema to describe an ABCD-J author +license: MIT + +prefixes: + abcdj: https://w3id.org/abcdj/ + linkml: https://w3id.org/linkml/ + obo: https://purl.obolibrary.org/obo/ + schema: http://schema.org/ +default_prefix: abcdj +default_range: string + +imports: + - linkml:types + +classes: + Author: + class_uri: schema:Person + description: >- + An author of the Dataset or of a Publication linked to the + Dataset. + attributes: + affiliation: + slot_uri: schema:affiliation + required: false + description: >- + The author's affiliation to a group, institution, or + employer. + email: + slot_uri: schema:email + required: false + description: >- + The author's email address. + name: + slot_uri: schema:name + required: true + description: >- + The author's name in the format . + orcid: + slot_uri: obo:IAO_0000708 + required: false + description: >- + The path of the file relative to the root of the Dataset, + provided in the POSIX format. diff --git a/src/linkml/enums/.gitkeep b/src/linkml/enums/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/linkml/root.yaml b/src/linkml/root.yaml new file mode 100644 index 0000000..2f96722 --- /dev/null +++ b/src/linkml/root.yaml @@ -0,0 +1,7 @@ +id: https://concepts.datalad.org +name: datalad-concepts-ontology +description: |- + [DataLad Concepts Ontology](https://concepts.datalad.org) (DLCO) + +imports: + - classes/author diff --git a/src/linkml/slots/.gitkeep b/src/linkml/slots/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/linkml/types/.gitkeep b/src/linkml/types/.gitkeep new file mode 100644 index 0000000..e69de29