1 10 package com.hp.hpl.jena.reasoner.rulesys.builtins; 11 12 import com.hp.hpl.jena.reasoner.InfGraph; 13 import com.hp.hpl.jena.reasoner.rulesys.*; 14 import com.hp.hpl.jena.graph.*; 15 16 23 public class Hide extends BaseBuiltin { 24 25 29 public String getName() { 30 return "hide"; 31 } 32 33 43 public boolean bodyCall(Node[] args, int length, RuleContext context) { 44 doHide(args, length, context); 45 return true; 46 } 47 48 49 58 public void headAction(Node[] args, int length, RuleContext context) { 59 doHide(args, length, context); 60 } 61 62 65 private void doHide(Node[] args, int length, RuleContext context ) { 66 InfGraph g = context.getGraph(); 67 if (g instanceof FBRuleInfGraph) { 68 for (int i = 0; i < length; i++) { 69 ((FBRuleInfGraph)g).hideNode(args[i]); 70 } 71 } else { 72 throw new BuiltinException(this, context, "hide only available for FB rule engines"); 73 } 74 } 75 } 76 77 78 79 | Popular Tags |