DocBook|Search
Class Reference
%iKnow.Matching.MatchingAPI
   
Server:basexml
Instance:SOAXML
User:UnknownUser
 
-
  [BASEXML] >  [%iKnow] >  [Matching] >  [MatchingAPI]
Private  Storage  

class %iKnow.Matching.MatchingAPI extends %iKnow.Queries.AbstractAPI

This is the main entry point for driving the iKnow Smart Matching mechanisms

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
23 44


Summary

Methods
%%OIDGet %AddToSaveSet %ClassIsLatestVersion
%ClassName %ConstructClone %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty
%Extends %GetParameter %IsA
%IsModified %New %NormalizeObject
%ObjectModified %OriginalNamespace %PackageName
%RemoveFromSaveSet %SerializeObject %SetModified
%ValidateObject ClearLogs GetDictionaryMatches
GetDictionaryMatchesById GetErrors GetHighlightedSentences
GetMatchElements GetMatchesByCrcOcc GetMatchesByDictionaryItemId
GetMatchesByDictionaryItemURI GetMatchesByEntOcc GetMatchesByPath
GetMatchesBySentence GetMatchesBySource GetMatchesBySourceId
GetTopItems GetTopMatchesByDictionaryItemId GetTopMatchesByDictionaryItemURI
GetTotalDictionaryScoresBySource GetTotalDictionaryScoresBySourceId GetTotalItemScoresBySource
GetTotalItemScoresBySourceId InvalidateMatchingResults MatchEntityUniques
MatchSource MatchSources


Parameters

• parameter GetDictionaryMatchesByIdRT = "dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%String,dictTerm:%String,dictElementId:%String,type:%String,matchScore:%Numeric,matchedWordBits:%String,isScattered:%Boolean,formatOutput:%String";
• parameter GetDictionaryMatchesRT = "dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%String,dictTerm:%String,dictElementId:%String,type:%String,matchScore:%Numeric,matchedWordBits:%String,isScattered:%Boolean,formatOutput:%String";
• parameter GetErrorsRT = "sourceId:%Integer,externalId:%String,errorMessage:%String,date:%Date";
• parameter GetMatchElementsRT = "position:%Integer,entOccId:%Integer,entUniId:%Integer,literal:%String,role:%Integer,matchScore:%Numeric,dictElementId:%Integer,dictElement:%String,matchedWordBits:%String,isScattered:%Boolean,formatOutput:%String";
• parameter GetMatchesByCrcOccRT = "matchId:%Integer,dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%Integer,targetType:%String,targetId:%Integer,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetMatchesByDictionaryItemIdRT = "matchId:%Integer,dictTermId:%Integer,sourceId:%Integer,externalId:%String,targetType:%String,targetId:%Integer,targetUniId:%Integer,targetValue:%String,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetMatchesByDictionaryItemURIRT = "matchId:%Integer,dictTermId:%Integer,sourceId:%Integer,externalId:%String,targetType:%String,targetId:%Integer,targetUniId:%Integer,targetValue:%String,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetMatchesByEntOccRT = "matchId:%Integer,dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%Integer,targetType:%String,targetId:%Integer,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetMatchesByPathRT = "matchId:%Integer,dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%Integer,targetType:%String,targetId:%Integer,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetMatchesBySentenceRT = "matchId:%Integer,dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%Integer,targetType:%String,targetId:%Integer,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetMatchesBySourceIdRT = "matchId:%Integer,dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%Integer,targetType:%String,targetId:%Integer,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetMatchesBySourceRT = "matchId:%Integer,dictId:%Integer,dictItemId:%Integer,dictItemURI:%String,dictTermId:%Integer,targetType:%String,targetId:%Integer,matchScore:%Numeric,matchingConceptCount:%Integer,matchingRelationCount:%Integer,partialMatchCount:%Integer,firstMatchedPosInPath:%Integer,lastMatchedPosInPath:%Integer,isOrdered:%Boolean";
• parameter GetTopItemsRT = "dictId:%Integer,dictItemId:%Integer,name:%String,URI:%String,frequency:%Integer,spread:%Integer,score:%Numeric";
• parameter GetTopMatchesByDictionaryItemIdRT = "targetType:%Integer,targetUniId:%Integer,targetValue:%String,frequency:%Integer,spread:%Integer,bestScore:%Numeric";
• parameter GetTopMatchesByDictionaryItemURIRT = "targetType:%Integer,targetUniId:%Integer,targetValue:%String,frequency:%Integer,spread:%Integer,bestScore:%Numeric";
• parameter GetTotalDictionaryScoresBySourceIdRT = "dictId:%Integer,dictionary:%String,matchCount:%Integer,totalScore:%Numeric";
• parameter GetTotalDictionaryScoresBySourceRT = "dictId:%Integer,dictionary:%String,matchCount:%Integer,totalScore:%Numeric";
• parameter GetTotalItemScoresBySourceIdRT = "dictId:%Integer,dictionary:%String,dictItemId:%Integer,item:%String,URI:%String,matchCount:%Integer,totalScore:%Numeric";
• parameter GetTotalItemScoresBySourceRT = "dictId:%Integer,dictionary:%String,dictItemId:%Integer,item:%String,URI:%String,matchCount:%Integer,totalScore:%Numeric";

