read template from kdb