1 19 20 package com.hp.hpl.jena.reasoner.dig; 23 24 25 import java.util.*; 28 29 import org.w3c.dom.Document ; 30 31 import com.hp.hpl.jena.graph.*; 32 import com.hp.hpl.jena.rdf.model.Model; 33 import com.hp.hpl.jena.reasoner.TriplePattern; 34 import com.hp.hpl.jena.util.iterator.*; 35 import com.hp.hpl.jena.vocabulary.RDF; 36 37 38 50 public class DIGQueryIsRoleTranslator 51 extends DIGQueryTranslator 52 { 53 54 57 60 63 66 69 public DIGQueryIsRoleTranslator() { 70 super( null, RDF.type.getURI(), null ); 71 } 72 73 74 77 78 84 public ExtendedIterator find( TriplePattern pattern, DIGAdapter da ) { 85 List result = new ArrayList(); 86 if (da.isRole( pattern.getSubject(), null )) { 87 result.add( pattern.asTriple() ); 88 } 89 90 return WrappedIterator.create( result.iterator() ); 91 } 92 93 94 95 public ExtendedIterator find( TriplePattern pattern, DIGAdapter da, Model premises ) { 96 return find( pattern, da ); 97 } 98 99 100 public Document translatePattern( TriplePattern pattern, DIGAdapter da ) { 101 return null; 103 } 104 105 106 public Document translatePattern( TriplePattern pattern, DIGAdapter da, Model premises ) { 107 return null; 109 } 110 111 public ExtendedIterator translateResponseHook( Document response, TriplePattern query, DIGAdapter da ) { 112 return null; 114 } 115 116 125 public boolean checkObject( Node object, DIGAdapter da, Model premises ) { 126 return da.getOntLanguage().OBJECT_PROPERTY().getNode().equals( object ); 127 } 128 129 130 public boolean checkSubject( Node subject, DIGAdapter da, Model premises ) { 131 return subject instanceof Node_Concrete; 132 } 133 134 135 138 142 } 143 144 145 171 | Popular Tags |