 The limerick that Data quotes, was written by Star Trek writer David  Gerrold. The complete version of the limerick can be found in the  third book of his War Against the Chtorr series: A Rage for Revenge.