UML Papyrus association notation - associations

I am creating an UML class diagram on Papyrus but I can't understand the notation used for associations.
When an association is set to be navigable, the tool adds a black dot on the tip of the arrow as default notation. I was able to remove the dot by changing the member end owner from classifier to association.
What is the conceptual difference between the two? I can't find any discussion on the concept of classifier in my UML book...
Thank you!!
PS: I'm using papyrus 4 on Eclipse Juno

If you know that the class A has some way of referencing B, by some function or attribute reference, for example, you make arrow from A to B. The instance of B is NAVIGABLE from A, but probably is not an attribute of A.
If you know that an of attribute A is one or more references to B instance, you can draw not only arrow, but also the "dot" at its end.
Very often people simply use arrow in both cases. But strict use of the dot can provide additional information.

As described in this UML Association Reference, the black dot's semantic is :
It could be interpreted as showing that the model includes a property of the type represented by the classifier touched by the dot
(See the link for more information)

Related

Show multiple free text compartments

I'm using Rational Rhapsody Architect for Systems Engineering to implement a domain-specific modeling language my team has designed. I'm building it as a profile that extends the SysML profile.
We have a metaclass that we've implemented as a new term stereotype applied to Class and generalized from Block.
I'd like to have multiple compartments with different names, that can display arbitrary text entered by the modeler in a Block Definition Diagram.
So far, only the Description compartment will display free text.
I can create an approximation by implementing a new term stereotype applied to Constraint. The specifications for those constraints are also free text and they appear in the diagram, but there are two problems: they are restricted to single line, and I can't seem to hide the stereotype name.
Do I have any options?

Entity Relationship Diagram - ISA direction

In ERD I am used to see something like:
But I ran into some cases where the triangle is upsidedown, like:
So I wondered, does the direction of the ISA triangle matters? It seems only logical that the pointy vertex would point at the parent, and inheritants would go from the edge itself.
There's no inherent meaning in the orientation of the triangle. In your examples, they mean exactly the same thing. Different tools might implement it differently, and there are other conventions for subtyping besides triangles.
I suggest you pick the more popular convention and stick with it.

Represent HashMap in class diagram

I have a class diagram which has a dictionary (in python terms) as an attribute. This is the basic structure:
serverEntry = { creditCardObj1 : accountBalance1, creditCardobj2 : accountBalance2, ...}
To clarify, creditCardObj1 is an instance of a class CreditCard while accountBalance1 is an integer value and similarly for the other entries in the dictionary.
I read that in Java, it is called HashMap. In any case, I would like to implement it in my UML class diagram. Any tips on how to do that. I am using Visio 2007 so it would even more helpful if someone can explain in terms of that.
I won't put much effort into this, as another answer has been chosen already. That answer does not cover the closest thing in UML to a HashMap: the qualifier. It is drawn as a rectangle between a class and an association. Inside the rectangle is a name and a type. What it means is that given an instance of that type, the association will yield some number of instances of things on the other end of the association. That number of instances is specified with a multiplicity.
For your purposes, you would put creditCard: CreditCard inside the qualifier rectangle, and Integer on the other end of the association, with a multiplicity of 1.
I believe that this question is more about UML than about the programming language. Thus, please allow me to use the language I feel more comfortable in.
C# calls it Dictionary too, Dictionary<string, T> for example with a string for the HashKey. The UML Class Diagram in Visual Studio (I am using the Community Edition of VS 2015 here) is fortunately close enough to code so that the UML Model basically is the language's meta-model and the diagram is just a different view to the real code.
This comes in handy because real programming problems - like the one you asked for - can be addressed directly in the diagram. (Also: no extra code generation or additional parsing necessary to get or maintain the diagram).
I like the way Visual Studio solved this. They offer two options, one that is focussed more on the technicalities (show as Association)
and one that is focussed more on the domain (show as Collection Association).
I am usually using the first one only if I need the diagram to emphasize that the Dictionary class is involved, in every other case the second option is my preferred option.

What are the symbols for specializations and generalizations etc. in crow foot notation

