Massive distributed cooperative computing in networks involves marshaling large collections of network nodes possessing the necessary computational resources. In order for the willing nodes to act in a concerted way they must first discover one another. This is the general setting of the Resource Discovery Problem (RDP). There are solutions for this problem that achieve impressive efficiency in the absence of failures, however, their correctness and performance cannot be guaranteed in the presence of failures. In practical environments it is important to have solutions that can cope with intermittent failures, and, in particular to design self-stabilizing algorithms for the problem. This paper presents a self-stabilizing algorithm that solves RDP in a deterministic synchronous setting. The approach is formulated in terms of evolving knowledge graphs, where vertices represent the participating network nodes, and edges represent one node's knowledge about another. Ideally, the diameter of such a graph is one, i.e., each node knows all others. The algorithm works in rounds as it evolves the knowledge graph by nodes sharing knowledge through gossip messages with the goal of reducing its diameter. We prove that the algorithm is self-stabilizing, that is, the algorithm is able to tolerate arbitrary perturbations in the nodes' local states and is guaranteed to solve the problem once such failures subside. We show that the algorithm has stabilization time of O(logD), and it takes at most 2logD + 10 complete round to stabilize, where D is the diameter of the initial knowledge graph. The corresponding message complexity is O(|V|2·logD), where V is the set of participating nodes.