get-or-create-definition query