IRISLIB database
MetadataAPI Class Reference
Inheritance diagram for MetadataAPI:
Collaboration diagram for MetadataAPI:

Static Public Member Functions

_.Library.Integer AddField (_.Library.Integer domainId, _.Library.String fieldName, _.Library.List supportedOperators, _.Library.String dataType, _.Library.Integer storage, _.Library.Boolean caseSensitive, _.Library.Integer lovId, _.Library.Boolean validateLov, _.Library.Boolean hidden, _.Library.Status sc)
 
_.Library.Integer AddListOfValues (_.Library.Integer domainId, _.Library.String lovName, _.Library.Boolean autoExtend, _.Library.Status sc)
 
_.Library.Status AddLovValue (_.Library.Integer domainId, _.Library.Integer lovId, _.Library.String value, _.Library.Integer rank)
 Adds a new value to an existing List Of Values.
 
_.iKnow.Filters.Filter CreateFilter (_.Library.Integer pDomainId, _.Library.String pFieldName, _.Library.String pOperator, _.Library.String pValue, _.Library.Status pSC)
 
_.Library.Status EndBatch (_.Library.Integer domainId)
 
_.Library.Integer GetFieldId (_.Library.Integer domainId, _.Library.String fieldName, _.Library.Status sc)
 Returns the metadata field ID corresponding to the supplied name, or "" if none exists in this domain.
 
_.Library.Status GetFieldInfo (_.Library.Integer pDomainId, _.Library.String pFieldName, pInfo)
 Returns some basic facts about metadata field pFieldName
 
_.Library.Status GetFieldInfoById (_.Library.Integer pDomainId, _.Library.String pFieldId, pInfo)
 Returns some basic facts about metadata field with ID pFieldId
 
_.Library.Status GetFieldValues (result, _.Library.Integer domainId, _.Library.String fieldName, _.Library.Integer page, _.Library.Integer pageSize)
 Returns all the distinct values currently in use for a given metadata field (by name). More...
 
_.Library.Status GetFieldValuesById (result, _.Library.Integer domainId, _.Library.Integer mdFieldId, _.Library.Integer page, _.Library.Integer pageSize)
 Returns all the distinct values currently in use for a given metadata field (by ID).
 
_.Library.Status GetFields (_.Library.Integer result, _.Library.Integer domainId, _.Library.Boolean includeHidden)
 
_.Library.Status GetLovValues (_.Library.Integer result, _.Library.Integer domainId, _.Library.Integer lovId)
 Returns all the allowed values for a given metadata LOV.
 
_.Library.Status GetLovs (result, _.Library.Integer domainId, _.Library.Integer page, _.Library.Integer pageSize)
 Returns all LOVs (List of Values) registered for this domain.
 
_.Library.Integer GetMetaSpreadByEntities (_.Library.Integer pDomainId, _.Library.String pFieldName, _.Library.List pEntityList, _.iKnow.Filters.Filter pFilter, _.Library.Integer pSetOp, _.Library.Status pSC)
 
_.Library.Integer GetMetaSpreadByEntityIds (_.Library.Integer pDomainId, _.Library.String pFieldName, _.Library.List pEntityIdList, _.iKnow.Filters.Filter pFilter, _.Library.Integer pSetOp, _.Library.Status pSC)
 
_.Library.String GetUniValue (_.Library.Integer pDomainId, _.Library.Integer pUniValueId)
 Returns the unique metadata value corresponding to the supplied pUniValueId.
 
_.Library.Integer GetUniqueValueCount (_.Library.Integer pDomainId, _.Library.String pFieldName, _.iKnow.Filters.Filter pFilter, pSC)
 
_.Library.Status GetUniqueValueCountById (_.Library.Integer pDomainId, _.Library.Integer pFieldId, _.iKnow.Filters.Filter pFilter, _.Library.Status pSC)
 
_.Library.Status GetUniqueValues (pResult, _.Library.Integer pDomainId, _.Library.String pFieldName, _.Library.Integer pPage, _.Library.Integer pPageSize, _.iKnow.Filters.Filter pFilter, _.Library.String pSortType)
 
_.Library.Status GetUniqueValuesById (pResult, _.Library.Integer pDomainId, _.Library.Integer pFieldId, _.Library.Integer pPage, _.Library.Integer pPageSize, _.iKnow.Filters.Filter pFilter, _.Library.String pSortType)
 
