RDFLESS(1)

NAME
rdfless - a colorful pretty printer for RDF data with ANSI colors

SYNOPSIS
rdfless [OPTION]... [FILE]...

DESCRIPTION
rdfless is a command-line tool for pretty-printing RDF data with syntax highlighting and ANSI colors. It supports multiple RDF formats including Turtle, TriG, N-Triples, N-Quads, and PROV-N. The tool automatically detects the input format from file extensions and provides options for customizing the output format and appearance. The tool includes robust error handling capabilities and can continue parsing even when encountering malformed RDF data. It also provides flexible filtering options to display only specific triples matching subject, predicate, or object criteria. When no input files are specified, rdfless reads from standard input. Output is written to standard output unless the -O option is used to specify an output file.

OPTIONS

-h, --help
    Print help information and exit.

-V, --version
    Print version information and exit.

--expand
    Expand prefixes instead of showing PREFIX declarations. When this option is used, all URIs are displayed in their full form rather than using namespace prefixes.

--compact
    Compact mode (opposite of --expand). Show PREFIX declarations and use prefixes to shorten URIs. This is the default behavior.

--format FORMAT
    Override the input format detection. By default, the format is auto-detected from the file extension. Possible values are:

    •   turtle - Turtle format (.ttl files)

    •   trig - TriG format (.trig files)

    •   ntriples - N-Triples format (.nt files)

    •   nquads - N-Quads format (.nq files)

    •   provn - PROV-N format (.provn files)

--pager
    Enable paging for large outputs using an interactive pager.

--no-pager
    Disable paging even if it would normally be enabled by configuration or auto-detection.

-o, --output FILE
    Write output to the specified file instead of standard output. When writing to a file, ANSI colors are automatically disabled unless explicitly forced with theme options.

--continue-on-error
    Continue parsing even when encountering errors in the RDF data. Invalid triples are skipped, and parsing continues with the next valid statement. Error information is reported to stderr.

