/** * Register an RDF predicate as one whose presence in a goal should force * the goal to be tabled. This is better done directly in the rule set. */ public synchronized void tablePredicate(Node predicate) { // Create a dummy rule which tables the predicate ... Rule tablePredicateRule = new Rule("", new ClauseEntry[]{ new Functor("table", new Node[] { predicate },BuiltinRegistry.theRegistry) }, new ClauseEntry[]{}); // ... end append the rule to the ruleset rules.add(tablePredicateRule); }
/** * Register an RDF predicate as one whose presence in a goal should force * the goal to be tabled. This is better done directly in the rule set. */ public synchronized void tablePredicate(Node predicate) { // Create a dummy rule which tables the predicate ... Rule tablePredicateRule = new Rule("", new ClauseEntry[]{ new Functor("table", new Node[] { predicate },BuiltinRegistry.theRegistry) }, new ClauseEntry[]{}); // ... end append the rule to the ruleset rules.add(tablePredicateRule); }
/** * Create a functor and wrap it up as a Literal node * @param name the name of the functor * @param args an array of nodes defining the arguments, this will not be copied so beware of * accidental structure sharing */ public static Node makeFunctorNode(String name, Node[] args) { return makeFunctorNode( new Functor( name, args, BuiltinRegistry.theRegistry ) ); }
private static Functor makePropertyAssertionFunctor(final Node p) { final Functor f = new Functor("isNotSubClass", new Node[] { p, PRED_SUB }); f.setImplementor(NOT_EQUAL); return f; }
/** * Create a functor and wrap it up as a Literal node * @param name the name of the functor * @param args an array of nodes defining the arguments, this will not be copied so beware of * accidental structure sharing */ public static Node makeFunctorNode(String name, Node[] args) { return makeFunctorNode( new Functor( name, args, BuiltinRegistry.theRegistry ) ); }
private static Functor makePropertyAssertionFunctor(final Node p) { final Functor f = new Functor("isNotSubClass", new Node[] { p, PRED_SUB }); f.setImplementor(NOT_EQUAL); return f; }
private static Functor makePropertyAssertionFunctor(final Node p) { final Functor f = new Functor("isNotSubClass", new Node[] { p, PRED_SUB }); f.setImplementor(NOT_EQUAL); return f; }
String name = nextToken(); List<Node> args = parseNodeList(); Functor clause = new Functor(name, args, registry); if (clause.getImplementor() == null) {
Functor f = new Functor(token, parseNodeList(), registry); return Functor.makeFunctorNode( f ); } else if (token.equals("'") || token.equals("\"")) {
String name = nextToken(); List<Node> args = parseNodeList(); Functor clause = new Functor(name, args, registry); if (clause.getImplementor() == null) {
Functor f = new Functor(token, parseNodeList(), registry); return Functor.makeFunctorNode( f ); } else if (token.equals("'") || token.equals("\"")) {
/** * Clone a functor, cloning any embedded variables. */ private Functor cloneFunctor(Functor f, Map<Node_RuleVariable, Node> vmap, BindingEnvironment env) { Node[] args = f.getArgs(); Node[] cargs = new Node[args.length]; for (int i = 0; i < args.length; i++) { cargs[i] = cloneNode(args[i], vmap, env); } Functor fn = new Functor(f.getName(), cargs, f.getImplementor()); fn.setImplementor(f.getImplementor()); return fn; }
/** * Clone a functor, cloning any embedded variables. */ private Functor cloneFunctor(Functor f, Map<Node_RuleVariable, Node> vmap, BindingEnvironment env) { Node[] args = f.getArgs(); Node[] cargs = new Node[args.length]; for (int i = 0; i < args.length; i++) { cargs[i] = cloneNode(args[i], vmap, env); } Functor fn = new Functor(f.getName(), cargs, f.getImplementor()); fn.setImplementor(f.getImplementor()); return fn; }
Functor newf = new Functor(functor.getName(), boundargs, functor.getImplementor()); return Functor.makeFunctorNode( newf ); } else {
Functor newf = new Functor(functor.getName(), boundargs, functor.getImplementor()); return Functor.makeFunctorNode( newf ); } else {
Functor newf = new Functor( functor.getName(), boundargs, functor.getImplementor() ); return Functor.makeFunctorNode( newf ); } else {
Functor newf = new Functor( functor.getName(), boundargs, functor.getImplementor() ); return Functor.makeFunctorNode( newf ); } else {