A method, comprising: receiving, by a device, a knowledge graph and a predefined parameter, wherein the predefined parameter includes a k-anonymity value associated with a k-anonymity model to be applied to the knowledge graph; processing, by the device, the knowledge graph to select a set of triples in the knowledge graph, each triple in the set of triples including a quasi-identifier relation; generating, by the device, an equivalence first class based on the set of triples in the knowledge graph; determining, by the device, a quantity of quasi-identifier attributes in the equivalence first class; comparing, by the device, the quantity of quasi-identifier attributes to the predefined parameter to generate a first comparison; embedding, by the device, the knowledge graph to generate an embedding space representation; identifying, by the device, a similar neighbor second class, wherein the similar neighbor second class is determined as a nearest equivalence class for the equivalence first class; determining, by the device, a first quantity of nodes in the first equivalence class and the similar neighbor second class; comparing, by the device, the first quantity of nodes in the first equivalence class and the similar neighbor second class to the predefined parameter to generate a second comparison; identifying, by the device, a similar neighbor third class, wherein the similar neighbor third class is determined as a nearest non-group individual in the embedding space representation for each individual in each equivalence class; determining, by the device, a second quantity of nodes in the first equivalence class and the similar neighbor third class; comparing, by the device, the second quantity of nodes in the first equivalence class and the similar neighbor third class to the predefined parameter to generate a third comparison; and merging, by the device, the similar neighbor second class or the similar neighbor third class with the first equivalence class, based on the first comparison, the second comparison, and the third comparison, to generate anonymized nodes for the knowledge graph. receiving, by a device, a knowledge graph and a predefined parameter, wherein the predefined parameter includes a k-anonymity value associated with a k-anonymity model to be applied to the knowledge graph; processing, by the device, the knowledge graph to select a set of triples in the knowledge graph, each triple in the set of triples including a quasi-identifier relation; generating, by the device, an equivalence first class based on the set of triples in the knowledge graph; determining, by the device, a quantity of quasi-identifier attributes in the equivalence first class; comparing, by the device, the quantity of quasi-identifier attributes to the predefined parameter to generate a first comparison; embedding, by the device, the knowledge graph to generate an embedding space representation; identifying, by the device, a similar neighbor second class, wherein the similar neighbor second class is determined as a nearest equivalence class for the equivalence first class; determining, by the device, a first quantity of nodes in the first equivalence class and the similar neighbor second class; comparing, by the device, the first quantity of nodes in the first equivalence class and the similar neighbor second class to the predefined parameter to generate a second comparison; identifying, by the device, a similar neighbor third class, wherein the similar neighbor third class is determined as a nearest non-group individual in the embedding space representation for each individual in each equivalence class; determining, by the device, a second quantity of nodes in the first equivalence class and the similar neighbor third class; comparing, by the device, the second quantity of nodes in the first equivalence class and the similar neighbor third class to the predefined parameter to generate a third comparison; and merging, by the device, the similar neighbor second class or the similar neighbor third class with the first equivalence class, based on the first comparison, the second comparison, and the third comparison, to generate anonymized nodes for the knowledge graph.