1 10 package com.hp.hpl.jena.rdf.model.impl; 11 12 import com.hp.hpl.jena.graph.Graph; 13 import com.hp.hpl.jena.rdf.model.*; 14 import com.hp.hpl.jena.reasoner.*; 15 import java.util.Iterator ; 16 17 24 public class InfModelImpl extends ModelCom implements InfModel { 25 26 30 public InfModelImpl(InfGraph infgraph) { 31 super(infgraph); 32 } 33 34 37 public InfGraph getInfGraph() { 38 return (InfGraph)getGraph(); 39 } 40 41 45 public Model getRawModel() { 46 return new ModelCom(getInfGraph().getRawGraph()); 47 } 48 49 52 public Reasoner getReasoner() { 53 return getInfGraph().getReasoner(); 54 } 55 56 63 public void rebind() { 64 getInfGraph().rebind(); 65 } 66 67 75 public void prepare() { 76 getInfGraph().prepare(); 77 } 78 79 85 public void reset() { 86 getInfGraph().reset(); 87 } 88 89 95 public ValidityReport validate() { 96 return getInfGraph().validate(); 97 } 98 99 116 public StmtIterator listStatements( Resource subject, Property predicate, RDFNode object, Model posit ) { 117 Iterator iter = getInfGraph().find(subject.asNode(), predicate.asNode(), object.asNode(), posit.getGraph()); 118 return IteratorFactory.asStmtIterator(iter,this); 119 } 120 121 126 public void setDerivationLogging(boolean logOn) { 127 getInfGraph().setDerivationLogging(logOn); 128 } 129 130 137 public Iterator getDerivation(Statement statement) { 138 return getInfGraph().getDerivation(statement.asTriple()); 139 } 140 141 151 public Model getDeductionsModel() { 152 if (deductionsModel == null) { 153 Graph deductionsGraph = getInfGraph().getDeductionsGraph(); 154 if (deductionsGraph != null) { 155 deductionsModel = new ModelCom(deductionsGraph); 156 } 157 } 158 return deductionsModel; 159 } 160 161 162 private Model deductionsModel = null; 163 } 164 165 166 | Popular Tags |