Let's assume that a Grakn KG contains entities of type 'product' and that they are uniquely identified by the key 'id_prod'. As I understand it, the attempt to insert an instance of product with a repeated id_prod will generate an error.
Assuming that the insertion is being done through a console script, how could the previous existence of the instance be checked with graql during the insertion? And via the python client, are there any special recommendations or patterns to follow?