Create a Cognate Query Expression Node.
Namespace: NetricsServerInterface
Assembly: NetricsServerInterface (in NetricsServerInterface.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function Cognate( _ ByVal qstrs As String(), _ ByVal fldnames As String(), _ ByVal fldweights As Double(), _ ByVal noncogwgt As Double, _ ByVal empty_field_penalty As Double _ ) As NetricsQuery |
C# |
---|
public static NetricsQuery Cognate( string[] qstrs, string[] fldnames, double[] fldweights, double noncogwgt, double empty_field_penalty ) |
C++ |
---|
public: static NetricsQuery Cognate( array<String>^ qstrs, array<String>^ fldnames, array<double>^ fldweights, double noncogwgt, double empty_field_penalty ) |
J# |
---|
public static NetricsQuery Cognate( string[] qstrs, string[] fldnames, double[] fldweights, double noncogwgt, double empty_field_penalty ) |
JScript |
---|
public static
function Cognate( qstrs : String[], fldnames : String[], fldweights : double[], noncogwgt : double, empty_field_penalty : double ) : NetricsQuery |
Parameters
- qstrs
- the list of query strings
- fldnames
- list of fields to query
- fldweights
- list of weights for field
- noncogwgt
- penalty applied to diagonal (non-cognate) field matches
- empty_field_penalty
- the penalty applied for unmatched data that can be associated with an empty field. If a value less than 0.0 is given the default empty field penalty is used.
Remarks
This creates a cognate query as described for the
The empty field penalty applies in situations where the query input has a fewer or greater number of non-empty fields then the record. A typical case is in matching names where there are first, middle and last name fields. Very often the middle name field is not populated. If given a query without a middle name you'd like to match records with a middle name, without a large penalty for the unmatched middle name in the record. If given a query with a middle name you'd like to match records that do not have a middle name without a large penalty for the unmatched middle name in the query. Setting the empty_field_penalty allows you to define how much the match is penalized for the unmatched data in these situations.
A cognate query allows for cross field matching. Therefore it is not valid to reduce penalties only for unmatched data in the middle name field of the record if the query middle name field is empty. The record may have the first name in the middle name field, and the middle name in the first name field. The middle name field of the record gets matched, the first name field is left unmatched. In this case we want to reduce the penalty for the unmatched data in the first name field. The general rule is when the record or query has more unpopulated fields than the other, the adjustment for empty field matches is applied to the fields with the least proportion of matched data. See the TIBCO Patterns Concepts Guide for a full explanation of how the penalty is applied, with examples.
A penalty factor of 1.0 implies the full penalty should be applied for unmatched data. This means there is no adjustment because of empty fields. This is the default, and the behavior previous to the availability of this feature.
A penalty factor of 0.0 implies no penalty is applied for unmatched data that can be attributed to an empty field. For example, with a penalty factor of 0.0 a match of "John", "Quincy", "Adams" against "John", "", "Adams" would return a 1.0 score.
It is generally recommended that an empty field penalty of 0.0 not be used. Some small penalty should normally be applied so that records that match in their entirety score higher than those that left some query or record data unmatched.