WormBase / pseudoace

Modelling the WormBase ACeDB database in datomic.
4 stars 3 forks source link

ENUM attributes: Those intended to be translated to components do not convert as intended #75

Open mgrbyte opened 7 years ago

mgrbyte commented 7 years ago

When a ENUM tag in the annotated ACeDB models is marked with a hash-model (e.g #Evidence), the data is not migrated since the ENUM will result in an ident, which is not a referenable construct (in it's own right) in datomic (i.e it is a :db.type/keyword not a :db.type/ref) The example cited that @a8wright ran into recently was :molecule.biofunction-role/value, whose annotated source is here,

The result (datomic entity api usage shown below in a clojure REPL session):

pseudoace.cli=> (->> mol :molecule/biofunction-role (map d/touch)
           #_=> )
({:db/id 12134210419605054, :molecule.biofunction-role/value :molecule.biofunction-role.value/metabolite, :molecule.biofunction-role/text "Paper_evidence"})
mgrbyte commented 7 years ago

Requires re-working the construct used in the annotated models not to use ENUM if the data captured in #Evidence needs to be maintained, or otherwise solved by re-modelling.

mgrbyte commented 7 years ago

Updates on this:

https://github.com/WormBase/website/issues/5687 https://github.com/WormBase/wormbase-pipeline/issues/61#issuecomment-308744523

Headline: only some usage of ENUM are effected; those where the enumerated value is followed with both a reference and a hash.