My university is forcing me to learn from a terrible textbook on ERD's, in which they are using a notation I personally don't like because I've never seen it used before (the book is so bad it doesn't even say what notation they're using), and I like learning it using a more common notation. Therefore I chose to learn it using the crow foot notation. (Please enlighten me if you think this is a bad decision)
Now the textbook is covering is-a(n) relationships (a.k.a. specializations/generalizations) and I'd like to know how I have to represent one in a consistent way with martin/crow foot notation... I learned about it thanks to a yt video (https://www.youtube.com/watch?v=MTG1zl8PkXk) but I noticed he's not using the same notation I'm using.
So how do I represent a specialization or generalization in crow foot notation? Or is crow foot notation only specific to cardinality? In my textbook, a few pages ahead, I also see concepts like multidimensional relationships (entity A has the same relation with entity B as with entity C) and relationships that refer to the same entity itsself (so 1 employee can hire multiple other employee's). Extra much love if you can show me how I should draw those as well :)
Unfortunately I could not find much information on this using search engines...
Try searching on "EER Diagram PDF". You'll get more images than you can shake a stick at. Some of them use crow's foot notation. Others don't.
The extra "E" stands for "Enhanced". This has to do with the fact that the original ER model did not have modeling conventions for Gen-spec (superclass/subclass) or for unions.
Unlike most people, I prefer to make a sharp distinction between diagrams that depict an ER model and ones that depict a relational model. Contrary to prevailing opinion, ER modeling isn't just "relational lite". It's a different model, with different purposes. You can look up the history if you are really interested.
I tend to use crow's foot notation in ER diagrams, and I always leave out junction boxes and foreign keys. This makes the diagram more useful for stakeholders who want to see the big picture.
I like arrowhead notation for relational diagrams. Foreign keys and junction boxes must be included in relational diagrams. They are part of the model, and implement relationships.
As far as a relational table design for gen-spec, I don't think you can beat Fowler's treatment of the subject. Try searching on "Fowler Class Table Inheritance" for an entry point into this aspect of the topic.

Measuring distances among classes in RDF/OWL graphs

Maybe someone could give me a hint. Is it possible to measure the distance between 2 concepts/classes that belong to the same ontology?
For example, let's suppose I have an ontology with the
Astronomy class and the Telescope class. There is a link between both, but it is not a direct link. Astronomy has a parent class called Science, and Telescope has a parent class called Optical Instrument which belongs to its parent called Instrumentation, that is related to a class called Empirical Science that finally belongs to a class called Science.
So there is an indirect link between Telescope and Astronomy, and I want to find out the number of steps needed to reach one class starting from the another one.
Is there an easy SPARQL query that resolves that question? Or are there better ways to do that job? Or is not possible to find that out using Semantic Web paradigm?
Any hint will be very appreciated.
SPARQL provides the ability to search for arbitrary length paths in a graph but no mechanism to tell you the length of that path.
So you can do something like:
SELECT * WHERE { ?s ex:property+ ?o }
The syntax is very much like regex so you can do alternatives, restricted cardinalities etc
In my understanding SPARQL doesn't contain any recursive constructions to be able to measure indirect link of arbitrary length. The best you could do is to prepare set of queries distance_1(a, b), distance_2(a, b)... to check for specific distance between two concepts.
Another alternative is to discover this information using non-SPARQL technology, for example writing graph traversing algorithm in Python with RDFlib.
Since you explicitly mentioned that you are talking about classes and they will be in the same ontology, it is safe to assume that they will be always connected (because ultimately both will be a subclass of "Thing", right?). On the other hand, the path I mentioned in the parentheses (Class1 -> ... -> Thing <- ... <- Class2) is a trivial one, so I assume you want to find... all of the existing paths between two classes, in other words, all of the existing paths between two vertices. Is that true? Or are you looking for the shortest path? Your question is not very clear in that aspect, can you clarify it?
As far as I know there is no simple SPARQL construct that will list all the paths between classes or the shortest path. However some semantic web triple stores come with graph traversal algorithms such as breadth-first-search or depth-first-search, please refer to:
http://www.franz.com/agraph/support/documentation/current/lisp-reference.html#sna
You may also find the source code of the following project very useful:
RelFinder, Interactive Relationship Discovery in RDF Data, http://www.visualdataweb.org/relfinder.php

Resources