script to filter ontologies