Constraining a relation layer based on its endpoints - does not work?

27 views
Skip to first unread message

Marleen Steinhoff

unread,
Jun 28, 2024, 3:01:16 PM6/28/24
to inception-users

Hello Inception Support Group,

I am using constraints in Inception to limit possible annotations to meet a domain-specific standard. The constraints restrict the possible feature values on my span layer (SDO).
However, the constraints written for the relation layer (SRO) attached to the span layer do not apply and I don't understand why.

My span layer has a property "SDOtype", which allows values from a specific tagset. My relation layer has constrains based on the SDOtype values at its endpoints. But the property "Relationship" on the relation layer does not show up in the Annotation view as soon as I enable "Show only when constraints apply" on the relation layer property "Relationship" even though the constraints should be met. 

My constraints for the relationship layer are:
"""
import webanno.custom.SRO as SRO;

SRO {
Governor.SDOtype = "threat-actor" & Dependent.SDOtype = "attack-pattern" -> Relationship = "uses";
}
"""
The property "Relationship" does not occur (with or without "uses", it's not visible at all), when I connect a SDOtype "threat-actor" with a SDOtype "attack-pattern".

To help illustrating the settings, I have attached screenshots from the entity layer, relation layer, tagset, constraints and annotation view.

Could you help me figuring out where my problem is? I tried a lot back and forth, but I do not get the dropdown menu for the "Relationship" property on the relation layer when the constraints are (or should be) matched. 

Thank you very much for your assistance.
Best regards, 
Marleen


relation_layer.png
constraints.png
tagset.png
entity_layer.png
annotation_view.png

Richard Eckart de Castilho

unread,
Jun 28, 2024, 3:08:48 PM6/28/24
to incepti...@googlegroups.com
Hi Marleen,

> On 28. Jun 2024, at 16:00, Marleen Steinhoff <marleens...@gmail.com> wrote:
>
> Could you help me figuring out where my problem is? I tried a lot back and forth, but I do not get the dropdown menu for the "Relationship" property on the relation layer when the constraints are (or should be) matched.

thank you for the detailed description. From the description, at first glance, it looks all quite reasonable and you seem to have adapted the example from the manual correctly.

Could you maybe send me (privately off-list) an export of that project - or of some reduced reproducer project that I can investigate? That would save me some time in rebuilding the project and I could look directly at what the problem might be.

Cheers,

-- Richard

Marleen Steinhoff

unread,
Jul 1, 2024, 7:58:27 AM7/1/24
to inception-users
Thank you Richard.
I just tried to send an email with the project directly to incepti...@googlegroups.com, but direct emails to this account seem to be blocked.
How can I reach out to you?

Best regards, 
Marleen

Richard Eckart de Castilho

unread,
Jul 2, 2024, 9:46:19 AM7/2/24
to incepti...@googlegroups.com
Hi Marleen,

> On 28. Jun 2024, at 17:08, Richard Eckart de Castilho <richard...@gmail.com> wrote:
>
>> On 28. Jun 2024, at 16:00, Marleen Steinhoff <marleens...@gmail.com> wrote:
>>
>> Could you help me figuring out where my problem is? I tried a lot back and forth, but I do not get the dropdown menu for the "Relationship" property on the relation layer when the constraints are (or should be) matched.
>
> thank you for the detailed description. From the description, at first glance, it looks all quite reasonable and you seem to have adapted the example from the manual correctly.

Looks like INCEpTION has a bug when it comes to merging multiple constraint rulesets.

As a workaround, you can copy the SRO rules/imports into the same ruleset as the SDO and remove the second ruleset - then it appears to work.

Thanks for reporting the issue. I'll look into fixing this problem.

Cheers,

-- Richard

Marleen Steinhoff

unread,
Jul 2, 2024, 12:30:53 PM7/2/24
to inception-users
Hi Richard, 

merging the rulesets manually works! Thank you for your quick and helpful response.

Cheers,
Marleen

SOLUTION/ FIX:
"""
import webanno.custom.SRO as SRO;
import webanno.custom.SDO as SDO;

SDO {
/* constraints */
}

SRO {
/* constraints */

Richard Eckart de Castilho

unread,
Jul 3, 2024, 5:20:15 AM7/3/24
to inception-users
Issue will be fixed in the next bugfix release:

https://github.com/inception-project/inception/issues/4921

-- Richard
Reply all
Reply to author
Forward
0 new messages