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.
- 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
aboutUrl
,propertyUrl
andvalueUrl
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 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.
- How
-
- Replace the HW3 file with a fixed one in the HW3 column.
-
To the HW4 column, upload a zipped file named
NPRG036-<groupID>-HW4.zip
, e.g.NPRG036-T2G1-HW4.zip
. -
Zip file will contain folder
4
, containing:-
Folder
model
containing:-
File
relational.svg
with the relational model
-
File
-
Folder
csv
containing:-
File
data.csv-metadata.json
with CSV on the Web Table Group descriptor. Optionally, if the descriptor is split into individual table descriptors, filesdata-1.csv-metadata.json
,data-2.csv-metadata.json
, ... -
Files
data-1.csv
,data-2.csv
, ... with data valid against the descriptor, linked from the descriptor
-
File
-
Folder
rdf
containing:-
RDF Turtle file
data.ttl
with data resulting from the transformation of the files to RDF usingrdf-tabular
in RDF Turtle (not just N-Triples).
-
RDF Turtle file
-
Folder
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:
besides<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 withex:
scheme instead ofhttp:
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.