Class Reference
InterSystems: The power behind what matters   
Documentation  Search

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()"


Parameters Properties Methods Queries Indices ForeignKeys Triggers


CreateDomainForTableColumn CreateDomainTables DeleteSource DeleteVirtualSource
DropData GetDomainId GetDomainName GetDomainParameterName
GetExternalId GetSourceId Help Highlight
IndexDirectory IndexFile IndexString IndexTable
IsResourceAcquired ListConfigurations ListDomains ListErrors
ListMetadata Normalize Shell mapToUMLS


• classmethod CreateDomainForTableColumn(pTableName As %String, pColumnName As %String, ByRef pDomainName As %String = "", Output pDomainId As %Integer, pObjectsPackage As %String = "", pDropExisting As %Boolean = 1, ByRef pDomainParams="", pIdColumn As %String = "ID") as %Status

Creates an iKnow domain named pDomainName representing the textual contents of column pColumnName in table pTableName, returning the domain ID in pDomainId. If pDomainName is left blank, a default name will be generated as follows: "SQL@pTableName@pColumnName"

If pObjectsPackage is non-null, wrapper objects for the generated elements will be generated in that package.

This method is deprecated. See CreateDomainTables

• classmethod CreateDomainTables(pTableName As %String, pColumnName As %String, ByRef pDomainName As %String = "", ByRef pDomainId As %Integer = "", pIdColumn As %String = "ID", lang As %String = "", silent As %Boolean = 0, turnOffJournal As %Boolean = 1, noindex As %Boolean = 1, createWordContextTable As %List = "", createITablesIndices As %Boolean = 1) as %Status

Creates an iKnow domain containing the data in the pColumnName column of table pTableName through a domain definition (%iKnow.DomainDefinition) named "Domain" in the same package as pTableName. In addition, customizable table projections for accessing the iKnow domain data through SQL will be generated by invoking %iKnow.Tables.Utils. If an existing domain ID is supplied through pDomainId, no domain definition is generated and only the projection classes will be generated.

Depending on the value of createITablesIndices, a number of additional index structures and properties will be created to complement the system-supplied ones on the table projections.

• 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 GetDomainParameterName(pMacroName As %String) as %String
Returns the name of the domain parameter whose macro name was passed in. For example, translates $$$IKPDEFAULTCONFIG into "DefaultConfig"
• 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 IsResourceAcquired() as %Boolean
Returns true if the iKnow kernel resource is current held, false otherwise
• 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.
• classmethod mapToUMLS(domainId As %Integer, sourceMatchLevel As %Integer = 0, buildTfIdfTable As %Boolean = 1) as %Status
For an iTables domain creates UMLS mapping between domain entities, sources and UMLS concepts.

Copyright © 1997-2018, InterSystems Corporation