1

One of the standards from W3C for RDB2RDF is Direct Mapping. I heard that there is a problem when converting many-to-many relationship from a relational database and they say it loses semantic, I need more explanation about it.

Ankur Soni
  • 5,725
  • 5
  • 50
  • 81
rawan az
  • 101
  • 7
  • 1
    And I don't understand what you're asking. Please show the source of the statement. Please provide an example. – UninformedUser May 07 '18 at 06:23
  • And please understand, RDF has only binary relations. N-ary relations have to be modelled by some intermediate node (could be a blank node or a URI) – UninformedUser May 07 '18 at 06:24
  • I have watched the video (Relational Database to RDF (RDB2RDF)) from Euclid.this is the link https://vimeo.com/66718408 – rawan az May 07 '18 at 07:37

1 Answers1

1

...there is a problem when converting many-to-many relationship from a relational database

I'd say that direct mapping introduces additional "parasitic" semantics, treating normalization artefacts as first-class object.

Let's consider the D011-M2MRelations testcase.

Student
+---------+-----------+----------+
| ID (PK) | FirstName | LastName |
+---------+-----------+----------+
| 10      | Venus     | Williams |
| 11      | Fernando  | Alonso   |
| 12      | David     | Villa    |
+---------+-----------+----------+

Student_Sport
+------------+----------+
| ID_Student | ID_Sport |
+------------+----------+
| 10         | 110      |
| 11         | 111      |
| 11         | 112      |
| 12         | 111      |
+------------+----------+

Sport
+---------+-------------+
| ID (PK) | Description |
+---------+-------------+
| 110     | Tennis      |
| 111     | Football    |
| 112     | Formula1    |
+---------+-------------+

Direct mapping generates a lot of triples of this kind:

<Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ref-ID_Student> <Student/ID=11>.
<Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ref-ID_Sport>  <Sport/ID=111>.
<Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ref-ID_Student> <Student/ID=11>.
<Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ref-ID_Sport>  <Sport/ID=112>.

Modeling from scratch, you'd probably write something like this (R2RML allows to achieve that):

<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/111>.
<http://example.com/student/11> <http://example.com/plays> <http://example.com/sport/112>.

Moreover, one can't improve results denormalizing original tables or creating SQL views: without primary keys, results are probably even worse.

In order to improve results, subsequent DELETE/INSERT (or CONSTRUCT) seems to be the only option available. The process should be named ELT rather than ETL. Perhaps the following DM-generated triples were intended to help in such transformation:

<Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ID_Student> "11"^^xsd:integer.
<Student_Sport/ID_Student=11;ID_Sport=111> <Student_Sport#ID_Sport>  "111"^^xsd:integer.
<Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ID_Student> "11"^^xsd:integer.
<Student_Sport/ID_Student=11;ID_Sport=112> <Student_Sport#ID_Sport>  "112"^^xsd:integer.

...they say it loses semantics

@JuanSequeda means that DM doesn't generate an OWL ontology from an relational schema, this behaviour is not many-to-many relations specific.


See also links from Issue 14.

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58