Liking cljdoc? Tell your friends :D

ont-app.vocabulary.core

clj

Defines utilities and a set of namespaces for commonly used linked data constructs, metadata of which specifies RDF namespaces, prefixes and other details.

Defines utilities and a set of namespaces for commonly used linked data 
constructs, metadata of which specifies RDF namespaces, prefixes and other 
details.
raw docstring

*alias-map*cljs

{alias ns-name, ...} Where alias is a symbol ns-name is a symbol naming an ns in the current lexical env NOTE: Informs cljc-ns-aliases in cljs space.

{`alias` `ns-name`, ...}
Where
`alias` is a symbol
`ns-name` is a symbol naming an ns in the current lexical env
NOTE: Informs cljc-ns-aliases in cljs space.
raw docstring

clear-caches!clj/s

(clear-caches!)

Side-effects: resets all caches in voc/ to nil NOTE: call this when you may have imported new namespace metadata

Side-effects: resets all caches in voc/ to nil
NOTE: call this when you may have imported new namespace metadata
raw docstring

cljc-all-nsclj/s

(cljc-all-ns)

Returns (ns-name-or-obj ...) Where

  • ns-name-or-obj may either be a namespace (in clj) or the name of a namespace (in cljs)
Returns (`ns-name-or-obj` ...)
Where
  - `ns-name-or-obj` may either be a namespace (in clj) 
     or the name of a namespace (in cljs)
raw docstring

cljc-find-nsclj/s

(cljc-find-ns _ns)

Returns ns-name-or-obj for _ns, or nil. Where

  • ns-name-or-obj may either be a namespace (in clj) or the name of a namespace (in cljs)
  • _ns is a symbol which may name a namespace. NOTE: Implementations involving cljs must use cljs-put/get-ns-meta to declare ns metadata.
Returns `ns-name-or-obj` for `_ns`, or nil.
Where 
  - `ns-name-or-obj` may either be a namespace (in clj) 
    or the name of a namespace (in cljs)
  - `_ns` is a symbol which may name a namespace.
NOTE: Implementations involving cljs must use cljs-put/get-ns-meta to declare
  ns metadata.
raw docstring

cljc-find-prefixesclj/s

(cljc-find-prefixes re-str s)

Returns #{prefix...} for s Where

  • prefix is a prefix found in s, for which some (meta ns) has a :vann/preferredNamespacePrefix declaration
  • s is a string, typically a SPARQL query body for which we want to infer prefix declarations.
Returns #{`prefix`...} for `s`
Where
  - `prefix` is a prefix found in `s`, for which some (meta ns) has a 
     :vann/preferredNamespacePrefix declaration
  - `s` is a string, typically a SPARQL query body for which we want to 
    infer prefix declarations.
raw docstring

cljc-get-ns-metaclj/sdeprecated

Deprecated. Use get-ns-meta

Deprecated. Use get-ns-meta
raw docstring

cljc-ns-aliasesclj/s

(cljc-ns-aliases)

Returns {alias ns, ...} Where

  • alias is a symbol
  • ns is its associated ns in the current lexical environment. NOTE: cljs will require explicit maintenance of alias-map This is really only necessary if you're importing a package as some symbol other than the preferred prefix.
Returns {`alias` `ns`, ...}
Where
  - `alias` is a symbol
  - `ns` is its associated ns in the current lexical environment.
NOTE: cljs will require explicit maintenance of *alias-map*
This is really only necessary if you're importing a package
as some symbol other than the preferred prefix.
raw docstring

cljc-ns-mapclj/s

mimics behavior of ns-map on cljs, but returns empty symbol->binding map

mimics behavior of `ns-map` on cljs, but returns empty symbol->binding map
raw docstring

cljc-put-ns-meta!clj/sdeprecated

Deprecated. Use put-ns-meta!

Deprecated. Use put-ns-meta!
raw docstring

cljs-ns-metadatacljs

Namespaces in cljs are not proper objects, and there is no metadata available at runtime. This atom stores 'pseudo-metadata' declared with cljc-put-ns-metadata and accessed with cljc-get-metadata. Clj just uses the metadata regime for its ns's

Namespaces in cljs are not proper objects, and there is no metadata
available at runtime. This atom stores 'pseudo-metadata' declared with
cljc-put-ns-metadata and accessed with cljc-get-metadata. Clj just uses
the metadata regime for its ns's
raw docstring

collect-prefixesclj/s