Methods

• classmethod ClearLogs(domainId As %Integer) as %Status
Clears any matching-related logfiles for the specified domain.
• classmethod GetDictionaryMatches(ByRef result As %Integer, domainId As %Integer, string As %String, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10, fullMatchOnly As %Integer = -1, profile As %iKnow.Matching.MatchingProfile = "") as %Status

Returns all potential matches for a given string.

A Matching Profile to be used when calculating match scores can be specified either by passing in an %iKnow.Matching.MatchingProfile object, or a Matching Profile ID. When passing in the ID, a negative number is treated as a namespace-wide profile, whereas a positive ID will be looked up within the context of the domain. If no profile is specified, the default profile for this domain will be used.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetDictionaryMatchesById(ByRef result As %Integer, domainId As %Integer, entUniId As %Integer, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10, fullMatchOnly As %Integer = -1, profile As %iKnow.Matching.MatchingProfile = "") as %Status

Returns all potential matches for the given entity ID.

A Matching Profile to be used when calculating match scores can be specified either by passing in an %iKnow.Matching.MatchingProfile object, or a Matching Profile ID. When passing in the ID, a negative number is treated as a namespace-wide profile, whereas a positive ID will be looked up within the context of the domain. If no profile is specified, the default profile for this domain will be used.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetErrors(ByRef result, domainId As %Integer, since As %Date = 0) as %Status
Returns any errors registered during the Matching process
• classmethod GetHighlightedSentences(ByRef result, domainId As %Integer, srcId As %Integer, page As %Integer = 1, pageSize As %Integer = 10, filter As %iKnow.Matching.MatchFilter = "", displayEveryMatch=0, entOccJSAction As %String = "", matchJSAction As %String = "", dictStyles="", matchScoreStyles="") as %Status

Returns a HTML representation of the given sources sentences in which all matched elements are highlighted according to the parameters specified in this method invocation. At lower subscript levels, all composing parts, literals and matching result info is specified to enable custom highlighting as well.

  • Setting displayEveryMatch to 1 will generate markup for every individual match, whereas 0 (the default) will display at most 1 match per entity to limit the complexity of the output
  • Through the entOccJSAction and matchJSAction parameters, a JavaScript method name can be provided to be rendered as onclick actions for either the entity occurrences or individual matches, taking their respective IDs as arguments.
  • The dictStyles and matchScoreStyles parameters can be used to supply local arrays specifying additional style classes to apply to matches for specific dictionaries and match score windows respectively.

If a negative Source ID is supplied, it is interpreted as a Virtual Source.

• classmethod GetMatchElements(ByRef result, domainId As %Integer, matchId As %Integer, vSrcId As %Integer = 0) as %Status

Returns a detailed overview of all the elements in the match target, be it an entity-level, CRC-level or path-level match. The elements that are matched get annotated with the matched elements ID, value and eventually the output from a %iKnow.Matching.Formats.Format class if it was responsible for the match.

If a Virtual Source ID is supplied, the query runs in the context of that virtual source.

• classmethod GetMatchesByCrcOcc(ByRef result, domainId As %Integer, crcOccId As %Integer, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10, includeEntityMatches As %Boolean = 1, includePathMatches As %Boolean = 1, includeSentenceMatches As %Boolean = 1) as %Status

Returns all the matches for the given CRC Occurrence. Use includeEntityMatches, includePathMatches and includeSentenceMatches to also include any matches for the Entities this CRC is composed of and the Paths these Entities participate in.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetMatchesByDictionaryItemId(ByRef result, domainId As %Integer, dictItemId As %Integer, page As %Integer = 1, pageSize As %Integer = 10, filter As %iKnow.Filters.Filter = "", targetTypes As %List = "") as %Status

