Liking cljdoc? Tell your friends :D

com.yetanalytics.pan


get-external-irisclj/s

(get-external-iris profile)

Return a map of keys to sets of IRIs, where the IRIs reference objects that do not exist in profile. Values include IRIs from Concepts, Statement Templates, and Patterns as well as "@context" IRI values.

Return a map of keys to sets of IRIs, where the IRIs reference
objects that do not exist in `profile`. Values include IRIs
from Concepts, Statement Templates, and Patterns as well as
"@context" IRI values.
sourceraw docstring

json-profile->ednclj/s

(json-profile->edn json-profile)

Convert an JSON string xAPI Profile into an EDN data structure, where all keys are keywordized (and @s, e.g. in @context, are converted into _).

Convert an JSON string xAPI Profile into an EDN data structure,
where all keys are keywordized (and `@`s, e.g. in `@context`, are
converted into `_`).
sourceraw docstring

validate-objectclj/s

(validate-object object
                 &
                 {object-type :type
                  :keys [result error-msg-opts]
                  :or {result :spec-error-data
                       error-msg-opts {:print-objects? true}}})

Perform syntax validation on object against the spec expected by the :type kwarg, or by its :type property if not provided (ultimately defaulting to Concept). Other forms of validation are not (yet) supported.

Valid :type keywords include

  • :concept
  • :template
  • :pattern

Valid result keywords include

  • :spec-error-data
  • :path-string (map of spec error path to error strings)
  • :string (monolithic error string)
  • :println (result of :string printed to stdout)
Perform syntax validation on `object` against the spec expected by
the `:type` kwarg, or by its `:type` property if not provided
(ultimately defaulting to Concept). Other forms of validation are not
(yet) supported.

Valid `:type` keywords include
- `:concept`
- `:template`
- `:pattern`

Valid `result` keywords include
- `:spec-error-data`
- `:path-string` (map of spec error path to error strings)
- `:string` (monolithic error string)
- `:println` (result of `:string` printed to stdout)
sourceraw docstring

validate-profileclj/s

(validate-profile profile
                  &
                  {:keys [syntax? ids? multi-version? relations? concept-rels?
                          template-rels? pattern-rels? contexts? extra-profiles
                          extra-contexts result error-msg-opts]
                   :or {pattern-rels? false
                        multi-version? false
                        syntax? true
                        concept-rels? false
                        error-msg-opts {:print-objects? true}
                        template-rels? false
                        ids? false
                        extra-contexts {}
                        relations? false
                        result :spec-error-data
                        extra-profiles []
                        contexts? false}})

Validate profile from the top down, printing or returning errors on completion. Supports multiple levels of validation based on the following keyword arguments:

  • :syntax? Basic syntax validation only. Default true.
  • :ids? Validate object and versioning IDs. Default false.
  • :multi-version? Whether to support multiple inSchemes in the same Profile. Default false.
  • :relations? Validate IRI-given relations between Concepts, Statement Templates and Patterns. Default false.
  • :concept-rels? Validate Concept-specific relations. Default false, and is overridden if :relations? is true.
  • :template-rels? Validate Statement Template-specific relations (incl. Concept-Template relations). Default false, and is overridden if :relations? is true.
  • :pattern-rels? Validate Pattern-specific relations (incl. Pattern and Statement Template relations). Default false, and is overridden if :relations? is true.
  • :contexts? Validate "@context" values and that Profile keys expand to absolute IRIs using RDF contexts. Default false.

Also supports multiple resources with the following:

  • :extra-profiles Extra profiles from which Concepts, Templates, and Patterns can be referenced from. Default [].
  • :extra-contexts Extra "@context" values (other than the xAPI Profile and Activity contexts) that "@context" IRIs in profile can reference during context validation. Default {}.

