INCATools/dead_simple_owl_design_patterns

Support for combinatorial synonym generation

Closed this issue · 3 comments

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

How it could work:

  • List of objects, each specifying:
    • AP
    • Linker phrase
    • specification of ordering to be used in combination.

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.

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

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.

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);
  • To support this we should change draft spec to have variants: generated_exact_synonyms; generated_narrow_synonyms etc

(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.)