Skip to content

how to parse a csv file with a metadata file #13

Open
@bblfish

Description

@bblfish

I have a csv file and a metadata file on my file system. With csv2rdf I can write

csv2rdf -t data/pplEx.csv -u pplEx.csv-meta.json -m minimal

in order to transform data/pplEx.csv using the pplEx.csv-meta.json metadata file. This will return ntriples for the csv file.

I can't work out how to do the same with rdf-tabular. All the examples use http urls which gives me the impression that one first has to setup special headers in the csv http headers. IS that right, or have I missed the command line needed when debugging.

I wanted to see if rdf-tabular had more advanced features than csv2rdf. For example I was interested to see what I need to do to get foreign keys to work. This is the csv file

Id,Name,DoB,Sex,mother
1,Linus,02-07-2016,male,4
2,Oliver,02-07-2016,male,4
3,Anaïs,10-09-2014,female,4
4,Gordana,30-05-1982,female,

this is the metadata file

{ 
  "@context": [ "http://www.w3.org/ns/csvw", { "@language": "en"} ],
  "dc:title": "example people data",
  "tableSchema": {
   "@id" : "http://example.com/",
   "columns": [
     {
        "name": "Id"
      }, {
        "name": "Name",
        "datatype": "string"
     },  {
        "name": "DoB",
        "datatype": {
          "base": "date",
          "format": "dd-MM-yyyy"
        }
      }, {
        "name": "Sex",
        "datatype": "string"
     }, {
        "name": "mother"
      } ],
    "primaryKey":"Id",  
    "foreignKeys": [{
        "columnReference": "mother",
        "reference": {
	  "schemaReference": "http://example.com/",
          "columnReference": "Id"
        }
      }]
   }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions