One may have compassion for someone whose rights have not been violated. Justice is connected closely with the dignity of human beings. This dignity is connected with the kind of being humans are. The appropriate emotional response to injustice is indignation, which is connected etymologically with dignity. Philosophers have questioned whether one can be unjust toward lower animals.
Compassion is a response to suffering.
Humans can suffer in complex ways because they are complex creatures, and one of the ways in which they can suffer, and in which other members of the animal kingdom arguably cannot, is to have their rights violated. Nonetheless, humans can suffer in ways unrelated to their particular status as moral agents, and compassion is a response to suffering in all its aspects. Since humans are not the only beings capable of suffering, human beings are not the only beings who are appropriate objects for compassion. Thus, the domain of compassion is wider than that of justice. I have argued above that compassion is a virtue of character, a beneficial character trait.