/** * This method is invoked when the builtin is called in a rule head. * Such a use is only valid in a forward rule. * @param args the array of argument values for the builtin, this is an array * of Nodes. * @param length the length of the argument list, may be less than the length of the args array * for some rule engines * @param context an execution context giving access to other relevant data */ @Override public void headAction(Node[] args, int length, RuleContext context) { if (context.getGraph() instanceof FBRuleInfGraph) { Triple t = new Triple(args[0], args[1], args[2]); ((FBRuleInfGraph)context.getGraph()).addDeduction(t); } else { throw new BuiltinException(this, context, "Only usable in FBrule graphs"); } } }
/** * This method is invoked when the builtin is called in a rule head. * Such a use is only valid in a forward rule. * @param args the array of argument values for the builtin, this is an array * of Nodes. * @param length the length of the argument list, may be less than the length of the args array * for some rule engines * @param context an execution context giving access to other relevant data */ @Override public void headAction(Node[] args, int length, RuleContext context) { if (context.getGraph() instanceof FBRuleInfGraph) { Triple t = new Triple(args[0], args[1], args[2]); ((FBRuleInfGraph)context.getGraph()).addDeduction(t); } else { throw new BuiltinException(this, context, "Only usable in FBrule graphs"); } } }