1

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.

Thanks

asked May 29, 2019 at 23:08
2
  • 1
    You might consider an Association Class, which is both an association with end points, and a class so it can have members. Commented May 29, 2019 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. Commented May 30, 2019 at 6:18

1 Answer 1

1

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.

Peter K.
3,8181 gold badge26 silver badges35 bronze badges
answered May 30, 2019 at 16:15

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.