de.fuberlin.wiwiss.wiqa.explanation
Class ExplanationStore

java.lang.Object
  extended byde.fuberlin.wiwiss.wiqa.explanation.ExplanationStore

public class ExplanationStore
extends Object

A temporary storage for explanation fragments. This is used to associate the explanations returned from ExplainableFunctions with the bindings that they explain.

ARQ Bindings cannot store explanation parts. They can only store RDF nodes. Therefore, we store the parts in this class, and store numeric tokens in the bindings, in ÒmagicÓ variables ?__explanation_function1 and so on.

The QueryIterExplain retrieves the parts after query execution and integrates them into the overall explanation.

A new ExplanationStore must be used for each query execution to avoid memory leaks.

Version:
$Id: ExplanationStore.java,v 1.1 2006/01/31 19:19:04 cyganiak Exp $
Author:
Oliver Maresch (oliver-maresch@gmx.de), Richard Cyganiak (richard@cyganiak.de)

Constructor Summary
ExplanationStore()
           
 
Method Summary
 ExplanationPart get(Binding binding, String functionName)
          Retrieves an explanation part from the store.
 void store(BindingMap binding, ExplanationPart part, String functionName)
          Puts an explanation into the store and adds a magic variable to the binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExplanationStore

public ExplanationStore()
Method Detail

store

public void store(BindingMap binding,
                  ExplanationPart part,
                  String functionName)
Puts an explanation into the store and adds a magic variable to the binding.

Parameters:
binding - A binding
part - An explanation part
functionName - The name of the explaining function

get

public ExplanationPart get(Binding binding,
                           String functionName)
Retrieves an explanation part from the store.

Parameters:
binding - A binding
functionName - The name of the explaining function
Returns:
The part stored for this function & binding