Class Reference
IRIS for UNIX 2019.3
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%iKnow] >  [DeepSee] >  [CubeUtils]
Private  Storage   

class %iKnow.DeepSee.CubeUtils extends %RegisteredObject

This class offers a number of utility options for interacting with DeepSee-managed domains.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 28


Summary

Methods
%%OIDGet %AddToSaveSet %BindExport %BuildAdditionalIndexDIJob
%BuildObjectGraph %ClassIsLatestVersion %ClassName %Close
%ConstructClone %DispatchClassMethod %DispatchGetModified %DispatchGetProperty
%DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%EndIKnowBatch %Extends %GetParameter %IncrementCount
%IsA %IsModified %New %NormalizeObject
%ObjectModified %OnKillFacts %OriginalNamespace %PackageName
%ProcessIKnowFact %RemoveFromSaveSet %SerializeObject %SetModified
%StartIKnowBatch %ValidateObject CreateDomain CreateEOCube
CreateMRCube DropDictionary DropDomain GetDeepSeeDomainName
GetDomainId GetFactId GetIKnowMeasures GetMeasureInfo
GetSourceObjectId GetSummary LoadTermListAsBlackList LoadTermListAsDictionary
RenameDomain TranslateIKnowBitstring UpdateDictionary UpdateMatching
UpdateMatchingInternal


Parameters

• parameter CHECKSUMFIELDNAME = "CheckSum";

Methods

• classmethod %BuildAdditionalIndexDIJob(pCube, pMeasure, pDomainId, pDomainType, pDictIdList, pSrcIdOffset) as %Status
• private classmethod %BuildAdditionalIndices(pCube As %String, pMeasure As %String, pDomainId As %Integer, pDomainType As %String, pDictionaries As %String = "") as %Status
Builds the following additional indices - $$$DeepSeeIndexGLVN(pCube, "%ikDI", pMeasure, [tDictItemId], [factIdOffset]) = $bitstring([factId])
• classmethod %EndIKnowBatch(pCube As %String, ByRef pMsrList As %String, pVerbose As %Boolean = 0) as %Status
This method is called after a large number of facts has been processed in batch mode, to execute any queued iKnow processing in a single iKnow batch Notification at the end of a "batch of updates".

NOTE: This method is called from generated cube code and should never be invoked by custom code.

• classmethod %OnKillFacts(pCube As %String, ByRef pMsrList As %String) as %Status

Notification that our cube has been killed.

NOTE: This method is called from generated cube code and should never be invoked by custom code.

• classmethod %ProcessIKnowFact(pCube As %String, pBatchMode As %Boolean, pFlag As %String, pFactId As %String, pMeasure As %String, pValue As %String = "", pSourceType As %String = "string") as %Status
This method is called when a fact within a DeepSee cube is inserted, updated, or deleted.
pCube is the name of the DeepSee cube.
pBatchMode is true for batch mode.
pFlag is "I" for insert, "U" for update, "D" for delete, and "K" when the entire cube is killed.
pFactId is the ID of the current record in the fact table.
pSourceType is "string","file", or "stream".
pProp is the name of the property.
pValue is the value of the property.

NOTE: This method is called from generated cube code and should never be invoked by custom code.

• classmethod %StartIKnowBatch(pCube As %String, ByRef pMsrList As %String, pVerbose As %Boolean = 0) as %Status
Notification at the start of a "batch of updates".

NOTE: This method is called from generated cube code and should never be invoked by custom code.

• private classmethod %SyncAdditionalIndices(pCube As %String, pMeasure As %String, pDomainId As %Integer, pDomainType As %String, pDictionaries As %String, pFactId As %Integer, pSrcId As %Integer, pFlag As %String) as %Status
Per-record version of %BuildAdditionalIndices()
• classmethod CreateDomain(pCube As %String, pMeasure As %String, pParams As %String, pDictionaries As %String, ByRef pDomainName As %String = "", Output pSC As %Status = $$$OK) as %Integer