The :result keyword argument affects the return data, and can take one of the following values:

  • :spec-error-data Return a {:error-type spec-error-data} map.
  • :type-path-string Return a {:err-type {:err-path err-string}} map.
  • :type-string Return a {:err-type err-string} map.
  • :string Return the Expound-generated error string.
  • :print Print the error string to standard output.

The :error-msg-opts keyword argument affects how error message strings are formed. The argument is a map that takes the following key-val pairs:

  • :print-objects? If true (default) display the entire object; if false only display the :id value. Affects both syntax and edge validation error messages.
Validate `profile` from the top down, printing or returning errors
on completion. Supports multiple levels of validation based on the
following keyword arguments:
- `:syntax?`        Basic syntax validation only. Default `true`.
- `:ids?`           Validate object and versioning IDs. Default `false`.
- `:multi-version?` Whether to support multiple inSchemes in the same
                    Profile. Default `false`.
- `:relations?`     Validate IRI-given relations between Concepts,
                    Statement Templates and Patterns. Default
                    `false`.
- `:concept-rels?`  Validate Concept-specific relations. Default `false`,
                    and is overridden if `:relations?` is `true`.
- `:template-rels?` Validate Statement Template-specific relations (incl.
                    Concept-Template relations). Default `false`, and is
                    overridden if `:relations?` is `true`.
- `:pattern-rels`?  Validate Pattern-specific relations (incl. Pattern and
                    Statement Template relations). Default `false`, and is
                    overridden if `:relations?` is `true`.
- `:contexts?`      Validate "@context" values and that Profile keys
                    expand to absolute IRIs using RDF contexts. Default
                    `false.`

Also supports multiple resources with the following:
- `:extra-profiles` Extra profiles from which Concepts, Templates, and
                      Patterns can be referenced from. Default `[]`.
- `:extra-contexts` Extra "@context" values (other than the xAPI Profile
                      and Activity contexts) that "@context" IRIs in
                      `profile` can reference during context validation.
                      Default `{}`.

The `:result` keyword argument affects the return data, and can take one
of the following values:
- `:spec-error-data`  Return a `{:error-type spec-error-data}` map.
- `:type-path-string` Return a `{:err-type {:err-path err-string}}` map.
- `:type-string`      Return a `{:err-type err-string}` map.
- `:string`           Return the Expound-generated error string.
- `:print`            Print the error string to standard output.
                    
The `:error-msg-opts` keyword argument affects how error message strings are
formed. The argument is a map that takes the following key-val pairs:
- `:print-objects?` If `true` (default) display the entire object; if `false`
                    only display the `:id` value. Affects both syntax and
                    edge validation error messages.
sourceraw docstring

validate-profile-collclj/s

(validate-profile-coll profile-coll
                       &
                       {:keys [syntax? ids? multi-version? relations?
                               concept-rels? template-rels? pattern-rels?
                               contexts? extra-profiles extra-contexts result
                               error-msg-opts]
                        :or {pattern-rels? false
                             multi-version? false
                             syntax? true
                             concept-rels? false
                             error-msg-opts {:print-objects? true}
                             template-rels? false
                             ids? false
                             extra-contexts {}
                             relations? false
                             result :spec-error-data
                             extra-profiles []
                             contexts? false}})

Like validate-profile, but takes a profile-coll instead of a single Profile. Each Profile can reference objects in other Profiles (as well as those in :extra-profiles) and must not share object IDs with those in other Profiles. During context validation, all Profiles reference the global :extra-contexts map. Keyword arguments are the same as in validate-profile, though the error result (except for :print) are now all vectors.

Like `validate-profile`, but takes a `profile-coll` instead of a
single Profile. Each Profile can reference objects in other Profiles
(as well as those in `:extra-profiles`) and must not share object
IDs with those in other Profiles. During context validation, all
Profiles reference the global `:extra-contexts` map. Keyword
arguments are the same as in `validate-profile`, though the error
result (except for `:print`) are now all vectors.
sourceraw docstring

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

× close