SERD-FILTER(1) | General Commands Manual | SERD-FILTER(1) |
serd-filter
—
serd-filter |
[-hVv ] [-B
base] [-I
syntax] [-O
syntax] [-b
bytes] [-f
pattern_file] [-k
bytes] [-o
filename] pattern
input ... |
serd-filter
scans for statements in RDF data. Its
interface is similar to grep(1), except
patterns are structural: instead of matching characters within a line,
serd-filter
matches nodes within a statement.
Data is read from files or standard input, and only those
statements that match the pattern (or do not match the pattern, if
-v
is given) are written. By default, the input
syntax is guessed from the file extension, and line-based output is written
to standard output.
Patterns are written in NTriples or NQuads with an extension that
allows variables like ?some
or
$thing
.
The options are as follows:
-B
baserebase
to use the output path.
See serd-pipe(1) for details.
-I
syntaxNQuads
,
NTriples
, TriG
,
Turtle
, lax
,
variables
, relative
, or
labels
. See
serd-pipe(1) for details.
-O
syntaxempty
,
NQuads
, NTriples
,
TriG
, Turtle
,
ascii
, contextual
,
expanded
, verbatim
,
terse
, or lax
. See
serd-pipe(1) for details.
-V
-b
bytes-f
pattern_file-h
-k
bytes-o
filename-v
serd-filter
exits with a status of 0, or non-zero if an
error occured.
$ serd-filter '?subject a ?type .'
input.ttl
To print every statement about http://example.org/subject:
$ serd-filter
'<http://example.org/subject> ?p ?o .' input.ttl
serd-filter
is a part of serd, by David
Robillard
d@drobilla.net.
August 12, 2021 | Serd 0.30.11 |