Recently I wanted to remove unused classes and properties because I wanted to use the NestedDataTypes module, but got an out of memory (see issue) because I had loaded the large schema org vocabulary (625 classes, 898 properties).
Examining the database table I found Omeka-S keeps track of the classes and properties used. With this knowledge I constructed the following query to delete unused classes and properties from my imported schema org vocabulary (in my case vocabulary_id 5):
DELETE FROM `resource_class` WHERE `vocabulary_id` = 5 AND id NOT IN
(SELECT DISTINCT (resource_class_id) FROM resource where resource_class_id>0);
DELETE FROM `property` WHERE `vocabulary_id` = 5 AND id NOT IN
(SELECT DISTINCT(property_id) FROM `value` WHERE property_id>0);
I did make a backup of the complete Omeka-S database first, because my assumptions could be wrong. But I found these 2 SQL statements worked in my case.