LINK
- Last Updated: May 13, 2026
- 3 minute read
- Semaphore
- Documentation
The Link rule allows you to to define rule constructs once and use them repeatedly throughout your rulebases.
Links require a single link source to which multiple links can be made. A link source is defined whenever you use a Label Attribute on a rule. You can reuse that labelled rule by simply defining a link rule with the same label.
Score calculation
Scores the same as the linked to rule (optionally scaled by the given weight)
Evidence calculation
The evidence is the evidence of the linked to rule
Attribute information
- Any attribute
- Label Attribute - specifies the label which this rule will match - NB you cannot label a link rule and then link to that in turn
- Weight Attribute - used to scale the weight of the linked to rule
Children restrictions
- No children allowed
A common use of links is to define lists of items, such as product names. The same list can then be used in multiple rules. See the example below.
By default links are globally scoped, so any label used can potentially be linked to from any other rulebase. For this reason it is important to name labels carefully and it may be worthwhile using some convention, such as prefixing labels with the name of the rulebase or an abbreviated name of the project to emulate a namespace mechanism.
The exception is any label beginning with “_:” which are locally scoped labels - these work just like normal labels / links but are only valid for the particular rulebase file and so the name may be re-used in other rulebase files without any cross linking. For some rulebases this allows for simpler label naming rather than having to create long label names to ensure uniqueness which may improve the readability.
Example
The following document fragment
Jean-Claude Trichet announced today a rise of 1/2 point in interest rates.
¶
In a separate intervention the governor of the European Central Bank announced that the
Evaluated against the following rulebase
<any weight="100" label="link.governors">
<text data="Jean-Claude Trichet" />
<text data="Alan Greenspan" />
</any>
<any weight="100" label="link.centralbanks">
<text data="European Central Bank" />
<text data="FED" />
</any>
<any weight="100" label="_:indicators">
<text data="interest rates" />
<text data="inflation" />
</any>
<category class="test" name="link1" label="link.link1">
<sentence>
<any>
<link label="link.governors" />
<link label="link.centralbanks" />
</any>
<link label="_:indicators" />
</sentence>
</category>
Will return (slightly modified for clarity)
<response>
<STRUCTUREDDOCUMENT>
<URL>...</URL>
<SYSTEM name="HASH" value="..."/>
<META name="Type" value="TEXT (4003)"/>
<SYSTEM name="DeterminedLanguage" value="english"/>
<SYSTEM name="LanguageGuessed" value="no"/>
<META name="test" value="link1" score="1.00"/>
</STRUCTUREDDOCUMENT>
</response>
You will have noted that the sample rulebase makes use of a concept designated as non triggering top level rules. The first 3 ANY rules will not produce independent scores and can only be used to contribute towards a triggering rule (a category) through inclusion via a LINK rule.
However when sent via the SANDBOX an extra containing category rule (called SANDBOX:PARENT) is automatically added surrounding all the rules for convenience in navigation - this will not happen automatically if you transfer these rules to a physical rulebase file and publish it.
Also note that two of these links are global and so could be used by any other rulebase published at the same time whilst the third has local scope and is only available for use with links in the same rulebase.