How to design database for polymorphic relationships
I would design a meta-data/value based model, as:



Or, where formality is enforced,



Being AttributeCode and ValueCode unique, textual, human-readable identifiers, alongside the corresponding AttributeId and ValueId.

For instance, the hypothetical meta-attribute length, physically stored with AttributeId = 1, would (should!) be referenced in specific queries as AttributeCode = 'LENGTH'.

(of course, AttributeCode and ValueCode could compose the PKs... but I personally prefer PKs columns to be integer-only)