Liking cljdoc? Tell your friends :D

ont-app.graph-log.core


annotate!clj/s

(annotate! element & args)

Side-effect, adds args to entry for element in log-graph Where

  • args := [predicate object, ...]
  • element is an element of the log-graph
Side-effect, adds `args` to entry for `element` in log-graph
Where
  - `args` := [`predicate` `object`, ...]
  - `element` is an element of the log-graph
sourceraw docstring

archiving?clj/s

(archiving?)
(archiving? g)

True iff archiving is enabled for g Where:

  • g is an IGraph being used as a log-graph (default log-graph)

VOCABULARY: <log graph> :glog/archiveDirectory <directory> <log graph> :glog/archivePathFn <path fn kw> <path fn kw> :igraph/compiledAs <fn [g] -> directory>

True iff archiving is enabled for `g`
Where:
- `g` is an IGraph being used as a log-graph (default [[log-graph]])

VOCABULARY:
<log graph> `:glog/archiveDirectory` <directory>
<log graph> `:glog/archivePathFn` <path fn kw>
<path fn kw> `:igraph/compiledAs` <fn [g] -> directory>
sourceraw docstring

clear-entriesclj/s

(clear-entries g)

Returns g with all entries removed

VOCABULARY: :glog/LogGraph :glog/hasEntry <entry>

Returns `g` with all entries removed

VOCABULARY:
`:glog/LogGraph` `:glog/hasEntry` <entry>
sourceraw docstring

compare-shared-entriesclj/s

(compare-shared-entries g1 g2)

Returns an IGraph containing content shared between g1 and g2 Where

  • g1, g2 are @log-graph's from two different sessions.
Returns an IGraph containing content shared between `g1` and `g2`
Where
  - `g1`, `g2` are @log-graph's from two different sessions.
sourceraw docstring

default-log-levelclj/s

Atom containing default log level. Initialized to :glog/INFO.

Atom containing default log level. Initialized to :glog/INFO.
sourceraw docstring

empty-graphclj/s

An instance of an empty native-normal graph.

An instance of an empty native-normal graph.
sourceraw docstring

entriesclj/s

(entries)
(entries entry-type)
(entries g entry-type)

Returns [entry-id, ...] for entry-type in g ordered by :glog/executionOrder Where

  • entry-id is a KWI identifying a log event in g
  • g is an optional IGraph supporting the logging ontology, (default log-graph) This is typically either the current log-graph or a copy of the log-grpah from a previous session.
  • entry-type is :all or the ID of some entry type.

VOCABULARY

  • :glog/LogGraph - Names @log-graph in @log-graph
  • <log graph> :glog/hasEntry <entry>
  • <entry> :glog/executionOrder <int representing that entry is ith event executed>
Returns [`entry-id`, ...] for `entry-type` in `g` ordered by :glog/executionOrder
Where
- `entry-id` is a KWI identifying a log event in `g`
- `g` is an optional IGraph supporting the logging ontology, (default log-graph)
  This is typically either the current log-graph or a copy of the log-grpah
  from a previous session.
- `entry-type` is :all or the ID of some entry type.

VOCABULARY
- `:glog/LogGraph` - Names @log-graph in @log-graph
- <log graph> `:glog/hasEntry` <entry>
- <entry> `:glog/executionOrder` <int representing that entry is ith event executed>
sourceraw docstring

entry-countclj/s

(entry-count)
(entry-count g)

Returns the number of entries in g (default @log-graph)

VOCABULARY: :Glog/LogGraph :glog/entryCount <# of entries>

Returns the number of entries in `g` (default @log-graph)

VOCABULARY:
`:Glog/LogGraph` `:glog/entryCount` <# of entries>
sourceraw docstring

find-divergenceclj/s

(find-divergence log1 log2)

Returns [same> [e1> e2>] forlog1andlog2` Where

  • same> := [shared-event>, ...]
  • e1, e2 name events whose details differ between log1 and log2
  • log1 log2 are @log-graph's from two different sessions, NOTE: typically called during debugging reflecting some minor change in the same code base.
Returns [`same> [`e1> `e2>] for `log1` and `log2`
Where
  - `same> := [`shared-event>, ...]
  - `e1`, `e2` name events whose details differ between `log1` and `log2`
  - `log1` `log2` are @log-graph's from two different sessions,
  NOTE: typically called during debugging reflecting some minor change in the same code
  base.
