1 10 package com.hp.hpl.jena.reasoner.rulesys.builtins; 11 12 import com.hp.hpl.jena.reasoner.rulesys.*; 13 import com.hp.hpl.jena.graph.*; 14 15 24 public class NoValue extends BaseBuiltin { 25 26 30 public String getName() { 31 return "noValue"; 32 } 33 34 44 public boolean bodyCall(Node[] args, int length, RuleContext context) { 45 if (length !=2 && length != 3) { 46 throw new BuiltinException(this, context, "builtin " + getName() + " requires 2 or 3 arguments but saw " + length); 47 } 48 Node obj = null; 49 if (length == 3) { 50 obj = getArg(2, args, context); 51 } 52 Node subj = getArg(0, args, context); 53 if (subj.isVariable()) { 55 subj = null; 56 } 57 Node pred = getArg(1, args, context); 58 if (pred.isVariable()) { 59 pred = null; 60 } 61 return !context.contains(subj, pred, obj); 62 } 63 64 } 65 66 | Popular Tags |