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 53 public class DIGQueryIsIndividualTranslator 54 extends DIGQueryTranslator 55 { 56 57 60 63 66 69 72 public DIGQueryIsIndividualTranslator() { 73 super( null, RDF.type.getURI(), null ); 74 } 75 76 77 80 81 87 public ExtendedIterator find( TriplePattern pattern, DIGAdapter da ) { 88 List result = new ArrayList(); 89 if (da.isIndividual( pattern.getSubject() )) { 90 result.add( pattern.asTriple() ); 91 } 92 93 return WrappedIterator.create( result.iterator() ); 94 } 95 96 97 98 public ExtendedIterator find( TriplePattern pattern, DIGAdapter da, Model premises ) { 99 return find( pattern, da ); 100 } 101 102 103 public Document translatePattern( TriplePattern pattern, DIGAdapter da ) { 104 return null; 106 } 107 108 109 public Document translatePattern( TriplePattern pattern, DIGAdapter da, Model premises ) { 110 return null; 112 } 113 114 public ExtendedIterator translateResponseHook( Document response, TriplePattern query, DIGAdapter da ) { 115 return null; 117 } 118 119 128 public boolean checkObject( Node object, DIGAdapter da, Model premises ) { 129 return da.getOntLanguage().THING().getNode().equals( object ) || 130 da.isConcept( object, premises ); 131 } 132 133 134 public boolean checkSubject( Node subject, DIGAdapter da, Model premises ) { 135 return subject instanceof Node_Concrete; 136 } 137 138 139 140 143 147 } 148 149 150 176 | Popular Tags |