sourceraw docstring

ith-entryclj/s

(ith-entry i)
(ith-entry g i)

Returns [entry-id description] for ith execution order in g (default @graph-log) Where

  • entry-id is keyword naming the entry
  • description is the normal-form description of entry-id in g
  • g is a log-graph (@log-graph by default)
Returns [`entry-id` `description`] for ith execution order  in `g`
  (default @graph-log)
Where
- `entry-id` is keyword naming the entry
- `description` is the normal-form description of `entry-id` in `g`
- `g` is a log-graph (@log-graph by default)
sourceraw docstring

level-prioritiesclj/s

Caches level priorities, to inform level>=

Caches level priorities, to inform `level>=`
sourceraw docstring

level>=clj/s

(level>= this-level that-level)

Returns true iff this-level has priority >= that-level Where <this-level> e.g. :glog/INFO <that-level> e.g. :glog/DEBUG

Returns true iff `this-level` has priority >= `that-level`
Where
<this-level> e.g. :glog/INFO
<that-level> e.g. :glog/DEBUG
sourceraw docstring

log!clj/s

(log! entry-type & args)

Side-effect: adds an entry to log-graph for id minted per entry-type and args Returns: id or nil (if no entry was made) Where

  • id is a KWI minted for entry-type and whatever arg-kwis are of :rdf/type :glog/InformsUri in @log-graph.
  • entry-type is a KWI
  • args := [arg-kwi value, ...] Note: Any issues relating to log levels should be handled before calling this function.

VOCABULARY

  • :glog/InformsUri - type for a property referred to when minting URIs
  • :glog/Entry - type for log entries
  • :glog/LogGraph - Names @log-graph in @log-graph
  • <log graph> :glog/entryCount <number of entries in the graph>
  • <log graph> :glog/hasEntry <entry>
  • <entry> :glog/timestamp <time of event in epoch ms>
  • <entry> :glog/executionOrder <int representing that entry is ith event executed>
Side-effect: adds an entry to log-graph for `id` minted per `entry-type` and `args`
Returns: `id` or nil (if no entry was made)
Where
- `id` is a KWI minted for `entry-type` and whatever `arg-kwi`s are of 
:rdf/type :glog/InformsUri in @log-graph.
- `entry-type` is a KWI
- `args` := [`arg-kwi` `value`, ...]
Note: Any issues relating to log levels should be handled before calling this
function.

VOCABULARY
- :glog/InformsUri - type for a property referred to when minting URIs
- :glog/Entry - type for log entries
- :glog/LogGraph - Names @log-graph in @log-graph
- <log graph> :glog/entryCount <number of entries in the graph>
- <log graph> :glog/hasEntry <entry>
- <entry> :glog/timestamp <time of event in epoch ms>
- <entry> :glog/executionOrder <int representing that entry is ith event executed>

sourceraw docstring

log-graphclj/s

An atom holding the current graph to which new entries will be logged.

An atom holding the current graph to which new entries will be logged.
sourceraw docstring

log-reset!clj/s

(log-reset!)
(log-reset! initial-graph)

Side-effect: resets @log-graph to initial-graph Where

  • <initial-graph> is an IGraph, informed by ont-app.graph-log.core/ontology
    • optional. Default is core/ontology.
Side-effect: resets @log-graph to `initial-graph`
Where
- <initial-graph> is an IGraph, informed by ont-app.graph-log.core/ontology
  - optional. Default is core/ontology.
sourceraw docstring

log-value!clj/s

(log-value! entry-type value)
(log-value! entry-type other-args value)

Returns value Side effect: logs <id> :glog/value value, plus other-args into log-graph Where

  • entry-type is a keyword naming the type of entry
  • value is the value being logged before it's returned.
  • other-args := [p o, ...]
  • entry is an entry in @glog/log-graph
  • p is a keyword naming a property of entry
  • o is a value asserted for p s.t. [entry p o] in the log.

