/** * Return the schema graph, if any, bound into this inference graph. */ @Override public Graph getSchemaGraph() { return fschema.getGraph(); }
/** * Return the raw RDF data Graph being processed (i.e. the argument * to the Reasonder.bind call that created this InfGraph). */ @Override public Graph getRawGraph() { return fdata.getGraph(); }
/** * 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); }
/** * Assert a new triple in the deduction graph, bypassing any processing machinery. */ @Override public void silentAdd(Triple t) { fdeductions.getGraph().add(t); }
/** Answer true iff this graph is empty. [Used to be in QueryHandler, but moved in here because it's a more primitive operation.] */ @Override public boolean isEmpty() { return fdata.getGraph().isEmpty(); }
/** * 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"); } }
/** * Assert a new triple in the deduction graph, bypassing any processing machinery. */ @Override public void silentAdd(Triple t) { fdeductions.getGraph().add(t); }
/** * Return the number of triples in the inferred graph */ @Override public int graphBaseSize() { checkOpen(); this.requirePrepared(); int baseSize = fdata.getGraph().size(); int dedSize = fdeductions.getGraph().size(); // System.err.println( ">> BasicForwardRuleInfGraph::size = " + baseSize + "(base) + " + dedSize + "(deductions)" ); return baseSize + dedSize; }
/** * Free all resources, any further use of this Graph is an error. */ @Override public void close() { if (!closed) { fdata.getGraph().close(); fdata = null; super.close(); } }
/** * Removes the triple t (if possible) from the set belonging to this graph. */ @Override public void performDelete(Triple t) { version++; this.requirePrepared(); fdata.getGraph().delete(t); }
/** * Return the number of triples in the just the base graph */ @Override public int graphBaseSize() { checkOpen(); return fdata.getGraph().size(); }
/** * Add one triple to the data graph, run any rules triggered by * the new data item, recursively adding any generated triples. */ @Override public synchronized void performAdd(Triple t) { version++; this.requirePrepared(); fdata.getGraph().add(t); }
/** * <p> * Delete one triple from the data graph, mark the graph not-prepared, but * don't run prepare() just yet. * </p> * * @param t * A triple to remove from the graph */ @Override public void performDelete(Triple t) { fdata.getGraph().delete( t ); setPreparedState(false); }
/** * Removes the triple t (if possible) from the set belonging to this graph. */ @Override public synchronized void performDelete(Triple t) { fdata.getGraph().delete(t); if (this.isPrepared()) { transitiveEngine.delete(t); } } /**
/** * Add one triple to the data graph, run any rules triggered by * the new data item, recursively adding any generated triples. */ @Override public synchronized void performAdd(Triple t) { this.requirePrepared(); fdata.getGraph().add(t); engine.add(t); }
/** * Add one triple to the data graph, run any rules triggered by * the new data item, recursively adding any generated triples. */ @Override public synchronized void performAdd(Triple t) { version++; fdata.getGraph().add(t); if (this.isPrepared()) { engine.add(t); } }
/** * Add one triple to the data graph, run any rules triggered by * the new data item, recursively adding any generated triples. */ @Override public synchronized void performAdd(Triple t) { version++; engine.checkSafeToUpdate(); fdata.getGraph().add(t); this.setPreparedState(false); }
/** * Removes the triple t (if possible) from the set belonging to this graph. */ @Override public synchronized void performDelete(Triple t) { version++; engine.checkSafeToUpdate(); fdata.getGraph().delete(t); this.setPreparedState(false); }
/** * Add one triple to the data graph, run any rules triggered by * the new data item, recursively adding any generated triples. */ @Override public synchronized void performAdd(Triple t) { this.requirePrepared(); fdata.getGraph().add(t); transitiveEngine.add(t); }