Scope Automated Check
- Overview
- Open (principle 1)
- Common Format (principle 2)
- URI/Identifier Space (principle 3)
- Versioning (principle 4)
- Scope (principle 5)
- Textual Definitions (principle 6)
- Relations (principle 7)
- Documentation (principle 8)
- Documented Plurality of Users (principle 9)
- Commitment To Collaboration (principle 10)
- Locus of Authority (principle 11)
- Naming Conventions (principle 12)
- Notification of Changes (principle 13)
- Maintenance (principle 16)
- Responsiveness (principle 20)
This page is generated via
_layouts/check.html. See edit guide
Scope Automated Check
Discussion on this check can be found here.
Requirements
- A scope (‘domain’) must be declared in the registry data
Fixes
First, read the FAQ on how to edit the metadata for your ontology. Then, add the following to your metadata file (replacing with your domain):
domain: experiments
Implementation
First, the registry data is checked for a ‘domain’ tag. If missing, that is an error. If it is present, the domain is compared to all other ontology domains. If the ontology shares a domain with one or more other ontologies, we return a list of those ontologies in an info message.
import dash_utils
from dash_utils import format_msg
info_msg = 'Shares domain \'{0}\' with {1} other ontologies ({2})'
def has_scope(data, domain_map):
'''Check fp 5 - scope.
Retrieve the "scope" tag from the data and compare to other scopes in the
map. If domains overlap, return INFO with a list of overlapping domains.
If scope is missing, ERROR. Otherwise, PASS.
Args:
data (dict): ontology data from registry
domain_map (dict): map of ontology to domain
'''
ns = data['id']
if 'domain' in data:
domain = data['domain']
else:
return {'status': 'ERROR', 'comment': 'Missing domain (scope)'}
# This check is excluded for now
# exclude this NS from check (it will match itself)
# updated_domain_map = domain_map
# updated_domain_map.pop(ns)
# if domain in updated_domain_map.values():
# same_domain = []
# for ont_id, other_domain in domain_map.items():
# if domain == other_domain:
# same_domain.append(ont_id)
# same_domain_str = ', '.join(same_domain)
# return {'status': 'INFO',
# 'comment': info_msg.format(
# domain, len(same_domain), same_domain_str)}
return {'status': 'PASS'}