/** * Free all resources, any further use of this Graph is an error. */ @Override public void close() { if (!closed) { engine = null; fdeductions = null; rules = null; schemaGraph = null; super.close(); } }
@Override public synchronized boolean isPrepared() { return super.isPrepared() && (!_autoDetectChanges || !_graphListener.isChanged()); }
/** * Checks whether the graph is prepared and calls {@link #prepare()} if it is not */ protected synchronized void requirePrepared() { if (!this.isPrepared) this.prepare(); } }
/** * 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); }
@Override public void clear() { getRawGraph().clear() ; discardState(); rebind(); getEventManager().notifyEvent( this, GraphEvents.removeAll ); }
/** * 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(); }
/** * Returns an iterator over Triples. * This implementation assumes that the underlying findWithContinuation * will have also consulted the raw data. */ @Override protected ExtendedIterator<Triple> graphBaseFind(Node subject, Node property, Node object) { return findWithContinuation(new TriplePattern(subject, property, object), fdata); }
/** * A convenience version of getGlobalProperty which can only return * a boolean result. */ @Override public boolean testGlobalProperty(Node property) { Node resultNode = getGlobalProperty(property); if (resultNode.isLiteral()) { Object result = resultNode.getLiteralValue(); if (result instanceof Boolean) { return (Boolean) result; } } throw new ReasonerException("Global property test returned non-boolean value" + "\nTest was: " + property + "\nResult was: " + resultNode); }
/** * An extension of the Graph.find interface which allows the caller to * encode complex expressions in RDF and then refer to those expressions * within the query triple. For example, one might encode a class expression * and then ask if there are any instances of this class expression in the * InfGraph. * @param subject the subject Node of the query triple, may be a Node in * the graph or a node in the parameter micro-graph or null * @param property the property to be retrieved or null * @param object the object Node of the query triple, may be a Node in * the graph or a node in the parameter micro-graph. * @param param a small graph encoding an expression which the subject and/or * object nodes refer. */ @Override public ExtendedIterator<Triple> find(Node subject, Node property, Node object, Graph param) { return cloneWithPremises(param).find(subject, property, object); }
@Override public void clear() { getRawGraph().clear() ; discardState(); rebind(); getEventManager().notifyEvent( this, GraphEvents.removeAll ); }
/** * 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); }
/** * 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(); }
/** * Returns an iterator over Triples. * This implementation assumes that the underlying findWithContinuation * will have also consulted the raw data. */ @Override protected ExtendedIterator<Triple> graphBaseFind(Node subject, Node property, Node object) { return findWithContinuation(new TriplePattern(subject, property, object), fdata); }
/** * A convenience version of getGlobalProperty which can only return * a boolean result. */ @Override public boolean testGlobalProperty(Node property) { Node resultNode = getGlobalProperty(property); if (resultNode.isLiteral()) { Object result = resultNode.getLiteralValue(); if (result instanceof Boolean) { return (Boolean) result; } } throw new ReasonerException("Global property test returned non-boolean value" + "\nTest was: " + property + "\nResult was: " + resultNode); }
/** * An extension of the Graph.find interface which allows the caller to * encode complex expressions in RDF and then refer to those expressions * within the query triple. For example, one might encode a class expression * and then ask if there are any instances of this class expression in the * InfGraph. * @param subject the subject Node of the query triple, may be a Node in * the graph or a node in the parameter micro-graph or null * @param property the property to be retrieved or null * @param object the object Node of the query triple, may be a Node in * the graph or a node in the parameter micro-graph. * @param param a small graph encoding an expression which the subject and/or * object nodes refer. */ @Override public ExtendedIterator<Triple> find(Node subject, Node property, Node object, Graph param) { return cloneWithPremises(param).find(subject, property, object); }
public boolean isClassified() { return super.isPrepared() && _kb.isClassified(); }
@Override public void remove( Node s, Node p, Node o ) { getRawGraph().remove( s, p, o ); discardState(); rebind(); getEventManager().notifyEvent( this, GraphEvents.remove( s, p, o ) ); }
/** * Checks whether the graph is prepared and calls {@link #prepare()} if it is not */ protected synchronized void requirePrepared() { if (!this.isPrepared) this.prepare(); } }
/** * Free all resources, any further use of this Graph is an error. */ @Override public void close() { if (!closed) { engine = null; fdeductions = null; rules = null; schemaGraph = null; super.close(); } }
/** * Return the number of triples in the just the base graph */ @Override public int graphBaseSize() { checkOpen(); return fdata.getGraph().size(); }