Fetching details from the dictionary...
(for something) to have occurred; to have done (something)
(for something) to happen on occasion
京都に行ったことがある。
I have been to Kyoto.
彼女と話をしたことがあります。
I have spoken with her before.
子供の頃、熊に遭遇したことがあった。
As a child, I had once encountered a bear.