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 import java.util.*; 15 16 25 public class ListMapAsSubject extends BaseBuiltin { 26 27 31 public String getName() { 32 return "listMapAsSubject"; 33 } 34 35 38 public int getArgLength() { 39 return 3; 40 } 41 42 51 public void headAction(Node[] args, int length, RuleContext context) { 52 checkArgs(length, context); 53 Node n0 = getArg(0, args, context); 54 Node n1 = getArg(1, args, context); 55 Node n2 = getArg(2, args, context); 56 List l = Util.convertList(n0, context); 57 for (Iterator i = l.iterator(); i.hasNext(); ) { 58 Node x = (Node)i.next(); 59 context.add( new Triple(x, n1, n2)); 60 } 61 } 62 63 } 64 65 66 67 | Popular Tags |