Class Reference
IRIS for UNIX 2019.1
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [%iKnow] >  [Configuration]
Private  Storage   

persistent class %iKnow.Configuration extends %Persistent

This class groups the configuration parameters to drive the iKnow Smart Indexing algorithm as executed by the iKnow engine (external libraries). Configurations are referred to by name and can be used across domains within the same namespace.

When creating a configuration, you can pass initial values for the following properties to its %New method:

  1. Name (required)
  2. DetectLanguage
  3. Languages
  4. UserDictionary
  5. Summarize
Check the respective property descriptions for more details.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
8 22 1 2


Summary

Properties
DetectLanguage Languages Name Summarize UserDictionary

Methods
%AddToSaveSet %AddToSyncSet %CheckConstraints %CheckConstraintsForExtent
%ClassIsLatestVersion %ClassName %ComposeOid %ConstructClone
%Delete %DeleteExtent %DeleteId %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %Exists %ExistsId
%Extends %GUID %GUIDSet %GetLock
%GetParameter %GetSwizzleObject %Id %IsA
%IsModified %IsNull %KillExtent %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PurgeIndices %Reload %RemoveFromSaveSet %ResolveConcurrencyConflict
%RollBack %Save %SaveDirect %SerializeObject
%SetModified %SortBegin %SortEnd %SyncObjectIn
%SyncTransport %UnlockExtent %UnlockId %ValidateIndices
%ValidateObject Create Delete DeleteId
Exists Normalize NormalizeWithParams Open
OpenId


Properties

• property DetectLanguage as %Boolean;
Whether or not to use Automatic Language Identification
• property Languages as %List;
The list of languages the engine should take into account when processing the text.
• property Name as %String [ ReadOnly ];
The name of this configuration, which should be unique within the namespace (case-insensitive)
deprecatedproperty Summarize as %Integer [ Deprecated,InitialExpression = 1 ];
This setting is deprecated. Summaries are now generated at query time.
• property UserDictionary as %String(MAXLEN=1000);
The name to the User Dictionary to use for rewriting and standardizing input as it is read by the engine. See also %iKnow.UserDictionary. Alternatively, the path to a file-based User Dictionary can be supplied.

Methods

• method %ConstructClone(deep As %Boolean = 0, ByRef cloned As %String, location As %String) as %RegisteredObject
Clone the current object to a new object. If deep is 1 then this does a deep copy which will also copy any subobjects and if deep is 0 then it will create another reference to any subobjects and increment the reference count appropriately. It returns the new cloned object.

Note that even if deep=0 when you clone a parent object in a parent child relationship or a one object of a one to many relationship then it will construct clones of all the child/many objects. This is because a child/many object can only point at a single parent and so if we did not create a clone of these then you would have a relationship with zero items in it. If you really just want to clone the object without these child/many objects then pass deep=-1 to this method.

After the clone is constructed it will call %OnConstructClone(object,deep,.cloned) on the clone if it is defined so that you can perform any additional steps e.g. taking out a lock. This works just the same way as %OnNew() does.

The object is the oref of the original object that was cloned. The cloned array is just used internally when doing a deep clone to prevent recursive loops, do not pass anything in at all for this parameter on the initial call. If you write a %OnConstructClone and from here you wish to call %ConstructClone on another object pass in the cloned array, e.g. 'Do oref.%ConstructClone(1,.cloned)' so that it can prevent recursive loops.

The location is used internally to pass the new location for stream objects.

• classmethod %DeleteExtent(concurrency As %Integer = -1, ByRef deletecount, ByRef instancecount, pInitializeExtent As %Integer = 1) as %Status
Delete all instances of this class from its extent. On exit instancecount contains the original number of instances while deletecount contains the number of instances actually deleted.

