Skip to main content

%SYSTEM.iKnow

abstract class %SYSTEM.iKnow extends %SYSTEM.Help

iKnow utility methods, available through the $system syntax from the command line. For example: "do $system.iKnow.ListDomains()"

Method Inventory

Methods

classmethod DeleteSource(pDomainName As %String, pSrcId As %Integer) as %Status
Deletes the source with internal ID pSrcId from domain pDomainName
classmethod DeleteVirtualSource(pDomainName As %String, vSrcId As %Integer) as %Status
Deletes the virtual source with ID vSrcId from domain pDomainName
classmethod DropData(pDomainName As %String, pDropMetadataFields As %Boolean = 1, pDropDictionaries As %Boolean = 1) as %Integer
Drops all of a Domain's contents
classmethod GetDomainId(pDomainName As %String = "") as %Integer
Returns the ID corresponding to the supplied domain name in pDomainName or "" if none found in this namespace.
classmethod GetDomainName(pDomainId As %Integer) as %String
Returns the name corresponding to the supplied domain ID or "" if none found in this namespace.
classmethod GetExternalId(pDomainName As %String, pSourceId As %Integer) as %String
Returns the External ID for a given pSourceId in domain pDomainName, or the empty string if no source exists with that Source ID.
classmethod GetSourceId(pDomainName As %String, pExternalId As %String) as %Integer
Returns the Source ID for a given pExternalId in domain pDomainName, or the empty string if no source exists with that External ID.
classmethod Highlight(pText As %String, ByRef pHighlight, pConfig As %String = $$$DEFAULTCONFIG, pEscapeHTML As %Boolean = 1, Output pSC As %Status = $$$OK) as %String
Highlights the supplied text pText using the highlight information specified through pHighlight. See GetHighlighted() in %iKnow.Queries.SentenceAPI for more details on possible input to pHighlight.
classmethod IndexDirectory(pDomainName As %String, pPath As %String, pRecurse As %Boolean = 0, pConfig As %String = "", pEncoding As %String = "UTF-8", pExtensions As %List = "") as %Status
Indexes the supplied file and stores the indexing results in domain pDomainName. The full path of the files indexed will be used to build the External ID (cf %iKnow.Source.File.Lister)
classmethod IndexFile(pDomainName As %String, pPath As %String, pConfig As %String = "", pEncoding As %String = "UTF-8", Output pSrcId As %Integer = 0) as %Status
Indexes the supplied file and stores the indexing results in domain pDomainName, returning the generated source ID as pSrcId. The full path of the files indexed will be used to build the External ID (cf %iKnow.Source.File.Lister)
classmethod IndexString(pDomainName As %String, pIdentifier As %String, pString As %String, pConfig As %String = "", pVirtual As %Boolean = 0, Output pSrcId As %Integer = 0) as %Status
Indexes the supplied pString and stores the results into the domain pDomainName, using pIdentifier to construct the External ID (cf %iKnow.Source.Temp.Lister). The generated sources ID will be returned through pSrcId.
classmethod IndexTable(pDomainName As %String, pTableName As %String, pIdField As %String, pGroupField As %String, pDataField As %String, pMetaFields As %List = "", pWhereClause As %String = "", pConfig As %String = "") as %Status

Indexes the contents of the pDataField column in table pTableName, using the pIdField and pGroupField columns to build the external ID for this record (cf %iKnow.Source.SQL.Lister). pDomainName can be a (SQL) constant, such as "'MyGroup'". The results are stored in the domain pDomainName.

Optionally, specify a %List of table field names through pMetaFields that should be loaded as metadata for the table records.

classmethod ListConfigurations() as %Status
Print a list of all the configurations within this namespace.
classmethod ListDomains(currentNamespaceOnly As %Boolean = 1) as %Status
Print a list of all the domains within this namespace.
classmethod ListErrors(pDomainName As %String, pLimit As %Integer = 5) as %Status
Prints the first pLimit load errors, failures and warnings for domain pDomainName. Use pLimit=0 to display all errors.
classmethod ListMetadata(pDomainName As %String, pIncludeHidden As %Boolean = 0) as %Status
Print a list of all metadata fields for a given namespace.
classmethod Normalize(pString As %String, pDomainId As %Integer = "", pConfig As %String = "", pLanguage As %String = "", Output pSC As %Status = $$$OK) as %String

Applies relevant iKnow normalization logic. By default, this implies removing whitespace from the front and back of the string, removing duplicate whitespace, and lowercase. For specific configurations or languages such as Japanese, normalization behaviour is more refined and described in the documentation.

If a domain ID is specified through pDomainId, its default configuration will be used (if specified). Otherwise, the configuration named pConfig will be used.

classmethod Shell()
Run the iKnow shell. See also %iKnow.Shell.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab