Turning tabular data into entities
Two widely used data formats on the Web are CSV and JSON. In order to enable fine-grained access in an hypermedia-oriented fashion I’ve started to work on Tride, a mapping language that takes one or more CSV files as inputs and produces a set of (connected) JSON documents.
In the 2 min demo video I use two CSV files (people.csv and group.csv) as well as a mapping file (group-map.json) to produce a set of interconnected JSON documents.
So, the following mapping file:
{
"input" : [
{ "name" : "people", "src" : "people.csv" },
{ "name" : "group", "src" : "group.csv" }
],
"map" : {
"people" : {
"base" : "http://localhost:8000/people/",
"output" : "../out/people/",
"with" : {
"fname" : "people.first-name",
"lname" : "people.last-name",
"member" : "link:people.group-id to:group.ID"
}
},
"group" : {
"base" : "http://localhost:8000/group/",
"output" : "../out/group/",
"with" : {
"title" : "group.title",
"homepage" : "group.homepage",
"members" : "where:people.group-id=group.ID link:group.ID to:people.ID"
}
}
}
}
… produces JSON documents representing groups. One concrete example output is shown below:
Filed under: demo, Experiment, FYI
