aboutsummaryrefslogtreecommitdiffstats
path: root/doc/man/serd-pipe.1
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-04-05 07:01:18 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit3cc5a4fcaea8f1e2fd47c53135b53f8edcb8619d (patch)
tree4496d7af98b1033630d992db1b8788077ebda8f6 /doc/man/serd-pipe.1
parent89acd9d099bd46c1cbf17ee3a7bb78610a8138fe (diff)
downloadserd-3cc5a4fcaea8f1e2fd47c53135b53f8edcb8619d.tar.gz
serd-3cc5a4fcaea8f1e2fd47c53135b53f8edcb8619d.tar.bz2
serd-3cc5a4fcaea8f1e2fd47c53135b53f8edcb8619d.zip
Factor out and rewrite command-line interface
Diffstat (limited to 'doc/man/serd-pipe.1')
-rw-r--r--doc/man/serd-pipe.198
1 files changed, 58 insertions, 40 deletions
diff --git a/doc/man/serd-pipe.1 b/doc/man/serd-pipe.1
index b1e01990..4d475985 100644
--- a/doc/man/serd-pipe.1
+++ b/doc/man/serd-pipe.1
@@ -8,15 +8,15 @@
.Nd read and write RDF data
.Sh SYNOPSIS
.Nm serd-pipe
-.Op Fl Cfhqv
+.Op Fl CVhq
.Op Fl B Ar base
.Op Fl I Ar syntax
.Op Fl O Ar syntax
+.Op Fl R Ar root
.Op Fl b Ar bytes
.Op Fl k Ar bytes
-.Op Fl r Ar root
+.Op Fl o Ar filename
.Op Fl s Ar string
-.Op Fl w Ar filename
.Op Ar input ...
.Sh DESCRIPTION
.Nm
@@ -60,12 +60,34 @@ then input is read as TriG and output is written as NQuads
The options are as follows:
.Bl -tag -width 3n
.It Fl B Ar base
-Input base URI.
-Relative URI references in the input will be resolved against this.
-When the input is a file,
-the URI of the file is automatically used as the base URI.
-This option can be used to override that,
-or to provide a base URI for input from stdin or a string.
+Base URI, path, or
+.Cm rebase
+to use the output path.
+This is used to resolve relative URI references in the input.
+.Pp
+If the input is a file,
+its path is used by default,
+so relative paths are written as they are in the input.
+The special
+.Cm rebase
+argument will instead use the output path set by the
+.Fl o
+option,
+so paths are written relative to the output file.
+.Pp
+The distinction matters when reading from bundles of files that refer to each other.
+For example,
+when copying
+.Pa in/manifest.ttl
+to
+.Pa out/manifest.ttl ,
+the relative URI reference
+.Ql <data.ttl>
+will be written as
+.Ql <../in/data.ttl>
+when using
+.Fl o
+.Cm rebase .
.It Fl C
Convert literals to canonical form.
Literals with supported XSD datatypes will be parsed and rewritten canonically.
@@ -155,26 +177,7 @@ 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.
-The default is 4096, which should perform well in most cases.
-Note that this only applies to files, standard input and output are always processed one byte at a time.
-.It Fl f
-Fast and loose URI mode:
-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 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 q
-Suppress all output except data.
-.It Fl r Ar root
+.It Fl R Ar root
Keep relative URIs within a
.Ar root
URI.
@@ -188,29 +191,44 @@ if
.Pa /home/you/file.ttl
is written to the file
.Pa /home/me/output.ttl
-using the destination's base URI,
-then it could be written as
+using
+.Fl B Cm rebase ,
+then it will be written as
.Li <../you/file.ttl> .
Setting
-.Fl r Li file:///home/me/
+.Fl R Pa /home/me/
would prevent references from
.Dq escaping
like this,
so the above would instead be written as
-.Li <file:///home/you/file.ttl> ,
-since it can't be expressed relative to the root URI.
+.Li <file:///home/you/file.ttl> .
.Pp
This is useful for keeping relative references within some directory.
-.It Fl s Ar string
-Parse
-.Ar string
-as input.
-.It Fl v
+.It Fl V
Display version information and exit.
-.It Fl w Ar filename
+.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.
+The default is 4096, which should perform well in most cases.
+Note that this only applies to files, standard input and output are always processed one byte at a time.
+.It Fl h
+Print the command line options.
+.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 o Ar filename
Write output to the given
.Ar filename
instead of stdout.
+.It Fl q
+Suppress all output except data.
+.It Fl s Ar string
+Parse
+.Ar string
+as input.
.El
.Sh ENVIRONMENT
Errors and warnings are printed in color by default if the output is a terminal.