Roles and Relationships in Object-Oriented Programming, Multiagent Systems and Ontologies