Boomla filesystem query language

In Boomla, files are selected. You can select one ore more files. This is in contrast with a traditional OS, where files are opened. In Boomla, you don’t need to open and close files, just work with them.

Selecting one or more files

To select a single file, use its path.

Examples:

  • //example.com/foo/bar
  • /foo/bar
  • foo/bar

To find multiple files, you can use a path with wildcards. You can also throw in some selectors and filters.

Selectors perform a certain function on the context collection. Take, for example, */first(). * is a filter for returning all the children of a given file. first() is a selector to keep only the first of those.

Filters are used to select 0 or more children of a file.

Note that only a single selector may be present between slashes (/), but you can use multiple filters.

Examples:

  • Selectors: */first()
  • Filters: foo/*:c:1/bar

Filters

Name filter name

Select a file by its name.

Examples: name, a/b/c.

Wildcard filter *

Select a file by pattern matching its name.

Examples: ali*, a/*, a/*/*.

Page filter :p

Only match files that are pages. A file is a page its type chain contains a file named .Page.

Examples: :p, a/:p, a/:p/:p

Content filter :c

Only match files that are contents. A file is a content if it is not a page.

Examples: :c, a/:c, a/:c/:c

Placeholder filter :1

Select all files in a given placeholder.

Examples: /:1, */:1, foo/*:1.

Selectors

Website root file selector //example.com

Select the root file of any website. Must be at the beginning of a query string. Note that access control may prevent you from selecting remote websites.

Examples: //example.com, //example.com/, //example.com/foo.

Root file selector /

Select the root file of the context filesystem. Must be at the beginning of a query string.

Note that for imported filesystems, this means the root file of the imported filesystem, not the outer one.

Examples: /, /a.

Parent selector ..

Select a file’s parent at parsing time.

Note that the .. parent selector is resolved before the query is executed, while the parent() selector is resolved at runtime. Thus, parent()/.. is not equivalent to ../parent().

foo/parent()/.. resolves to foo, while foo/../parent() resolves to parent()

Examples: .., ../../a.

File type selector type()

Follow the file’s type reference.

Examples: type(), a/type()/b.

File typeChain selector typeChain()

Return all the files along the file’s type chain, including self.

Examples: typeChain(), a/typeChain()/b.

Root selector root()

Selects the root file of the context. Note that for imported filesystems, this means the root file of the imported filesystem, not the outer one.

Examples: root(), root()/foo.

Parent selector parent()

Select a file’s parent at runtime.

Note that the parent() selector is resolved at runtime, not at parsing time. Thus, parent()/.. is not equivalent to ../parent().

foo/parent()/.. resolves to foo, while foo/../parent() resolves to parent()

Examples: parent(), typeChain()/last()/root().

First selector first()

Returns the first file from the collection. May also be called on a file.

Examples: first(), */first().

Last selector last()

Returns the last file from the collection. May also be called on a file

Examples: last(), */last().