This method will create a DeepSee-managed iKnow domain for storing the indexation results of an iKnow measure (pMeasure) in a DeepSee cube (pCube). Apart from the default DeepSee-driven parameters, pParams can contain a semicolon- delimited list of additional parameters supplied through the cube definition, but these should be parameters a user is allowed to configure through the SetParameter method in the %iKnow.Domain class.

If a domain for this iKnow measure already exists, both the default DeepSee parameters and the user-defined parameters supplied through pParams will be applied, regardless of any existing settings that have been made outside of DeepSee.

Warning: this method should never be called by custom code!

• classmethod CreateEOCube(pCube As %String, pIKnowMeasure As %String, pBuild As %Boolean = 1) as %Status

This method creates a new DeepSee Cube definition representing the entities occurring in the textual contents of an iKnow measure pIKnowMeasure in cube pCube. The generated cube will have a set of meaningful dimensions for this entity occurrence level as well as a relationship to pCube, so all of its dimensions are also available for the new cube. The name of this cube will be "pCube > pIKnowMeasure > Entity Occurrences" and can be used or modified just like any other DeepSee cube after creation.

Setting pBuild to 1 will automatically build the cube.

NOTE: some of the functionality exposed by this cube can be achieved by using the iKnow plugin exposing numerical query results %DeepSee.PlugIn.iKnow as a calculated measure, without the need to create any additional cubes.

• classmethod CreateMRCube(pCube As %String, pIKnowMeasure As %String, pBuild As %Boolean = 1) as %Status

This method creates a new DeepSee Cube definition representing the matching results occurring in the textual contents of an iKnow measure pIKnowMeasure in cube pCube. The generated cube will have a set of meaningful dimensions for this dictionary match level as well as a relationship to pCube, so all of its dimensions are also available for the new cube. The name of this cube will be "pCube > pIKnowMeasure > Matching Results" and can be used or modified just like any other DeepSee cube after creation.

Setting pBuild to 1 will automatically build the cube.

NOTE: most of the functionality exposed by this cube can be achieved by using the iKnow plugin for Dictionaries %DeepSee.PlugIn.iKnowDictionary as a calculated measure, without the need to create any additional cubes.

• classmethod DropDictionary(pTermList As %String) as %Status
Wrapper method to support cross-domain dictionaries managed through a Term List
• classmethod DropDomain(pDomainName As %String) as %Status
Wrapper method to support domains managed solely by DeepSee
• classmethod GetDeepSeeDomainName(pCube As %String, pMeasure As %String) as %String
Returns the default generated domain name for a DeepSee-managed domain
• private classmethod GetDictionaryIds(pDictionaries As %String) as %List
Given the names of the term lists to match against, return a %List containing the corresponding dictionary IDs to supply to MatchSource[s]() Note: assumes version >= 3 (for cross-domain dictionary use)!
• classmethod GetDomainId(pCube As %String, pMeasure As %String, Output pSC As %Status = $$$OK) as %Integer [ SQLProc = ]
Returns the domain ID for the supplied combination of cube name (pCube) and iKnow measure name (pMeasure).
• classmethod GetFactId(pCube As %String, pSourceObjectId As %String, pRelations As %String = "", pSC As %Status = $$$OK) as %Integer
This method translates the source objects OID into the corresponding Fact ID, which is identical to the iKnow source ID for a DeepSee-managed domain.
• classmethod GetIKnowMeasures(pCube As %String, Output pList, pIncludeRelatedToOne As %Boolean = 0, pIncludeRelatedToMany As %Boolean = 0) as %Status
Returns all iKnow Measures for cube pCube in the form pList(n) = $lb(measureName, iKnowSourceType, cubeCaption)
• classmethod GetMeasureInfo(pCube As %String, pMeasure As %String, Output pSourceType As %String = "", Output pDomainId As %Integer = "", Output pDomainName As %Integer = "", Output pDomainType As %String = "", Output pParams As %String = "", Output pDictionaries As %String = "") as %Status