(collect-prefixes acc next-ns)

Returns {prefix namespace ...} s.t. next-ns is included Where

  • prefix is a prefix declared in the metadata of next-ns
  • namespace is a URI namespace declared for prefix in metadata of next-ns
  • next-ns is typically an element in a reduction sequence of ns's
Returns {`prefix` `namespace` ...} s.t. `next-ns` is included
Where
  - `prefix` is a prefix declared in the metadata of `next-ns`
  - `namespace` is a URI namespace declared for `prefix` in metadata of `next-ns`
  - `next-ns` is typically an element in a reduction sequence of ns's 
raw docstring

default-on-no-kwi-nsclj/s

(default-on-no-kwi-ns kw)

Returns the name-string of kw if its name string is a typical URI or URN, otherwise throws a :NoIRIForKw error Where

  • kw is a keyword with no namespace.
Returns the name-string of `kw` if its name string is a typical URI or URN, otherwise throws a :NoIRIForKw error
Where
- `kw` is a keyword with no namespace.
raw docstring

default-on-no-nsclj/s

(default-on-no-ns _uri _keyword)

Returns the kwi normally appropriate for _keyword in cases where no ns can be matched, as is the case with say http://.....

Returns the kwi normally appropriate for `_keyword` in cases where no ns can be matched, as is the case with say http://.....
raw docstring

exceptional-iri-str-reclj/s

A regex matching an IRI string which doesn't match the usual http//-ish scheme, such as urn:

A regex matching an IRI string which doesn't match the usual http//-ish scheme, such as urn:
raw docstring

get-ns-metaclj/s

(get-ns-meta)
(get-ns-meta _ns)

Returns metadata assigned to ns named _ns Where

  • _ns names a namespace or a 'dummy' namespace whose sole purpose is to hold metadata.
  • metadata := {key value, ...}
  • key is a keyword containing vocabulary metadata, e.g. :vann/preferredNamespacePrefix
Returns `metadata` assigned to ns named `_ns`
Where
- `_ns` names a namespace or a 'dummy' namespace whose sole purpose is to hold metadata.
- `metadata` := {`key` `value`, ...}
- `key` is a keyword containing vocabulary metadata, e.g. :vann/preferredNamespacePrefix
raw docstring

invalid-qname-nameclj/s

fn [qname-name] -> truthy if qname-name is not valid Where

  • qname-name is a string
fn [qname-name] -> truthy if `qname-name` is not valid
Where
- `qname-name` is a string
raw docstring

iri-forclj/s

Alias of uri-for

Alias of uri-for
raw docstring

keyword-forclj/s

(keyword-for uri)
(keyword-for on-no-ns uri)

Returns a keyword equivalent of uri, properly prefixed if Vann declarations exist in some ns in the current lexical environment. Side effects per on-no-ns Where

  • uri is a string representing a URI
  • on-no-ns (optional) := fn [uri kw] -> kwi', possibly with side-effects in response to the fact that no qname was found for uri (default returns kw) NOTE: typically on-no-ns would log a warning or make an assertion.
Returns a keyword equivalent of `uri`, properly prefixed if Vann declarations
exist in some ns in the current lexical environment.
Side effects per `on-no-ns`
Where
- `uri` is a string representing a URI
- `on-no-ns` (optional) := fn [uri kw] -> kwi',
   possibly with side-effects in response to the fact that no qname was found for
   `uri` (default returns `kw`)
NOTE: typically `on-no-ns` would log a warning or make an assertion.
raw docstring

kwi-missing-namespace-if-not-urn-or-arnclj/s

(kwi-missing-namespace-if-not-urn-or-arn kw)

Returns the name-stiring of kw, or throws ::NoIRIForKw if kw is incorrectly missing a namespace

Returns the name-stiring of `kw`, or throws ::NoIRIForKw if `kw` is incorrectly missing a namespace
raw docstring

namespace-reclj/s

(namespace-re)

Returns a regex to recognize substrings matching a URI for an ns declared with LOD metadata. Groups for namespace and value.

Returns a regex to recognize substrings matching a URI for an ns 
declared with LOD metadata. Groups for namespace and value.
raw docstring

namespace-to-nsclj/s

(namespace-to-ns)

returns {namespace ns ...} for each ns with :vann/preferredNamespaceUri declaration Where

  • namespace is the URI suitable for for an RDF prefix declaration
  • ns is either a clojure ns (clj) or a symbol naming a clojure ns (cljs).
