Liking cljdoc? Tell your friends :D

tegere.query

Functionality for querying a :tegere.parser/features collection, including preparing said collection for querying by 'projecting' tags from features and example tables to the scenarios that are the ultimate targets of queries.

Functionality for querying a ``:tegere.parser/features`` collection, including
preparing said collection for querying by 'projecting' tags from features and
example tables to the scenarios that are the ultimate targets of queries.
raw docstring

examples-queryclj

source

features->dbclj

(features->db features)
source

filter-featuresclj

(filter-features features indices)

Return a substructure of features that matches the sequence of [feature-idx scenario-idx] in indices. The input and output features collection conforms to :tegere.parser/features.

Return a substructure of ``features`` that matches the sequence of
[feature-idx scenario-idx] in ``indices``. The input and output features
collection conforms to ``:tegere.parser/features``.
sourceraw docstring

filter-scenariosclj

(filter-scenarios scenarios indices)

Return the sub-collection of scenarios whose positional indices match any of the indices in indices.

Return the sub-collection of ``scenarios`` whose positional indices match any
of the indices in ``indices``.
sourceraw docstring

get-all-scenario-tagsclj

(get-all-scenario-tags features)

Given a :tegere.parser/features vector, return a map from scenario paths within that vector (2-ary vecs of int) to sets of tags belonging to the scenario at the path. E.g., {[0 0] #{manner_of_looking=quizzically chimpanzees fruit-reactions} ...}.

Given a ``:tegere.parser/features`` vector, return a map from scenario paths
within that vector (2-ary vecs of int) to sets of tags belonging to the
scenario at the path. E.g.,
{[0 0] #{manner_of_looking=quizzically chimpanzees fruit-reactions} ...}.
sourceraw docstring

get-datalog-boolean-treeclj

(get-datalog-boolean-tree user-query)
source

queryclj

(query features where)

Query the features data structure (conformant to :tegere.parser/features) using where clause where and returning a substructure of features that contains only the features and scenarios that match the where clause. The where clause must be a list-based tree structure that conforms to ::query-tree, i.e., its non-terminal nodes are the symbols 'and 'or or 'not and its terminal nodes are strings that should match Gherkin tags in the features. Example usage::

(query features '(and (or chimpanzees orangutan) (not fruit-reactions)))
Query the features data structure (conformant to ``:tegere.parser/features``)
using where clause ``where`` and returning a substructure of ``features`` that
contains only the features and scenarios that match the where clause. The
``where`` clause must be a list-based tree structure that conforms to
``::query-tree``, i.e., its non-terminal nodes are the symbols 'and 'or or 'not
and its terminal nodes are strings that should match Gherkin tags in the
features. Example usage::

    (query features '(and (or chimpanzees orangutan) (not fruit-reactions)))
sourceraw docstring

remove-top-level-conjunctionsclj

(remove-top-level-conjunctions datalog-boolean-tree)
source

set-all-scenario-tagsclj

(set-all-scenario-tags features)

Return a modified copy of the :tegere.parser/features vector features such that each feature's :tegere.parser/scenario contains a ::tags set containing all of the tags that pertain to that scenario.

Return a modified copy of the ``:tegere.parser/features`` vector ``features``
such that each feature's ``:tegere.parser/scenario`` contains a ``::tags`` set
containing *all* of the tags that pertain to that scenario.
sourceraw docstring

tags-queryclj

source

user-query->datalog-queryclj

(user-query->datalog-query user-query)

Given a user query conformant to ::query-tree (e.g., '(and chimpanzees bonobos)), return a datalog query that can be passed to datascript.core/q. The return value of executing this query will be a set of 2-ary vectors containing a feature index and a scenario index.

Given a user query conformant to ``::query-tree`` (e.g.,
'(and chimpanzees bonobos)), return a datalog query that can be passed to
``datascript.core/q``. The return value of executing this query will be a set
of 2-ary vectors containing a feature index and a scenario index.
sourceraw docstring

user-query->where-clausesclj

(user-query->where-clauses user-query)

Given ::query-tree user-query, return a sequence of datalog 'where' clauses. Remove all top-level 'and' lists of all clauses.

Given ``::query-tree`` ``user-query``, return a sequence of datalog 'where'
clauses. Remove all top-level 'and' lists of all clauses.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close