Bug fix on resource name resolving + use relation on definition