[Fix] add rules for saving Graph to database