This query returns a list of all the match occurrences for the Dictionary Item specified through dictItemId.

Specifying a %iKnow.Filters.Filter object as filter will restrict the search space to only those sources satisfying the filters criteria. Through targetTypes, the desired target types can be specified in a %List (defaults to all types).

• classmethod GetMatchesByDictionaryItemURI(ByRef result, domainId As %Integer, dictItemURI As %String, page As %Integer = 1, pageSize As %Integer = 10, filter As %iKnow.Filters.Filter = "", targetTypes As %List = "") as %Status

This query returns a list of all the match occurrences for the Dictionary Item specified through dictItemURI.

Specifying a %iKnow.Filters.Filter object as filter will restrict the search space to only those sources satisfying the filters criteria. Through targetTypes, the desired target types can be specified in a %List (defaults to all types).

• classmethod GetMatchesByEntOcc(ByRef result, domainId As %Integer, entOccId As %Integer, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10, includeCrcMatches As %Boolean = 1, includePathMatches As %Boolean = 1, includeSentenceMatches As %Boolean = 1) as %Status

Returns all the matches for the given Entity Occurrence. Use includeCrcMatches, includePathMatches and includeSentenceMatches to also include any matches for the CRC, Path or Sentence in which this Entity Occurrences participates.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetMatchesByPath(ByRef result, domainId As %Integer, pathId As %Integer, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10, includeEntityMatches As %Boolean = 1, includeCrcMatches As %Boolean = 1, includeSentenceMatches As %Boolean = 1) as %Status

Returns all the matches for the given Path. Use includeEntityMatches, includeCRCMatches and includeSentenceMatches to also include any matches for the Entities this path is composed of and the CRCs or Sentences these Entities participate in.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetMatchesBySentence(ByRef result, domainId As %Integer, sentenceId As %Integer, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10, includeEntityMatches As %Boolean = 1, includeCrcMatches As %Boolean = 1, includePathMatches As %Boolean = 1) as %Status

Returns all the matches for the given Sentence. Use includeEntityMatches, includeCrcMatches and includePathMatches to control which (target) types of matches should be included in the result.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetMatchesBySource(ByRef result, domainId As %Integer, externalId As %String, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10) as %Status

Returns all the matches for the given Source, as identified by its external ID.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetMatchesBySourceId(ByRef result, domainId As %Integer, srcId As %Integer, dictIds As %List = "", page As %Integer = 1, pageSize As %Integer = 10) as %Status

Returns all the matches for the given Source, as identified by its Source ID (interpreted as a Virtual Source if a negative value is supplied).

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetTopItems(ByRef result, domainId As %Integer, page As %Integer = 1, pageSize As %Integer = 10, filter As %iKnow.Filters.Filter = "", dictIds As %List = "", sortType As %Integer = $$$SORTBYFREQUENCY, vSrcId As %Integer = 0) as %Status

Returns the Dictionary Items for which most matches have been found in this domain (optionally narrowed down through a %iKnow.Filters.Filter object passed in through filter). Result sort order is controlled by sorttype:

  • $$$SORTBYFREQUENCY will sort by the number of actual matches for a Dictionary Item
  • $$$SORTBYSPREAD will sort by the number of distinct documents in which at least one match for the Dictionary Item occurs.
  • $$$SORTBYSCORE will sort by the total match score of all matches for a Dictionary Item

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetTopMatchesByDictionaryItemId(ByRef result, domainId As %Integer, dictItemId As %Integer, page As %Integer = 1, pageSize As %Integer = 10, filter As %iKnow.Filters.Filter = "", targetTypes As %List = "", sortType As %Integer = $$$SORTBYFREQUENCY) as %Status

This query returns a list of the "best" matching results for the Dictionary Item specified through dictItemId, aggregated by matched unique target (entity, CRC, path or sentence). The meaning of "best" is defined by sortType: if set to $$$SORTBYFREQUENCY or $$$SORTBYSPREAD, results are sorted by decreasing number of matched occurrences, whereas $$$SORTBYSCORE will rank them according to the highest match score. The first two options will yield the most relevant results for entities and CRCs, with the score ranking a better fit for paths and sentences, as they inherently have frequency and spread equal to 1.

Specifying a %iKnow.Filters.Filter object as filter will restrict the search space to only those sources satisfying the filters criteria. Through targetTypes, the desired target types can be specified in a %List (defaults to all types).

