📜 ⬆️ ⬇️

Features of conceptual domain modeling

I continue a series of articles on the peculiarities of conceptual modeling of subject areas. In the last article I showed. how it is possible to associate an object with a class of objects by a semantic link. In the article I talked about what is meant by the term class in the PLO. Today I will explain why I prefer to build conceptual models in the form of ER diagrams.

Let us need to model the thesis that each car has 4 wheels. Not a group of four wheels, namely, - 4 wheels.

In terms of the ER model, it is customary to say that there is a car, there is a wheel and there is a connection between the car and the wheel. This connection is called "wheel-car" and has a ratio of one to four. The link readable from the wheels is called: “stands on”; the link read from the car is called: “has.”
')


In OOP terms, they say: there is a class of OOP cars and there is a class of OOP wheels. There is a one-to-four relationship between these OOP classes. The link is called: "car-wheel". The link readable from the wheels is called: “stands on”; the link read from the car is called: “has.”



Let's look carefully at the subject area and write what the representation of the domain model will look like in terms of the logical paradigm.

In the logical paradigm there is a term class TM, which coincides with the definition of a class in mathematics. This definition is very similar to the definition of a set, and a set, in turn, is a group of objects. So, we have a lot of cars and lots of wheels. Each car has 4 wheels connected by car-wheel semantic links. Thus, each car has 4 wheels and 4 semantic links. The semantic link in the logical paradigm is written in the form of a tuple: (Car number 123; wheel number 234). All tuples belong to a class, or a set of tuples. It is united by many semantics: “There is a wheel on a car”. Between a particular wheel and the car on which the wheel is installed, only one semantic link is established. This relationship is one to one. How, then, to say that 4 wheels are installed on one car? In the logical paradigm, this is pronounced as follows: for each car there are 4 links to the wheels in the semantic link class called “The car has a wheel”, for each wheel there is only one such link in this class.



Thus, to simulate a car, we needed 4 connections between a car with a wheel, and not one, as in the case of the ER model, and not one, as in the case of a class diagram. This is logical: one car has 4 wheels. In the diagram, arrows indicate the relationship "classification".

Is there a semantic link between the TM class of cars and the TM class of wheels? In this formulation of the problem - no. There is a class of connections between cars and wheels, but there is no connection between the TM class of cars and the TM class of wheels.

Consider now another task. Let it be necessary to simulate the fact that cars have a group of wheels. Not wheels, but a group. In mathematics, the term set is responsible for defining a group. In mathematical language, we have to say: the car has many (group) wheels. This means that we have postulated the ability to semantically link an object and a class of objects. How to model this thesis in a logical paradigm?

For this purpose, we distinguish such wheel classes from the TM wheel class, each of which belongs to one car. So we associate the car and the group of wheels related to this car. In the model, it will look like this:



The arrows still denote the connection classification, but the circle denotes the connection specialization, or “multi-set”.

In this diagram, we see that the automobile object is associated with the class of wheels by the “has” semantic link.
Such a model can no longer be represented as a class diagram or as an ER model. In addition, no modern ontological standard has the ability to model such relationships. The reason is simple: difficulty in implementing such relationships in OOP programming languages.

Note that class diagrams do not model classes of objects: rectangles on class diagrams model types of objects.

But with ER diagrams more interesting. What is indicated by a rectangle in the ER diagram is a class of TM objects. Therefore, it is incorrect to call a rectangle in the ER model a noun in the singular. Correctly called a noun in the plural. Then the model will be as follows:



And this model brings us closer to the TM class model. However, the links between the TM classes actually do not exist, but there are links between the objects of the TM class, and they are read like this: for each car there are 4 links with wheels in the semantic link class called “The car has a wheel”, for each wheel there is only one such connection in this class.

Conclusion: conceptual modeling in the form of ER is much closer to the logical paradigm than modeling in the form of a class diagram. But neither one nor the other method of modeling allows modeling semantic relations between objects and classes of objects. This is a significant limitation of modern modellers, which must be eliminated.

Source: https://habr.com/ru/post/256823/


All Articles