|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface encapsulates a document index, represented by specific relations.
Standard relations:
docid storing the ids of the documents,tf storing the indexing values ("tokens") of the
documents together with the number of their ocurrence in the documents,df storing the document frequencies of the index
tokens,rd storing values which are independent from the
document- and indexing tokens,weight is optional and contains the indexing weights,expectation storing the expectations of the index
tokens,variance storing the variances of the index
tokens,result{query id} contains the document RSVs.
| Field Summary | |
static java.lang.String |
DF_RELATION
Name of the document frequency relation. |
static java.lang.String |
DOCID_RELATION
Name of the docid relation. |
static java.lang.String |
EXPECTATION_RELATION
Name of the expectation relation. |
static java.lang.String |
IDB_RD_RELATION
Name of the IDB rd relation (values computed by rules). |
static java.lang.String |
PROB_RELATION
Prefix of the result relations. |
static java.lang.String |
RD_RELATION
Name of the rd relation. |
static java.lang.String |
RSV_RELATION
Prefix of the rsv relations. |
static java.lang.String |
TF_RELATION
Name of the token relation. |
static java.lang.String |
VARIANCE_RELATION
Name of the variance relation. |
static java.lang.String |
WEIGHT_RELATION
Name of the indexing weight relation. |
| Method Summary | |
void |
add(Fact fact)
Adds the fact to the knowledge base. |
EDBRelation |
addEDBRelation(java.lang.String name,
int arity,
boolean create)
Creates a new EDB relation. |
IDBRelation |
addIDBRelation(java.lang.String name,
int arity,
boolean create)
Creates a new IDB relation. |
void |
addMomentsCondition(java.lang.String queryID,
double weight,
java.lang.Object value,
java.util.List addList)
Adds a query condition for computing moments. |
void |
addRule(java.lang.String queryID,
java.lang.String[] relations,
double prob,
java.util.List addList)
Add a rule with the given relations and a single argument to the specified list. |
void |
closeQuery(java.lang.String queryID)
Finishes the processing of this query and frees used resources. |
void |
completeRelation(java.lang.String name)
Signals that the specified relation is complete. |
void |
compute(IDBRelation relation,
java.util.Collection rules)
Computes the result of the specified rules (all corresponding to the specified IDB relation). |
void |
compute(Rule rule)
Computes the result of the specified rule. |
void |
computeDisjoint(IDBRelation relation,
java.util.Collection rules)
Computes the result of the specified rules (all corresponding to the specified IDB relation). |
void |
computeDisjoint(java.lang.String relationName,
int arity,
java.util.Collection rules)
Computes the result of the specified rules (all corresponding to the specified IDB relation). |
void |
computeMoments()
Computes the moments of the indexing weights. |
void |
computeMoments(java.lang.String queryID,
java.util.List ruleList)
Finishes the computation of the moments. |
void |
computeProbs(java.lang.String queryID,
java.util.List addList,
boolean computeDisjoint)
Computes the probabilities of relevance for the given query based on the RSVs specified by the list of rules. |
java.lang.String |
convert(java.lang.String relationName)
Converts a relative relation name into an absolute one, using the collection name and the index key as a prefix. |
java.lang.String |
convertCollection(java.lang.String relationName)
Converts a relative relation name into an absolute one, using only the collection name as a prefix. |
double |
getMax(java.lang.String relation)
Returns the maximum probability for the specified relation. |
double |
getMaxRSV(java.lang.String queryID,
java.lang.String conditionID)
Returns the maximum RSV for the specified query. |
java.lang.String |
getProbRelation(java.lang.String queryID,
java.lang.String subqueryID)
|
java.util.List |
getProbs(java.lang.String queryID,
int numDocs)
Returns the document ids and probabilities of relevance of the first documents. |
double |
getRD(java.lang.String key)
Returns the value corresponding to the specified key in the rd relation. |
double |
getRD(java.lang.String key,
double defaultValue)
Returns the value corresponding to the specified key in the rd relation or a default value if no entry is found. |
java.lang.String |
getRSVRelation(java.lang.String queryID,
java.lang.String subqueryID)
|
void |
init()
Inits the index. |
void |
initQuery(java.lang.String queryID)
Initialises the relation for the specified query. |
void |
insert(java.lang.String docID)
Inserts the document id to the corresponding table. |
void |
insert(java.lang.String docID,
java.lang.String token,
int tokencount)
Inserts the specified value into the given document. |
java.util.Iterator |
iterator(java.lang.String relation)
Returns an iterator over the specified relation. |
void |
remove()
Removes the index. |
void |
removeRelation(java.lang.String name)
Removes the specified relation from this index. |
void |
setRD(java.lang.String key,
double value)
Sets the value corresponding to the specified key in the rd
relation. |
| Field Detail |
public static final java.lang.String DOCID_RELATION
public static final java.lang.String TF_RELATION
public static final java.lang.String DF_RELATION
public static final java.lang.String RD_RELATION
public static final java.lang.String IDB_RD_RELATION
public static final java.lang.String WEIGHT_RELATION
public static final java.lang.String EXPECTATION_RELATION
public static final java.lang.String VARIANCE_RELATION
public static final java.lang.String RSV_RELATION
public static final java.lang.String PROB_RELATION
| Method Detail |
public java.lang.String convert(java.lang.String relationName)
relationName - relative name of the relation
public java.lang.String convertCollection(java.lang.String relationName)
relationName - relative name of the relation
public void init()
public void insert(java.lang.String docID)
docID - document id
public void insert(java.lang.String docID,
java.lang.String token,
int tokencount)
docID - document idtoken - tokentokencount - number of occurences of the valuepublic void computeMoments()
public void remove()
public void initQuery(java.lang.String queryID)
queryID - query id
public void addRule(java.lang.String queryID,
java.lang.String[] relations,
double prob,
java.util.List addList)
queryID - query idrelations - array of relation namesprob - probability of the ruleaddList - list to which the rule is added
public void computeProbs(java.lang.String queryID,
java.util.List addList,
boolean computeDisjoint)
queryID - query idaddList - list of rules for computing the probabilities of relevancecomputeDisjoint - if true, disjointness is assumed
public double getMaxRSV(java.lang.String queryID,
java.lang.String conditionID)
queryID - query idconditionID - condition identifier (in the relation name)
public double getMax(java.lang.String relation)
relation - relation name
public java.util.List getProbs(java.lang.String queryID,
int numDocs)
queryID - query idnumDocs - number of documents to be retrieved
public void closeQuery(java.lang.String queryID)
queryID - query id
public void addMomentsCondition(java.lang.String queryID,
double weight,
java.lang.Object value,
java.util.List addList)
computeMoments.
queryID - query idweight - condition weightvalue - comparison value
public void computeMoments(java.lang.String queryID,
java.util.List ruleList)
queryID - query idpublic double getRD(java.lang.String key)
rd relation.
key - value key
public double getRD(java.lang.String key,
double defaultValue)
rd relation or a default value if no entry is found.
key - value keydefaultValue - default value used if no value is found
public void setRD(java.lang.String key,
double value)
rd
relation.
key - value keyvalue - valuepublic void add(Fact fact)
fact - fact to be addedpublic void compute(Rule rule)
rule - single rule for target relation
public void compute(IDBRelation relation,
java.util.Collection rules)
relation - target relationrules - collection of rules for target relation
public void computeDisjoint(IDBRelation relation,
java.util.Collection rules)
relation - target relationrules - collection of rules for target relation
public void computeDisjoint(java.lang.String relationName,
int arity,
java.util.Collection rules)
relationName - target relation namearity - arityrules - collection of rules for target relationpublic java.util.Iterator iterator(java.lang.String relation)
relation - relation name
public EDBRelation addEDBRelation(java.lang.String name,
int arity,
boolean create)
name - name of the relationarity - arity of the relationcreate - if true, the relation is physically created
public IDBRelation addIDBRelation(java.lang.String name,
int arity,
boolean create)
name - name of the relationarity - arity of the relationcreate - if true, the relation is physically created
public void removeRelation(java.lang.String name)
name - relation namepublic void completeRelation(java.lang.String name)
name - relation name
public java.lang.String getRSVRelation(java.lang.String queryID,
java.lang.String subqueryID)
queryID - subqueryID -
public java.lang.String getProbRelation(java.lang.String queryID,
java.lang.String subqueryID)
queryID - subqueryID -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||