[TF-TD] A case for using Turtle internally in the group

Dear all,


Following our discussion in the teleconference today, here I'd like to 
explain more precisely why we (Maxime, Andrei, and I) would prefer using 
Turtle for discussing the structure of thing descriptions (while keeping 
JSON-LD for examples in the documents we publish).

What we have to agree on is the graph structure showing the relations 
between the parts of a description. We need to describe how a thing can 
be related to a property, or an action, or an event, how these are 
related to an encoding or mime type, etc. We need to know what the 
relationships are meaning and what kinds of entities they are relating.

For this, we need to be able to communicate example graph structures by 
email as efficiently as possible. Although JSON-LD is a valid and more 
and more popular way to serialise an RDF graph, it is not the easiest in 
terms of understanding the underlying graph behind the serialisation.

Turtle is pretty good and concise for this, especially if you omit the 
preliminary directives for prefixes. As an example, consider a graph 
like this:

ex:sensor123 ----type----> td:Thing
      |
      |
  td:hasAction
      |
      |
      v
  ex:actionXYZ ----type----> td:Action

where there are 3 arcs connecting 4 nodes. In Turtle, one may just write 
down each arc, one by one, with a simple node-arc-node triple, like so:

ex:sensor123  type  td:Thing .
ex:sensor123  td:hasAction  ex:actionXYZ .
ex:actionXYZ  type  td:Action .

It's pretty easy to reconstruct the graph mentally, or draw it on paper. 
It's a bit verbose though. If several arcs originate from the same node, 
you have to repeat the origin many times. But there are a few 
abbreviations in Turtle that are good to know and easy to parse. For 
each arc with the same origin, you use a semicolon to separate arc-node 
pairs starting from the same node:

ex:sensor123  type  td:Thing;
               td:hasAction  ex:actionXYZ .
ex:actionXYZ  type  td:Action .

It's still fairly easy to see what graph we are serialising, without 
much knowledge of RDF and Turtle and the Semantic Web (and without the 
possibly misleading assumptions about how it looks like in JSON).

Then, once we've agreed on what graph a TD has to represent, we can 
write a JSON-LD context that makes writing the graph in JSON 
straightforward for a web developer. The web developers then play with 
the TD as they like to do in JSON, while the semantic web developers may 
interpret it as RDF for more advanced processing, or reasoning.


Best regards,
-- 
Antoine Zimmermann
Institut Henri Fayol
École des Mines de Saint-Étienne
158 cours Fauriel
CS 62362
42023 Saint-Étienne Cedex 2
France
Tél:+33(0)4 77 42 66 03
Fax:+33(0)4 77 42 66 66
http://www.emse.fr/~zimmermann/
Member of team Connected Intelligence, Laboratoire Hubert Curien

Received on Wednesday, 5 October 2016 13:02:44 UTC