+----------------------------------------+ | Unix Flatfile to RDFizer | +----------------------------------------+ What is this? ------------- It's a perl script that converts classic unix text database files, like /etc/passwd, into RDF/N3. What is the current status? --------------------------- Not known not to work. Usage & Examples ---------------- Usage: flat2rdf.pl [-n ]* [-s ] [-c ] [-C] [-m ] -- flat file to process -- RDF/N3 file to write -- perl regex to split fields, default /:/ -- list of ; split via /,w*/ -- [[;];] -- integer, string, url, qstring, qurl; name; default is string when the type is name the prefix (default :) is prefixed on the token. -- perl charset name of the input, default is iso-8859-1. -C -- do not discard lines that begin with '#', i.e. comments. For example converting the groups file into RDF/N# % ./flat2rdf.pl /etc/group /tmp/foo % head -3 /tmp/foo [:f1 "nobody"; :f2 "*"; :f3 "-2"]. [:f1 "nogroup"; :f2 "*"; :f3 "-1"]. [:f1 "wheel"; :f2 "*"; :f3 "0"; :f4 "root"]. Usually you want to use the -m argument. % MAP=':group;name;, drop, :groupid;integer' % ./flat2rdf.pl -m "$MAP" /etc/group /tmp/foo % head -2 /tmp/foo [:group nobody; :groupid -2]. [:group nogroup; :groupid -1]. or alternately if you wanted to have the group id as the subject. % MAP='subject,name,g:; drop; :groupid,integer' % ./flat2rdf.pl -m "$MAP" /etc/group /tmp/foo % head -2 /tmp/foo g:nobody :groupid -2 . g:nogroup :groupid -1 . You can define the g: prefix with the -n switch, i.e.: -n '@PREFIX g: .' Credits ------- "There is no limit to what a man can do or how far he can go if he doesn't mind who gets the credit." - Robert Woodruff Ben Hyde