who is the office holder whose deputy was gregor mcgregor and predecessor was joseph cook ?
SELECT DISTINCT var_uri where brack_open var_uri dbp_deputy dbr_Gregor_McGregor sep_dot var_uri dbo_predecessor dbr_Joseph_Cook sep_dot var_uri a dbo_OfficeHolder brack_close