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.Node; 32 import com.hp.hpl.jena.graph.Node_Concrete; 33 import com.hp.hpl.jena.rdf.model.Model; 34 import com.hp.hpl.jena.reasoner.TriplePattern; 35 import com.hp.hpl.jena.util.iterator.*; 36 import com.hp.hpl.jena.util.iterator.ExtendedIterator; 37 import com.hp.hpl.jena.vocabulary.RDF; 38 39 40 52 public class DIGQueryIsConceptTranslator 53 extends DIGQueryTranslator 54 { 55 56 59 62 65 68 71 public DIGQueryIsConceptTranslator() { 72 super( null, RDF.type.getURI(), null ); 73 } 74 75 76 79 80 86 public ExtendedIterator find( TriplePattern pattern, DIGAdapter da ) { 87 List result = new ArrayList(); 88 if (da.isConcept( pattern.getSubject(), null )) { 89 result.add( pattern.asTriple() ); 90 } 91 92 return WrappedIterator.create( result.iterator() ); 93 } 94 95 96 public ExtendedIterator find( TriplePattern pattern, DIGAdapter da, Model premises ) { 97 return find( pattern, da ); 98 } 99 100 101 public Document translatePattern( TriplePattern pattern, DIGAdapter da ) { 102 return null; 104 } 105 106 107 public Document translatePattern( TriplePattern pattern, DIGAdapter da, Model premises ) { 108 return null; 110 } 111 112 public ExtendedIterator translateResponseHook( Document response, TriplePattern query, DIGAdapter da ) { 113 return null; 115 } 116 117 public boolean checkObject( Node object, DIGAdapter da, Model premises ) { 118 return da.getOntLanguage().CLASS().getNode().equals( object ); 119 } 120 121 122 public boolean checkSubject( Node subject, DIGAdapter da, Model premises ) { 123 return subject instanceof Node_Concrete; 124 } 125 126 127 130 134 } 135 136 137 163 | Popular Tags |