--filter-subject SUBJECT
    Filter RDF triples to show only those with the specified subject. The subject can be an IRI (e.g., <http://example.org/person>) or a prefixed name (e.g., ex:person).

--filter-predicate PREDICATE
    Filter RDF triples to show only those with the specified predicate. The predicate can be an IRI (e.g., <http://xmlns.com/foaf/0.1/name>) or a prefixed name (e.g., foaf:name).

--filter-object OBJECT
    Filter RDF triples to show only those with the specified object. The object can be an IRI, a prefixed name, or a literal value (e.g., "John Doe").

--dark-theme
    Force dark theme colors suitable for dark terminal backgrounds.

--light-theme
    Force light theme colors suitable for light terminal backgrounds.

--no-auto-theme
    Disable automatic background detection and use the explicitly configured colors from the configuration file.

-k, --keybindings
    Print pager keybindings help and exit.

SUPPORTED FORMATS
rdfless supports the following RDF serialization formats:

Turtle (.ttl)
    Terse RDF Triple Language - a compact, human-readable syntax for RDF.

TriG (.trig)
    An extension of Turtle that supports named graphs (quads).

N-Triples (.nt)
    A line-based, plain text format for encoding RDF triples.

N-Quads (.nq)
    An extension of N-Triples that supports named graphs (quads). Format detection is based on file extensions. If no format is specified and the file extension is unrecognized, Turtle format is assumed.

CONFIGURATION
rdfless can be configured using a TOML configuration file. The configuration file is located at:

•   Linux/macOS: ~/.config/rdfless/config.toml

•   Windows: %APPDATA%\rdfless\config.toml See rdfless-config(5) for detailed information about the configuration file format.

COLOR OUTPUT
rdfless provides syntax highlighting with different colors for:

•   Subjects - RDF resource subjects

•   Predicates - RDF properties

•   Objects - RDF resource objects

•   Literals - String literals, numbers, and typed literals

•   Prefixes - Namespace prefix declarations

•   Graphs - Named graph identifiers (in TriG format) Colors can be customized through the configuration file and support both named colors and hex color codes.

AUTO-PAGING
rdfless automatically enables paging for large outputs when:

•   The output exceeds the terminal height

•   Auto-paging is enabled in configuration (default: true)

•   Output is going to a terminal (not redirected to a file or pipe)

•   No explicit paging option is specified Auto-paging can be configured or disabled through the configuration file.

PAGER KEYBINDINGS
When paging is enabled, rdfless uses the minus pager which provides powerful navigation and search capabilities. The complete list of keybindings can be displayed using the --keybindings option. Key bindings include:

Navigation

Ctrl+C, q
    Quit the pager

[n] Arrow Up, k
    Scroll up by n line(s) (default: 1)

[n] Arrow Down, j
    Scroll down by n line(s) (default: 1)

[n] Arrow Left, h
    Scroll left by n line(s) (default: 1)

[n] Arrow Right, l
    Scroll right by n line(s) (default: 1)

Page Up
    Scroll up by entire page

Page Down
    Scroll down by entire page

[n] Enter
    Scroll down by n line(s)

Space
    Scroll down by one page

Ctrl+U, u
    Scroll up by half a screen

Ctrl+D, d
    Scroll down by half a screen

g   Go to the very top of the output

[n] G
    Go to the very bottom (or line n if specified)

Display Options

Ctrl+h
    Turn off line wrapping and allow horizontal scrolling

Ctrl+L
    Toggle line numbers if not forced enabled/disabled

Ctrl+f
    Toggle follow-mode

Search

/   Start forward search

?   Start backward search

Esc Cancel search input

n   Go to the next search match

p   Go to the previous search match

Mouse

Mouse scroll Up
    Scroll up by 5 lines

Mouse scroll Down
    Scroll down by 5 lines Note: [n] means you can precede the key with an integer to repeat the action n times.

EXAMPLES

rdfless data.ttl
    Pretty-print a Turtle file with default formatting and colors.

rdfless --expand data.ttl
    Print the file with all prefixes expanded to full URIs.

rdfless --format turtle data.rdf
    Force interpretation of data.rdf as Turtle format.

rdfless data.ttl -o formatted.ttl
    Save the formatted output to a file (without ANSI colors).

rdfless --dark-theme -o colored.ttl data.ttl
    Save formatted output with dark theme colors to a file.

rdfless --no-pager large_file.ttl
    Display a large file without using a pager.

cat data.ttl | rdfless
    Read RDF data from standard input and pretty-print it.

rdfless file1.ttl file2.ttl
    Process multiple files and concatenate their output.

rdfless --continue-on-error malformed.ttl
    Parse a file with potential errors, skipping invalid triples and continuing with valid ones.

rdfless --filter-subject ex:john data.ttl
    Show only triples where the subject is ex:john.

rdfless --filter-predicate foaf:name --expand data.ttl
    Show only triples with foaf:name predicate and expand all prefixes.

rdfless --filter-object John Doe --no-pager data.ttl
    Show only triples with "John Doe" as the object, without using a pager.

rdfless --keybindings
    Display all available pager keybindings and exit.

EXIT STATUS
rdfless exits with status 0 on success, and >0 if an error occurred. When the --continue-on-error option is used, parsing errors in individual triples do not cause the program to exit with an error status; only fatal errors that prevent processing will result in a non-zero exit status.

FILES

~/.config/rdfless/config.toml
    User configuration file (Linux/macOS)

%APPDATA%\rdfless\config.toml
    User configuration file (Windows)

SEE ALSO
rdfless-config(5)

BUGS
Report bugs to: https://github.com/larsw/rdfless/issues

AUTHOR
Written by Lars Wilhelmsen.

COPYRIGHT
Copyright © 2025 Lars Wilhelmsen.
License BSD-3-Clause: https://opensource.org/licenses/BSD-3-Clause
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.