INCATools / dead_simple_owl_design_patterns

A simple system for specifying OWL class design patterns for OBO-ish ontologies.
http://incatools.github.io/dead_simple_owl_design_patterns/
GNU General Public License v3.0
40 stars 5 forks source link

Support for combinatorial synonym generation #32

Closed dosumis closed 6 years ago

dosumis commented 7 years ago

TBD: support this in the core spec, or as an extension?

How it could work:

Draft:


definitions:
    combined_text:
       properties:
           annotation_property:  
               description: >
                      The readable identifier of an annotation property
                       to use as a source and a target for combined text.
               type: string
           linker_phrase: 
               description: "Text to use to link text from source terms."
               type: string
           ordering:
               description: > 
                   The names of two vars specifying source terms and their ordering.
               type: array
               items: string
               length: 2  # Limit to linking synonyms from two terms spec'd in pattern?

properties:

    combination_synonyms:
           type: array
           items: 
              $ref: '#/definitions/combined_text', 
              mapping: "oboInOwl:hasExactSynonym"

Examples:

pattern_name: catabolism_to

vars: 
   from: "'chemical_entity'"
   to: "'chemical_entity'" 

name: 
   text: "%s catabolism to %s"
   vars:
      - from
      - to 

def: 
   text: "The chemical reactions and pathways resulting in the breakdown of %s to %s"
   vars: 
       - from
       - to

combination_synonyms:
    - 
       linker_phrase: "  breakdown to "
       ordering: 
           - from
           - to

Challenges: How to combine with manually specified synonyms / allow weeding out of duff combinations. Weeding out presumably only practical for terms that live in the ontology, rather than tsv.

dosumis commented 7 years ago

Hmmmm - Looking at example, I think I've made it needlessly complicated. Can just be a printf like other cases.

dosumis commented 7 years ago

Using existing fields:


annotations:
    - 
        annotation_property: 'has_exact_synonym'
        text: '%s breakdown to %s'
        vars: 
           - from
           - to

We could then define a convenience field with the AP pre-filled:


properties:
   generated_synonyms:
       type: array
       items:  
              $ref: '#/definitions/printf_annotation_obo', 
              mapping: "oboInOwl:hasExactSynonym" 

Example:

generated_synonyms:
    - 
       text: " %s breakdown to %s"
       vars: 
           - from
           - to

This assumes only exact synonyms generated - which I think is safest.

Annotations (e.g. xrefs) can be specified for each axiom.

dosumis commented 7 years ago

Some patterns specify narrow synonyms, +ve reg has:

var synonyms = termgenie.synonyms([ "positive regulation of ",
    "up regulation of ", "up-regulation of ", "upregulation of ", "activation of " ],
    ["EXACT", "EXACT", "EXACT", "EXACT", "NARROW" ],
    x, go, [], label);

(Note: js function is much less verbose (and more OBO-ish) than dosdp here. But synonym type mapping in OWL makes this OBO-ish syntax hard to build on the DOSDP basic spec.)