de.fuberlin.wiwiss.wiqa.extensions
Class AbstractRankBasedMetric

java.lang.Object
  extended byde.fuberlin.wiwiss.wiqa.extensions.AbstractRankBasedMetric
All Implemented Interfaces:
Extension
Direct Known Subclasses:
AppleseedMetric, SemanticPageRank

public abstract class AbstractRankBasedMetric
extends Object
implements Extension

Author:
Oliver Maresch (oliver-maresch@gmx.de)

Field Summary
protected  DatasetGraph dataSource
           
protected  String uri
          URI, which identifies the Metric in the TriQL Trust-Architecture.
 
Constructor Summary
AbstractRankBasedMetric(String uri)
           
 
Method Summary
 void build(List args, String uri)
           
protected  void cache(RankingCache obj, Node sink)
          Stores a metric-specific RankingCache into the cache.
protected  Node cl(String str)
          Creates a String Literal Node
 QueryIterator exec(QueryIterator input, List args, String uri, ExecutionContext execCxt)
           
abstract  Integer execMetric(List inputTable)
           
 ExplanationPart explain()
           
 Graph explainRDF()
           
 RankingCache getCachedRanking(RankingCache notCached)
          Checks for a ranking, whether or not a ranking with the same parameters was allready calculated.
 DatasetGraph getDataSource()
           
 int getRank()
           
protected  RankingCache getRankingCache(int i)
          Looks up the RankingCache of the binding i.
protected  Node getSink(int i)
          Looks up the sink of the binding i.
 String getURI()
           
 boolean hasCachedRanking(RankingCache obj)
           
 boolean isAccepted()
           
 void setComparator(Node cmp)
           
 void setRank(int rank)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uri

protected String uri
URI, which identifies the Metric in the TriQL Trust-Architecture.


dataSource

protected DatasetGraph dataSource
Constructor Detail

AbstractRankBasedMetric

public AbstractRankBasedMetric(String uri)
Method Detail

getDataSource

public DatasetGraph getDataSource()

setComparator

public void setComparator(Node cmp)

setRank

public void setRank(int rank)

getRank

public int getRank()

getSink

protected Node getSink(int i)
Looks up the sink of the binding i.


getRankingCache

protected RankingCache getRankingCache(int i)
Looks up the RankingCache of the binding i.


cache

protected void cache(RankingCache obj,
                     Node sink)
Stores a metric-specific RankingCache into the cache. The RankingCache is accessible with the specified key, which should be the number of the resultbindg, which produces the data of the RankingCache.


getURI

public String getURI()

hasCachedRanking

public boolean hasCachedRanking(RankingCache obj)

getCachedRanking

public RankingCache getCachedRanking(RankingCache notCached)
Checks for a ranking, whether or not a ranking with the same parameters was allready calculated. If so, the cached rating will be returned, null otherwise.


cl

protected Node cl(String str)
Creates a String Literal Node

Parameters:
str -
Returns:
StringLiteral as a Node

explain

public ExplanationPart explain()

explainRDF

public Graph explainRDF()

isAccepted

public boolean isAccepted()

build

public void build(List args,
                  String uri)
Specified by:
build in interface Extension

exec

public QueryIterator exec(QueryIterator input,
                          List args,
                          String uri,
                          ExecutionContext execCxt)
Specified by:
exec in interface Extension

execMetric

public abstract Integer execMetric(List inputTable)