In this paper we address the problem of automatic design of the abstract structure of a robot. The design is driven by the desired capabilities that the robot should be able to perform. To this aim, an extension for the IEEE Standard Ontology for Robotics and Automation has been developed. We present an intelligent system which infers abstract robot morphologies from this ontology by relating robot actions to necessary structural parts. Then, these abstract structures can be materialized into physical robots that are able to perform requested capabilities. We show this implementation using a modular robotics platform as a demonstrator.