aboutsummaryrefslogtreecommitdiffstats
path: root/doc/man/serd-pipe.1
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-08-01 20:09:38 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commitfac7901dca0b4821582c6062600d37ac987082d9 (patch)
tree177f20f43d11e65857be9a6d71a5e27c370212c5 /doc/man/serd-pipe.1
parentaa96c067439252b1955cfa11e75948d15f1b1656 (diff)
downloadserd-fac7901dca0b4821582c6062600d37ac987082d9.tar.gz
serd-fac7901dca0b4821582c6062600d37ac987082d9.tar.bz2
serd-fac7901dca0b4821582c6062600d37ac987082d9.zip
Collapse input and output options into single flags
Diffstat (limited to 'doc/man/serd-pipe.1')
-rw-r--r--doc/man/serd-pipe.1111
1 files changed, 70 insertions, 41 deletions
diff --git a/doc/man/serd-pipe.1 b/doc/man/serd-pipe.1
index d731f0b4..0ce40dbd 100644
--- a/doc/man/serd-pipe.1
+++ b/doc/man/serd-pipe.1
@@ -8,13 +8,13 @@
.Nd read and write RDF data
.Sh SYNOPSIS
.Nm serd-pipe
-.Op Fl Cafhlqtvx
+.Op Fl Cfhqv
.Op Fl B Ar base
+.Op Fl I Ar syntax
+.Op Fl O Ar syntax
.Op Fl b Ar bytes
.Op Fl c Ar prefix
-.Op Fl i Ar syntax
.Op Fl k Ar bytes
-.Op Fl o Ar syntax
.Op Fl p Ar prefix
.Op Fl r Ar root
.Op Fl s Ar string
@@ -80,9 +80,67 @@ All numeric datatypes are supported, as well as
.Vt hexBinary ,
and
.Vt base64Binary .
-.It Fl a
-Write ASCII output.
-If this is enabled, all non-ASCII characters will be escaped, even if the output syntax allows them to be written in UTF-8.
+.It Fl I Ar syntax
+Set an input syntax or option.
+May be given multiple times.
+The case-insensitive
+.Ar syntax
+can be
+.Cm NQuads ,
+.Cm NTriples ,
+.Cm TriG ,
+.Cm Turtle ,
+or an option:
+.Bl -tag -width 3n
+.It Cm lax
+Tolerate invalid input where possible.
+Warnings will be printed for syntax errors,
+but parsing will attempt to continue.
+Note that data may be lost when using this option!
+.It Cm variables
+Support parsing variable nodes.
+Variables can be written in SPARQL style, for example
+.Li ?var
+or
+.Li $var .
+.It Cm verbatim
+Normally, the reader expands all relative URIs,
+and may adjust blank node labels to avoid clashing with generated ones.
+This flag disables all of this processing,
+so that URI references and blank nodes are passed to the sink exactly as they are in the input.
+Note that this does not apply to CURIEs, since serd deliberately does not
+have a way to represent CURIE nodes.
+A bad namespace prefix is considered a syntax error.
+.El
+.It Fl O Ar syntax
+Set an output syntax or option.
+May be given multiple times.
+The case-insensitive
+.Ar syntax
+can be
+.Cm empty ,
+.Cm NQuads ,
+.Cm NTriples ,
+.Cm TriG ,
+.Cm Turtle ,
+or an option:
+.Bl -tag -width 3n
+.It Cm ascii
+Escape all non-ASCII characters.
+.It Cm expanded
+Write expanded URIs instead of prefixed names.
+.It Cm lax
+Tolerate corrupt UTF-8 and write replacements.
+.It Cm terse
+Write terser output with fewer, longer lines.
+.It Cm verbatim
+Write URI references exactly as in the input.
+.El
+.Pp
+The
+.Cm empty
+syntax suppresses the output,
+so that only warnings and errors will be printed.
.It Fl b Ar bytes
I/O block size.
This is the number of bytes in a file that will be read or written at once.
@@ -111,39 +169,12 @@ preserve full URIs (without qualifying or making relative),
and pass prefixed names through as-is.
.It Fl h
Print the command line options.
-.It Fl i Ar syntax
-Read input as
-.Ar syntax .
-Case is ignored, valid values are:
-.Dq NQuads ,
-.Dq NTriples ,
-.Dq TriG ,
-and
-.Dq Turtle .
.It Fl k Ar bytes
Parser stack size.
Parsing is performed using a pre-allocated stack for performance and security reasons.
By default, the stack is 1 MiB, which should be sufficient for most data.
This can be increased to support unusually structured data and huge literals,
or decreased to reduce overall memory requirements and reduce startup time.
-.It Fl l
-Lax (non-strict) parsing.
-If this is enabled, recoverable syntax errors will print a warning, but parsing will proceed starting at the next statement if possible.
-Note that data may be lost when using this option.
-.It Fl o Ar syntax
-Write output as
-.Ar syntax .
-Case is ignored, valid values are:
-.Dq empty ,
-.Dq NQuads ,
-.Dq NTriples ,
-.Dq TriG ,
-and
-.Dq Turtle .
-The
-.Cm empty
-syntax suppresses the output,
-so that only warnings and errors will be printed.
.It Fl p Ar prefix
Add
.Ar prefix
@@ -191,20 +222,12 @@ This is useful for keeping relative references within some directory.
Parse
.Ar string
as input.
-.It Fl t
-Write terser output without newlines.
.It Fl v
Display version information and exit.
.It Fl w Ar filename
Write output to the given
.Ar filename
instead of stdout.
-.It Fl x
-Support parsing variable nodes.
-Variables can be written in SPARQL style, for example
-.Dq ?var
-or
-.Dq $var .
.El
.Sh ENVIRONMENT
Errors and warnings are printed in color by default if the output is a terminal.
@@ -235,6 +258,12 @@ exits with a status of 0, or non-zero if an error occurred.
.Nm Fl o
.Ar output.ttl
.Pa input.nt
+.It Expand all prefixed names into full URIs:
+.Nm Fl O
+.Ar expanded
+.Fl o
+.Ar expanded.ttl
+.Pa input.ttl
.It Merge two files:
.Nm Fl o
.Pa merged.ttl