Lab: Semantic Lifting - CSV

From Info216
Revision as of 21:27, 12 March 2020 by Say004 (talk | contribs)

Lab 9: Semantic Lifting - CSV


Today's topic involves lifting the data in CSV format into RDF. The goal is for you to learn an example of how we can convert unsemantic data into RDF.

CSV stands for Comma Seperated Values, meaning that each point of data is seperated by a column.

Fortunately, CSV is already structured in a way that makes the creation of triples relatively easy.

Relevant Libraries

  • Pandas


Task 1

Below are four lines of comma-separated values (csv - five lines with the headers) that could have been saved from a spreadsheet. Copy them into a file and write a program with a loop that reads each line from that file (except the initial header line) and adds it to your graph as triples:

"Regina Catherine Hall","F","Great Britain","Manchester","Ecology, zoology","Football, music travelling"
"Achille Blaise","M","France","Nancy","","Chess, computer games"
"Nyarai Awotwi Ihejirika","F","Kenya","Nairobi","Computers, semantic networks","Hiking, botany"
"Xun He Zhang","M","China","Chengdu","Internet, mathematics, logistics","Dancing, music, trombone"

In the resulting graph, delete all information about Achille.

Task 2

Task 3

Useful Readings