I have a datastructure that involves rating items, much like Netflix do. Now those ratings are numbers that are attached to relations between objects in a graph database. However, it seems as if attaching properties to relations, not nodes, in UML seems to be a difficult thing to find to do.

To elucidate. Object A rates Object B with a score of 8. So there are two objects that are connected by a relation called "rating" which has a value of 8 on it. Now, I would rather not create a relation for each value (A and B are related by rating score 8) -- this seems like a bad way of doing things. If someone could point me to how to represent this that would be brilliant.


  • 1
    You might consider an Association Class, which is both an association with end points, and a class so it can have members.
    – Erik Eidt
    May 29 '19 at 23:20
  • @ErikEidt, you should add a bit more details and make it an answer. I don't want to take your credits so I will wait for you to do so rather than answering myself.
    – Ister
    May 30 '19 at 6:18

It is an association class. Consider it as a class „C“ that

  • links between A and B
  • has properties, such as the Rating score

You could implement it, for example, by referencing from C to both A and B (and vice versa),

Find some more info for example here and here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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