MeridianMERIDIAN

S-Expression

container.object.s_expression

Balanced nested parenthetical serialization — the S-expression family: Lisp/Scheme source, linguistic constituency/dependency parse trees (Penn Treebank, OntoNotes: "(ROOT (S (NP (NN cat)) (VP (VBZ sits))))"), and code ASTs ("(program (call (id print) (string hi)))"). A nested structure of the form (head child child ...), distinguished from a comma/whitespace list by its balanced, recursively-nested parentheses.

Try a value

S-Expression's rule accepts it.

Reads it as (ROOT (S (NP (NN cat)) (VP (VBZ sits))))

Also accepted by

  • CSV Record (ROOT (S (NP (NN cat)) (VP (VBZ sits))))
Casts to
VARCHAR

Shape

Length at least 5 characters.

Pattern
^\s*\(.*\)\s*$
ValueLengthShape
(ROOT (S (NP (NN cat)) (VP (VBZ sits))))40matches
(program (call (id print) (string hello)))42matches
(+ (* 2 3) (- 4 1))19matches
(a (b c) (d (e f)))19matches
(S (INTJ (UH Uh)) (, ,) (NP-SBJ (PRP I)) (VP (VBP think)))58matches
ROOT (S (NP (NN cat)) (VP (VBZ sits))))39rejected: first character dropped

Told apart

1 of the 6 other object types accept every one of these samples on shape alone.

Generated on request only: the model does not predict this leaf, a rule recovers it, so its synthetic values exist for the training set's label coverage and not for the default output.

Background

Origin

In most modern S-expression notations, (x y z) stands for (x . (y . (z . NIL))).[1] Whitespace-separated list notation is typical in Lisp.[1]

RFC 9804, Simple Public Key Infrastructure (SPKI) S-Expressions, was written by R. Rivest and D. Eastlake 3rd and published in June 2025.[2] RFC 9804 says its S-expressions were originally developed in 1996 for SDSI, the Simple Distributed Security Infrastructure by Lampson and Rivest.[2] RFC 9804 says the origins of these S-expressions date back to McCarthy's LISP programming language.[2] According to RFC 9804, a specification was made publicly available as draft-rivest-sexp-00.txt on 4 May 1997 but was never actually submitted to the IETF.[2] RFC 9804 defines an S-expression informally as either an octet-string or a finite list of simpler S-expressions.[2] One of RFC 9804's design goals is that it should be easy to produce a unique canonical form of an S-expression for digital signature purposes.[2] RFC 9804's canonical form represents each octet-string in verbatim mode and puts no blanks between list elements or the surrounding parentheses.[2]

FineType defines container.object.s_expression as a general type for balanced, nested parenthetical serialisation, covering Lisp and Scheme source, linguistic parse trees and code ASTs.[3] FineType's definition distinguishes an S-expression from a comma or whitespace list by its balanced, recursively nested parentheses.[3]

Use

In the Lisp family of programming languages, S-expressions are used to represent both source code and data.[1] When Lisp source code is written as an S-expression, the first element is commonly an operator or function name and the remaining elements are treated as arguments.[1] Lisp programs are valid S-expressions, but not all S-expressions are valid Lisp programs.[1] S-expressions are used for the WebAssembly text format.[1] Wikipedia names IMAP among the communication protocols that use S-expressions as mark-up.[1] RFC 9804 says its S-expressions are in active use between GnuPG and Ribose's RNP.[2] Libgcrypt's public key functions use S-expressions to pass complex data structures around.[4]

Treebank-3 is listed in the Linguistic Data Consortium catalogue as LDC99T42.[5] The Linguistic Data Consortium catalogue lists Mitchell P. Marcus, Beatrice Santorini, Mary Ann Marcinkiewicz and Ann Taylor as the authors of Treebank-3.[5] NLTK's Tree.fromstring reads a bracketed tree string, such as (S (NP (NNP John)) (VP (V runs))), and returns a tree.[6] NLTK's Tree.fromstring has a remove_empty_top_bracketing option, which the NLTK documentation says is useful for treebank trees that sometimes contain an extra level of bracketing.[6] In the part-of-speech tags of the CoNLL-2012 OntoNotes v5 dataset on Hugging Face, -LRB- and -RRB- stand for the ( and ) characters.[7] Before you rebuild sentence text from a parse tree, map bracket tokens such as -LRB- and -RRB- back to the parentheses they stand for. (Meridian's view)

Tree-sitter query patterns are S-expressions that match nodes in a syntax tree.[8] In a tree-sitter pattern, a node is matched by a pair of parentheses containing the node's type and, optionally, patterns for its children.[8] Tree-sitter represents text its parser does not recognise as an (ERROR) node in the syntax tree.[8] The tree-sitter parse command's --no-ranges option omits node ranges from the default parse output, which the documentation says is useful when copying S-expressions to a test file.[9] Before treating a column of syntax trees as clean, look for ERROR nodes and decide whether those rows belong in the analysis. (Meridian's view)

In Lisp-like languages a quoted string can typically contain anything but a quote.[1] Line breaks usually qualify as separators in S-expression notation.[1] Parse an S-expression with a reader built for its dialect, such as a Lisp reader or a treebank tree reader, rather than splitting it on commas or spaces. (Meridian's view)

Where you'll meet it

The CoNLL-2012 OntoNotes v5 dataset on Hugging Face has a parse_tree field stored as a string.[7] The Hugging Face card for the CoNLL-2012 OntoNotes v5 dataset describes the parse_tree field as a serialized NLTK Tree that includes POS tags as pre-terminal nodes.[7] An example parse_tree on the CoNLL-2012 OntoNotes v5 dataset card begins (TOP(S(NP (NNP CONCORDE).[7]

Detection notes

New 2026-07-05 (company-reference audit; author-approved as a general S-expression type over a narrow parse_tree leaf). Mined from 1,292 corpus columns — `trees`/`parse_tree`/`ast` — every one mislabelled container.array.comma_separated by the delimiter detector. The 244-dim model cannot predict this leaf; it is recovered at profile time by the deterministic `s_expression_recovery` Sharpen guard when >=90% of a column's values pass the balanced-nested-paren structural check (finetype_core::structure::is_s_expression). Value-based (0048), no header gate — the structural signature is self-precise (corpus over-recovery: zero). NO retrain (0096; value-determinable → Sharpen). Generated on request only: the model does not predict this leaf, a rule recovers it, so its synthetic values exist for the training set's label coverage and not for the default output.

Use it

CLI · DuckDB
$ finetype infer -i "(ROOT (S (NP (NN cat)) (VP (VBZ sits))))" --mode column
→ container.object.s_expression

SELECT ft_infer('(ROOT (S (NP (NN cat)) (VP (VBZ sits))))');
-- → 'container.object.s_expression'
Cast expression
CAST({col} AS VARCHAR)

Schema

https://meridian.online/schemas/container.object.s_expression · Frictionless type string

finetype taxonomy container.object.s_expression -o json-schema

Aliases

sexps_exprparse_treelisp

Type Registry