This is an interesting comparison. Let's first consider the role of the Sun in "The Allegory of the Cave." Plato states that most people live life as if they are trapped in a cave, able to face one wall. They know nothing of what is behind them, let alone the world outside the cave. If one were able to unchain him/herself and get outside the cave, he would be blinded and/or totally bewildered by the Sun. The Sun represents absolute truth and that truth would be so brilliant and incomprehensible that the former cave dweller would have to struggle to understand. Most would prefer the familiarity and simplicity of life in the cave. It would take a bold, determined philosopher to make the journey to the outside: to absolute truth. Plato adds that if, once the philosopher has adjusted and learned the nature of absolute truth (the Sun), he might go back into the cave and try to enlighten the others still chained inside. However, they might take his explanation of the Sun/truth as the ramblings of a madman. They might ostracize or even kill him. (This is precisely what happened to Socrates.) It is risky to go out of the cave, let alone come back in. The person who leaves the cave must have some insatiable desire for truth. If he leaves, it must mean that this desire (or courage) outweighs any fears he has of being hurt, going crazy, or being ostracized by the community.
Giovanni has a similar predicament. He has an insatiable desire for Beatrice and a desire to know the truth of her life. He knows the risks but goes anyway. It is a struggle and at one point he suspects that Beatrice has lured him out to contaminate him. But this is not the case. She simply wants to be loved. In the end, Rappacinni's greedy ambition to conquer nature ends up killing his daughter. What is the lesson or the truth that is learned? Maybe it is that man's desire to technologically tame nature is doomed to fail. Maybe it is something more fundamental: that love is more powerful than power itself. (In this case, that is to say that love is more powerful and desirable than being able to kill all other living beings.) Beatrice knows this and expresses it in the end, saying to her father, "I would fain have been loved, not feared."
This is what Giovanni learns by having the courage to go outside, to pursue his desire, even though there are risks to himself and others. This story has a tragic ending, but it shows how discovering truth is sometimes difficult. Each person has his or her comfort zone. Leaving a place of familiarity takes some courage. Whether you are seeking knowledge, desire, or some other end goal, if the road is paved with new experiences, potential drawbacks, or even public scrutiny, it will be a difficult road. This is the thesis I see developing here. Exploring, proclaiming, or exposing a truth that others might not understand will be a difficult process. It necessitates moving from one's comfort zone. But in most cases, pursuing truth is better than remaining in ignorance.