A West Yorkshire Police officer started an inappropriate sexual relationship with a woman he met when attending a domestic violence incident, a court has heard.