Is it possible to use semantic tags in UML associations (among classes) to express the wider semantic nature of the relationship?

For example, consider the relation that Doctor TREATS Patient. Beyond the TREATS relation, we also want to express that it's a medical and humanitarian relation. Is it possible to somehow tag the association between Doctor and Patient with these two additional tags in UML?

Also, consider the example of a Doctor's relation with another Doctor. We want a model where a Doctor can have multiple (semantic) relations such as Professional, Social and many other relations with another Doctor.

  • 1
    Welcome to stack exchange. In (lightweight) domain modeling with UML, the relationships between conceptual (problem domain) classes are semantic. I don't see any reason why you couldn't tag the associations as you suggest. However, since real-world semantics come with lots of complexity, it's advised not to add things to a domain model that won't be part of the software that's being developed. It's to avoid analysis paralysis and to make sure the software isn't bloated. Be sure what value the tags are adding to your software. Idem for relationships among doctors. Sep 12, 2018 at 13:33

1 Answer 1


I'm not sure that UML was designed for this purpose.

You can define an UML profile and define a set of stereotypes. You can then tag each element of a diagram with one or several stereotypes (e.g. « social », « professional », ...).

However, these "tags" are not meant to scale ad infinitum, unless you'd use them in a non standard way. Stereotypes are more used to customize UML for domain specific needs. So I'm not sure it's the best way to go.

You could as well consider to manage a simpler (in terms of syntax) model, using a semantic net enriched with your own tagging system. I'm not an expert of this field, but I think you'd then have the flexibility to combine your model with data formats designed for semantic networks and knowledge management.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.