|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.fuberlin.wiwiss.wiqa.Policy
A WIQA policy defines rules for accepting or rejecting RDF statements.
Policies are usually authored in a SPARQL-like syntax and parsed
using the PolicyParser. A policy consists of:
ExtensionsTODO: There are also count constraints.
A policy forms an implicit SPARQL query. A statement is accepteded if it matches the query. The policy also provides explanations templates which can generate an explanation stating why a particular statement was accepteded (but not why a statement was rejected).
Policy instances are created mainly through the
PolicyParser.
| Field Summary | |
static Policy |
ACCEPT_EVERYTHING
A pre-defined policy that accepts all statements. |
| Constructor Summary | |
Policy()
Creates a new policy without name and description. |
|
Policy(String name,
String description)
Creates a new policy. |
|
| Method Summary | |
void |
addCountConstraint(CountConstraint countConstraint)
Adds a count constraint to the policy. |
void |
addExtension(ElementExtension extension)
Adds an Extension call. |
void |
addGraphPatternElement(ElementNamedGraph element,
ExplanationTemplate explanationTemplate)
Adds a graph pattern and its explanation template to the policy. |
void |
addRootFilter(Constraint constraint)
Adds a filter Constraint to the root level. |
List |
countConstraints()
|
String |
description()
|
ExplanationTemplate |
explanationTemplate(ElementNamedGraph element)
|
List |
extensions()
In a WIQA policy, Extensions may be provided inside
any graph pattern or on the query pattern level, but in
either case, they are executed after all graph
patterns and filter constraints have been processed.
|
Template |
graphExplanationTemplate()
|
List |
graphPatternElements()
Returns ARQ parse tree elements for each of the policy's graph patterns. |
String |
name()
|
PrefixMapping |
prefixes()
|
ExplanationTemplate |
rootExplanationTemplate()
|
List |
rootFilters()
|
GraphPatternTreeNode |
rootGraphPattern()
The graph patterns of a policy are arranged into a tree shape based on common variables. |
void |
setDescription(String description)
Changes the policy's description. |
void |
setGraphExplanationTemplate(Template template)
|
void |
setName(String name)
Changes the policy's name. |
void |
setRootExplanationTemplate(ExplanationTemplate tpl)
Sets the root-level explanation template. |
Query |
toARQ()
A policy forms an implicit ARQ query. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final Policy ACCEPT_EVERYTHING
| Constructor Detail |
public Policy()
public Policy(String name,
String description)
name - The name of the policydescription - The description of the policy| Method Detail |
public String name()
public void setName(String name)
public String description()
public void setDescription(String description)
public List graphPatternElements()
ElementNamedGraphspublic ExplanationTemplate explanationTemplate(ElementNamedGraph element)
element - An ARQ parse tree element representing one
of the policy's graph patterns
public void addGraphPatternElement(ElementNamedGraph element,
ExplanationTemplate explanationTemplate)
element - The ARQ parse tree elementexplanationTemplate - The explanation templatepublic ExplanationTemplate rootExplanationTemplate()
public void setRootExplanationTemplate(ExplanationTemplate tpl)
tpl - public List rootFilters()
Constraints provided for the
root of the query pattern, outside of the graph patternspublic void addRootFilter(Constraint constraint)
Constraint to the root level. Filter
constraints can be located inside one of the graph patterns
(then they become part of the pattern's ARQ parse tree),
or outside of any graph pattern (then they are added to
the query with this method).
constraint - public List extensions()
Extensions may be provided inside
any graph pattern or on the query pattern level, but in
either case, they are executed after all graph
patterns and filter constraints have been processed.
Their location in the policy is only used to determine
their relative order.
ElementExtensionspublic void addExtension(ElementExtension extension)
Extension call. The call is represented
here by an ARQ parse tree, but WIQA actually uses a different
custom syntax for extensions, and the parser has to construct
the ARQ style parse tree before delivering it to this method.
extension - The ARQ parse tree representing the
extension callpublic void addCountConstraint(CountConstraint countConstraint)
countConstraint - The count constraintpublic List countConstraints()
CountConstraints in the order they
were defined in the policypublic PrefixMapping prefixes()
public GraphPatternTreeNode rootGraphPattern()
TreeBuilder.
TreeBuilderpublic void setGraphExplanationTemplate(Template template)
template - The graph explanation template for the policypublic Template graphExplanationTemplate()
public Query toARQ()
Extensions. An ARQ query
is a SPARQL query that can use some additional language
features.)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||