%SYSTEM.iKnow
Class %SYSTEM.iKnow Extends %SYSTEM.Help [ Abstract, Deprecated, System = 4 ]
iKnow utility methods, available through the $system syntax from the command line. For example: "do $system.iKnow.ListDomains()"
Methods
ListDomains
ClassMethod ListDomains(currentNamespaceOnly As %Boolean = 1) As %Status
Print a list of all the domains within this namespace.
ListConfigurations
ClassMethod ListConfigurations() As %Status
Print a list of all the configurations within this namespace.
ListMetadata
ClassMethod ListMetadata(pDomainName As %String, pIncludeHidden As %Boolean = 0) As %Status
Print a list of all metadata fields for a given namespace.
ListErrors
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.
GetDomainId
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.
GetDomainName
ClassMethod GetDomainName(pDomainId As %Integer) As %String
Returns the name corresponding to the supplied domain ID or "" if none found in this namespace.
DropData
ClassMethod DropData(pDomainName As %String, pDropMetadataFields As %Boolean = 1, pDropDictionaries As %Boolean = 1) As %Integer
Drops all of a Domain's contents
IndexFile
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)
IndexDirectory
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)
IndexTable
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.
IndexString
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.
GetSourceId
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.
GetExternalId
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.
IsResourceAcquired
ClassMethod IsResourceAcquired() As %Boolean [ Internal ]
Returns true if the iKnow kernel resource is current held, false otherwise
CreateDomainForTableColumn
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 [ Deprecated, Internal ]
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
GetDomainParameterName
ClassMethod GetDomainParameterName(pMacroName As %String) As %String [ Internal ]
Returns the name of the domain parameter whose macro name was passed in. For example, translates $$$IKPDEFAULTCONFIG into "DefaultConfig"
mapToUMLS
ClassMethod mapToUMLS(domainId As %Integer, sourceMatchLevel As %Integer = 0, buildTfIdfTable As %Boolean = 1) As %Status [ Deprecated, Internal ]
For an iTables domain creates UMLS mapping between domain entities, sources and UMLS concepts.
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 [ Internal ]
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.
Shell
ClassMethod Shell()
Run the iKnow shell. See also %iKnow.Shell.
Highlight
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.
DeleteSource
ClassMethod DeleteSource(pDomainName As %String, pSrcId As %Integer) As %Status
Deletes the source with internal ID pSrcId from domain pDomainName
DeleteVirtualSource
ClassMethod DeleteVirtualSource(pDomainName As %String, vSrcId As %Integer) As %Status
Deletes the virtual source with ID vSrcId from domain pDomainName
Normalize
ClassMethod Normalize(pString As %String, pDomainId As %Integer = "", pConfig As %String = "", pLanguage As %String = "", Output pSC As %Status = {$$$OK}, pCleanPunctuation As %Boolean = 1) 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.