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.vocabulary.OWL; 14 import com.hp.hpl.jena.graph.*; 15 import java.util.*; 16 17 23 public class AssertDisjointPairs extends BaseBuiltin { 24 25 29 public String getName() { 30 return "assertDisjointPairs"; 31 } 32 33 36 public int getArgLength() { 37 return 1; 38 } 39 40 49 public void headAction(Node[] args, int length, RuleContext context) { 50 checkArgs(length, context); 51 List l = Util.convertList(args[0], context); 52 for (Iterator i = l.iterator(); i.hasNext(); ) { 53 Node x = (Node)i.next(); 54 for (Iterator j = l.iterator(); j.hasNext(); ) { 55 Node y = (Node)j.next(); 56 if (!x.sameValueAs(y)) { 57 context.add( new Triple(x, OWL.differentFrom.asNode(), y) ); 58 } 59 } 60 } 61 } 62 63 } 64 65 | Popular Tags |