VOCABULARY

  • <entry> :glog/value <value of some eval'd expression>
Returns `value`
Side effect: logs <id> :glog/value `value`, plus `other-args` into log-graph
Where
- `entry-type` is a keyword naming the type of `entry`
- `value` is the value being logged before it's returned.
- `other-args` := [`p` `o`, ...]
- `entry` is an entry in @glog/log-graph
- `p` is a keyword naming a property of `entry`
- `o` is a value asserted for `p` s.t. [`entry` `p` `o`] in the log.

VOCABULARY
- <entry> :glog/value <value of some eval'd expression>
sourceraw docstring

ontologyclj/s

A native-normal graph containing the graph-log ontology

A native-normal graph containing the graph-log ontology
sourceraw docstring

query-logclj/s

(query-log q)
(query-log g q)

Returns [bmap, ....] for q posed to optional g Where

  • bmap := {var value, ...} bindings to q posed to g
  • q is a query in a format amenable to g
  • g is an IGraph supporting the graph-log vocabulary (default @log-graph)
Returns [`bmap`, ....] for `q` posed to optional `g`
Where
- `bmap` := {`var` `value`, ...} bindings to `q` posed to `g`
- `q` is a query in a format amenable to `g`
- `g` is an IGraph supporting the graph-log vocabulary (default @log-graph)
sourceraw docstring

remove-timestampsclj/s

(remove-timestamps)
(remove-timestamps g)

Removes timestamps, a spurious difference between two otherwise equivalent log entries.

NOTE: typically used to compare two otherwise identical logs.

VOCABULARY:

  • :glog/LogGraph - Names @log-graph in @log-graph
  • <log graph> :glog/hasEntry <entry>
  • <entry> :glog/timestamp <time of event in epoch ms>
Removes timestamps, a spurious difference between two otherwise equivalent log entries.

NOTE: typically used to compare two otherwise identical logs.

VOCABULARY:
- `:glog/LogGraph` - Names @log-graph in @log-graph
- <log graph> `:glog/hasEntry` <entry>
- <entry> `:glog/timestamp` <time of event in epoch ms>
sourceraw docstring

remove-variant-valuesclj/s

(remove-variant-values)
(remove-variant-values g)

Returns g, removing/replacing values which would naturally vary between sessions. These would give rise to spurious differences between two otherwise identical logs. Timestamps are removed, and compiled objects are replaced with :compiled Where

  • g is an optional log-graph from the current or past sessions. Default is current @log-graph
Returns `g`, removing/replacing values which would naturally vary between sessions.
These would give rise to spurious differences between two otherwise identical
  logs. Timestamps are removed, and compiled objects are replaced with
  :compiled
Where
- `g` is an optional log-graph from the current or past sessions. Default
  is current @log-graph
sourceraw docstring

report-divergenceclj/s

(report-divergence g1 g2)
source

(search inc-or-dec entry-test g c _found q)

Returns [c found [previous-index]] for entry-test of ith entry per q and inc-or-dec See also the IGraph docs for traversal functions.