• classmethod GetTopMatchesByDictionaryItemURI(ByRef result, domainId As %Integer, dictItemURI As %String, page As %Integer = 1, pageSize As %Integer = 10, filter As %iKnow.Filters.Filter = "", targetTypes As %List = "", sortType As %Integer = $$$SORTBYFREQUENCY) as %Status

This query returns a list of the "best" matching results for the Dictionary Item specified through dictItemURI, aggregated by matched unique target (entity, CRC, path or sentence). The meaning of "best" is defined by sortType: if set to $$$SORTBYFREQUENCY or $$$SORTBYSPREAD, results are sorted by decreasing number of matched occurrences, whereas $$$SORTBYSCORE will rank them according to the highest match score. The first two options will yield the most relevant results for entities and CRCs, with the score ranking a better fit for paths and sentences, as they inherently have frequency and spread equal to 1.

Specifying a %iKnow.Filters.Filter object as filter will restrict the search space to only those sources satisfying the filters criteria. Through targetTypes, the desired target types can be specified in a %List (defaults to all types).

• classmethod GetTotalDictionaryScoresBySource(ByRef result, domainId As %Integer, externalId As %String, sortType As %Integer = $$$SORTBYFREQUENCY) as %Status
Returns summary information for all matches in a given source (identified by External ID), organized per Dictionary.
• classmethod GetTotalDictionaryScoresBySourceId(ByRef result, domainId As %Integer, srcId As %Integer, sortType As %Integer = $$$SORTBYFREQUENCY) as %Status
Returns summary information for all matches in a given source (identified by Source ID), organized per Dictionary.
• classmethod GetTotalItemScoresBySource(ByRef result, domainId As %Integer, externalId As %String, dictIds As %List = "", sortType As %Integer = $$$SORTBYFREQUENCY) as %Status

Returns summary information for all matches in a given source (identified by External ID), organized per Dictionary Item.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod GetTotalItemScoresBySourceId(ByRef result, domainId As %Integer, srcId As %Integer, dictIds As %List = "", sortType As %Integer = $$$SORTBYFREQUENCY) as %Status

Returns summary information for all matches in a given source (identified by Source ID), organized per Dictionary Item.

Specifying "" for dictIds will return results for all Dictionaries in this domain.

• classmethod InvalidateMatchingResults(domainId As %Integer, dictIds As %List = "", keepEntUniMatches As %Boolean = 0) as %Status

Deletes all current matching results for the list of Dictionary IDs passed in dictIds.

Specifying "" for dictIds will drop results for all Dictionaries in this domain.

Optionally, the matching results at the unique entity level (calculated by MatchEntityUniques) can be retained by setting keepEntUniMatches to 1.

• classmethod MatchEntityUniques(domainId As %Integer, dictIds As %List = "", vSrcId As %Integer = 0) as %Status

Match the unique entities in this domain to all Dictionary Terms and Formats in the list of Dictionaries specified through dictIds that haven't been matched in earlier operations. This method is called automatically at the start of a call to MatchSource or MatchSources.

Specifying "" for dictIds will match against all Dictionaries in this domain.

If a Virtual Source is specified, the entities of this Virtual Source will be matched.

• classmethod MatchSource(domainId As %Integer, srcId As %Integer, dictIds As %List = "", overrideProfile As %iKnow.Matching.MatchingProfile = "") as %Status

Matches an individual source against the list of Dictionary IDs passed in dictIds. A Matching Profile to calculate match scores can be specified either by passing in an %iKnow.Matching.MatchingProfile object, or a Matching Profile ID. When passing in the ID, a negative number is treated as a namespace-wide profile, whereas a positive ID will be looked up within the context of the domain.

Specifying "" for dictIds will match against all Dictionaries in this domain.

A negative Source ID is interpreted as a Virtual Source.

• classmethod MatchSources(domainId As %Integer, filter As %iKnow.Filters.Filter = "", dictIds As %List = "", overrideProfile As %iKnow.Matching.MatchingProfile = "") as %Status

Matches all sources in the domain, optionally restricted to those satisfying the criteria of a %iKnow.Filters.Filter object provided as filter, against the list of Dictionary IDs passed in dictIds.

A Matching Profile to calculate match scores can be specified either by passing in an %iKnow.Matching.MatchingProfile object, or a Matching Profile ID. When passing in the ID, a negative number is treated as a namespace-wide profile, whereas a positive ID will be looked up within the context of the domain.

Specifying "" for dictIds will match against all Dictionaries in this domain.