Define FirstRuleCreationQuestion sub rule


#1

Hi grakn team,
I need some help about rule creation :slight_smile:

The use case:
I have a GROUP (MyGROUP) linked to MARKING through PERMISSION
My MARKING have a level and a type. (WHITE=MARK{TLP,1} , GREEN=MARK{TLP,2})
Currently i just created PERMISSION between MyGROUP and GREEN .
I try with a rule to create a inferred relation between MyGROUP and WHITE because WHITE have a lower level and the type is the same.

The rule:

define
tlp-group-rule sub rule,
when {
  (allowed: $group, allow: $marking) isa permission;
  $marking has level $markingLevel has type $markingType;
  $markingDefinition isa Marking-Definition has level $markingDefinitionLevel has type $markingDefinitionType;
  $markingDefinitionType == $markingType;
  $markingDefinitionLevel <= $markingLevel;
} then {
  (allow: $markingDefinition, allowed: $group) isa permission;
};

Current result:
Infinite loop in the workbase when i try to expend MyGROUP to see all the relations.

Thanks in advance :wink:


#2

Hi Julien,

Whatโ€™s the type of $marking in $marking has level $markingLevel has type $markingType;?

Try specifying the type ($marking isa <type's label> has ...) in that line and see if it makes a difference. If the problem persists, can you share the relevant schema definitions and some insert queries for reproducing the issue?


#3

The $marking isa Marking-Definition and it works when I specified it :wink:
Thanks for this magic answer.
Do you think i need to create a ticket for this or its something you already aware of?


#4

Hello Julien!

Please create an issue on github. If you could describe a minimum reproducible example that would help us a lot in tracking and verifying the issue.