Load the datahike (DH) database from Jena content; define pathom resolvers.
Load the datahike (DH) database from Jena content; define pathom resolvers.
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
(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.
(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).
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.
(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.
(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.
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.
(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.
(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.
(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.
(learn-type prop examples)
Return the :db/valueType for the data.
Return the :db/valueType for the data.
(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.
(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
(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.
(load-local src)
Load an ontology stored in a file in resources.
Load an ontology stored in a file in resources.
(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.
When false it is usually because of a timeout slurping a URL.
When false it is usually because of a timeout slurping a URL.
a map from URI strings to prefix strings
a map from URI strings to prefix strings
(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.
(mark-as-stored onto-spec conn)
Add :source/loaded? true to the onto spec
Add :source/loaded? true to the onto spec
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.
These aren't stored; they are used to create vectors.
These aren't stored; they are used to create vectors.
(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).
(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.
(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.
Other keywords are assumed to be resources
Other keywords are assumed to be resources
(reset-for-new-db!)
(resolve-rdf-lists dvecs)
Return a map of toplevel rdf/Lists.
Return a map of toplevel rdf/Lists.
(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.
(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.
(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.
(resource-ids conn)
Return a vector of resource keywords
Return a vector of resource keywords
(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}.
The following are properties that can only take one value.
The following are properties that can only take one value.
(site-online? url timeout)
Return true if the site reacts within timeout
Return true if the site reacts within timeout
(sources conn & {:keys [l2s]})
Return maps describing what was loaded
Return maps describing what was loaded
(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.
(temp-id? k)
(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.
(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.
(update-long2short! conn)
Return a map from uri strings to prefix strings
Return a map from uri strings to prefix strings
(valid-for-transact? data)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close