1 19 20 package com.hp.hpl.jena.reasoner.dig; 23 24 25 26 import java.util.Iterator ; 29 30 import org.w3c.dom.Document ; 31 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 36 37 45 public abstract class DIGIteratedQueryTranslator 46 extends DIGQueryTranslator 47 { 48 49 52 55 58 61 67 public DIGIteratedQueryTranslator( String subject, String predicate, String object ) { 68 super( subject, predicate, object ); 69 } 70 71 72 73 76 84 protected abstract Iterator expandQuery( TriplePattern pattern, DIGAdapter da ); 85 86 87 97 public ExtendedIterator find( TriplePattern pattern, DIGAdapter da ) { 98 ExtendedIterator all = null; 99 100 for (Iterator i = expandQuery( pattern, da ); i.hasNext(); ) { 101 ExtendedIterator results = da.find( (TriplePattern) i.next() ); 102 all = (all == null) ? results : all.andThen( results ); 103 } 104 105 return UniqueExtendedIterator.create( all ); 106 } 107 108 109 112 public Document translatePattern( TriplePattern query, DIGAdapter da ) { 113 return null; 114 } 115 116 public Document translatePattern( TriplePattern pattern, DIGAdapter da, Model premises ) { 117 return null; 119 } 120 121 124 public ExtendedIterator translateResponseHook(Document Response, TriplePattern query, DIGAdapter da) { 125 return null; 126 } 127 128 129 132 136 } 137 138 139 165 | Popular Tags |