public class QueryEngineImpl extends Object implements QueryEngine
SesameStream settings), performance data is generated in the process.
Current assumptions:
1) only simple, conjunctive SELECT queries, without filters, unions, optionals, etc.
2) no GRAPH constraints
3) no duplicate queries
4) no duplicate statements
5) no duplicate triple patterns in a query
6) single query at a time
7) no combo of queries and statements such that multiple triple patterns match the same statement
8 queries are only added, never removed
9) statements are only added, never removed
10) a statement will never match more than one triple pattern, per query, at a time| Modifier and Type | Class and Description |
|---|---|
class |
QueryEngineImpl.TriplePatternDeduplicator
An object to ensure that triple patterns created by replacement are not duplicates
|
QueryEngine.IncompatibleQueryException, QueryEngine.InvalidQueryException| Constructor and Description |
|---|
QueryEngineImpl()
Creates a new query engine with an empty index
|
| Modifier and Type | Method and Description |
|---|---|
Subscription |
addQuery(String q,
BindingSetHandler h) |
Subscription |
addQuery(org.openrdf.query.algebra.TupleExpr t,
BindingSetHandler h)
Adds a new query subscription to this query engine
|
void |
addStatement(org.openrdf.model.Statement s) |
void |
addStatements(Collection<org.openrdf.model.Statement> statements) |
void |
addStatements(org.openrdf.model.Statement... statements) |
void |
clear() |
TripleIndex |
getIndex()
Gets the index, or in-memory database, of this query engine
|
void |
setLinkedDataCache(net.fortytwo.linkeddata.LinkedDataCache cache,
org.openrdf.sail.Sail sail)
Adds a Linked Data fetching and caching layer to this query engine.
|
public QueryEngineImpl()
public void setLinkedDataCache(net.fortytwo.linkeddata.LinkedDataCache cache,
org.openrdf.sail.Sail sail)
throws org.openrdf.sail.SailException
cache - a collection of caching metadata about Linked Data already retrievedsail - the RDF component of the caching metadataorg.openrdf.sail.SailException - if a cache-level query exception occurspublic TripleIndex getIndex()
public void clear()
clear in interface QueryEnginepublic Subscription addQuery(String q, BindingSetHandler h) throws QueryEngine.IncompatibleQueryException, QueryEngine.InvalidQueryException
addQuery in interface QueryEngineQueryEngine.IncompatibleQueryExceptionQueryEngine.InvalidQueryExceptionpublic Subscription addQuery(org.openrdf.query.algebra.TupleExpr t, BindingSetHandler h) throws QueryEngine.IncompatibleQueryException
t - the query to addh - a handler for future query answersIncompatibleQueryException - if the syntax of the query is not supported by this engineQueryEngine.IncompatibleQueryExceptionpublic void addStatement(org.openrdf.model.Statement s)
addStatement in interface QueryEnginepublic void addStatements(org.openrdf.model.Statement... statements)
addStatements in interface QueryEnginepublic void addStatements(Collection<org.openrdf.model.Statement> statements)
addStatements in interface QueryEngineCopyright © 2014. All Rights Reserved.