Documented Plurality of Users Automated Check

Discussion on this check can be found here.

Requirements

  1. The ontology must have a tracker.
  2. The ontology must have usages.

Fixes

First, read the FAQ on how to edit the metadata for your ontology.

Adding a Tracker

If you do not already have a version control repository that has an Issues Tracker, create one. We recommend creating a GitHub Repository. To do this, you will need to create a GitHub account if you do not already have one.

Once you have a version control repository, add the following to your metadata file (replacing with the link to your repository’s issue tracker):

tracker: https://github.com/DiseaseOntology/HumanDiseaseOntology/issues

Adding Usages

Determine what other groups are using your ontology and how they are using it. Then, add the following to your metadata file (replacing with the correct group name, link, and description):

usages:
- user: http://www.informatics.jax.org/disease (link to group)
  description: MGI disease model annotations use DO (description of group)
  examples:
   - url: http://www.informatics.jax.org/disease/DOID:4123 (link to specific example)
     description: Human genes and mouse homology associated with nail diseases (description of specific example)

You may have multiple examples for each user, and multiple users under the usages tag.

Implementation

The registry data is checked for ‘tracker’ and ‘usage’ entries. If either is missing, this is an error. The tracker should be a valid URL to an issue tracking system, and usages should contain at least one user with a valid URL and description.

import dash_utils
from dash_utils import format_msg


def has_users(data):
   """Check fp 9 - users.
   If the ontology has an active issue tracker and examples of use, PASS.

   Args:
       data (dict): ontology registry data from YAML file

   Return:
       PASS or ERROR with optional help message
   """
   if 'tracker' in data:
       tracker = data['tracker']
   else:
       tracker = None
   if 'usages' in data:
       usages = data['usages']
       # TODO: usages should have a valid user that resovles
       #       and a description
   else:
       usages = None

   # tracker is required?
   if tracker is None and usages is None:
       return {'status': 'ERROR', 'comment': 'Missing tracker and usages'}
   elif tracker is None:
       return {'status': 'ERROR', 'comment': 'Missing tracker'}
   elif usages is None:
       return {'status': 'ERROR', 'comment': 'Missing usages'}
   return {'status': 'PASS'}