<s>
jq	B-Language
is	O
a	O
very	B-Language
high-level	I-Language
lexically	B-Language
scoped	I-Language
functional	B-Language
programming	I-Language
language	I-Language
in	O
which	O
every	O
JSON	B-General_Concept
value	O
is	O
a	O
constant	O
.	O
</s>
<s>
jq	B-Language
supports	O
backtracking	B-Algorithm
and	O
managing	O
indefinitely	O
long	O
streams	B-Architecture
of	O
JSON	B-General_Concept
data	O
.	O
</s>
<s>
It	O
is	O
related	O
to	O
the	O
Icon	B-Language
and	O
Haskell	B-Language
programming	I-Language
languages	I-Language
.	O
</s>
<s>
The	O
original	O
implementation	O
of	O
jq	B-Language
was	O
in	O
C	B-Language
;	O
gojq	O
is	O
a	O
"	B-Application
pure	I-Application
Go	I-Application
"	I-Application
implementation	O
.	O
</s>
<s>
There	O
is	O
also	O
a	O
Rust	B-Application
implementation	O
of	O
a	O
large	O
subset	O
of	O
jq	B-Language
named	O
jaq	O
,	O
</s>
<s>
for	O
which	O
a	O
denotational	B-Application
semantics	I-Application
has	O
been	O
specified	O
.	O
</s>
<s>
gojq	O
should	O
run	O
on	O
any	O
platform	O
where	O
Go	B-Application
is	O
supported	O
,	O
and	O
likewise	O
for	O
jaq	O
and	O
Rust	B-Application
.	O
</s>
<s>
jq	B-Language
was	O
created	O
by	O
Stephen	O
Dolan	O
,	O
and	O
released	O
in	O
October	O
2012	O
.	O
</s>
<s>
It	O
was	O
famously	O
described	O
as	O
being	O
"	O
like	O
sed	B-Application
for	O
JSON	B-General_Concept
data	O
"	O
.	O
</s>
<s>
Support	O
for	O
regular	B-Language
expressions	I-Language
was	O
added	O
in	O
jq	B-Language
version	O
1.5	O
.	O
</s>
<s>
A	O
"	O
wrapper	O
"	O
program	O
for	O
jq	B-Language
named	O
adds	O
support	O
for	O
YAML	B-Protocol
,	O
XML	B-Protocol
and	O
TOML	B-Protocol
.	O
</s>
<s>
The	O
Go	B-Application
implementation	O
,	O
gojq	O
,	O
was	O
initially	O
released	O
in	O
2019	O
.	O
gojq	O
notably	O
extends	O
jq	B-Language
to	O
include	O
support	O
for	O
YAML	B-Protocol
.	O
</s>
<s>
very	O
large	O
JSON	B-General_Concept
documents	O
with	O
minimal	O
memory	O
requirements	O
.	O
</s>
<s>
jq	B-Language
is	O
typically	O
used	O
at	O
the	O
command	O
line	O
and	O
can	O
be	O
used	O
with	O
other	O
command-line	O
utilities	O
,	O
such	O
as	O
curl	B-Language
.	O
</s>
<s>
Here	O
is	O
an	O
example	O
showing	O
how	O
the	O
output	O
of	O
a	O
command	O
can	O
be	O
piped	O
to	O
a	O
jq	B-Language
filter	O
to	O
determine	O
the	O
category	O
names	O
associated	O
with	O
this	O
Wikipedia	O
page	O
:	O
</s>
<s>
The	O
output	O
produced	O
by	O
this	O
pipeline	O
consists	O
of	O
a	O
stream	O
of	O
JSON	B-General_Concept
strings	O
,	O
the	O
first	O
few	O
of	O
which	O
are	O
:	O
</s>
<s>
The	O
command	O
above	O
uses	O
the	O
MediaWiki	B-Application
API	O
for	O
this	O
page	O
to	O
produce	O
a	O
JSON	B-General_Concept
response	O
.	O
</s>
<s>
The	O
pipe	O
allows	O
the	O
output	O
of	O
to	O
be	O
accessed	O
by	O
jq	B-Language
,	O
a	O
standard	O
Unix	B-Application
shell	I-Application
mechanism	O
.	O
</s>
<s>
The	O
jq	B-Language
filter	O
shown	O
is	O
an	O
abbreviation	O
for	O
the	O
jq	B-Language
pipeline	O
:	O
</s>
<s>
This	O
corresponds	O
to	O
the	O
nested	O
JSON	B-General_Concept
structure	O
produced	O
by	O
the	O
call	O
to	O
.	O
</s>
<s>
Notice	O
that	O
the	O
jq	B-Language
pipeline	O
is	O
constructed	O
in	O
the	O
same	O
manner	O
using	O
the	O
character	O
as	O
the	O
Unix-style	O
pipeline	O
.	O
</s>
<s>
Both	O
the	O
C	B-Language
and	O
the	O
Go	B-Application
implementations	O
provide	O
libraries	O
so	O
that	O
jq	B-Language
functionality	O
can	O
be	O
embedded	O
in	O
other	O
applications	O
and	O
programming	O
environments	O
.	O
</s>
<s>
For	O
example	O
,	O
gojq	O
has	O
been	O
integrated	O
with	O
SQLite	B-Language
so	O
that	O
a	O
function	O
is	O
available	O
in	O
SQL	B-Language
statements	O
.	O
</s>
<s>
like	O
the	O
sed	B-Application
utility	O
can	O
be	O
thought	O
of	O
as	O
a	O
"	O
stream	B-Application
editor	I-Application
"	O
for	O
lines	O
of	O
text	O
.	O
</s>
<s>
However	O
jq	B-Language
has	O
several	O
other	O
modes	O
of	O
operation	O
:	O
</s>
<s>
it	O
can	O
gather	O
a	O
stream	O
of	O
inputs	O
from	O
a	O
specified	O
source	O
into	O
a	O
JSON	B-General_Concept
array	O
;	O
</s>
<s>
it	O
can	O
parse	O
its	O
JSON	B-General_Concept
inputs	O
using	O
a	O
so-called	O
"	O
streaming	O
parser	O
"	O
that	O
produces	O
a	O
stream	O
of	O
[	O
path	O
,	O
value ]	O
arrays	O
for	O
all	O
"	O
leaf	O
"	O
paths	O
.	O
</s>
<s>
For	O
example	O
,	O
for	O
an	O
arbitrarily	O
large	O
array	O
of	O
JSON	B-General_Concept
objects	O
,	O
</s>
<s>
Every	O
JSON	B-General_Concept
value	O
is	O
itself	O
a	O
value	O
in	O
jq	B-Language
,	O
which	O
accordingly	O
has	O
the	O
types	O
shown	O
in	O
the	O
table	O
below	O
.	O
</s>
<s>
is	O
a	O
value	O
,	O
just	O
like	O
any	O
other	O
JSON	B-General_Concept
scalar	O
;	O
it	O
is	O
not	O
a	O
pointer	O
or	O
a	O
"	O
null-pointer	O
"	O
.	O
</s>
<s>
(	O
corresponding	O
to	O
NaN	O
)	O
and	O
(	O
see	O
IEEE	O
754	O
)	O
are	O
the	O
only	O
two	O
jq	B-Language
scalars	O
that	O
are	O
not	O
also	O
JSON	B-General_Concept
values	O
.	O
</s>
<s>
There	O
is	O
a	O
very	O
close	O
relationship	O
between	O
jq	B-Language
and	O
the	O
parsing	O
expression	O
grammar	O
(	O
PEG	O
)	O
formalism	O
.	O
</s>
<s>
The	O
relationship	O
stems	O
from	O
the	O
equivalence	O
of	O
the	O
seven	O
basic	O
PEG	O
operations	O
and	O
the	O
jq	B-Language
constructs	O
shown	O
in	O
the	O
following	O
table	O
.	O
</s>
<s>
+	O
Correspondence	O
between	O
PEG	O
operations	O
and	O
jq	B-Language
equivalents	O
PEG	O
operation	O
name	O
PEG	O
notation	O
jq	B-Language
operation	O
or	O
def	O
Sequence	O
e1	O
|	O
e2	O
Ordered	O
choice	O
Zero-or-more	O
def	O
star(E )	O
:	O
(	O
E	O
|	O
star(E )	O
)	O
//	O
.	O
</s>