returns {`namespace` `ns` ...} for each `ns` with :vann/preferredNamespaceUri
declaration
Where
- `namespace` is the URI suitable for for an RDF prefix declaration
- `ns` is either a clojure ns (clj) or a symbol naming a clojure ns (cljs).
raw docstring

ns-to-namespaceclj/s

(ns-to-namespace _ns)

Returns iri for ns Where

  • iri is an iri declared with :vann/preferredNamespaceUri in the metadata for ns, or nil
  • ns is an instance of clojure.lang.Namespace (in clj) or a symbol-name for ns (cljs)
Returns `iri` for `ns`
Where
  - `iri` is an iri declared with :vann/preferredNamespaceUri in the metadata for 
    `ns`, or nil
  - `ns` is an instance of clojure.lang.Namespace (in clj) or a symbol-name for ns (cljs)
raw docstring

ns-to-prefixclj/s

(ns-to-prefix _ns)

Returns the prefix associated with _ns Where

  • _ns is a clojure namespace, which may have :vann/preferredNamespacePrefix declaration in its metadata.
Returns the prefix associated with `_ns`
Where
  - `_ns` is a clojure namespace, which may have :vann/preferredNamespacePrefix
  declaration in its metadata.   
raw docstring

on-duplicate-prefixclj/s

(on-duplicate-prefix prefixes prefix _ns)

Throws an error if a prefix is bound to more than one namespace. Reduces into prefix argument NOTE: Can be overridden with with-redefs.

Throws an error if a prefix is bound to more than one namespace.
Reduces into `prefix` argument
NOTE: Can be overridden with `with-redefs`.
raw docstring

ordinary-iri-str-reclj/s

An regex matching a standard IRI string like http://

An regex matching a standard IRI string like http://
raw docstring

prefix-re-strclj/s

(prefix-re-str)

Returns a regex string that recognizes prefixes declared in ns metadata with :vann/preferredNamespacePrefix keys. NOTE: this is a string because the actual re-pattern will differ per clj/cljs.

Returns a regex string that recognizes prefixes declared in ns metadata with 
  `:vann/preferredNamespacePrefix` keys. 
NOTE: this is a string because the actual re-pattern will differ per clj/cljs.
raw docstring

prefix-to-namespace-uriclj/s

(prefix-to-namespace-uri prefix)

returns namespace URI associated with prefix Where:

  • namespace is a string declared for some ns with vann/preferredNamespaceUri
  • prefix is a string declared for ns with vann/preferredNamespacePrefix
returns `namespace` URI associated with `prefix`
Where:
- `namespace` is a string declared for some `ns` with vann/preferredNamespaceUri
- `prefix` is a string declared for `ns` with vann/preferredNamespacePrefix
raw docstring

prefix-to-nsclj/s

(prefix-to-ns)

Returns {prefix ns ...} Where

  • prefix is declared in metadata for some ns with :vann/preferredNamespacePrefix
  • ns is an instance of clojure.lang.ns available within the lexical context in which the call was made.
Returns {`prefix` `ns` ...}
Where 
  - `prefix` is declared in metadata for some `ns` with 
  :vann/preferredNamespacePrefix 
  - `ns` is an instance of clojure.lang.ns available within the lexical 
  context in which the  call was made.
raw docstring

prefixed-nsclj/s

(prefixed-ns prefix)

Returns nil or the ns whose prefix was declared in metadata with :vann/preferredNamespacePrefix Where

  • prefix is a string, typically parsed from a keyword.
Returns nil or the ns whose `prefix` was declared in metadata with
  :vann/preferredNamespacePrefix
Where
  - `prefix` is a string, typically parsed from a keyword.
raw docstring

prepend-prefix-declarationsclj/s

(prepend-prefix-declarations sparql-string)

Returns sparql-string, prepended with appropriate PREFIX decls.

Returns `sparql-string`, prepended with appropriate PREFIX decls.
raw docstring

put-ns-meta!clj/s

(put-ns-meta! m)
(put-ns-meta! _ns m)

