I have annotations which have features that are other annotations in the same document. Host and feature typically do not overlap, though. I would then like to check whether the feature annotation object has certain properties. I have two problems when trying to do this:
First, I cannot access deep features, e.g.:
DeepAnnotation{->SETFEATURE("foo", DeepAnnotation.bar.foo)}
This does not work, as it seems to interpret only the last ".foo" as a membership expression and everything before as a type.
Second, in cases where DeepAnnotation.bar.foo is an annotation object, I seem to not be able to use IS() etc. to check its properties or assign it to a variable. Is there a list of which conditions accept non-matching annotations as second arguments? For my use case, I would greatly benefit from being ably to check all conditions on non-matched annotations and possibly assign them to variables. If this is the wrong forum for this, I will happily file a feature request somewhere else.
Thanks!
The action SETFEATURE does not work correctly with feature expression in UIMA Ruta 2.1.0. Operations with variables and literal values should work just fine.
You can access deep features with the dot notation as you already do in your example. In case foo
is a feature for an annotation, then DeepAnnotation.bar.foo{-> Type};
should match on all DeepAnnotations, then on the value of bar, then on the value of foo. The action should create an annotation of the type Type
for each 'foo' annotation. Mind that matches out of the current window are not allowed (if the rule is located within a block that resticts the window).
Assignments of annotations to features are only possible with a limited set of actions right now. To these belong CREATE, FILL, GATHER, TRANSFER.