THE trial of Graham Dwyer has heard allegations that he had an "unusual" relationship with Elaine O'Hara.
Text messages allegedly sent between the pair outlined fantasies and a relationship that allegedly involved what is called BDSM - Bondage, Domination, Sadism and Masochism.
The jury has been told that their alleged relationship featured acts of stabbing by the accused on Ms O'Dwyer.
It is the prosecution's case that Mr Dwyer "very nearly" committed the perfect crime when, it is alleged, he killed Ms O'Hara for his own sexual gratification.
Ms O'Hara, who disappeared on August 22, 2012, on the day of her release as a psychiatric patient from St Edmundsbury Hospital in Lucan, was "almost the perfect victim," Sean Guerin SC said.
Over the course of the next six to eight weeks the prosecution will seek to prove its case to a jury of seven men and five women.
So far, the jurors have heard two days of evidence, including Mr Guerin's lengthy opening speech in which he set out the case against Mr Dwyer.
The Central Criminal Court has also heard from Ms O'Hara's father Frank, the Deputy State Pathologist Dr Michael Curtis, some of Ms O'Hara's co-workers from a newsagent in Blanckrock and a pharmacist who filled her last prescription on the day she disappeared.
In his opening address, Mr Guerin told the jury that Elaine's partial skeletal remains were found by a dog walker in the Dublin mountains more than a year later, on September 13, 2013.
By "coincidence" in the same week, fishermen at Vartry reservoir in Wickow had pulled handcuffs and rope from the water and alerted gardai who then discovered Ms O'Hara's keys and supermarket loyalty cards.
Texts were recovered from two mobile phones which the prosecution alleges had been used by the accused and Ms O'Hara before her death.
It is contended by the prosecution that the accused and Ms O'Hara had a relationship, that it involved BDSM and that a central feature was acts of stabbing by the accused on Ms O'Hara.
This reflected "a deep seated, passionately held, irrepressible desire on the part of Mr Dwyer to get sexual gratification by stabbing a woman", the prosecutor said.
The accused had a "huge urge to kill and stab" and had taken advantage of Ms O'Hara's mental illness, Mr Guerin told the jury.
One text allegedly sent by Mr Dwyer said: "My urge to rape, stab and kill is huge. You have to help me control or satisfy it.
The prosecution's case would be that the accused "manipulated and groomed" Ms O'Hara to normalise the idea of stabbing.
Mr Guerin alleged that Ms O'Hara "had to believe that he was pretending to kill her" and that it was the "perfect cover for what he was going to do".
"There was every reason for it to look like suicide," he added.
Yesterday the packed courtroom heard evidence from those who knew Ms O'Hara best - her family and friends.
Her father Frank O'Hara told how he was "shocked" when his daughter revealed details of her sexual relationship with a married architect.
"She said 'He ties me up and m*********s over me, but we haven't had sex.'"
Mr O'Hara told the court that the last time he saw his daughter was when they visited his late wife's grave in Shanganagh Cemetery on August 22, 2012.
She called to his home in Killiney between 1.30pm and 2pm and they drove, along with his granddaughter, to Shanganagh Cemetery.
"Elaine was in the car texting. I don't know who she was texting," Mr O'Hara said.
"I remember telling her 'could you to put the phone away for a while?'"
Mr O'Hara told the court that his eldest daughter left his home after 4pm as she was preparing to volunteer at the Tall Ships Festival the next day. He said she was "in extremely good form".
Mr O'Hara said he can still visual seeing his daughter standing in the doorway, as he held his grandchild in the hall.
Ms O'Hara failed to turn up at the Tall Ships event, and when her father didn't hear from her all day, he texted her at 11.30pm.
"Ironically," he said, he texted the words "are you alive?"
When there was still no sign of Ms O'Hara, her father began making enquiries and informed the gardai that she was missing.
The court heard that Ms O'Hara began encountering mental health difficulties in her teen years after she was bullied and a friend was killed in a road accident. She began self-harming aged 16.
She was described as a trusted employee but someone who said things "to shock".
Ms O'Hara is alleged to have confided in colleagues that she was involved with a married man. She allegedly told colleagues at one point that she thought she "might be pregnant".