Published February 5, 2026 | Version v1

Technical details on the Narrascope query language

Authors/Creators

Description

This repository contains files detailing the use and detailed structure of Narrascope's query language (NQL).

NQL is a functional programming language. It is used to (1) describe the structure of the queryable data (the "schema"), (2) formulate specific queries, (3) create functional building blocks/utility functions that can be used to simplify queries.

As example, schema.txt contains one domain-specific data schema that was used to import video corpus data for querying film editing patterns. The file is written in NQL. A second file, query.txt, contains implementations of utility functions that are available in all user queries. The file is written in NQL.

The NQL interpreter relies on a grammar and a prelude of standard functions. These components are described in the following files:

* prelude.txt contains the low-level prelude for the NQL interpreter, which are mostly type and operator predence definitions for fundamental library functions such as map and sort. Most functions are stubs that refer to native JavaScript implementations. The file is written in NQL.

* grammar.ohmjs contains the parsing expression grammar (PEG) for NQL. The grammar file is written in the Ohm language (see https://ohmjs.org/docs/syntax-reference).

Files

grammar.ohmjs.txt

Files (24.5 kB)

Name Size Download all
md5:a59cf1a189fc06a5ef47ed2e65e72744
8.8 kB Preview Download
md5:1101ff54dfad973081ca3832e1fc195a
9.9 kB Preview Download
md5:4c724924db1483eb1542004a94c0e1ce
3.0 kB Preview Download
md5:50dd0c06ad51d14e2a8017671cf30757
2.8 kB Preview Download