Liking cljdoc? Tell your friends :D

pdenno.owl-db-tools.core

Load the datahike (DH) database from Jena content; define pathom resolvers.

Load the datahike (DH) database from Jena content; define pathom resolvers.
raw docstring

*conn*clj

A dynamic var that is bound to a DB connection on db-create

A dynamic var that is bound to a DB connection on db-create
raw docstring

app-schemaclj


arg-prefix-mapsclj

(arg-prefix-maps ontos)

Define a map relating prefixes to URIs from, the create-db ontos argument.

Define a map relating prefixes to URIs from, the create-db ontos argument.
raw docstring

box-valueclj

(box-value v triple)

Boxing is the process of converting a value type to the type object. Return the value boxed as a map where the key identifies the type. This is necessary where an owl property can have multiple types (like :owl/oneOf).

Boxing is the process of converting a value type to the type object.
Return the value boxed as a map where the key identifies the type.
This is necessary where an owl property can have multiple types (like :owl/oneOf).
raw docstring

boxed-property?clj

These can take multiple values of various types, some need to be boxed.

These can take multiple values of various types, some need to be boxed.
raw docstring

create-db!clj

(create-db! db-cfg
            ontos
            &
            {:keys [check-sites check-sites-timeout rebuild? user-attrs]
             :or {check-sites-timeout 15000}})

If rebuild? is true, read OWL with Jena and write it into a Datahike DB. Otherwise, just set the connection atom, conn. BTW, if this doesn't get a response within 15 secs from slurping odp.org, it doesn't rebuild the DB.

If rebuild? is true, read OWL with Jena and write it into a Datahike DB.
Otherwise, just set the connection atom, conn.
BTW, if this doesn't get a response within 15 secs from slurping odp.org, it doesn't rebuild the DB.
raw docstring

debugging?clj


distinct-tempsclj

(distinct-temps mm temps)

The maps from resolve-temps :perm-data can contain field values that contain temps. The values the temps refer to ought to be unique. If they aren't this function returns the map with such vectors dropping the duplicates.

The maps from resolve-temps :perm-data can contain field values that contain temps.
The values the temps refer to ought to be unique. If they aren't this function
returns the map with such vectors dropping the duplicates.
raw docstring

full-schemaclj

The currently schema, consisting of static-schema plus what is learned while loading.

The currently schema, consisting of static-schema plus what is learned while loading.
raw docstring

keywordize-tripleclj

(keywordize-triple {:?/syms [x y z]})

From Jena, all the resources come back as symbols in either namespace '_' or 'http:'. These are to be rendered as keywords in the namespace 'temp' for _, and the short prefix for the full URL otherwise. The function returns a vector of the converted [x y z] triple.

From Jena, all the resources come back as symbols in either namespace '_' or 'http:'.
These are to be rendered as keywords in the namespace 'temp' for _, and the short prefix for the full URL otherwise.
The function returns a vector of the converted [x y z] triple.
raw docstring

learn-cardinalityclj

(learn-cardinality prop examples)

Return either :db.cardinality/many or :db.cardinality/one based on evidence.

Return either :db.cardinality/many or :db.cardinality/one based on evidence.
raw docstring

learn-schema!clj

(learn-schema! dvecs conn)

Create a schema from what we know about the owl, rdfs, and rdf parts plus any additional triples created by ontologies.

Create a schema from what we know about the owl, rdfs, and rdf parts
plus any additional triples created by ontologies.
raw docstring

learn-typeclj

(learn-type prop examples)

Return the :db/valueType for the data.

Return the :db/valueType for the data.
raw docstring

list-startersclj

(list-starters dvecs)

Return a list of triples that start lists. They have a :rdf/first, but they aren't used as the :rdf/rest of anything.

Return a list of triples that start lists. They have a :rdf/first,
but they aren't used as the :rdf/rest of anything.
raw docstring

load-inlineclj

(load-inline src)

When (:access src) is the keyword :inline, then src will also include :inline-data

When (:access src) is the keyword :inline, then src will also include :inline-data
raw docstring

load-jenaclj

(load-jena {:keys [uri access format] :as src})

Using Jena, return an rdf/KB object with the argument ontologies loaded.

Using Jena, return an rdf/KB object with the argument ontologies loaded.
raw docstring

load-localclj

(load-local src)

Load an ontology stored in a file in resources.

Load an ontology stored in a file in resources.
raw docstring

load-remoteclj

(load-remote src & {:keys [timeout] :or {timeout 10000}})

Experience suggests some sites (e.g. ontologydesignpatterns.org) cannot be relied upon. Return nil if you can't load from the :access URL, otherwise return the stream.

Experience suggests some sites (e.g. ontologydesignpatterns.org) cannot be relied upon.
Return nil if you can't load from the :access URL, otherwise return the stream.
raw docstring

loaded-ok?clj

When false it is usually because of a timeout slurping a URL.

When false it is usually because of a timeout slurping a URL.
raw docstring

long2shortclj

a map from URI strings to prefix strings

a map from URI strings to prefix strings
raw docstring

lookup-resourceclj

(lookup-resource id conn)

Return the :db/id of the resource given the its ns-qualified keyword identifier.

Return the :db/id of the resource given the its ns-qualified keyword identifier.
raw docstring

