Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [%iKnow] >  [Queries] >  [MetadataI]
Private  Storage   

deprecatedabstract class %iKnow.Queries.MetadataI extends %RegisteredObject

This is the interface to interact with metadata as expected by other parts of the iKnow libraries. A simple but flexible implementation is provided through %iKnow.Queries.MetadataAPI, but customers can choose to develop their own or wire to an existing metadata infrastructure by implementing the interface specified in this class.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 14


Summary

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified %ValidateObject
AddField CreateFilter EndBatch GetFieldId
GetFieldInfo GetFieldInfoById GetFields GetValue
GetValueById SetValue SetValueById StartBatch

Subclasses
%iKnow.DeepSee.MetadataAPI %iKnow.Queries.MetadataAPI

Parameters

• parameter GetFieldsRT = "mdFieldId:%String,fieldName:%String,supportedOperators:%List,dataType:%String,storage:%Integer,caseSensitive:%Boolean,lovId:%Integer,validateLov:%Boolean,hidden:%Boolean";

Methods

• classmethod AddField(domainId As %Integer, fieldName As %String, supportedOperators As %List, dataType As %String = $$$MDDTSTRING, storage As %Integer = $$$MDSTNORMAL, caseSensitive As %Boolean = 0, lovId As %Integer = -1, validateLov As %Boolean = 1, hidden As %Boolean = 0) as %Integer

Adds a field definition with the given name and properties.

  • The supportedOperators parameter specifies which operations (such as $$$MDOPEQUAL) will be available for filtering criteria
  • For dataType, choose either $$$MDDTSTRING, $$$MDDTNUMBER or $$$MDDTDATE ($horolog format)
  • Use storage to control the way how values are stored: $$$MDSTNORMAL for cases where you would use a normal index, $$$MDSTBITMAP where you would use a bitmap index (few different metadata values compared to total # of records)
  • If dataType is $$$MDDTSTRING, caseSensitive controls whether or not string values should be treated as case-sensitive.
  • The lovId and validateLov parameters define wheter a List Of Values is available for this metadata field and whether input values should be verified against this list. See also AddListOfValues.
  • If hidden is set to true, the field will by default not appear in metadata field and value lists.
• abstract classmethod CreateFilter(pDomainId As %Integer, pFieldName As %String, pOperator As %String, pValue As %String, Output pSC As %Status = $$$OK) as %iKnow.Filters.Filter
Create a %iKnow.Filters.Filter instance that filters sources according to the given criteria, using the filter class compatible with this %iKnow.Queries.MetadataI implementation.
• classmethod EndBatch(domainId As %Integer) as %Status

Ends a metadata batch. See StartBatch for more details.

• classmethod GetFieldId(domainId As %Integer, fieldName As %String) as %Integer
Returns the metadata field ID corresponding to the supplied name, or "" if none exists in this domain.
• abstract classmethod GetFieldInfo(pDomainId As %Integer, pFieldName As %String, Output pInfo) as %Status
• abstract classmethod GetFieldInfoById(pDomainId As %Integer, pFieldId As %String, Output pInfo) as %Status
• abstract classmethod GetFields(ByRef result As %Integer, domainId As %Integer, includeHidden As %Boolean = 0) as %Status

Returns all field definitions (including their properties) for the given domain.

• classmethod GetValue(domainId As %Integer, fieldName As %String, externalId As %String, Output sc As %Status) as %String
Returns the actual value for a given metadata field (by name) and source (by External ID).
• classmethod GetValueById(domainId As %Integer, fieldId As %Integer, srcId As %Integer, Output sc As %Status) as %String
Returns the actual value for a given metadata field (by ID) and source (by Source ID).
• classmethod SetValue(domainId As %Integer, fieldName As %String, externalId As %String, value As %String) as %Status

Sets (or replaces if it exists) the value for a given metadata field (by name) for a given source (by External ID).

Values for fields of type $$$MDDTSTRING are normalized and stripped of whitespace and control characters at the beginning and end of the string.

• classmethod SetValueById(domainId As %Integer, fieldId As %Integer, srcId As %Integer, value As %String) as %Status

Sets (or replaces if it exists) the value for a given metadata field (by ID) for a given source (by Source ID).

Values for fields of type $$$MDDTSTRING are normalized and stripped of whitespace and control characters at the beginning and end of the string.

• classmethod StartBatch(domainId As %Integer) as %Status

Starts a 'batch' during which metadata values can be set. Some setting operations and index recalculations are optimized for batch processing.

NOTE: It is currently up to the user to make sure no metadata values are read during the batch and no values exist already (as replacing a value involves reading it). Reading metadata field values during a batch is not guaranteed to return correct results.



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