One thing to consider is where this functionality ought best to go. If an App wanted consistency checking, it could
- do what is suggested below - a "hook" that can be set up to call some consistency checker on every add-to-index. - or change the App code, refactoring it so that all add-to-indexes needing consistency checking went to one (or more) consistency checking common routines, which, if the checks passed, would do the add-to -indexes. The 2nd approach allow more modularity - only those add-to-indexes where this check is wanted would do the check, and many different kinds of consistency checking could be implemented, for all kinds of subsets of add-to-indexes calls. The first approach would funnel all add-to-indexes calls into a single consistency checker, which would then funnel out (I guess) to the various kinds of checks needed. -M On 11/13/2017 2:38 PM, Richard Eckart de Castilho wrote: > Hi all, > > I am wondering if it would be feasible to add some "addToIndex" hooks to UIMA > which would be called whenever a FS is added to indexes. > > Why? > > There may be conventions on the type system and feature values that cannot be > expressed simply via the type system definition. For example, in DKPro Core, > there is a convention that the begin/end of a Dependency annotation must > match the begin/end of the Token that is referred to by the "dependent" > feature. There are a number of additional conventions like these. > > It would probably be possible to use customized JCas classes to check for > such conventions, but that of course would fail if the feature structures are > created/manipulated via the CAS API. Also, not everybody is fond of > customized (i.e. not auto-generated) JCas classes. > > Has anybody already through of supporting such "consistency checks" at the > CAS level? > > How are you ensuring consistent information in your CASes? > > Cheers, > > -- Richard