_.Library.String GetValue (_.Library.Integer domainId, _.Library.String fieldName, _.Library.String externalId, _.Library.Status sc)
 Returns the actual value for a given metadata field (by name) and source (by External ID).
 
_.Library.String GetValueById (_.Library.Integer domainId, _.Library.Integer fieldId, _.Library.Integer srcId, _.Library.Status sc)
 Returns the actual value for a given metadata field (by ID) and source (by Source ID).
 
_.Library.Status GetValues (_.Library.Integer result, _.Library.Integer domainId, _.Library.String externalId, _.Library.Boolean includeHidden)
 
_.Library.Status GetValuesById (_.Library.Integer result, _.Library.Integer domainId, _.Library.Integer srcId, _.Library.Boolean includeHidden)
 
_.Library.Status PopulateFromSQL (_.Library.Integer pDomainId, _.Library.String pSQL, _.Library.Boolean pIgnoreErrors)
 
_.Library.Status RemoveField (_.Library.Integer domainId, _.Library.String fieldName)
 Removes a metadata field (by name) from the domain, including all references by existing sources.
 
_.Library.Status RemoveFieldById (_.Library.Integer domainId, _.Library.Integer fieldId)
 Removes a metadata field (by ID) from the domain, including all references by existing sources.
 
_.Library.Status SetValue (_.Library.Integer domainId, _.Library.String fieldName, _.Library.String externalId, _.Library.String value)
 
_.Library.Status SetValueById (_.Library.Integer domainId, _.Library.Integer fieldId, _.Library.Integer srcId, _.Library.String value)
 
_.Library.Status StartBatch (_.Library.Integer domainId)
 
_.Library.Status UpdateField (_.Library.Integer domainId, _.Library.String fieldName, _.Library.List supportedOperators, _.Library.Integer storage, _.Library.Integer hidden, _.Library.Integer lovId, _.Library.Integer validateLov)
 
_.Library.Status UpdateFieldById (_.Library.Integer domainId, _.Library.Integer fieldId, _.Library.List supportedOperators, _.Library.Integer storage, _.Library.Integer hidden, _.Library.Integer lovId, _.Library.Integer validateLov)
 
- Static Public Member Functions inherited from MetadataI
_.Library.Integer AddField (_.Library.Integer domainId, _.Library.String fieldName, _.Library.List supportedOperators, _.Library.String dataType, _.Library.Integer storage, _.Library.Boolean caseSensitive, _.Library.Integer lovId, _.Library.Boolean validateLov, _.Library.Boolean hidden)
 
_.Library.Integer GetFieldId (_.Library.Integer domainId, _.Library.String fieldName)
 Returns the metadata field ID corresponding to the supplied name, or "" if none exists in this domain.
 

Static Public Attributes

 GetFieldValuesByIdRT = None
 
 GetLovsRT = None
 
- Static Public Attributes inherited from MetadataI
 GetFieldsRT = None
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Additional Inherited Members

- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Detailed Description

The InterSystems IRIS NLP iKnow technology is now deprecated. Please see the product documentation for more detail.

This is the default implementation for the <class>iKnow.Queries.MetadataI</class> interface and the central place to manage and query metadata fields and values.

Member Function Documentation

◆ AddField()

_.Library.Integer AddField ( _.Library.Integer  domainId,
_.Library.String  fieldName,
_.Library.List  supportedOperators,
_.Library.String  dataType,
_.Library.Integer  storage,
_.Library.Boolean  caseSensitive,
_.Library.Integer  lovId,
_.Library.Boolean  validateLov,
_.Library.Boolean  hidden,
_.Library.Status  sc 
)
static

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 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 whether a List Of Values is available for this metadata field and whether input values should be verified against this list. See also <method>AddListOfValues</method>.
  • If hidden is set to true, the field will by default not appear in metadata field and value lists.

◆ AddListOfValues()

_.Library.Integer AddListOfValues ( _.Library.Integer  domainId,
_.Library.String  lovName,
_.Library.Boolean  autoExtend,
_.Library.Status  sc 
)
static

Adds a List Of Values to the domain, which can then be used as a list of allowable values for

one or more metadata fields.

◆ CreateFilter()

_.iKnow.Filters.Filter CreateFilter ( _.Library.Integer  pDomainId,
_.Library.String  pFieldName,
_.Library.String  pOperator,
_.Library.String  pValue,
_.Library.Status  pSC 
)
static

