public abstract class SparqlStreamProcessor<Q> extends RDFStreamProcessor<SparqlQuery,Q>
RDFStreamProcessor.Counter, RDFStreamProcessor.QuantityStreamProcessor.IncompatibleQueryException, StreamProcessor.InvalidQueryExceptionloggerINFINITE_TTL, NEVER_EXPIRE| Modifier | Constructor and Description |
|---|---|
protected |
SparqlStreamProcessor() |
| Modifier and Type | Method and Description |
|---|---|
Subscription |
addQuery(int ttl,
org.openrdf.query.algebra.TupleExpr tupleExpr,
java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer)
Adds a new query, as a pre-parsed TupleExpr to this query engine, returning a subscription
|
protected boolean |
addTuple(org.openrdf.model.Value[] tuple,
int ttl,
long now)
Adds a tuple to an internal index, possibly generating new solutions
|
protected abstract boolean |
addTupleInternal(org.openrdf.model.Value[] tuple,
int ttl,
long now) |
org.openrdf.rio.RDFHandler |
createRDFHandler(int ttl) |
protected BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> |
createSubscription(int ttl,
SparqlQuery sparqlQuery,
java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) |
protected abstract BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> |
createSubscriptionInternal(SparqlQuery q,
List<VariableOrConstant<String,org.openrdf.model.Value>[]> patterns,
long expirationTime,
java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) |
static long |
getReducedModifierCapacity() |
protected void |
handleCandidateSolution(BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> subscription,
org.openrdf.query.BindingSet bs,
long expirationTime) |
protected SparqlQuery |
parseQuery(String queryStr) |
protected abstract void |
register(BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> subscription) |
void |
setLinkedDataCache(net.fortytwo.linkeddata.LinkedDataCache cache)
Adds a Linked Data fetching and caching layer to this query engine.
|
static void |
setReducedModifierCapacity(long capacity)
Sets the REDUCED capacity.
|
protected abstract void |
visitQueryPatterns(Q query,
java.util.function.Consumer<VariableOrConstant<String,org.openrdf.model.Value>[]> visitor) |
addInputs, addQuery, addQueryNative, beginOperation, clearCounters, get, getNow, handleSolution, increment, incrementQueries, incrementSolutions, incrementStatements, isActive, logEntry, logHeader, setClock, setDoPerformanceMetrics, setDoUseCompactLogFormat, shutDown, toExpirationTimerenew, unregisterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearpublic static long getReducedModifierCapacity()
public static void setReducedModifierCapacity(long capacity)
capacity - the number of distinct solutions which each query subscription can store
before it begins recycling themprotected abstract void visitQueryPatterns(Q query, java.util.function.Consumer<VariableOrConstant<String,org.openrdf.model.Value>[]> visitor)
protected abstract boolean addTupleInternal(org.openrdf.model.Value[] tuple,
int ttl,
long now)
protected abstract void register(BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> subscription)
protected abstract BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> createSubscriptionInternal(SparqlQuery q, List<VariableOrConstant<String,org.openrdf.model.Value>[]> patterns, long expirationTime, java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer)
protected boolean addTuple(org.openrdf.model.Value[] tuple,
int ttl,
long now)
RDFStreamProcessoraddTuple in class RDFStreamProcessor<SparqlQuery,Q>tuple - the tuple to addttl - the time-to-live in secondsnow - the current time in millisecondspublic org.openrdf.rio.RDFHandler createRDFHandler(int ttl)
public void setLinkedDataCache(net.fortytwo.linkeddata.LinkedDataCache cache)
cache - a collection of caching metadata about Linked Data already retrievedpublic Subscription addQuery(int ttl, org.openrdf.query.algebra.TupleExpr tupleExpr, java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer) throws StreamProcessor.IncompatibleQueryException, IOException
ttl - the time-to-live in secondstupleExpr - the query to addconsumer - a handler for future query answersIncompatibleQueryException - if the syntax of the query is not supported by this engineStreamProcessor.IncompatibleQueryExceptionIOExceptionprotected BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> createSubscription(int ttl, SparqlQuery sparqlQuery, java.util.function.BiConsumer<org.openrdf.query.BindingSet,Long> consumer)
createSubscription in class RDFStreamProcessor<SparqlQuery,Q>protected SparqlQuery parseQuery(String queryStr) throws StreamProcessor.InvalidQueryException, StreamProcessor.IncompatibleQueryException
parseQuery in class RDFStreamProcessor<SparqlQuery,Q>StreamProcessor.InvalidQueryExceptionStreamProcessor.IncompatibleQueryExceptionprotected void handleCandidateSolution(BasicSubscription<SparqlQuery,Q,org.openrdf.query.BindingSet> subscription, org.openrdf.query.BindingSet bs, long expirationTime) throws IOException
IOExceptionCopyright © 2016. All Rights Reserved.