Augmented model file - WormBase/db-prototypes GitHub Wiki

The Pseudoace schema generator uses an "annotated" model file, being maintained in parallel to the standard ACeDB model file. The syntax is very similar, but it has a few additions in order to smooth migration to Datomic.

Alternate name annotations

Any node in the model can be annotated with an alternate name which can be used in the new database. Alternate names are indicated with a caret (^) and apply to the node before them, e.g.

   ?MyClass ^magic  Foo Text
                    Bar ^description Text

...will result in a Datomic schema with attribute idents:

    :magic/id     ;; auto-generated class-membership identifier
    :magic/foo
    :magic/description

XREF directionality

"Outbound" ends of XREF links should be marked "OUTXREF". "Inbound" ends should be marked INXREF.

FILL_DEFAULT

An extra attribute to indicate that importers should fill in a default value if a tag is present in ACeDB without a value, and it is suspected that the presence of the tag is "interesting" even in the absence of any value. This is probably an indication that we should be re-thinking the data model further.

ENUM

A hint that the immediate children of the previous tag should form the keys of an enum. These tags may themselves have children (the "augmented enum" case) but it may (should?) cause a schema-generation-time error if the augmentations differ between keys. For example:

  ?Gene Identity Status ENUM ^status Live #Evidence
                                     Suppressed #Evidence
                                     Dead #Evidence

yields a Datomic schema such that gene status can be stored like:

    {:db/id [:gene/id "...]
     :gene/status {
     :gene.status/status :gene.status.status/live
     :evidence/remark "And believe me I am Still Alive."}}

There is also support for multi-level enums e.g.:

  ?Interaction Type ENUM Physical
                         Predicted
                         Regulatory Change_of_localization
                                    Change_of_expression_level

yields the following key-entity idents in Datomic:

   :interaction.type/physical
   :interaction.type/predicted
   :interaction.type/regulatory
   :interaction.type/regulatory:change-of-localization
   :interaction.type/regulatory:change-of-expression-level