@faubulous/mentor-rdf-serializers
    Preparing search index...

    Interface TurtleFormatterOptions

    Turtle-specific formatting options.

    interface TurtleFormatterOptions {
        alignObjects?: boolean;
        alignPredicates?: boolean;
        baseIri?: string;
        blankLinesBetweenSubjects?: boolean;
        blankNodeIdGenerator?: (counter: number) => string;
        blankNodeStyle?: BlankNodeStyle;
        directiveStyle?: "turtle" | "sparql-lowercase" | "sparql-uppercase";
        emitDirectives?: boolean;
        groupBySubject?: boolean;
        indent?: string;
        inlineCollections?: boolean;
        inlineSingleUseBlankNodes?: boolean;
        lineEnd?: string;
        maxLineWidth?: number;
        newlineAfterSubject?: boolean;
        objectListStyle?: ObjectListStyle;
        predicateListStyle?: PredicateListStyle;
        prefixes?: Record<string, string>;
        prettyPrint?: boolean;
        relabelBlankNodes?: boolean;
        sort?: SortingOption;
        spaceBeforePunctuation?: boolean;
        useRdfTypeShorthand?: boolean;
    }

    Hierarchy (View Summary)

    Index
    alignObjects?: boolean

    Whether to align objects in columns (requires alignPredicates). Default: false

    alignPredicates?: boolean

    Whether to align predicates in columns. Default: false

    baseIri?: string

    The base IRI for relative IRI resolution.

    blankLinesBetweenSubjects?: boolean

    Whether to insert blank lines between subjects. Default: true

    blankNodeIdGenerator?: (counter: number) => string

    Custom blank node ID generator. If provided, this function will be called to generate IDs for new blank nodes.

    blankNodeStyle?: BlankNodeStyle

    Blank node formatting style. Default: 'auto'

    directiveStyle?: "turtle" | "sparql-lowercase" | "sparql-uppercase"

    Controls the style used for prefix and base directives.

    • 'turtle': Turtle-style (@prefix ex: <…> . / @base <…> .)
    • 'sparql-lowercase': SPARQL-style lowercase (prefix ex: <…> / base <…>)
    • 'sparql-uppercase': SPARQL-style uppercase (PREFIX ex: <…> / BASE <…>) When omitted, the original casing from the source document is preserved.
    emitDirectives?: boolean

    Whether to emit PREFIX/BASE directives in serializer output. Default: true.

    groupBySubject?: boolean

    Whether to group statements by subject (Turtle/TriG style). Default: true for Turtle/TriG, false for N-Triples/N-Quads

    indent?: string

    Indentation string (default: ' ' for 2 spaces).

    inlineCollections?: boolean

    Whether to serialize well-formed RDF lists (rdf:first/rdf:rest/rdf:nil chains) using collection syntax (( ... )) when pretty printing. Malformed, shared or otherwise ambiguous lists fall back to blank node serialization so that no triples are ever dropped.

    This applies only when prettyPrint is true. Default: true

    inlineSingleUseBlankNodes?: boolean

    Whether to serialize single-use blank nodes as local property lists ([ ... ]) when pretty printing.

    This applies only when prettyPrint is true. Default: true

    lineEnd?: string

    Line ending string (default: '\n').

    maxLineWidth?: number

    Maximum line width before wrapping (0 = no wrapping). Default: 0

    newlineAfterSubject?: boolean

    When true (and prettyPrint is enabled), place the subject on its own line and start the predicate list on the next line.

    Example: ex:s a ex:T; ex:p ex:o.

    Default: false

    objectListStyle?: ObjectListStyle

    Object list formatting style. Default: 'auto'

    predicateListStyle?: PredicateListStyle

    Predicate list formatting style. Default: 'first-same-line'

    prefixes?: Record<string, string>

    Prefix mappings for compact IRI serialization. Maps prefix names to namespace IRIs.

    prettyPrint?: boolean

    Whether to use pretty printing with indentation and line breaks. Default: true

    relabelBlankNodes?: boolean

    Whether to rename all blank nodes in first-appearance order using the blankNodeIdGenerator before serializing. Useful for exports where source blank node labels carry parser-internal prefixes (e.g. _:13xf400_b0) that would otherwise leak into the output. Default: false

    Sorting option for quads.

    spaceBeforePunctuation?: boolean

    Add a space before punctuation (. and ;). Default: false.

    useRdfTypeShorthand?: boolean

    Whether to use the 'a' shorthand for rdf:type. Default: true for Turtle/TriG/N3, false for N-Triples/N-Quads