mark-as-storedclj

(mark-as-stored onto-spec conn)

Add :source/loaded? true to the onto spec

Add :source/loaded? true to the onto spec
raw docstring

multi-valued-property?clj

Properties where the object can have many values Many-valued properties aren't the same as things bearing temp values. For example, :owl/complement of can have a temp.

Properties where the object can have many values
Many-valued properties aren't the same as things bearing temp values. For example, :owl/complement of can have a temp.
raw docstring

not-stored-property?clj

These aren't stored; they are used to create vectors.

These aren't stored; they are used to create vectors.
raw docstring

onto-keywordclj

(onto-keyword sym)

Return the keyword representing an ontology or schema (e.g. RDF).

Return the keyword representing an ontology or schema (e.g. RDF).
raw docstring

owl-schemaclj


partition-temp-permclj

(partition-temp-perm dmapv)

Create a map with two keys: :temp-data - a map of temp resources indexed by their :resource/id. :perm-data - a subset of the argument vector with temp maps removed.

Create a map with two keys:
:temp-data - a map of temp resources indexed by their :resource/id.
:perm-data - a subset of the argument vector with temp maps removed. 
raw docstring

prefix-mapsclj

(prefix-maps jkb conn)

Define a map relating prefixes to URIs found by means of the Jena. Check whether the DB already has a short-name for that resource (user might have specified it). If a short-name already exists, keep it. (Both long and short are db.unique db.identity, intentionally, so you really can't change it anyway.

Define a map relating prefixes to URIs found by means of the Jena.
Check whether the DB already has a short-name for that resource (user might have specified it).
If a short-name already exists, keep it. (Both long and short are db.unique db.identity,
intentionally, so you really can't change it anyway.
raw docstring

rdf-schemaclj


rdfs-schemaclj


real-keyword?clj

Other keywords are assumed to be resources

Other keywords are assumed to be resources
raw docstring

reset-for-new-db!clj

(reset-for-new-db!)

resolve-rdf-listsclj

(resolve-rdf-lists dvecs)

Return a map of toplevel rdf/Lists.

Return a map of toplevel rdf/Lists.
raw docstring

resolve-temp-internalclj

(resolve-temp-internal temp-maps)

Temp resources can reference other temp resources. This resolves everything.

Temp resources can reference other temp resources.
This resolves everything.
raw docstring

resolve-temp-refsclj

(resolve-temp-refs dmapv conn)

resolve-temps created references to resources, :resource/temp-ref. Stubs for all :resource/ids were transacted to the DB. This recursively replaces :resource/temp-ref with their DH entity ID. Argument is a vector of maps, one for each resource.

resolve-temps created references to resources, :resource/temp-ref.
Stubs for all :resource/ids were transacted to the DB.
This recursively replaces :resource/temp-ref with their DH entity ID.
Argument is a vector of maps, one for each resource.
raw docstring

resolve-tempsclj

(resolve-temps dmapv)

Replace every temp reference with its value. Argument is a vector of maps.

Replace every temp reference with its value. Argument is a vector of maps.
raw docstring

resource-idsclj

(resource-ids conn)

Return a vector of resource keywords

Return a vector of resource keywords
raw docstring

schema-attributesclj

(schema-attributes conn & {:keys [origin] :or {origin #{:learned :user}}})

Return a vector of maps of learned or user schema elements. Arguments: conn - a database connection. :origin - an optional keyword argument consisting of a set containing any of #{:all, :learned :user}. The default value for this argument is #{:learned :user}.

Return a vector of maps of learned or user schema elements.
Arguments:
  conn     - a database connection.
  :origin  - an optional  keyword argument consisting of a set containing any of
             #{:all, :learned :user}. The default value for this argument is #{:learned :user}.
raw docstring

single-valued-property?clj

The following are properties that can only take one value.

The following are properties that can only take one value.
raw docstring

site-online?clj

(site-online? url timeout)

Return true if the site reacts within timeout

Return true if the site reacts within timeout
raw docstring

sourcesclj

(sources conn & {:keys [l2s]})

Return maps describing what was loaded

Return maps describing what was loaded
raw docstring

static-schemaclj

The subset of schema define above.

The subset of schema define above.
raw docstring

store-onto!clj

(store-onto! conn jena-maps)

Transform RDF triples in argument jena-maps, resolve rdf/List, create maps of resources. Then store it.

Transform RDF triples in argument jena-maps, resolve rdf/List, create maps of resources.
Then store it.
raw docstring

temp-id?clj

(temp-id? k)

transact?clj

(transact? conn data & {:keys [check-data?] :or {check-data? debugging?}})

Optionally check that the data is valid before sending it. Does not compare against the schema. Currenlty only checks for nils.

Optionally check that the data is valid before sending it.
Does not compare against the schema. Currenlty only checks for nils.
raw docstring

triples2mapsclj

(triples2maps dvecs rdf-lists)

Iterate through the triples returning a map keyed by the RDF resource (keyword) represented.

Iterate through the triples returning a map keyed by the RDF resource (keyword) represented.
raw docstring

update-long2short!clj

(update-long2short! conn)

Return a map from uri strings to prefix strings

Return a map from uri strings to prefix strings
raw docstring

valid-for-transact?clj

(valid-for-transact? data)

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

× close