i have list of entities which have been extracted from a text.
for example here is my text
"text": "Anarchism is an anti-authoritarian political and social philosophy that rejects hierarchies deemed unjust and advocates their replacement with self-managed, self-governed societies based on voluntary, cooperative institutions."
here is extracted entities from this text.(for each pair first one is entity and second one is its mention in text.
"anchored_et": [["Anti-authoritarianism", "anti-authoritarian"], ["Political philosophy", "political"], ["Social philosophy", "social philosophy"], ["Hierarchy", "hierarchies"], ["Workers' self-management", "self-managed"], ["Self-governance", "self-governed"], ["cooperative", "cooperative"]]
besides that i have list of triples which their subject and objects are in wiki data QID format.
so i need first to convert extracted entities to their QID then finding triples which their subject is like that and after finding these triples i need to convert object QID to its entity.
so i need to convert wiki data QID to entity and vice versa in python.
my question is how can i do that.