NPRG036 - Data Formats - Homework 4 assignment

What
In this homework, you will create data schemas and data samples using the relational data data model and CSV, including transformations of the relational data to RDF. You should use the same data instances as in HW2 and HW3, this time in CSV.
  1. Fix the previous homework based on the tutor's notes.
  2. Based on your conceptual model, create a relational model showing how your data will be split into tables, what will be the primary keys and what foreign keys will be there.
  3. Create a corresponding CSV on the Web Table group descriptor, including proper data types, languages, and primary and foreign keys.
  4. Represent the data in CSV files valid against the created CSV on the Web descriptor.
  5. Enhance the CSV on the Web descriptor with virtual columns, and aboutUrl, propertyUrl and valueUrl annotations. The resulting RDF data representation should be identical to the ones from Homeworks 2 and 3. Use the rdf-tabular ruby gem to transform the CSV table group to RDF N-Triples. Use the Apache Jena riot command-line tool or the RDF translator online tool to transform the result into RDF Turtle.
Quantitative requirements
  1. At least 3 instances of each class. In case of inheritance hierarchies, one of each children is enough.
  2. Every attribute used at least once.
  3. At least 3 instances of each association.
How
  1. Replace the HW3 file with a fixed one in the HW3 column.
  2. To the HW4 column, upload a zipped file named NPRG036-HW4-<groupID>.zip, e.g. NPRG036-HW4-T2G1.zip.
  3. Zip file will contain folder 4, containing:
    1. Folder model containing:
      1. File relational.svg with the relational model
    2. Folder csv containing:
      1. File data.csv-metadata.json with CSV on the Web Table Group descriptor. Optionally, if the descriptor is split into individual table descriptors, files data-1.csv-metadata.json, data-2.csv-metadata.json, ...
      2. Files data-1.csv, data-2.csv, ... with data valid against the descriptor, linked from the descriptor
    3. Folder rdf containing:
      1. RDF Turtle file data.ttl with data resulting from the transformation of the files to RDF using rdf-tabular and converted to RDF Turtle.

Frequently Asked Questions (FAQ)

How to translate the conceptual model to a relational one?
This is covered in NDBI025 - Database systems. The translation alogirthm is straightforward, and deals especially with repeated attributes and associations based on their cardinalities. For those who did not have NDBI025 yet, or need to refresh this knowledge, the algorithm is shown from slide 25 in the NDBI025 lecture.

Common errors

Mixing prefixed and relative IRIs in CSVW descriptor
In this example:
<http://sis.cuni.cz/S006> a <ex:Room> ;
          <ex:roomCode> "SU2" ;
          <oo:capacity> 30 ;
          <vivo:building> "Malá strana" .
besides "Malá strana" missing a language tag, the <ex:roomCode> and similar IRIs are not prefixed IRIs. They are asolute IRIs with ex: scheme instead of http: scheme. A prefixed IRI in RDF Turtle would not be delimited by <>. This is the result of bad mapping in the CSVW descriptor. Note that the CSVW specification states, that the CSVW JSON-LD context contains a predefined set of prefixes and it forbids defining additional ones. This means that for some common prefixes, the usage of prefixed IRIs in the CSVW descriptor is possible, but otherwise absolute IRI representation needs to be used.