Optional reference in provided interface implementation

I’m running into the problem that this is not possible in implementation.alan:

'Model': text = $ >'SKU'.'Model'

… because it refers to this part op application.alan:

'SKU': text ~> ^ ^ . 'Catalog' []

… which uses an optional reference (~>). I think the implementation can only deal with mandatory references (->). How to deal with this?

As SKU is an optional reference, >'SKU' may or may not produce a node holding a value for Model. You need to handle the possibility that no value exists for Model. You can do that by specifying a derivation in your application model, which you can then refer to in your implementation.alan:

'Model with fallback': text = switch >'SKU' (
    | node as $ => $ .'Model'
    | none => "<no SKU available>"


'Model with fallback': text = $ >'SKU'.'Model'