It's called the principle of "mitigation of damages." Under this common-law principle, the plaintiffs in a case could have any damages diminished or eliminated if it can be demonstrated that the person in question (the victim, in this case) knew the risks involved in the incident and had an opportunity to mitigate or eliminate them, but chose not to.
In other words, the city's strongest defense in this case would be: "It is commonly known that we have been a 'sanctuary city' for years. If this was a problem for the victim, she should have lived somewhere else."
Doesn't the idea of mitigation of damages imply reasonable mitigation actions? Mitigation of damages doesn't require extraordinary mitigation efforts. If I were an attorney, I would be willing to let a jury decide if moving away from the city is a reasonable mitigation expectation. Assuming you can find 12 reasonable people in SF (a big assumption), I guessing the jury would say no.