90%: Fix to missing spec regen

This fixes the issue where search docs and tables weren't regenerating properly when a resource changes rdf:type.

It still requires a test, but I'm still trying to figure out exactly the scenario that causes the problem to spec the test off of.
Worth moving these to a function rather than duplicating?