Hello Grégoire,
> On 18. Feb 2026, at 12:02, Grégoire Montcheuil <
gregoire....@gmail.com> wrote:
>
> I want to configure a project where a KB based feature appear only when another feature has a special value.
> B.e. a NER task where one of the category is 'Medical terms' and in this case we have a second feature, linked to a KB (say SNOMED CT, ICD-10, ...).
>
> It seems the solution is a constraint for conditional feature... but when we look the constraint grammar, we have to list all possible values for the constrained feature ( <restrictions>)... what could be very fastidious for a KB.
> (1) Is there any special syntax for the constraints to restrict the values to a full KB (or a partial sub-set of the KB) ?
> (2) Otherwise, is there another solution for our set-up ?
The constraints code currently is only able to re-order a tagset.
Values matching the constraints are sorted first, then the other values.
This only works for string features with tagsets.
Allowing constraints for KBs would require a new implementation.
It is not particularly clear what this implementation would need to look like.
Probably a simple thing like defining a regex over the concept ID would not be sufficient.
Probably some like of property matching rules over the knowledge base would be required.
Maybe this matching would need to interact with the queries to the knowledge base itself.
So while this is an interesting feature, it is a bit of effort and it requires getting a
clearer picture of what is actually needed.
Feel free to describe your scenario in more detail in a feature issue:
https://github.com/inception-project/inception/issues/new?template=feature_request.md
> Furthermore, we try a constraints like `NER { category = 'Medical terms' -> medical_kb = ""; }` ... but when we look in the Layers panel at the options for our KB feature, any of the "Required" and "Shown only when constraints apply" checkbox appear.
> (3) Does anyone know why this two options are missing in the case of a KB feature ?
> Nota: they both appear on the (a little outdated) screenshot in the documentation for the version we used (39.5).
Same explanation as above :) The reason why these options are in the (outdated) documentation
is that for some time, the logic that would hide these options when they are not applicable was
missing. Since, this has been fixed, and the options are now only visible when applicable
(hopefully).
-- Richard