Associating data with relations

I’d like to be able to associate arbitrary data with a relation, in order to define general rules that act on that data. Something like this:

Fondness relates various people to various people.
It [the fondness relation] has a number called depth.   The depth is usually 5.
It has a text called greeting.  The greeting is usually "Hello, [second noun]".
It has an action called expression.  The expression is usually shaking hands with it.
The verb to be fond of means the fondness relation.

Stanley is fond of Stella.
It [the fondness of Stanley to Stella] has a depth of 10.
It has a greeting of "Hubba, hubba!"
It has an expression of kissing it.

The point of this all is that I don’t want to custom write rules for every particular instance of a relation. I want to write general rules, and annotate particular relations with information and behavior. For example, I’d like to be able to write a general rule saying “when X sees Y in the same location, if X is fond of Y, if the seriousness is >= 5 or X is drunk, X says their greeting. If the seriousness is >=10 or X is drunk and the seriousness is >=5, X tries their expression (possibly on Y, if the expression involves a second noun)”

Is there any sane way to do this without resorting to tables?

I guess I could do something like

Fondness-behavior is a kind of object.
Every fondness-behavior has a person called the fondler.
Every fondness-behavior has a person called the fondled.
Every fondness-behavior has a number called depth.   The depth is usually 5.
Every fondness-behavior has a text called greeting.  The greeting is usually "Hello, [fondled]".
Every fondness-behavior has an action called expression.  The expression is usually shaking hands with the fondled.

Every person has a list of fondness-behaviors called affections.

Fondness relates a person (called X) to a person (called Y) when ... [??? how to express: the X has an affection where the the fondler is Y]

Stanley-to-Stella-fondness-behavior is a fondness-behavior.
The fondler is Stanley.
The fondled is Stella.
The depth is 10.
The greeting is "Hubba, hubba!"
The expression is kissing it.

The fondness-behaviors of Stanley are { Stanley-to-Stella-fondness-behavior }.

Unfortunately, this is still too awkward to associate the behaviors, and then access them in generic rules …

You’re getting into three-way relations, which Inform doesn’t currently support: a badly-written three-way relation such as “relating things to numbers to numbers” could incur monumental storage costs, without it being obvious why. Unfortunately there’s no real alternative which looks good in a natural-language setting, except simulating it yourself (using a table as an adjacency list or adjacency matrix, and custom phrases to get and set values).