My current solution to this problem is just putting a JSONB column in relevant tables. GIN indexes do the heavy lifting as needed.
This lets us implement arbitrary, queryable ontologies on top of the data without requiring further database instrumentation (aside from creating an index now and then).
This lets us implement arbitrary, queryable ontologies on top of the data without requiring further database instrumentation (aside from creating an index now and then).