public final class Ruleset extends Object
Modifier and Type | Field and Description |
---|---|
static Ruleset |
OWL2RL |
static Ruleset |
RDFS |
static Ruleset |
RHODF |
Constructor and Description |
---|
Ruleset(Iterable<Rule> rules,
Iterable<org.openrdf.model.URI> metaVocabularyTerms)
Creates a new ruleset with the rules and meta-vocabulary terms supplied.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Two rulesets are equal if they have the same rules and meta-vocabulary terms.
|
static Ruleset |
fromRDF(Iterable<org.openrdf.model.Statement> model)
Parses a ruleset from the supplied RDF statements.
|
static Ruleset |
fromRDF(String location)
Parses a ruleset from the RDF located at the specified location.
|
Ruleset |
getABoxRuleset(QuadModel tboxData)
Returns the ruleset with the ABox rules obtained from the rules of this ruleset and the
TBox data specified.
|
Set<org.openrdf.model.URI> |
getMetaVocabularyTerms()
Returns the meta-vocabulary terms associated to this ruleset.
|
Rule |
getRule(org.openrdf.model.URI ruleID)
Returns the rule with the ID specified, or null if there is no rule for that ID.
|
Set<Rule> |
getRules()
Returns the rules in this ruleset.
|
int |
hashCode()
The returned hash code depends on all the rules and meta-vocabulary terms in
this ruleset.
|
boolean |
isDeletePossible()
Returns true if the evaluation of the ruleset may cause some statements to be deleted.
|
boolean |
isInsertPossible()
Returs true if the evaluation of the ruleset may cause some statements to be inserted.
|
boolean |
isMatchable(org.openrdf.model.Statement stmt)
Returns true if the supplied statement can be matched by a pattern in a WHERE or DELETE
expression of some rule in this ruleset.
|
static Ruleset |
merge(Ruleset... rulesets)
Merges multiple rulesets in a single ruleset.
|
Ruleset |
mergeSameWhereExpr()
Returns the ruleset obtained by merging the rules in this ruleset with the same WHERE
expression, priority and fixpoint flag.
|
Ruleset |
rewriteGlobalGM(org.openrdf.model.URI globalGraph)
Returns the ruleset obtained by rewriting the rules of this ruleset according to the GLOBAL
graph inference mode, using the global graph URI specified.
|
Ruleset |
rewriteSeparateGM()
Returns the ruleset obtained by rewriting the rules of this ruleset according to the
SEPARATE graph inference mode.
|
Ruleset |
rewriteStarGM(org.openrdf.model.URI globalGraph)
Returns the ruleset obtained by rewriting the rules of this ruleset according to the STAR
graph inference mode, using the global graph URI supplied.
|
Ruleset |
rewriteVariables(org.openrdf.query.BindingSet bindings)
Returns the ruleset obtained by replacing selected variables in the rules of this ruleset
with the constant values dictated by the supplied bindings.
|
<T extends Collection<? super org.openrdf.model.Statement>> |
toRDF(T output)
Emits the RDF serialization of the ruleset.
|
String |
toString()
The returned string lists, on multiple lines, all the meta-vocabulary terms
and rules in this ruleset.
|
public static final Ruleset RHODF
public static final Ruleset RDFS
public static final Ruleset OWL2RL
public Set<Rule> getRules()
@Nullable public Rule getRule(org.openrdf.model.URI ruleID)
ruleID
- the rule IDpublic Set<org.openrdf.model.URI> getMetaVocabularyTerms()
public boolean isDeletePossible()
public boolean isInsertPossible()
public boolean isMatchable(org.openrdf.model.Statement stmt)
stmt
- the statement to testpublic Ruleset getABoxRuleset(QuadModel tboxData)
tboxData
- the TBox datapublic Ruleset rewriteGlobalGM(@Nullable org.openrdf.model.URI globalGraph)
globalGraph
- the URI of the global graph where to insert new quads; if null, quads will be
inserted in the default graph sesame:nil
Rule.rewriteGlobalGM(URI)
public Ruleset rewriteSeparateGM()
Rule.rewriteSeparateGM()
public Ruleset rewriteStarGM(@Nullable org.openrdf.model.URI globalGraph)
globalGraph
- the URI of the global graph whose quads are 'imported' in other graphs; if null,
the default graph sesame:nil
will be usedRule.rewriteStarGM(URI)
public Ruleset rewriteVariables(@Nullable org.openrdf.query.BindingSet bindings)
bindings
- the variable = value bindings to use for rewriting rules; if null or empty, no
rewriting will take placeRule.rewriteVariables(BindingSet)
public Ruleset mergeSameWhereExpr()
Rule.mergeSameWhereExpr(Iterable)
public boolean equals(Object object)
public int hashCode()
public String toString()
public <T extends Collection<? super org.openrdf.model.Statement>> T toRDF(T output)
output
- the collection where to add emitted RDF statements, not nullpublic static Ruleset fromRDF(Iterable<org.openrdf.model.Statement> model)
model
- the RDF statements, not nullpublic static Ruleset fromRDF(String location)
location
- the location where to load RDF data, not nullpublic static Ruleset merge(Ruleset... rulesets)
rulesets
- the rulesets to mergeCopyright © 2015–2016 FBK-irst. All rights reserved.