In this paper, we propose an abstract domain-neutral architecture for a cognitive digital twin (CDT) and a software platform to develop such CDTs, including machine reasoning capabilities. Sustainable development refers here to an abstract model that enables a holistic view of limiting resources and has an ability to adapt to different application domains while reusing existing resources. The proposed solution allows for a unified abstract representation and the development of a wide range of diverse digital twins, as well as facilitating their interoperability. The abstract architecture consists of a four-layer structure (observation/actuation layer, data management layer, reasoning layer, and simulation layer) with an upper ontology to which the domain ontology of the specific CDT is mapped. The architecture relies on semantic web technologies, including ontology-based reasoning using OWL, and a loosely coupled, component-based service-oriented software architecture. The platform utilizes a microservice architecture that enables separate, loosely coupled services on each layer, message queues to provide asynchronous communication, and possesses cloud technologies to achieve scalability. The proposed approach was validated by implementing a software platform prototype and demonstrating its key features through two dissimilar scenarios. The first scenario demonstrates simple sustainable energy management through IoT systems inside smart buildings, while the second one demonstrates knowledge quality management based on knowledge space theory.