Where

  • c is the (ignored) traversal context
  • found is nil or the first previous entry to pass test
  • previous-index decrements the head of q, or empty if found or i < 0
  • entry-test := fn [g entry] -> boolean
  • q := [entry or i [i] if still searching or [] if found. inc/dec-ing per iteration
  • i is the execution order to test
  • inc-or-dec :~ #{inc dec}, inc to search forward dec to search backward.
  • entry is the ith entry in g
  • g is a log-graph.
  • NOTE: typically we'd use search-forward or search-backward which wrap this fn.
  • NOTE: typically this is used as a partial application over test (igraph/traverse g (partial search-backward test) nil [entry-id])

VOCABULARY

  • <entry> :glog/executionOrder <int indicating event is ith event executed>
Returns [c found [previous-index]] for `entry-test` of `i`th  entry per `q` and inc-or-dec
See also the IGraph docs for traversal functions.

Where
-  `c` is the (ignored) traversal context
- `found` is nil or the first previous entry to pass `test`
- `previous-index` decrements the head of `q`, or empty if found or `i` < 0
- `entry-test` := fn [g entry] -> boolean
- `q` := [`entry` or `i` [i] if still searching or [] if found. inc/dec-ing
  per iteration
- `i` is the execution order to test
- `inc-or-dec` :~ #{inc dec}, inc to search forward dec to search backward.
- `entry` is the `i`th entry in `g`
- `g` is a log-graph.
- NOTE: typically we'd use `search-forward` or `search-backward` which wrap this fn.
- NOTE: typically this is used as a partial application over `test`
  (igraph/traverse `g` (partial search-backward `test`)
                               nil
                               [`entry-id`])

VOCABULARY
- <entry> `:glog/executionOrder` <int indicating event is ith event executed>
sourceraw docstring

search-backwardclj/s

(search-backward test)
(search-backward test start)
(search-backward g test start)

Searches the log backward for a match to test, starting at start Where

  • test := fn [g entry] -> boolean
  • start is an integer indexing the (entries g) (default end of entries)
  • g is the log-graph
Searches the log backward for a match to `test`, starting at `start`
Where
- `test` := fn [g entry] -> boolean
- `start` is an integer indexing the (entries g) (default end of entries)
- `g` is the log-graph
sourceraw docstring

search-forwardclj/s

(search-forward test)
(search-forward test start)
(search-forward g test start)

Searches the log forward for a match to test starting at start Where

  • test := fn [g entry] -> boolean
  • start is an integer indexing (entries g) (default 0)
  • g is the log-graph
Searches the log forward for a match to `test` starting at `start`
Where
- `test` := fn [g entry] -> boolean
- `start` is an integer indexing (entries g) (default 0)
- `g` is the log-graph
sourceraw docstring

set-level!clj/s

(set-level! level)
(set-level! element level)

Side-effect, adds args to entry for element in log-graph Where

  • args := [predicate object, ...]
  • element is an element of the log-graph

VOCABULARY:

  • <log-graph or entry> :glog/level <level>
Side-effect, adds `args` to entry for `element` in log-graph
Where
  - `args` := [`predicate` `object`, ...]
  - `element` is an element of the log-graph

VOCABULARY:
  - <log-graph or entry> `:glog/level` <level>
sourceraw docstring

showclj/s

(show entry-id)
(show entry-id p)
(show entry-id p o)

Returns contents of entry-id for optional g p and o Where

  • entry-id is the KWI of an entry
  • g is a log-graph (default @log-graph)
  • p specifies a property of the entry
  • o tests for a specific object
Returns contents of `entry-id` for optional `g` `p` and `o`
Where
- `entry-id` is the KWI of an entry
- `g` is a log-graph (default @log-graph)
- `p` specifies a property of the entry
- `o` tests for a specific object
sourceraw docstring

std-logging-messageclj/s

(std-logging-message & args)

Returns: a string suitable for standard logging based on args, or nil if there is no :glog/message specification. Where

  • args := {p o, ....}
  • p is a keyword naming a property, possibly :glog/message
  • o is a value, known as template if p = :glog/message
  • template is a mustache-style template to which desc-map will be applied Of the form `yadda {{<p>}} yadda...'
  • desc-map := {p o, ...}, minus any :glog/message. Specifying o's to be inserted into template.

VOCABULARY: <entry> :glog/message <message mustache template>

Returns: a string suitable for standard logging based on `args`, or nil
  if there is no :glog/message specification.
Where
  - `args` := {`p` `o`, ....}
  - `p` is a keyword naming a property, possibly :glog/message
  - `o` is a value, known as `template` if `p` = :glog/message
  - `template` is a mustache-style template to which `desc-map` will be applied
  Of the form `yadda {{<p>}} yadda...'
  - `desc-map` := {`p` `o`, ...}, minus any :glog/message. Specifying `o`'s to be 
  inserted into `template`.

  VOCABULARY:
  <entry> `:glog/message` <message mustache template>
sourceraw docstring

theclj/s

alias for igraph/unique

alias for igraph/unique
sourceraw docstring

timestampclj/s

(timestamp)

Returns the timestamp associated with the current moment in epoch ms.

Returns the timestamp associated with the current moment in epoch ms.
sourceraw docstring

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

× close