Skip to content

Commit

Permalink
Merge pull request #46 from caufieldjh/main
Browse files Browse the repository at this point in the history
Update dependencies, ODK, and names
  • Loading branch information
caufieldjh authored Mar 12, 2024
2 parents cccf94f + 595b9a7 commit 7230d64
Show file tree
Hide file tree
Showing 54 changed files with 4,745 additions and 2,228 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Basic ODK workflow
name: Docs

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches:
- main

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v3

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
# Or use mhausenblas/mkdocs-deploy-gh-pages@nomaterial to build without the mkdocs-material theme
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yaml

6 changes: 3 additions & 3 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
ontology_qc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.2.29
container: obolibrary/odkfull:v1.5

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Run ontology QC checks
env:
DEFAULT_BRANCH: main
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false

18 changes: 9 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ bin/
src/ontology/mirror
src/ontology/mirror/*
src/ontology/reports/*
src/ontology/deep-learning-ontology.owl
src/ontology/deep-learning-ontology.obo
src/ontology/deep-learning-ontology.json
src/ontology/deep-learning-ontology-base.*
src/ontology/deep-learning-ontology-basic.*
src/ontology/deep-learning-ontology-full.*
src/ontology/deep-learning-ontology-simple.*
src/ontology/deep-learning-ontology-simple-non-classified.*
src/ontology/artificial-intelligence-ontology.owl
src/ontology/artificial-intelligence-ontology.obo
src/ontology/artificial-intelligence-ontology.json
src/ontology/artificial-intelligence-ontology-base.*
src/ontology/artificial-intelligence-ontology-basic.*
src/ontology/artificial-intelligence-ontology-full.*
src/ontology/artificial-intelligence-ontology-simple.*
src/ontology/artificial-intelligence-ontology-simple-non-classified.*

src/ontology/seed.txt
src/ontology/dosdp-tools.log
src/ontology/ed_definitions_merged.owl
src/ontology/ontologyterms.txt
src/ontology/simple_seed.txt
src/ontology/patterns
src/ontology/merged-deep-learning-ontology-edit.owl
src/ontology/merged-artificial-intelligence-ontology-edit.owl

src/ontology/target/
src/ontology/tmp/*
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/yamllint.json": "file:///home/harry/artificial-intelligence-ontology/src/metadata/artificial-intelligence-ontology.yml"
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Before you write a new request, please consider the following:

- **Does the term already exist?** Before submitting suggestions for new ontology terms, check whether the term exist, either as a primary term or a synonym term. You can search using [OLS](http://www.ebi.ac.uk/ols/ontologies/deep-learning-ontology)
- **Does the term already exist?** Before submitting suggestions for new ontology terms, check whether the term exist, either as a primary term or a synonym term. You can search using [OLS](http://www.ebi.ac.uk/ols/ontologies/artificial-intelligence-ontology)

## Guidelines for creating GitHub tickets with contributions to the ontology:

Expand Down
1 change: 1 addition & 0 deletions docs/cite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# How to cite ARTIFICIAL-INTELLIGENCE-ONTOLOGY
1 change: 1 addition & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# How to contribute to ARTIFICIAL-INTELLIGENCE-ONTOLOGY
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ARTIFICIAL-INTELLIGENCE-ONTOLOGY Ontology Documentation

[//]: # "This file is meant to be edited by the ontology maintainer."

Welcome to the ARTIFICIAL-INTELLIGENCE-ONTOLOGY documentation!

You can find descriptions of the standard ontology engineering workflows [here](odk-workflows/index.md).
25 changes: 25 additions & 0 deletions docs/odk-workflows/ContinuousIntegration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Introduction to Continuous Integration Workflows with ODK

Historically, most repos have been using Travis CI for continuous integration testing and building, but due to
runtime restrictions, we recently switched a lot of our repos to GitHub actions. You can set up your repo with CI by adding
this to your configuration file (src/ontology/artificial-intelligence-ontology-odk.yaml):

```
ci:
- github_actions
```

When [updateing your repo](RepoManagement.md), you will notice a new file being added: `.github/workflows/qc.yml`.

This file contains your CI logic, so if you need to change, or add anything, this is the place!

Alternatively, if your repo is in GitLab instead of GitHub, you can set up your repo with GitLab CI by adding
this to your configuration file (src/ontology/artificial-intelligence-ontology-odk.yaml):

```
ci:
- gitlab-ci
```

This will add a file called `.gitlab-ci.yml` in the root of your repo.

125 changes: 125 additions & 0 deletions docs/odk-workflows/EditorsWorkflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Editors Workflow

The editors workflow is one of the formal [workflows](index.md) to ensure that the ontology is developed correctly according to ontology engineering principles. There are a few different editors workflows:

1. Local editing workflow: Editing the ontology in your local environment by hand, using tools such as Protégé, ROBOT templates or DOSDP patterns.
2. Completely automated data pipeline (GitHub Actions)
3. DROID workflow

This document only covers the first editing workflow, but more will be added in the future

### Local editing workflow

Workflow requirements:

- git
- github
- docker
- editing tool of choice, e.g. Protégé, your favourite text editor, etc

#### 1. _Create issue_
Ensure that there is a ticket on your issue tracker that describes the change you are about to make. While this seems optional, this is a very important part of the social contract of building an ontology - no change to the ontology should be performed without a good ticket, describing the motivation and nature of the intended change.

#### 2. _Update main branch_
In your local environment (e.g. your laptop), make sure you are on the `main` (prev. `master`) branch and ensure that you have all the upstream changes, for example:

```
git checkout main
git pull
```

#### 3. _Create feature branch_
Create a new branch. Per convention, we try to use meaningful branch names such as:
- issue23removeprocess (where issue 23 is the related issue on GitHub)
- issue26addcontributor
- release20210101 (for releases)

On your command line, this looks like this:

```
git checkout -b issue23removeprocess
```

#### 4. _Perform edit_
Using your editor of choice, perform the intended edit. For example:

_Protégé_

1. Open `src/ontology/artificial-intelligence-ontology-edit.owl` in Protégé
2. Make the change
3. Save the file

_TextEdit_

1. Open `src/ontology/artificial-intelligence-ontology-edit.owl` in TextEdit (or Sublime, Atom, Vim, Nano)
2. Make the change
3. Save the file

Consider the following when making the edit.

1. According to our development philosophy, the only places that should be manually edited are:
- `src/ontology/artificial-intelligence-ontology-edit.owl`
- Any ROBOT templates you chose to use (the TSV files only)
- Any DOSDP data tables you chose to use (the TSV files, and potentially the associated patterns)
- components (anything in `src/ontology/components`), see [here](RepositoryFileStructure.md).
2. Imports should not be edited (any edits will be flushed out with the next update). However, refreshing imports is a potentially breaking change - and is discussed [elsewhere](UpdateImports.md).
3. Changes should usually be small. Adding or changing 1 term is great. Adding or changing 10 related terms is ok. Adding or changing 100 or more terms at once should be considered very carefully.

#### 4. _Check the Git diff_
This step is very important. Rather than simply trusting your change had the intended effect, we should always use a git diff as a first pass for sanity checking.

In our experience, having a visual git client like [GitHub Desktop](https://desktop.github.com/) or [sourcetree](https://www.sourcetreeapp.com/) is really helpful for this part. In case you prefer the command line:

```
git status
git diff
```
#### 5. Quality control
Now it's time to run your quality control checks. This can either happen locally ([5a](#5a-local-testing)) or through your continuous integration system ([7/5b](#75b-continuous-integration-testing)).

#### 5a. Local testing
If you chose to run your test locally:

```
sh run.sh make IMP=false test
```
This will run the whole set of configured ODK tests on including your change. If you have a complex DOSDP pattern pipeline you may want to add `PAT=false` to skip the potentially lengthy process of rebuilding the patterns.

```
sh run.sh make IMP=false PAT=false test
```

#### 6. Pull request

When you are happy with the changes, you commit your changes to your feature branch, push them upstream (to GitHub) and create a pull request. For example:

```
git add NAMEOFCHANGEDFILES
git commit -m "Added biological process term #12"
git push -u origin issue23removeprocess
```

Then you go to your project on GitHub, and create a new pull request from the branch, for example: https://github.com/INCATools/ontology-development-kit/pulls

There is a lot of great advise on how to write pull requests, but at the very least you should:
- mention the tickets affected: `see #23` to link to a related ticket, or `fixes #23` if, by merging this pull request, the ticket is fixed. Tickets in the latter case will be closed automatically by GitHub when the pull request is merged.
- summarise the changes in a few sentences. Consider the reviewer: what would they want to know right away.
- If the diff is large, provide instructions on how to review the pull request best (sometimes, there are many changed files, but only one important change).

#### 7/5b. Continuous Integration Testing
If you didn't run and local quality control checks (see [5a](#5a-local-testing)), you should have Continuous Integration (CI) set up, for example:
- Travis
- GitHub Actions

More on how to set this up [here](ContinuousIntegration.md). Once the pull request is created, the CI will automatically trigger. If all is fine, it will show up green, otherwise red.

#### 8. Community review
Once all the automatic tests have passed, it is important to put a second set of eyes on the pull request. Ontologies are inherently social - as in that they represent some kind of community consensus on how a domain is organised conceptually. This seems high brow talk, but it is very important that as an ontology editor, you have your work validated by the community you are trying to serve (e.g. your colleagues, other contributors etc.). In our experience, it is hard to get more than one review on a pull request - two is great. You can set up GitHub branch protection to actually require a review before a pull request can be merged! We recommend this.

This step seems daunting to some hopefully under-resourced ontologies, but we recommend to put this high up on your list of priorities - train a colleague, reach out!

#### 9. Merge and cleanup
When the QC is green and the reviews are in (approvals), it is time to merge the pull request. After the pull request is merged, remember to delete the branch as well (this option will show up as a big button right after you have merged the pull request). If you have not done so, close all the associated tickets fixed by the pull request.

#### 10. Changelog (Optional)
It is sometimes difficult to keep track of changes made to an ontology. Some ontology teams opt to document changes in a changelog (simply a text file in your repository) so that when release day comes, you know everything you have changed. This is advisable at least for major changes (such as a new release system, a new pattern or template etc.).
47 changes: 47 additions & 0 deletions docs/odk-workflows/ManageDocumentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Updating the Documentation

The documentation for ARTIFICIAL-INTELLIGENCE-ONTOLOGY is managed in two places (relative to the repository root):

1. The `docs` directory contains all the files that pertain to the content of the documentation (more below)
2. the `mkdocs.yaml` file contains the documentation config, in particular its navigation bar and theme.

The documentation is hosted using GitHub pages, on a special branch of the repository (called `gh-pages`). It is important that this branch is never deleted - it contains all the files GitHub pages needs to render and deploy the site. It is also important to note that _the gh-pages branch should never be edited manually_. All changes to the docs happen inside the `docs` directory on the `main` branch.

## Editing the docs

### Changing content
All the documentation is contained in the `docs` directory, and is managed in _Markdown_. Markdown is a very simple and convenient way to produce text documents with formatting instructions, and is very easy to learn - it is also used, for example, in GitHub issues. This is a normal editing workflow:

1. Open the `.md` file you want to change in an editor of choice (a simple text editor is often best). _IMPORTANT_: Do not edit any files in the `docs/odk-workflows/` directory. These files are managed by the ODK system and will be overwritten when the repository is upgraded! If you wish to change these files, make an issue on the [ODK issue tracker](https://github.com/INCATools/ontology-development-kit/issues).
2. Perform the edit and save the file
3. Commit the file to a branch, and create a pull request as usual.
4. If your development team likes your changes, merge the docs into main branch.
5. Deploy the documentation (see below)

## Deploy the documentation

The documentation is _not_ automatically updated from the Markdown, and needs to be deployed deliberately. To do this, perform the following steps:

1. In your terminal, navigate to the edit directory of your ontology, e.g.:
```
cd artificial-intelligence-ontology/src/ontology
```
2. Now you are ready to build the docs as follows:
```
sh run.sh make update_docs
```
[Mkdocs](https://www.mkdocs.org/) now sets off to build the site from the markdown pages. You will be asked to
- Enter your username
- Enter your password (see [here](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) for using GitHub access tokens instead)
_IMPORTANT_: Using password based authentication will be deprecated this year (2021). Make sure you read up on [personal access tokens](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) if that happens!

If everything was successful, you will see a message similar to this one:

```
INFO - Your documentation should shortly be available at: https://berkeleybop.github.io/artificial-intelligence-ontology/
```
3. Just to double check, you can now navigate to your documentation pages (usually https://berkeleybop.github.io/artificial-intelligence-ontology/).
Just make sure you give GitHub 2-5 minutes to build the pages!



Loading

0 comments on commit 7230d64

Please sign in to comment.