CSV: types, variables, translations, integration

I have been working with CSV files for many years. I want to share my techniques for dealing with the issues
of types, variables, translation, and integration into a knowledge representation language.

I have used three properties to describe the basic CSV information, and begin-end sentences to integrate
CSV files into a KR language.  The same approach also works for TSV files, and is compatible with SPARQL.

The three properties are named "label", "format" and "meaning".
"label" is a list of column names
"format" is a list of type:variable names
"meaning" is a list of KR sentences
The table of CSV sentences is named "relation"

To illustrate the use of these properties, I will use a simple address book and Turtle.

:ab  a  :relation ;
       :label  ( "full name"  "phone number"  "email address" ) ;
       :format  ( "person:1"  "phone:2"  "email:3" ) ;
       :meaning  {
             $1  a  :person .  $2  a  :phone .  $3  a  :email .
             $1  :phone  $2 ;
                   :email  $3 .
       } .

The use of integers as variable names is concise and consistent with UNIX shell conventions.
For SPARQL, you can use SPARQL variables as relation variables and column names.

For further details on my use of these concepts, see http://mkrmke.org/

Dick McCullough
Context Knowledge Systems
What is your view?

Received on Tuesday, 25 November 2014 14:03:59 UTC