CSV2RDF(1)

✨ CSV2RDF β€” the NAME bit ✨

okay so like, this is the manual page for csv2rdf, a User Command that literally just converts CSV to RDF. that's it. that's the whole job. and she does it flawlessly. πŸ’…


🌈 SYNOPSIS 🌈

csv2rdf -b <instance-base> -p <property-base> [-c <classname>] [-i
<identity column(s)>] [-l <label columns>] [-s <N>] [-o <output>] [-f
configfile] [--col<N> <colspec>] [--prop<N> <property>] <[-d <delim>]
[-C] [files...]

πŸŽ€ DESCRIPTION πŸŽ€

she reads csv files β€” from stdin or from the files you hand her. your call, bestie. 🫢

here's the whole vibe check on what each flag does:

  • -d <delim> β€” if you pass -d, that's your delimiter. she'll use it. no questions asked. πŸ“
  • -s <N> β€” if you pass -s, she skips N lines at the very start. perfect for when your csv has a lil header moment that's giving nothing. πŸ™ˆ
  • -i <identity column(s)> β€” she creates a URI from the columns you give to -i. if you give her none, she'll just number them automatically. lowkey genius. ✨
  • -l <label columns> β€” she outputs RDFS labels from the columns you give to -l. cute lil name tags for your data. 🏷️
  • -c <classname> β€” if -c is given, she adds a type triple with the classname you gave her. queen behavior. πŸ‘‘
  • -C β€” if -C is given, the class is defined as rdfs:Class. periodt.
  • -b <instance-base> β€” the instance base. mandatory, no skips. πŸ’–
  • -p <property-base> β€” the property base. also mandatory, she's not doing this without it. πŸ’–
  • -o <output> β€” output goes to stdout unless you specify -o. then it goes wherever you told her to put it. πŸ“
  • -f configfile β€” tells her to read config from a .ini/config file (more on that below, it's a whole moment).
  • --col<N> <colspec> β€” long options --col0, --col1, ... let you specify conversion for individual columns. yes, she can do per-column glow-ups. πŸ”₯
  • --prop<N> <property> β€” long options --prop0, --prop1, ... let you use specific properties instead of the ones she auto-generates from the headers. iykyk. πŸ¦‹
  • files... β€” the files themselves. feed her as many as you want. no cap.

and the long options in general? she supports --base, --propbase, --ident, --class, --label, --out, --defineclass. same energy, more letters. πŸ’œ


🌸 the conversions 🌸

bestie, the conversions can be:

float(), int(), split(sep, [more]), uri(base, [class]), date(format)

like, that's the whole menu. float(), int(), split(sep, [more]), uri(base, [class]), date(format). pick your fighter. ⭐


🧚 the config file situation 🧚

so -f says to read config from a .ini/config file. and the file must contain one section called csv2rdf, with keys like the long options, i.e.:

[csv2rdf]
    out=output.n3
    base=http://example.org/
    col0=split(";")
    col1=split(";", uri("http://example.org/things/",
                        "http://xmlns.com/foaf/0.1/Person"))
    col2=float()
    col3=int()
    col4=date("%Y-%b-%d %H:%M:%S")

see how clean that is? she ate. 😭


πŸ“Œ the important technical tea πŸ“Œ

  • she outputs one RDF triple per column in each row. every single one. no skipping.
  • output is in n3 format. that's the format. that's the vibe. πŸ’…
  • output is stdout, unless -o is specified. ✨

πŸ‘‘ AUTHOR πŸ‘‘

this manual page was written by Olivier Berger <obergix@debian.org>, for the Debian distribution. give her her flowers, she earned them. 🌸


and that's the whole page, bestie 🫢 this is csv2rdf from the csv2rdf manual, December 2013 edition, section 1. go forth and convert. πŸ’–βœ¨πŸŽ€πŸ¦‹