refactored HasIRI to IRI as a function

This can be used in a smorgasbord of places. More to come.