Create a <class>iKnow.Filters.Filter</class> instance that filters sources according to

the given criteria, using the filter class compatible with this <class>iKnow.Queries.MetadataI</class> implementation.

For the default MetadataAPI, this is a <class>iKnow.Filters.SimpleMetadataFilter</class> instance.

Reimplemented from MetadataI.

◆ EndBatch()

_.Library.Status EndBatch ( _.Library.Integer  domainId)
static

Ends a metadata batch. See <method>StartBatch</method> for more details.

Reimplemented from MetadataI.

◆ GetFieldValues()

_.Library.Status GetFieldValues (   result,
_.Library.Integer  domainId,
_.Library.String  fieldName,
_.Library.Integer  page,
_.Library.Integer  pageSize 
)
static

Returns all the distinct values currently in use for a given metadata field (by name).

See also <method>GetUniqueValues</method> for a version returning the number of sources with this metadata value and sorting options.

◆ GetFields()

_.Library.Status GetFields ( _.Library.Integer  result,
_.Library.Integer  domainId,
_.Library.Boolean  includeHidden 
)
static

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

Setting includeHidden to true will also return any metadata fields marked as 'hidden'.

Reimplemented from MetadataI.

◆ GetMetaSpreadByEntities()

_.Library.Integer GetMetaSpreadByEntities ( _.Library.Integer  pDomainId,
_.Library.String  pFieldName,
_.Library.List  pEntityList,
_.iKnow.Filters.Filter  pFilter,
_.Library.Integer  pSetOp,
_.Library.Status  pSC 
)
static

Returns the "spread" of metadata values (number of distinct values) for field

pFieldName for the entities in pEntityList, in the sources satisfying pFilter. When specifying multiple entities, sources (and their metadata values) are included based on the value of pSetOp: if pSetOp = $$$UNION, only one entity has to be present (default), if pSetOp = $$$INTERSECT, all of them need to be present.

◆ GetMetaSpreadByEntityIds()

_.Library.Integer GetMetaSpreadByEntityIds ( _.Library.Integer  pDomainId,
_.Library.String  pFieldName,
_.Library.List  pEntityIdList,
_.iKnow.Filters.Filter  pFilter,
_.Library.Integer  pSetOp,
_.Library.Status  pSC 
)
static

Returns the "spread" of metadata values (number of distinct values) for field

pFieldName for the entities in pEntityIdList, in the sources satisfying pFilter. When specifying multiple entities, sources (and their metadata values) are included based on the value of pSetOp: if pSetOp = $$$UNION, only one entity has to be present (default), if pSetOp = $$$INTERSECT, all of them need to be present.

◆ GetUniqueValueCount()

_.Library.Integer GetUniqueValueCount ( _.Library.Integer  pDomainId,
_.Library.String  pFieldName,
_.iKnow.Filters.Filter  pFilter,
  pSC 
)
static

Returns the number of unique metadata values for a given field pFieldName in

the sources satisfying the supplied filter, after normalization based on the field specifications such as case sensitivity and data type.

◆ GetUniqueValueCountById()

_.Library.Status GetUniqueValueCountById ( _.Library.Integer  pDomainId,
_.Library.Integer  pFieldId,
_.iKnow.Filters.Filter  pFilter,
_.Library.Status  pSC 
)
static

Returns the number of unique metadata values for a given field pFieldId in

the sources satisfying the supplied filter, after normalization based on the field specifications such as case sensitivity and data type.

◆ GetUniqueValues()

_.Library.Status GetUniqueValues (   pResult,
_.Library.Integer  pDomainId,
_.Library.String  pFieldName,
_.Library.Integer  pPage,
_.Library.Integer  pPageSize,
_.iKnow.Filters.Filter  pFilter,
_.Library.String  pSortType 
)
static

Returns all the unique metadata values for field pFieldName in sources

satisfying the supplied filter, optionally sorted by value (pSortType = "VALUE") or frequency (pSortType = "FREQUENCY"). The returned frequency represents the number of sources with this metadata value (satisfying the filter).

NOTE: sorting by value is only precise up to the 150 first characters

◆ GetUniqueValuesById()

_.Library.Status GetUniqueValuesById (   pResult,
_.Library.Integer  pDomainId,
_.Library.Integer  pFieldId,
_.Library.Integer  pPage,
_.Library.Integer  pPageSize,
_.iKnow.Filters.Filter  pFilter,
_.Library.String  pSortType 
)
static

