Introducing External Functions in Constraint Query Languages