Add more checks on results that can be null to avoid using them or throw
exceptions as appropriate
Remove check that is not necessary by contract

if there is no ontology, or it is not found, then all ontologies are
used