Skip to content

Commit

Permalink
Ontology starting point
Browse files Browse the repository at this point in the history
  • Loading branch information
jsheunis authored and mih committed Nov 24, 2023
0 parents commit 67c5d2c
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated
build/
*-stamp
.*.swp
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```
17 changes: 17 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linkml
mkdocs
mkdocs-gitbook
mkdocs-mermaid2-plugin
Empty file added src/extra-docs/about.md
Empty file.
47 changes: 47 additions & 0 deletions src/linkml/classes/author.yaml
Original file line number Diff line number Diff line change
@@ -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 <givenName> <familyName>.
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.
Empty file added src/linkml/enums/.gitkeep
Empty file.
7 changes: 7 additions & 0 deletions src/linkml/root.yaml
Original file line number Diff line number Diff line change
@@ -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
Empty file added src/linkml/slots/.gitkeep
Empty file.
Empty file added src/linkml/types/.gitkeep
Empty file.

0 comments on commit 67c5d2c

Please sign in to comment.