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 skipsNlines 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-cis given, she adds a type triple with the classname you gave her. queen behavior. π-Cβ if-Cis given, the class is defined asrdfs: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 tostdoutunless 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
n3format. that's the format. that's the vibe. π - output is
stdout, unless-ois 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. πβ¨ππ¦
π¦ where this page comes from
- debian bookworm: python-rdflib-tools 6.1.1-1 Β· BSD-3-Clause
- debian trixie: python-rdflib-tools 7.1.1-3 Β· BSD-3-Clause
- ubuntu jammy: python-rdflib-tools 6.1.1-1 Β· BSD-3-Clause
- ubuntu noble: python-rdflib-tools 6.1.1-3 Β· BSD-3-Clause
- ubuntu questing: python-rdflib-tools 7.1.1-3
- ubuntu resolute: python-rdflib-tools 7.4.0-1 Β· BSD-3-Clause
- ubuntu stonking: python-rdflib-tools 7.6.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms