The aim of this project is to specify a simple OWL design pattern system that can easily be consumed, whatever your code base.
Project description
Dead simple owl design pattern (DOS-DP) exchange format
For details please see:
Dead Simple OWL Design Patterns David Osumi-Sutherland, Melanie Courtot, James P. Balhoff and Christopher Mungall Journal of Biomedical Semantics 2017 8:18 DOI:10.1186/s13326-017-0126-0
Motivation
The job of editing the GO and many other OBOish OWL ontologies increasingly involves specifying OWL design patterns. We need a simple, light-weight standard for specifying these design patterns that can then be used for generating documentation, generating new terms and retrofitting old ones. The solution must be readable and editable by anyone with a basic knowledge of OWL and the ability to read manchester syntax. It must also be easy to use programatically without the need for custom parsers - i.e. it should follow some existing data exchange standard.
Human readability and editability requires that Manchester syntax be written using labels, but sustainability and consistency checking requires that the pattern record IDs.
Approach
-
Patterns are specified in the subset of YAML that can be converted to JSON.
- JSON format is the ideal exchange format for programatic consumption: It is already javascript; Standard libraries are available to convert it into datastructures in many languages;Developers are typically experienced at consuming it.
- But YAML is much easier than JSON for humans to edit (it can be difficult for human editors to keep curly braces and quotes balanced and to add commas correctly in JSON). YAML also has the great advantage over JSON of allowing comments to be embedded. Conversion between YAML and JSON is trivial
-
All patterns contain dictionaries (hash lookups) that can be used to lookup up OWL shortform IDs from labels. OWL ShortFormIDs are assumed to be sufficient for entity resolution during usage of the pattern. Labels are assumed to be sufficient for entity resolution within a pattern.
-
Variable interpolation into Manchester syntax and text is specified using printf format strings. Variable names are stored in associated lists.
-
Variables are specified in a dictionary with variable name as key and value as range specified as a Manchester syntax expresssion.
Specification:
Full specification using JSON-schema.
The following is a quick guide to commonly used fields, with an emphasis on OBO-specific (derived) fields:
Manchester syntax expressions use names (labels). These are always single quoted inside an expression that is double quoted. (Note single quotes in term names must be escaped).
- pattern_name (string): the name of the pattern. No spaces or special characters allowed.
- description(string): Text describing the pattern and its uses. For use in documentation - not in OWL files.
- classes (associative array): hash lookup for OWL classes used in the pattern. key = name, value = ID
- relations (associative array): hash lookup for OWL object properties (relations) used in the pattern. key = name, value = ID
- vars (associative array): a hash lookup for vars in the pattern, key = var name, value = range expressed as manchester syntax.
- name (associative array):
- text (string): sprintf label text
- vars (string): list of vars for interpolation of class names into sprintf of text.
- def (associative array):
- text (string): sprintf definition text.
- vars (array): List of vars for interpolation of class names into sprintf of text.
- comment(string)
- EquivalentTo (associative array):
- text (string): Sprintf OWL Manchester syntax string. All OWL entities must be quoted; %s not quoted).
- vars (array): List of vars for interpolation into sprintf owl MS text.
Draft yaml example - import_into_cell
Draft json example - import_into_cell
Validator spec
Basic validation
- test converstion of YAML to JSON
- validate against JSON schema (e.g. see test_schema.py)
Recommendations for additional validation outside of JSON schema:
-
For all printf fields,
- test length of var array matches number of interpolation slots in string
- test that all var names are valid for the pattern
-
For printf_owl fields:
- Check quoted names in the printf field correspond to dictionary entries in the pattern.
-
Tests against referenced ontologies:
- Are the entities in the dictionaries present and non-obsolete in the latest releases of the relevant ontologies?
- Are the readable names up to date ?
- For all printf manchester syntax strings: Is a valid Manchester syntax string generated when variable slots are filled using the range for each variable?
-
Validation when creating instances:
- Are values for variable slots present and non-obsolete in the latest releases of the relevant ontologies?
- Are values for the variable slots in the specified range?
Implementation
The aim of this project is to specify a simple design pattern system that can easily be consumed, whatever your code base. This repository includes a simple Python validator (src/simple_pattern_tester.py).
For implementation, we recommend dosdp-tools.
Uses
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dosdp-0.1.0.dev1.tar.gz
.
File metadata
- Download URL: dosdp-0.1.0.dev1.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79b508b17945786f12f4f3f7bd1ab50db69687253c4d61fd9fbbb57bf6059b5f |
|
MD5 | 3d063d58bb8da81385853f04fbe8adbd |
|
BLAKE2b-256 | 6c0f233e508f13a54f58ee5a7f214423635e5a694f5c6e1c974178b64b6210fb |
Provenance
File details
Details for the file dosdp-0.1.0.dev1-py3-none-any.whl
.
File metadata
- Download URL: dosdp-0.1.0.dev1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f25dcda7b280f5fbda5954716e44a7ab891433486d4da0062f2630c390a9ae19 |
|
MD5 | aafc6d40b29545f8d62dca20d505448c |
|
BLAKE2b-256 | d72e912ab38f93428a46417cdfe0bc62e23782a3e65ec2c3ef14570beb895b3c |