From 67c5d2c77edff00b8976b10e360d7e5b7c025244 Mon Sep 17 00:00:00 2001 From: Stephan Heunis Date: Tue, 21 Nov 2023 17:49:28 +0100 Subject: [PATCH] Ontology starting point --- .github/workflows/docbuild.yml | 65 ++++++++++++++++++++++++++++++++++ .gitignore | 4 +++ Makefile | 31 ++++++++++++++++ README.md | 23 ++++++++++++ mkdocs.yml | 17 +++++++++ requirements.txt | 4 +++ src/extra-docs/about.md | 0 src/linkml/classes/author.yaml | 47 ++++++++++++++++++++++++ src/linkml/enums/.gitkeep | 0 src/linkml/root.yaml | 7 ++++ src/linkml/slots/.gitkeep | 0 src/linkml/types/.gitkeep | 0 12 files changed, 198 insertions(+) create mode 100644 .github/workflows/docbuild.yml create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 mkdocs.yml create mode 100644 requirements.txt create mode 100644 src/extra-docs/about.md create mode 100644 src/linkml/classes/author.yaml create mode 100644 src/linkml/enums/.gitkeep create mode 100644 src/linkml/root.yaml create mode 100644 src/linkml/slots/.gitkeep create mode 100644 src/linkml/types/.gitkeep diff --git a/.github/workflows/docbuild.yml b/.github/workflows/docbuild.yml new file mode 100644 index 0000000..1f8105e --- /dev/null +++ b/.github/workflows/docbuild.yml @@ -0,0 +1,65 @@ +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 + # this is building a branch specific site + # when multiple branches/versions are maintained concurrently + # we likely need to build all of them and do a joint upload + run: | + #mkdir -p ./build/upload + #export "SITEDIR=./build/upload/$(git branch --show-current)" + #export "SITEURL=https://concepts.datalad.org/$(git branch --show-current)" + make mkdocs-site + #mv ./build/mkdocs-site $SITEDIR + mv ./build/mkdocs-site ./build/upload + + - 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..5b7169e --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# DataLad Concept Ontology + +_WORK IN PROGRESS_ + +## How to... + +Install (in a virtualenv) + +``` +pip install -r requirements.txt +``` + +Build docs: + +``` +make +``` + +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