@Override public Reasoner create( Resource configuration ) { return rf.create( configuration ).bindSchema( schema ); }
/** * Create a continuation object which is a cascade of two * continuation objects. * @param first the first Graph/Finder to try * @param second the second Graph/Finder to try */ public static Finder cascade(Finder first, Finder second) { if (first == null || (first instanceof FGraph && ((FGraph)first).getGraph() == null)) return second; if (second == null || (second instanceof FGraph && ((FGraph)second).getGraph() == null)) return first; return new Cascade(first, second); }
/** * Create a continuation object which is a cascade of three * continuation objects. * @param first the first Graph/Finder to try * @param second the second Graph/Finder to try * @param third the third Graph/Finder to try */ public static Finder cascade(Finder first, Finder second, Finder third) { return new Cascade(first, cascade(second, third)); }
/** * Search the combination of data and deductions graphs for the given triple pattern. * This may different from the normal find operation in the base of hybrid reasoners * where we are side-stepping the backward deduction step. */ @Override public ExtendedIterator<Triple> findDataMatches(Node subject, Node predicate, Node object) { return dataFind.find(new TriplePattern(subject, predicate, object)); }
/** * Returns an iterator over Triples. * This implementation assumes that the underlying findWithContinuation * will have also consulted the raw data. */ @Override public ExtendedIterator<Triple> graphBaseFind(Node subject, Node property, Node object) { return findWithContinuation(new TriplePattern(subject, property, object), fdata); }
/** * Return the schema graph, if any, bound into this inference graph. */ @Override public Graph getSchemaGraph() { if (tbox == null) return null; if (tbox instanceof FGraph) { return ((FGraph)tbox).getGraph(); } else { throw new ReasonerException("Transitive reasoner got into an illegal state"); } }
/** * Test the consistency of the bound data. This normally tests * the validity of the bound instance data against the bound * schema data. * @return a ValidityReport structure */ @Override public ValidityReport validate() { checkOpen(); return new StandardValidityReport(); }
/** * Return the Jena Graph Capabilties that the inference graphs generated * by this reasoner are expected to conform to. */ @Override public Capabilities getGraphCapabilities() { if (capabilities == null) { capabilities = new BaseInfGraph.InfFindSafeCapabilities(); } return capabilities; }
/** Answer the InfCapabilities of this InfGraph. */ @Override public Capabilities getCapabilities() { if (capabilities == null) { return getReasoner().getGraphCapabilities(); } else { return capabilities; } }
/** * Basic pattern lookup interface. * This implementation assumes that the underlying findWithContinuation * will have also consulted the raw data. * @param pattern a TriplePattern to be matched against the data * @return a ExtendedIterator over all Triples in the data set * that match the pattern */ public ExtendedIterator<Triple> find(TriplePattern pattern) { checkOpen(); return findWithContinuation(pattern, fdata); }
/** * Return the Jena Graph Capabilties that the inference graphs generated * by this reasoner are expected to conform to. */ @Override public Capabilities getGraphCapabilities() { if (capabilities == null) { capabilities = new BaseInfGraph.InfCapabilities(); } return capabilities; }
/** * Constructor * @param data the raw data file to be augmented with entailments * @param reasoner the engine, with associated tbox data, whose find interface * can be used to extract all entailments from the data. */ public BaseInfGraph(Graph data, Reasoner reasoner) { super( ); this.fdata = new FGraph( data ); this.reasoner = reasoner; }
/** * Constructor - builds a pattern from three nodes, * use Node_RuleVariables as variables, use a variable * with an empty name as a wildcard, can also use null * as a wildcard. */ public TriplePattern(Node subject, Node predicate, Node object) { this.subject = normalize(subject); this.predicate = normalize(predicate); this.object = normalize(object); }
/** * Printable string */ @Override public String toString() { return simplePrintString(subject) + " @" + simplePrintString(predicate) + " " + simplePrintString(object); }
/** Answer the URI of the underlying ReasonerFactory. */ @Override public String getURI() { return factory.getURI(); } }
/** * Return the Jena Graph Capabilties that the inference graphs generated * by this reasoner are expected to conform to. */ @Override public Capabilities getGraphCapabilities() { if (capabilities == null) { capabilities = new BaseInfGraph.InfFindSafeCapabilities(); } return capabilities; }
/** * Create a continuation object which is a cascade of four * continuation objects. * @param first the first Graph/Finder to try * @param second the second Graph/Finder to try * @param third the third Graph/Finder to try * @param fourth the third Graph/Finder to try */ public static Finder cascade(Finder first, Finder second, Finder third, Finder fourth) { return new Cascade(first, cascade(second, cascade(third, fourth))); }
/** * Return the Jena Graph Capabilties that the inference graphs generated * by this reasoner are expected to conform to. */ @Override public Capabilities getGraphCapabilities() { if (capabilities == null) { capabilities = new BaseInfGraph.InfCapabilities(); } return capabilities; }
/** * Return the Jena Graph Capabilties that the inference graphs generated * by this reasoner are expected to conform to. */ @Override public Capabilities getGraphCapabilities() { if (capabilities == null) { capabilities = new BaseInfGraph.InfFindSafeCapabilities(); } return capabilities; }
protected PelletReasoner( Graph schema, Model reasonerCapabilities ) { this.schema = schema; this.reasonerCapabilities = reasonerCapabilities; graphCapabilities = new InfFindSafeCapabilities(); }