public abstract class RuleEngine extends Object
Implementation note: concrete rule engine implementations should extend this abstract class and
implement one or both methods #doEval(QuadModel)
and #doEval(RDFHandler)
.
Modifier | Constructor and Description |
---|---|
protected |
RuleEngine(Ruleset ruleset)
Creates a new
RuleEngine using the Ruleset specified. |
Modifier and Type | Method and Description |
---|---|
static RuleEngine |
create(Ruleset ruleset)
Factory method for creating a new
RuleEngine using the Ruleset specified. |
protected void |
doEval(Collection<org.openrdf.model.Statement> model)
Internal method called by
#eval(QuadModel) . |
protected org.openrdf.rio.RDFHandler |
doEval(org.openrdf.rio.RDFHandler handler,
boolean deduplicate)
Internal method called by
#eval(RDFHandler) . |
void |
eval(Collection<org.openrdf.model.Statement> model)
Evaluates rules on the
QuadModel specified. |
org.openrdf.rio.RDFHandler |
eval(org.openrdf.rio.RDFHandler handler,
boolean deduplicate)
Evaluates rules in streaming mode, emitting resulting statements to the
RDFHandler
supplied. |
Ruleset |
getRuleset()
Returns the ruleset applied by this engine
|
protected RuleEngine(Ruleset ruleset)
RuleEngine
using the Ruleset
specified. The ruleset must not
contain unsafe rules.ruleset
- the ruleset, not null and without unsafe rulespublic static RuleEngine create(Ruleset ruleset)
RuleEngine
using the Ruleset
specified.
The ruleset must not contain unsafe rules. The engine implementation instantiated is based
on the value of configuration property rdfpro.rules.implementation
, which contains
the qualified name of a concrete class extending abstract class RuleEngine
.ruleset
- the ruleset, not null and without unsafe rulespublic final Ruleset getRuleset()
public final void eval(Collection<org.openrdf.model.Statement> model)
QuadModel
specified.model
- the model the engine will operate onpublic final org.openrdf.rio.RDFHandler eval(org.openrdf.rio.RDFHandler handler, boolean deduplicate)
RDFHandler
supplied.handler
- the handler where to emit resulting statementsdeduplicate
- true if the output should not contain duplicate statementsRDFHandler
where input statements can be streamed intoprotected void doEval(Collection<org.openrdf.model.Statement> model)
#eval(QuadModel)
. Its base implementation delegates to
#doEval(RDFHandler)
.model
- the model to operate onprotected org.openrdf.rio.RDFHandler doEval(org.openrdf.rio.RDFHandler handler, boolean deduplicate)
#eval(RDFHandler)
. Its base implementation delegates to
#doEval(QuadModel)
.handler
- the handler where to emit resulting statementsdeduplicate
- true if output should not contain duplicate statementsCopyright © 2015–2016 FBK-irst. All rights reserved.