NPRG036 - Data Formats - Homework 4 assignment
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.
- Fix the previous homework based on the tutor's notes.
- 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.
- Create a corresponding CSV on the Web Table group descriptor, including proper data types, languages, and primary and foreign keys.
- Represent the data in CSV files valid against the created CSV on the Web descriptor.
Enhance the CSV on the Web descriptor with virtual columns, and
valueUrlannotations. 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
riotcommand-line tool or the RDF translator online tool to transform the result into RDF Turtle.
- Quantitative requirements
- At least 3 instances of each class. In case of inheritance hierarchies, one of each children is enough.
- Every attribute used at least once.
- At least 3 instances of each association.
- Replace the HW3 file with a fixed one in the HW3 column.
To the HW4 column, upload a zipped file named
Zip file will contain folder
relational.svgwith the relational model
data.csv-metadata.jsonwith CSV on the Web Table Group descriptor. Optionally, if the descriptor is split into individual table descriptors, files
data-2.csv, ... with data valid against the descriptor, linked from the descriptor
RDF Turtle file
data.ttlwith data resulting from the transformation of the files to RDF using
rdf-tabularand converted to RDF Turtle.
- RDF Turtle file
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.
- 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" .
"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.