Fetches measure info from the cube definition:

  • pSourceType: the value of the iKnowSource attribute
  • pDomainId: the iKnow domain (ID) containing the data for this measure
  • pDomainName: the iKnow domain (name) containing the data for this measure
  • pDomainType: "iKnow" for an iKnow-managed domain, "DeepSee" for a DeepSee-managed one
  • pParams: the semicolon-delimited list of domain parameter name/value pairs to use apply to the domain instantiated for this measure
  • pDictionaries: the comma-delimited list of Term Lists to match against.
• private classmethod GetMeasureInfoInternal(pCube As %String, pMeasure As %String, Output pSourceType As %String = "", Output pDomainId As %Integer = "", Output pDomainName As %Integer = "", Output pDomainType As %String = "", Output pParams As %String = "", Output pDictionaries As %String = "") as %Status
• classmethod GetSourceObjectId(pCube As %String, pFactId As %Integer) as %Integer
This method translates a fact ID (= iKnow source ID in a DeepSee-managed domain) into the corresponding source object OID.
• classmethod GetSummary(pCube As %String, pMeasure As %String, pSourceObjectId As %String, pLength As %Integer = 5) as %String [ SQLProc = ]

Shorthand method to retrieve a summary of the iKnow measure value for pMeasure in cube pCube for the record identified by pSourceObjectId. Using pLength, the user can supply a desired summary length (in sentences).

This method is available as a SQL stored procedure and can be invoked in a Listing through using the $$$IKSUMMARY keyword.

• classmethod LoadTermListAsBlackList(pCube As %String, pMeasure As %String, pTermList As %String = "") as %Status

Loads the elements of a Term List as a BlackList into a given iKnow measures domain, using just the key as a string to be blacklisted. The Terms will all be added to a single blacklist named after this Term List.
If a BlackList with the given name already exists, its contents will be replaced by the contents of the supplied Term List. If no value is supplied for pTermList, its value will be derived from the value of the domain parameter $$$IKPDSBLACKLIST.

• classmethod LoadTermListAsDictionary(pCube As %String, pMeasure As %String, pTermList As %String, pMatch As %Integer = 1, pClear As %Integer = 1) as %Status

Loads the elements of a TermList as Dictionary Terms into a given iKnow measures domain, taking the key as the Term string and value as the items name. The Terms will all be added to a single dictionary named after this TermList.
The following fields will be interpreted along the way, if present:

  • "URI": the unique identifier for the Item level the value field refers to. If not present, a URI of the form :pTermList:value will be created.
  • "language": the two-letter language code to use for this term. Defaults to English ("en") if not present.

If pMatch is 1, the newly created dictionary will be matched against the contents of the domain. If set to 2, all existing dictionaries will be matched and if set to 0, no matching will occur as part of this method invocation.

If pClear is 1, any existing dictionary named pTermList will be deleted prior to loading this Term List. If set to 0, none will be dropped. The option to clear all dictionaries using the value 2 is discontinued as from 2013.2.

• classmethod RenameDomain(pFrom As %String, pTo As %String) as %Status
Wrapper method to support domains managed solely by DeepSee
• classmethod TranslateIKnowBitstring(pCubeName As %String, pMeasureName As %String, pGlobFrom As %String, pGlobTo As %String = "", pToFactIDs As %Boolean = 1) as %Status
Translates a bitstring based on iKnow source IDs into one based on DeepSee fact IDs for an iKnow-managed domain when pToFactIDs = 1, or vice versa otherwise.
• classmethod UpdateDictionary(pTermList As %String, pCube As %String = "", pMeasure As %String = "", pClearFirst As %Boolean = 0) as %Status

This method will update matching results for the Term List identified by pTermList to reflect the changes made to the Term List entries. If pCube is left blank, this method will be invoked for all cubes in this namespace. If pMeasure is left blank, it will be called for all iKnow measures in pCube.

Using pClearFirst, the user can specify whether or not the existing dictionary should first be dropped before reloading it from the Term List. Leave pClearFirst at 0 if you only appended to the Term List and use 1 if any existing terms were changed or removed.

• classmethod UpdateMatching(pCubeName As %String, pMeasureName As %String) as %Status
• classmethod UpdateMatchingInternal(pDomainId As %Integer, pDictionaries As %String, pFactId As %Integer = "") as %Status


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