diction.core

*force-sensible*

dynamic

Dynamic force-sensible flag var for generated values for data element docs.

*generate-all-fields*

dynamic

Dynamic generate-all-fields flag var for forcing generation of all document fields.

<-meta

(<-meta id)
Returns the metadata of the element with `id`.  `nil` is none.

boolean!

Programmatic registration of a boolean data element.

clean

(clean elem)
Cleans the element `element` by removing `type` and `id` fields.

clear-decoration-rules!

(clear-decoration-rules! element-id)
Clears decoration rules for element `element-id`.

clear-dictionary!

(clear-dictionary!)
Clear dictionary entries.

clear-undecoration-rules!

(clear-undecoration-rules! element-id)
Clears undecoration rules for element `element-id`.

clear-validation-rules!

(clear-validation-rules! element-id)
Clears validation rules for element `element-id`.

clone!

(clone! parent-id id)(clone! parent-id id ctx)
Clones `parent-id` to the new element id `id`.

custom-element!

(custom-element! custom-elem element-info)(custom-element! custom-elem id element)(custom-element! custom-elem id element ctx)(custom-element! custom-elem parent-id id element ctx)
Registers custom element with custom element init 'custom-elem`, id `id`, element map `element` with optional element context `ctx and parent element id `parent-id`.  The
parent element may be used as a base for the element definition.

data-dictionary

(data-dictionary)(data-dictionary filter-f)
Generates a data dictionary given current element definitions.

decorate

(decorate element-id v)(decorate element-id v ctx)
Decorates element value `v` using decoration rules for element `element-id` with optional context map `ctx`.

decoration-rule!

(decoration-rule! {:keys [element-id rule-id rule-f ctx]})(decoration-rule! element-id rule-id rule-f)(decoration-rule! element-id rule-id rule-f ctx)
Registers a decoration rule for element `element-id`, decoration rule id `rule-id`, rule function `rule-f`,
and optional context map `ctx`.

decoration-rules

Decoration rules as atom.

default-gen-vector-max

Default maximum count for vector (16).

default-gen-vector-min

Default minimum count for vector (0).

diction-boolean

Diction core boolean data element id.

diction-double

Diction core double data element id.

diction-double-neg

Diction core negative double data element id.

diction-double-pos

Diction core positive double data element id.

diction-float

Diction core float data element id.

diction-float-neg

Diction core negative float data element id.

diction-float-pos

Diction core positive float data element id.

diction-int

Diction core integer data element id.

diction-int-neg

Diction core negative integer data element id.

diction-int-pos

Diction core positive integer data element id.

diction-joda

Diction core Joda date data element id.

diction-keyword

Diction core keyword data element id.

diction-long

Diction core long data element id.

diction-long-neg

Diction core negative long data element id.

diction-long-pos

Diction core positive long data element id.

diction-string

Diction core string data element id.

diction-uuid

Diction core UUID data element id.

dictionary

Atom that holds the dictionary data structure.

dictionary!

(dictionary! d)
Set the dictonary atom with new dictionary value `d`.

document!

(document! id req-un)(document! id req-un opt-un)(document! id req-un opt-un element)(document! id req req-un opt opt-un element ctx)
Register a document/map element given element id `id`, required unqualified nested element ids `req-un`,
optional nested unqualified element ids `opt-un`, required nested element ids `req`, optional nested element
ids `opt-un`, element map `element` and context `ctx`.

document-or-field

(document-or-field m)
Returns either :documents or :fields based on if `m` is a document/map.

document?

(document? m)
Determines if `m` element is a document/map.

double!

Programmatic registration of a double data element.

element!

