Menu

LinksRelatingData

Anonymous Vladimir Chukharev
Attachments
Database_classes.png (74154 bytes)

Introduction to links between data

The simplest type of data is just some text. Something like "An unusual glare was observed from an old sample of unknown origin." This can be stored as an object of class Fact in the database, see ClassDiagram below.

Database classes

Next day an absorption spectrum of the sample might be measured and saved as an object of class AbsorptionSpectrum. It's reasonable to save the information that the spectrum is measured using this particular sample. In other words, the spectrum is linked to the sample. The link can be saved in the database.

Let's use the word 'link' and its derivatives for this type of things. The word 'relation' looks better in this place, but it is widely used in database discussions with a too special meaning.

Some more examples of links between data.

From the spectrum, position and amplitude of the maxima for each absorption band can be determined and recorded. This information is linked to the spectrum and indirectly to the first fact. These values (position and amplitude of the bands) are linked to some used units, e.g. nm for position of the absorption band. To make this a bit longer, a connection between a nanometer and a meter might be also registered in the database. The fact 'meter' might have a link to the fact 'm' with link type 'synonym'.

Later on, the composition of the sample might be accurately determined and the information that the actual name of the unknown sample can be recorded as a synonym for the name chosen on the first fact recording.

The first thought about the way to hold the links in database is to add a reference from a data record to the data record it is linked to. This approach has a problem that quite many data structures have undefined or varying number of links. A simple example is a solution, which can have at least one solvent and few (any number, actually) of solutes.

There is a common need for tracing transitive and commutative (symmetric) links like synonym. If A is a synonym for B, and B is a synonym of C, that also means that C is a synonym of A, as well as A is a synonym of C.

For these properties to be used, a number of booleans should be used in class LinkType. These include at least the following.

  • Commutative - (or symmetric) A lnk B <=> B lnk A
  • Transitive - (A lnk B) and (B lnk C) => A lnk C
  • Nonidempotent - A lnk B can be used more than one time; by default the second link will be rejected by a validator

All three properties are interconnected, e.g. if there is a commutative link A lnk B, then an insertion of B lnk A should be rejected by a validator unless lnk is nonidempotent.

Transitivity, Commutativity, Idempotence, and Associativity are usual properties of operations considered in abstract algebras. Links are not operations, and Assosiativity does not look as a useful property of a link type. Nevertheless, below is a definition of associativity in case we will need it in future development.

  • Associative - ((A lnk B) lnk C) <=> (A lnk (B lnk C))

The experience with first version of LabMan indicates that a strict order of information recording is quite inconvenient. It seems better to allow user start his/her records from any point, marking not yet recorded parts as undefined, e.g. by links leading to nowhere (NULL values in SQL database). These links later can be filled, making the information more complete.

See also LinkPresentation and AccessControl.


Related

Wiki: AccessControl
Wiki: ClassDiagram
Wiki: Home
Wiki: LinkPresentation

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.