Metamodels and how they relate – part 3: From XML to relational database

The last post was about the terminology while performing Qualitative Data Analyses (QDA) with XML, this one will explain the interrelation of the terms of XML, tables and relational databases.

With the help of XSLT I transformed my XML data to a CSV file,  which can represented in a tabular form. A table has a table name and consists of rows and columns, that in turn contains values. Columns have column names and column indexes and rows have (sometimes named) row indexes:

Table Terminology
The terminology of a table

You may noticed how carefully I decide between what something is and which name it has. That’s necessary to distinguish the ressource with all it’s assigned or contained information and the appellation that used to identify this ressource.

Let’s recap the XML:

Enriched
The XML markup of the productive activity segment of the goldsmith.

Apparently, their are three things I want to talk about. First, lexical units (words) with their orthographical form and semantics; second, productive activities and their assigned task, materials and products, and third about the occupational titles and their productive activities. I could represent all that information in one table, but that would produce a lot of unacassary redundancy; so I normalise my ressources to three tables, which I name “Lexical Units”, “Productive Activities”, and “Occupations”.

Table LexUnits
Table for the Lexical Units
Table Productive Activity
Table for the Productive Activities
Table Occupations
Table for the Occupations

I can relate the tables by specifying that values from one table refer to rows on another. Look at the columns of the table “Productive Activities”. You will find the values of the columns “Task”, “Material” and “Product” in the column “Lexical unit id” as well. The values in the column “Lexical unit id” acting as unique identifiers for a specific row and are called primary keys. Other columns can use these values as pointers; in this context the values are called foreign keys.

Relation between tables
The foreign keys of the table “Productive Activity” point to the primary keys of the table “Lexical units”

Connecting separate tables with keys, evolve them to one database. Since the various tables in a database are basically relate information for a specific entity type, they are called relations. Entities types are simply things of one kind, we want to store data about, like “Occupations”, “Productive Activities” or “Lexical Units”. Each of those entity types have attributes, like “Lexical unit id”, “Orthographical form” or “Synset id” in the case of the relation “Lexical Units”. By assigning values to those attributes, records (or tuples) are created.  Every record represents one instance of an entity type.

Data Base Terminology
The terminology of a data base.

Even if the form of tables and relations are identical, the terminology of databases suggests that its content describes concrete, distinguishable, and tendentially unique objects of the world,  modelled in a way, that avoid redundancy (and thus inconsistency) and simplify data operations. To do so, one must have a theory of the things, that he or she wants to describe.

As you may notices, both the XML meta model and the relational data base meta model have a information carrier called “attribute”.  But as you see, there are no attribute names called “type” or “ana” with values like “Goldsmith” or “material” in the data base.  Depending on the meta model, attributes are used differently and attribute names and values are not identical. This may seem confusing the first time, but it becomes more clear if “attribute”  is only seen as a slot to store information inside the structure of the meta model. To transpose the data from one meta model to another, the meaning of every slot have to be aligned. So the questions would be:

Question XML Database
About which entities do I want to make statements? Occupations Occupations
How these entities are represented in the meta model? An Occupation is a div-element, containing an ana-attribute with the value “occupation” An Occupation is a record in a relation called “Occupations”
What are the attributes of these entities? The occupational title is the type-attribute of the selected div-element, the productive activity is the value of the type-attribute of the child element “s”, that have an ana-attribute with the value “productive activity” of that selected div-element. For a selected record inside the relation “Occupations”, the occupational title is the value of an attribute called “occupational title” and the productive activity is the value of an attribute called “productive activity”.

In order to be able to compare and classify occupations automatically (or at least with the aid of computers), semantic links between their characteristics must be drawn. How do we now, that Goldsmith and Silversmith are very similar professions? Because both of them craft jewelery out of precious metal:

Dimensions
Adding a taxonomical dimension to compare occupations.

By connecting information units with the help of a logical language and through taxonomic (is a) and analytical (has characteristic) relationships, an ontology is formed. Ontologies are first and foremost a way to organise and formalise knowledge and are therefore not necessarily to be implemented in specific syntax of a programming language like OWL. It is the same as with XML and relational databases: once the principles and terminologies are understood, they can be easily transposed into each other. That is what we do in the next post.


Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.