Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On the difference between a data model vs data format

I recently had to explain to an audience what is the difference between a data model and a data format. They wanted to explain why we just don't use XML to do the basic thing we do with RDF. Although I could explain a bunch of things, such as a distributed data model, reasoning and etc.. I was somewhat enable to explain the difference between a data model and a data format.

I wonder if there is a simpler answer to this. I think instead of giving many points, like I did and that are not easy to understand for a simple user, it would clearly expose, why we need a data model over simply XML. Then one could go on and explain not any data model.

like image 656
MaatDeamon Avatar asked Oct 19 '25 00:10

MaatDeamon


2 Answers

A data model defines concepts used in the computer system and their semantic relationship to concepts in the world outside. For example: The HOTEL entity represents a single hotel, hostel, or cruise ship where travellers can book accommodation.

A data format defines how these concepts in the computer system are represented using bits and bytes (perhaps via intermediate layers such as XML or JSON, because if you define it in terms of XML or JSON, then the representation in bits and bytes is implicit). For example: the HOTEL entity is represented as an XML element named <t:hotel>, ...

like image 148
Michael Kay Avatar answered Oct 20 '25 13:10

Michael Kay


Answering specifically in terms of RDF

The RDF 1.1 Concepts and Abstract Syntax specification describes RDF as the following:

The Resource Description Framework (RDF) is a framework for representing information in the Web.

and goes on to say that is it

an abstract syntax (a data model) which serves to link all RDF-based languages and specifications

As it is an abstract syntax it is independent of the way in which you write down the data i.e. the data format.

JSON and XML happen to be two examples of data formats that we can write RDF data down in but they are not the only one. The advantage of using RDF is that we have a consistent data model which we can represent in different data formats according to the systems we need to interact with.

For example a fully automated system is going to prefer something like Turtle or even a custom binary format over JSON/XML because those formats are much faster to parse and process (not to mention far more compact for data transfer).

The audience understanding problem may be due to the fact that in a lot of cases with JSON and XML there is no real separation between the data model and the data format. So users are not used to thinking of the two things as being in any way separate. This is particularly true of JSON which was specifically designed to be as close as possible to a literal serialization of Javascript data structures.

like image 41
RobV Avatar answered Oct 20 '25 13:10

RobV