de.fuberlin.wiwiss.wiqa
Class Explanation

java.lang.Object
  extended byde.fuberlin.wiwiss.wiqa.Explanation
All Implemented Interfaces:
ExplanationNode

public class Explanation
extends Object
implements ExplanationNode

A textual explanation why a given triple matched a given policy.

Explanations are structured as a tree of text fragments. This class represents the root of the tree and has no associated text fragment; the other nodes are ExplanationParts and all have associated text fragments. Explanations are generated either programmatically by ExplainableFunctions and ExplainableExtensions, or through the instantiation of ExplanationTemplates.

The main capability of an explanation is to write itself into an RDF graph using the EXPL vocabulary.

Version:
$Id: Explanation.java,v 1.3 2006/07/19 06:29:26 tgauss Exp $
Author:
Richard Cyganiak (richard@cyganiak.de), Oliver Maresch

Constructor Summary
Explanation(Triple triple, Policy policy)
          Creates a new, empty explanation.
 
Method Summary
 void addPart(ExplanationPart part)
          Adds a new child to the root node of this explanation tree.
 boolean equals(Object other)
          Checks two explanations for equality.
 Triple getExplainedTriple()
           
 String getPolicyDescription()
           
 String getPolicyName()
           
 int hashCode()
           
 Collection parts()
           
 Graph toRDF()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Explanation

public Explanation(Triple triple,
                   Policy policy)
Creates a new, empty explanation.

Parameters:
triple - An RDF triple
policy - The policy that has accepted the triple
Method Detail

addPart

public void addPart(ExplanationPart part)
Adds a new child to the root node of this explanation tree.

Specified by:
addPart in interface ExplanationNode
Parameters:
part - The new child

parts

public Collection parts()
Returns:
all children of the root of this explanation tree

equals

public boolean equals(Object other)
Checks two explanations for equality. Two explanations are equal if the trees have the same structure and the same text at every node, and if they explain the same triple for the same policy.

Parameters:
other - Another object
Returns:
true if other is an explanation and equal to this

hashCode

public int hashCode()

toRDF

public Graph toRDF()
Returns:
A Jena graph representation of the explanation using the EXPL vocabulary

getExplainedTriple

public Triple getExplainedTriple()
Returns:
The RDF triple of this explanation

getPolicyName

public String getPolicyName()
Returns:
The name of the policy of this explanation

getPolicyDescription

public String getPolicyDescription()
Returns:
The description of the policy of this explanation