Side-effect: ensures that subsequent calls to (cljc-get-ns-meta _ns return m Where

  • _ns is an ns(clj only) or the name of a namespace, possibly declared for the sole purpose of holding vocabulary metadata (e.g. rdf, foaf, etc)
  • m := {key value, ...}, metadata (clj) or 'pseudo-metadata' (cljs)
  • key is a keyword containing vocabulary metadata, e.g. ::vann/preferredNamespacePrefix NOTE: In cljs, ns's are not available at runtime, so the metadata is stored in an atom called 'voc/cljs-ns-metadata' See also declarations for ont-app.vocabulary.rdf, ont-app.vocabulary.foaf, etc. for examples of namespaces declared solely to hold vocabulary metadata.
Side-effect: ensures that subsequent calls to (cljc-get-ns-meta `_ns` return `m`
Where
- `_ns`  is an ns(clj only) or the name of a namespace, possibly declared for the sole purpose of holding vocabulary metadata (e.g. rdf, foaf, etc)
- `m` := {`key` `value`, ...}, metadata (clj) or 'pseudo-metadata' (cljs)
- `key` is a keyword containing vocabulary metadata, e.g.
  `::vann/preferredNamespacePrefix`
NOTE: In cljs, ns's are not available at runtime, so the metadata is stored
  in an atom called 'voc/cljs-ns-metadata'
See also declarations for ont-app.vocabulary.rdf, ont-app.vocabulary.foaf, etc.
for examples of namespaces declared solely to hold vocabulary metadata.
raw docstring

qname-forclj/s

(qname-for kw)

Returns the 'qname' URI for kw, or <...>'d full URI if no valid qname could be found. Throws an error if the prefix is specified, but can't be mapped to metadata. Where

  • kw is a keyword, in a namespace with LOD declarations in its metadata.
Returns the 'qname' URI for `kw`, or <...>'d full URI if no valid qname
  could be found. Throws an error if the prefix is specified, but can't be
  mapped to metadata.
Where
  - `kw` is a keyword, in a namespace with LOD declarations in its metadata.
raw docstring

sparql-prefixes-forclj/s

(sparql-prefixes-for sparql-string)

Returns [prefix-string...] for each prefix identified in sparql-string Where

  • prefix-string := PREFIX prefix: namespace

  • prefix is a prefix defined for namespace in metadata of some ns with :vann/preferredNamespacePrefix

  • namespace is a namespace defined in the metadata for some ns with :vann/preferredNamespaceUri

Returns [`prefix-string`...] for each prefix identified in `sparql-string`
Where
  - `prefix-string` := PREFIX `prefix`: `namespace`

  - `prefix` is a prefix defined for `namespace` in metadata of some ns with 
     `:vann/preferredNamespacePrefix`
  - `namespace` is a namespace defined in the metadata for some ns with 
    `:vann/preferredNamespaceUri`
raw docstring

termsclj/s

Describes vocabulary for this namespace. May be read into an IGraph downstream.

Describes vocabulary for this namespace. May be read into an IGraph downstream.
raw docstring

uri-forclj/s

(uri-for kw)
(uri-for on-no-kwi-ns kw)

Returns iri for kw based on metadata attached to ns Alias of iri-for or `on-no-prefix (kw) if the keyword is not namespaced. Where

  • iri is of the form namespace``value
  • kw is a keyword of the form prefix:value
  • ns is an instance of clojure.lang.ns
  • on-no-kwi-ns := fn [kw] -> uri, for cases where kw is not namespaced default is default-on-no-kwi-ns
  • prefix is declared with :vann/preferredNamespacePrefix in metadata of ns
  • namespace is typically of the form http://...., declared with :vann/preferredNamespaceUri in metadata of ns
Returns `iri`  for `kw` based on metadata attached to `ns` Alias of `iri-for` or `on-no-prefix (kw) if the keyword is not namespaced.
Where
  - `iri` is of the form `namespace``value`
  - `kw` is a keyword of the form `prefix`:`value`
  - `ns` is an instance of clojure.lang.ns
  - `on-no-kwi-ns` := fn [kw] -> uri, for cases where `kw` is not namespaced
    default is `default-on-no-kwi-ns`
  - `prefix` is declared with :vann/preferredNamespacePrefix in metadata of `ns`
  - `namespace` is typically of the form http://...., declared with 
    `:vann/preferredNamespaceUri` in metadata of `ns`
raw docstring

vann-annotated-objectsclj/s

(vann-annotated-objects)

Returns `[obj, ...] Where:

  • obj bears metadata s.t. (get-ns-meta obj) includes :vann/... annotations
    • these may be either namespaces or vars
Returns `[obj, ...]
Where:
  - `obj` bears metadata s.t. (get-ns-meta obj)  includes :vann/... annotations
    - these may be either namespaces or vars
raw docstring

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

× close