Internally, %DeleteExtent iterates over the set of instances in the collection and invokes the %Delete method.
Refer to Object Concurrency Options for more details on the optional concurrency argument.
The option pInitializeExtent argument allows the user to override the default behavior of calling %KillExtent when all instances are successfully deleted. %KillExtent is called by default when the extent is empty so that empty globals can be killed. If %KillExtent is not called then some empty globals can remain as well as the ID counter if it exists. The default value for pInitializeExtent is 1. Unless the caller specifies a false value for pInitializeExtent the globals used by the extent will be killed. In some cases, the globals used by the extent are not used exclusively by the extent. In those cases it is possible that some globals will still be defined even when pInitializeExtent is true. By default this call to %KillExtent will not delete default stream storage global, but if you pass '2' in pInitializeExtent and if the entire extent was deleted we will call %KillExtent passing the 'killstreams' flag to ask it to remove kill the default storage global.

Returns a %Status value indicating success or failure.

deprecatedclassmethod Create(name As %String, DetectLanguage As %Integer = 0, languages As %List = $lb("en"), userDictionary As %String = "", summarize As %Integer = 1, maxConceptLength As %Integer = 0, Output sc As %Status = $$$OK) as %iKnow.Configuration
Create a new Configuration object using the specified parameters

Deprecated: Please use %New and %Save

deprecatedclassmethod Delete(configName As %String) as %Status
Deletes a named configuration

Deprecated: Please use NameIndexOpen and %DeleteId

deprecatedclassmethod DeleteId(configId As %String) as %Status
Deletes a configuration specified by ID

Deprecated: Please use %DeleteId

deprecatedclassmethod Exists(name As %String) as %Boolean
Checks whether a Configuration object exists with the given name

Deprecated: Please use NameIndexExists

• method Normalize(pString As %String, pLanguage As %String = "", Output pSC As %Status = $$$OK, pCleanPunctuation As %Boolean = 1) as %String

Takes an input string pString and returns its normalized form as returned by the iKnow engine. Using this method will ensure a string has the same form as any results (entities) returned by the engine as a result of iKnow indexing with this Configuration object.

More specifically, this normalization takes into account the following properties:

  • User Dictionary literal input substitutions.
  • Language model preprocess filters.
  • Character normalization (lower casing and some punctuation separation)
  • Whitespace compression.
  • Entity filters.

Input substitution adheres to the User Dictionary as specified in the UserDictionary property of this Configuration. If not specified through pLanguage (as a two-letter language code), the language will be randomly selected by the engine from the list specified in this Configuration's Languages property, so it's recommended to supply a value for pLanguage if Languages contains more than one entry. If specified, pLanguage should appear in Languages

See also NormalizeWithParams to normalize without a Configuration object.

• classmethod NormalizeWithParams(pString As %String, pLanguage As %String = "en", pUserDictionary As %String = "", Output pSC As %Status = $$$OK, pCleanPunctuation As %Boolean = 1) as %String

Takes an input string pString and returns its normalized form as returned by the iKnow engine. Using this method will ensure a string has the same form as any results (entities) returned by the engine as a result of indexing operations.

More specifically, this normalization takes into account the following properties:

  • User Dictionary literal input substitutions.
  • Language model preprocess filters.
  • Character normalization (lower casing and some punctuation separation)
  • Whitespace compression.
  • Entity filters.

Input substitution adheres to the User Dictionary as specified through pUserDictionary and the preprocess filters for language pLanguage are used.

See also Normalize to normalize using an existing Configuration object.

• classmethod Open(name As %String, Output pSC As %Status = $$$OK) as %iKnow.Configuration
Opens the Configuration object with the supplied name. When requesting the default configuration ($$$DEFAULTCONFIG), it will be created if it didn't exist yet for this namespace.
deprecatedclassmethod OpenId(id As %Integer) as %iKnow.Configuration
Opens the Configuration object with the supplied ID

Deprecated: Please use %OpenId


Queries

• query GetAllConfigurations()
Selects configId As %Integer, configName As %String, detectLanguage As %Integer, languages As %String, userDictionary As %String, summarize As %Integer, maxConceptLength As %Integer
Simple class query to retrieve all the configurations for this Namespace.

Deprecated: Please use normal SQL queries to approach this class.


Indices

•index (NameIndex on Name) [Unique];
•index (PKINDEX on Id) [IdKey,PrimaryKey,Unique];


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.