How should a custom module install a reference data dictionary? I'm about to write a custom module dealing with chemical hazards symbols. It's basically a 300-item dictionary of simple objects: a symbol, its description (around 100 chars) and in some cases a supplementary short information.

I'm still undecided whether I'd make my module a text filter, field or entity, but regardless (I think) of the way I choose, I'm clueless about what would be the Drupal way to install this simple dictionary, a PHP variable, a persistent variable, or a database table?

My guess would be that storing it as PHP variable would not burden the memory too much, it would provide quick lookup access, and would save database queries. Would there be any benefit to choose the table option?

What is limiting me in using taxonomy here is that some terms would have to be supplemented by a piece of information on a binding/instance level. For example, there would be a symbol (term)  P0123: Store in temperatures below %1 C/ %2 F or P2345: Wash %1 thoroughly after handling. For each node referencing that term there should be a possibility to add the precise values that might be different per node. That is the reason I have been thinking of making it a text filter that would parse line:

P0123,10,50 (&lt;- term with supplementary contextual values, %1 and %2)
P2345,en:hands|de:Hande|es:manos (&lt;- i18n-savvy contextual string)
P3456 (&lt;- term without additional info)


I have already filed a feature request for the Relation module, to provide labelling of relationships on instance level. We'll see if the authors consider it as worth implementing for a wider public. For now I'm trying to find a swift workaround.
In D7 I would make a Taxonomy out of such data. Just create a new taxonomy called Chemical Dictionary. Taxonomies already have:


a title
a description field


You just need to add a custom field for the image(s) using the Field UI. You could easily import these things from CSV or a remote database table using the Migrate module if your comfortable with code.

Taxonomy terms are stored in a database table by default in drupal, they are already entities.

While typically used for tagging things, you dont have to use it that way.