com.hp.hpl.jena.reasoner.rulesys.builtins
Class Drop

java.lang.Object
  extended by com.hp.hpl.jena.reasoner.rulesys.builtins.BaseBuiltin
      extended by com.hp.hpl.jena.reasoner.rulesys.builtins.Drop
All Implemented Interfaces:
Builtin

public class Drop
extends BaseBuiltin

A variant of the "remove" builtin that will delete matched triples from the graph but will not trigger further rule processing for the removed triples. This makes it seriously non-monotonic but useful for rewrite rules.

Version:
$Revision: 1.1 $
Author:
Dave Reynolds

Field Summary
 
Fields inherited from class com.hp.hpl.jena.reasoner.rulesys.builtins.BaseBuiltin
BASE_URI
 
Constructor Summary
Drop()
           
 
Method Summary
 String getName()
          Return a name for this builtin, normally this will be the name of the functor that will be used to invoke it.
 void headAction(Node[] args, int length, RuleContext context)
          This method is invoked when the builtin is called in a rule head.
 boolean isMonotonic()
          Returns false if this builtin is non-monotonic.
 
Methods inherited from class com.hp.hpl.jena.reasoner.rulesys.builtins.BaseBuiltin
bodyCall, checkArgs, getArg, getArgLength, getURI, isSafe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Drop

public Drop()
Method Detail

getName

public String getName()
Return a name for this builtin, normally this will be the name of the functor that will be used to invoke it.


headAction

public void headAction(Node[] args,
                       int length,
                       RuleContext context)
This method is invoked when the builtin is called in a rule head. Such a use is only valid in a forward rule.

Specified by:
headAction in interface Builtin
Overrides:
headAction in class BaseBuiltin
Parameters:
args - the array of argument values for the builtin, this is an array of Nodes.
length - the length of the argument list, may be less than the length of the args array for some rule engines
context - an execution context giving access to other relevant data

isMonotonic

public boolean isMonotonic()
Returns false if this builtin is non-monotonic. This includes non-monotonic checks like noValue and non-monotonic actions like remove/drop. A non-monotonic call in a head is assumed to be an action and makes the overall rule and ruleset non-monotonic. Most JenaRules are monotonic deductive closure rules in which this should be false.

Specified by:
isMonotonic in interface Builtin
Overrides:
isMonotonic in class BaseBuiltin


Licenced under the Apache License, Version 2.0