DRef(...) match {
case DId(id) => ...
}

requires a unapply(ref: DRef) function in companion object DId
DId is a DatomicData as DRef so it wouldn't be so bad.

case Keyword(...) would require unapply in Keyword.
Keyword is a term and not a DatomicData... so it wouldn't be so good