(element! element-info)(element! id element)(element! id element ctx)(element! parent-id id element ctx)
Registers element with id `id`, element map `element` with optional element context `ctx and parent element id `parent-id`.  The
parent element may be used as a base for the element definition.

entity!

Alias for document! function

enum!

(enum! id enums)(enum! id enums element)(enum! id enums element ctx)
Register an enum element given element id `id`, enum set/list/vector `enums`, element
map `element` and context `ctx`.

explain

(explain id v)
Explains validation failures for element `id` against element value `v` as a vector of maps with validation
failure messages and info.  If no validation failure occurs, returns nil.

explain-all

(explain-all id v)
Explains validation failures for element `id` against element value `v` as a vector of maps with validation
failure messages and info.  If no validation failure occurs, returns nil.

export-elements!

(export-elements!)
Generates the current data elements list.

export-elements-to!

(export-elements-to! target)
Exports elements to `target`.

export-entries

(export-entries)
Generates export vector of element entries.

export-entries-to-file!

(export-entries-to-file! fn)
Exports element entries to file `fn`.

field-element-id

(field-element-id id fld-id)
Returns the namespaced (if available) field id for document element `id` given
a field id `id`.

filter-out-diction-elements

(filter-out-diction-elements x)
Filters out diction elements given element `x`.

float!

Programmatic registration of a float data element.

force-generate

(force-generate id)
Generates a valid value of element id `id`.

function!

(function! {:keys [id f argument-element-ids result-element-id]})(function! function-id f argument-element-ids result-element-id)
Registers function id `id` for function `f` and vector of element ids for the arguments
`arugment-element-ids`, and result element id `result-element-id`.

functions

Generative functions registry as atom.

functions!

(functions! fs)
Registers list of generative testing functions `fs`.

generate

Alias for generate-sensibly function call

generate-nested-elements

(generate-nested-elements element-ids)(generate-nested-elements element-ids unqualified?)(generate-nested-elements element-ids unqualified? optional?)
Generates nested elements `element-ids` with optional flags `unqualified?` for
element id keys and `optional?` for the nested elements.

generate-random-boolean

(generate-random-boolean)
Generates a randome boolean `true` or `false`.

generate-random-double

(generate-random-double)(generate-random-double max)(generate-random-double min max)
Generates random double numbers given optional minimum `min` and maximum `max`.
Default min is Double/MIN_VALUE.  Default max is Double/MAX_VALUE.

generate-random-float

(generate-random-float)(generate-random-float max)(generate-random-float min max)
Generates random float numbers given optional minimum `min` and maximum `max`.
Default min is Float/MIN_VALUE.  Default max is Float/MAX_VALUE.

generate-random-int

(generate-random-int)(generate-random-int max)(generate-random-int min max)
Generates random int numbers given optional minimum `min` and maximum `max`.
Default min is Integer/MIN_VALUE.  Default max is Integer/MAX_VALUE.

generate-random-joda

(generate-random-joda)(generate-random-joda max)(generate-random-joda min max)
Generates random int numbers given optional minimum `min` and maximum `max`.
Default min is Integer/MIN_VALUE.  Default max is Integer/MAX_VALUE.

generate-random-keyword

(generate-random-keyword)(generate-random-keyword max)(generate-random-keyword min max)(generate-random-keyword min max random-str)
Generates a random keyword given optional minimum length `min` and maximum lenghts `max`.
Default min is 0.  Default max is 64.

generate-random-long

(generate-random-long)(generate-random-long max)(generate-random-long min max)
Generates random long numbers given optional minimum `min` and maximum `max`.
Default min is Long/MIN_VALUE.  Default max is Long/MAX_VALUE.

generate-random-map

(generate-random-map element-id)
Generates a random map.

generate-random-poly-vector

(generate-random-poly-vector element-ids)(generate-random-poly-vector element-ids max)(generate-random-poly-vector element-ids min max)(generate-random-poly-vector element-ids min max meta)
Generates a random poly vector of elements `element-ids` given optional minimum size `min` and maximum size `max`.
Default min is 0.  Default max is 16.

generate-random-set

(generate-random-set element-id)(generate-random-set element-id max)(generate-random-set element-id min max)(generate-random-set element-id min max meta)
Generates a random set of element `element-id` given optional minimum size `min` and maximum size `max`.
Default min is 0.  Default max is 16.

generate-random-string

(generate-random-string)(generate-random-string max)(generate-random-string min max)(generate-random-string min max random-str)
Generates a random string given optional minimum length `min` and maximum lenghts `max`.
Default min is 0.  Default max is 64.

generate-random-tuple

(generate-random-tuple element-ids)
Generates a random tuple of elements `element-ids`

generate-random-vector

(generate-random-vector element-id)(generate-random-vector element-id max)(generate-random-vector element-id min max)(generate-random-vector element-id min max meta)
Generates a random vector of element `element-id` given optional minimum size `min` and maximum size `max`.
Default min is 0.  Default max is 16.

generate-regex-keyword

(generate-regex-keyword regex)
Generates a keyword using the regular expression `regex`.  Basic regex is supported only.

generate-regex-string

(generate-regex-string regex)
Generates a string using the regular expression `regex`.  Basic regex is supported only.

generate-sensibly

(generate-sensibly id)(generate-sensibly id generate-as-fallback?)
Generates a sensible value for element with `id` and optional `generate-as-fallback?`
flag to use the generative function for the element if no sensible values
exist in the meta of the element (:element :meta :sensible-values).

generate-test-arguments

(generate-test-arguments arguments)
Generates test 

groom

(groom id v)(groom id v ctx)(groom parent-id id v ctx)
Grooms the `value` of element `id` to align with only the registered diction elements.
If the `value` is a map, then groom acts recursively like `select-keys` to groom unregistered
keys and only passthru registered diction element keys (required and optional).

help

Alias for element lookup function

import!

(import! elem)
Import element `elem` to diction data dictionary.

import-boolean!

Import declarative boolean data element.

import-clone!

(import-clone! elem)
Import a clone element `elem`.

import-document!

(import-document! elem)
Import the document element `elem`.

import-double!

Import declarative double data element.

import-element!

(import-element! elem)(import-element! diction-f elem)
Import element `elem` with optional diction function `diction-f`.

import-entries!

(import-entries! entries)
Imports element entries `entries`.

import-entries-from-file!

(import-entries-from-file! fn)
Imports element entries from file `fn`.

import-enum!

Import declarative enum data element.

import-float!

Import declarative float data element.

import-from-file!

(import-from-file! source)
Import elements from `source` file.

import-keyword!

Import declarative keyword data element.

import-long!

Import declarative long data element.

import-neg-double!

Import declarative negative double data element.

import-neg-float!

Import declarative negative float data element.

import-neg-long!

Import declarative negative long data element.

import-ofs!

(import-ofs! register-f of-key elem)
Import collection of `of-key` elements for element `elem` with the diction
`register-f` function.

import-poly-vector!

Import declarative poly-vector data element.

import-pos-double!

Import declarative positive double data element.

import-pos-float!

Import declarative positive float data element.

import-pos-long!

Import declarative positive long data element.

import-set!

Import declarative set data element.

import-string!

Import declarative string data element.

import-tuple!

Import declarative tuple data element.

import-vector!

Import declarative vector data element.

imports!

(imports! elements)
Imports elements `elements` to diction data dictionary.

info

Alias for element lookup function

inherit!

(inherit! parent-id id)(inherit! parent-id id element)(inherit! parent-id id element ctx)
Register a child element given element id `id`, parent element id `parent-id`, element
map `element` and context `ctx`.

int!

Programmatic registration of an integer data element.

joda!

Programmatic registration of a Joda date data element.

keyword!

Programmatic registration of a keyword data element.

long!

Programmatic registration of a long data element.

lookup

(lookup id)
Lookup of element by element id `id`.

map!

Alias for document! function

meta-query

(meta-query {:keys [element-ids query query-f mask], :as meta-query-map})
Query diction element metadata with map `meta-query-map` and keys
`element-ids` (optional) : subset of element ids to search;
`query` (required) : query map that will simple try to match the element meta data map

neg-double!

Programmatic registration of a negative data element.

neg-float!

Programmatic registration of a negative float data element.

neg-int!

Programmatic registration of a negative integer data element.

neg-long!

Programmatic registration of a negative long data element.

opt-key

Optional qualified/ns fields key.

opt-un-key

Optional unqualified fields keys.

poly-vector!

(poly-vector! id vector-of-element-ids)(poly-vector! id vector-of-element-ids element)(poly-vector! id vector-of-element-ids element ctx)
Register a poly vector (polyglot of element ids) element given element id `id`,
vector element ids `vector-of-element-ids`, element map `element` and context `ctx`.

pos-double!

Programmatic registration of a positive double data element.

pos-float!

Programmatic registration of a positive float data element.

pos-int!

Programmatic registration of a positive integer data element.

pos-long!

Programmatic registration of a positive long data element.

references

(references element-id)
Determine the documents that reference the element `element-id`.

register-element!

(register-element! elem)
Register element `elem` using declarative data.

remove-decoration-rule!

(remove-decoration-rule! element-id rule-id)
Removes decoration rule `rule-id` from element `element-id`.

remove-undecoration-rule!

(remove-undecoration-rule! element-id rule-id)
Removes undecoration rule `rule-id` from element `element-id`.

remove-validation-rule!

(remove-validation-rule! element-id rule-id)
Removes validation rule `rule-id` from element `element-id`.

req-key

Required qualified/ns fields key.

req-un-key

Required unqualified fields key.

reset-decoration-rules!

(reset-decoration-rules!)(reset-decoration-rules! x)
Resets the decoration rules.  Clears all decoration rules if no arguments or `x` is `nil`.  Otherwise,
reset the decoration rules to `x`.

reset-undecoration-rules!

(reset-undecoration-rules!)(reset-undecoration-rules! x)
Resets the undecoration rules.  Clears all undecoration rules if no arguments or `x` is `nil`.  Otherwise,
reset the undecoration rules to `x`.

reset-validation-rules!

(reset-validation-rules!)(reset-validation-rules! x)
Resets the validation rules.  Clears all validation rules if no arguments or `x` is `nil`.  Otherwise,
reset the validation rules to `x`.

sensible

Atom that is the flag to force sensible values during documentation generation

sensible!

(sensible! s)
Sets the sensible flag atom to value `s`.

set-of!

(set-of! id set-of-element-id)(set-of! id set-of-element-id element)(set-of! id set-of-element-id element ctx)
Register a set element given element id `id`, set element id `set-of-element-id`, element
map `element` and context `ctx`.

string!

Programmatic registration of a string data element.

summary-entry

(summary-entry entry)
Generates an index entry for element entry `entry`.

test-all-functions

(test-all-functions)(test-all-functions test-function-count)
Generatively test all registered functions with optional test function count `test-function-count`.

test-function

(test-function function-id)(test-function function-id test-function-count)
Generatively tests registered function `function-id` with optional test count `test-function-count`.
Returns `nil` is all generative test function calls pass.  Otherwise, return failures.

tuple!

(tuple! id vector-of-element-ids)(tuple! id vector-of-element-ids element)(tuple! id vector-of-element-ids element ctx)
Register a tuple (polyglot of element ids) element given element id `id`,
vector element ids `vector-of-element-ids`, element map `element` and context `ctx`.

type-normalizer!

(type-normalizer! normalizer-f)
Register register normalizer function `normalizer-f`.

type-normalizers

Atom with type normalizers to auto-register/decorate data elements.

type-normalizers!

(type-normalizers! normalizer-fs)
Registers register normalizer fuction `normalizer-fs`.

types->functions

Maps data element types to import functions.

undecorate

(undecorate element-id v)(undecorate element-id v ctx)
Undecorates element value `v` using undecoration rules for element `element-id` with optional context map `ctx`.

undecoration-rule!

(undecoration-rule! {:keys [element-id rule-id rule-f ctx]})(undecoration-rule! element-id rule-id rule-f)(undecoration-rule! element-id rule-id rule-f ctx)
Registers an undecoration rule for element `element-id`, undecoration rule id `rule-id`, rule function `rule-f`,
and optional context map `ctx`.

undecoration-rules

Undecoration rules as an atom.

uuid!

Programmatic registration of a UUID data element.

valid-all?

(valid-all? id v)
Determines if the element value `v` of element `id` is valid.

valid?

(valid? id v)
Determines if the element value `v` of element `id` is valid.

validation-rule!

(validation-rule! {:keys [element-id rule-id rule-f ctx]})(validation-rule! element-id rule-id rule-f)(validation-rule! element-id rule-id rule-f ctx)
Registers a validation rule for element id `element-id`, rule id `id`, rule function `rule-f`, and optional
conext map `ctx`.

validation-rules

Validation rules as atom.

vector!

(vector! id vector-of-element-id)(vector! id vector-of-element-id element)(vector! id vector-of-element-id element ctx)
Register a vector element given element id `id`, vector element id `vector-of-element-id`, element
map `element` and context `ctx`.

wrap-gen-f

(wrap-gen-f gen-f)
Wraps generatior function `gen-f` with a function that ignores the element id `id` and element entry `entry` trailing
paramsters when called by the framework to generate a element value. This may be used when the element value
generator function does not need the `id` or `entry` to generate the value.