Returns all the unique metadata values for field pFieldId in sources

satisfying the supplied filter, optionally sorted by value (pSortType = "VALUE") or frequency (pSortType = "FREQUENCY"). The returned frequency represents the number of sources with this metadata value (satisfying the filter).

NOTE: sorting by value is only precise up to the 150 first characters

◆ GetValues()

_.Library.Status GetValues ( _.Library.Integer  result,
_.Library.Integer  domainId,
_.Library.String  externalId,
_.Library.Boolean  includeHidden 
)
static

Returns the actual metadata values for the given source (by External ID).

Setting includeHidden to true will also return the values for hidden metadata fields.

◆ GetValuesById()

_.Library.Status GetValuesById ( _.Library.Integer  result,
_.Library.Integer  domainId,
_.Library.Integer  srcId,
_.Library.Boolean  includeHidden 
)
static

Returns the actual metadata values for the given source (by Source ID).

Setting includeHidden to true will also return the values for hidden metadata fields.

◆ PopulateFromSQL()

_.Library.Status PopulateFromSQL ( _.Library.Integer  pDomainId,
_.Library.String  pSQL,
_.Library.Boolean  pIgnoreErrors 
)
static

Populates any number of metadata fields with the values retrieved based on the values

retrieved by a query pSQL. The query should at least return a column named "SourceId" containing iKnow Source IDs or a column named "ExternalId" containing the full External IDs of the sources whose metadata fields are to be updated. All other columns with names matching existing metadata fields for this domain will be used to update or set the fields' values for each record. Columns whose name does not correspond to an existing metadata field will be ignored.

Sample query:

SELECT ':SQL:' || YEAR(EventDate) || ':' || EventId As ExternalId, InjuriesHighest, YEAR(EventDate) "Year" FROM Aviation.Event

This will update the InjuriesHighest and Year fields (if they exist).

◆ SetValue()

_.Library.Status SetValue ( _.Library.Integer  domainId,
_.Library.String  fieldName,
_.Library.String  externalId,
_.Library.String  value 
)
static

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.

Reimplemented from MetadataI.

◆ SetValueById()

_.Library.Status SetValueById ( _.Library.Integer  domainId,
_.Library.Integer  fieldId,
_.Library.Integer  srcId,
_.Library.String  value 
)
static

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

(by Source ID). Explicitly setting a value to "" (null/empty string) will erase the current value.

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

Reimplemented from MetadataI.

◆ StartBatch()

_.Library.Status StartBatch ( _.Library.Integer  domainId)
static

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.

Reimplemented from MetadataI.

◆ UpdateField()

_.Library.Status UpdateField ( _.Library.Integer  domainId,
_.Library.String  fieldName,
_.Library.List  supportedOperators,
_.Library.Integer  storage,
_.Library.Integer  hidden,
_.Library.Integer  lovId,
_.Library.Integer  validateLov 
)
static

Updates the properties for a given metadata field (by name). See also <method>AddField</method>.

Specifying a "" for the supportedOperators will leave the current value for that property. Similarly, specifying -1 for storage, hidden and validateLov or -2 for lovId will leave their respective values unmodified. Setting lovId to -1 will unset the LOV for this field.

◆ UpdateFieldById()

_.Library.Status UpdateFieldById ( _.Library.Integer  domainId,
_.Library.Integer  fieldId,
_.Library.List  supportedOperators,
_.Library.Integer  storage,
_.Library.Integer  hidden,
_.Library.Integer  lovId,
_.Library.Integer  validateLov 
)
static

Updates the properties for a given metadata field (by ID). See also <method>AddField</method>.

Specifying a "" for the supportedOperators will leave the current value for that property. Similarly, specifying -1 for storage, hidden and validateLov or -2 for lovId will leave their respective values unmodified. Setting lovId to -1 will unset the LOV for this field.

Member Data Documentation

◆ GetFieldValuesByIdRT

GetFieldValuesByIdRT = None
static

The InterSystems IRIS NLP iKnow technology is now deprecated. Please see the product documentation for more detail.

This is the default implementation for the <class>iKnow.Queries.MetadataI</class> interface and the central place to manage and query metadata fields and values.

◆ GetLovsRT

GetLovsRT = None
static