%iKnow.Queries.MetadataAPI
class %iKnow.Queries.MetadataAPI extends %iKnow.Queries.MetadataI, %iKnow.Queries.AbstractAPI
This is the default implementation for the %iKnow.Queries.MetadataI interface and the central place to manage and query metadata fields and values.
Method Inventory
- AddField()
- AddListOfValues()
- AddLovValue()
- CreateFilter()
- EndBatch()
- GetFieldId()
- GetFieldInfo()
- GetFieldInfoById()
- GetFieldValues()
- GetFieldValuesById()
- GetFields()
- GetLovValues()
- GetLovs()
- GetMetaSpreadByEntities()
- GetMetaSpreadByEntityIds()
- GetMetaSpreadInternal()
- GetUniValue()
- GetUniqueValueCount()
- GetUniqueValueCountById()
- GetUniqueValues()
- GetUniqueValuesById()
- GetValue()
- GetValueById()
- GetValues()
- GetValuesById()
- PopulateFromSQL()
- RemoveField()
- RemoveFieldById()
- SetValue()
- SetValueById()
- StartBatch()
- UpdateField()
- UpdateFieldById()
Parameters
Methods
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 Caché index, $$$MDSTBITMAP where you would use a Caché 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 AddListOfValues().
- If hidden is set to true, the field will by default not appear in metadata field and value lists.
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.
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.
For the default MetadataAPI, this is a %iKnow.Filters.SimpleMetadataFilter instance.
Ends a metadata batch. See StartBatch() for more details.
Returns all field definitions (including their properties) for the given domain.
Setting includeHidden to true will also return any metadata fields marked as 'hidden'.
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.
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.
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.
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.
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
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
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.
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.
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.EventThis will update the InjuriesHighest and Year fields (if they exist).
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.
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.
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.
Updates the properties for a given metadata field (by name). See also AddField().
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.
Updates the properties for a given metadata field (by ID). See also AddField().
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.
Inherited Members
Inherited 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()