|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.retrieval.pire.PDatalogIndex
A document index, represented by specific relations. using pDatalog++.
| Field Summary | |
protected RelationBase |
base
The relation base used by this index. |
protected java.lang.String |
collectionName
The name of the corresponding collection. |
protected java.lang.String |
name
The prefix for the relations, containing the collection name and the index key. |
protected java.util.Map |
removeRelations
Map with relations which names of temporary relations which have to be deleted after retrieval. |
| Fields inherited from interface de.unidu.is.retrieval.pire.Index |
DF_RELATION, DOCID_RELATION, EXPECTATION_RELATION, IDB_RD_RELATION, PROB_RELATION, RD_RELATION, RSV_RELATION, TF_RELATION, VARIANCE_RELATION, WEIGHT_RELATION |
| Constructor Summary | |
PDatalogIndex(RelationBase base,
java.lang.String collectionName,
java.lang.String key)
Creates a new index. |
|
| 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 |
compute(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 |
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 list,
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 condition. |
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 or idb_rd relations or a default value
if no entry is found.
|
Relation |
getRelation(java.lang.String name)
Returns the specified relation. |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected RelationBase base
protected java.lang.String collectionName
protected java.lang.String name
protected java.util.Map removeRelations
| Constructor Detail |
public PDatalogIndex(RelationBase base,
java.lang.String collectionName,
java.lang.String key)
base - relation basecollectionName - name of the collectionkey - index key| Method Detail |
public java.lang.String convert(java.lang.String relationName)
convert in interface IndexrelationName - relative name of the relation
public java.lang.String convertCollection(java.lang.String relationName)
convertCollection in interface IndexrelationName - relative name of the relation
public void init()
init in interface Indexpublic void insert(java.lang.String docID)
insert in interface IndexdocID - document id
public void insert(java.lang.String docID,
java.lang.String token,
int tokencount)
insert in interface IndexdocID - document idtoken - tokentokencount - number of occurences of the valuepublic void computeMoments()
computeMoments in interface Indexpublic void remove()
remove in interface Indexpublic void initQuery(java.lang.String queryID)
initQuery in interface IndexqueryID - query id
public void addRule(java.lang.String queryID,
java.lang.String[] relations,
double prob,
java.util.List addList)
addRule in interface IndexqueryID - 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 list,
boolean computeDisjoint)
computeProbs in interface IndexqueryID - query idlist - 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)
getMaxRSV in interface IndexqueryID - query idconditionID - condition identifier (in the relation name)
public double getMax(java.lang.String relation)
getMax in interface Indexrelation - relation name
public java.util.List getProbs(java.lang.String queryID,
int numDocs)
getProbs in interface IndexqueryID - query idnumDocs - number of documents to be retrieved
public void closeQuery(java.lang.String queryID)
closeQuery in interface IndexqueryID - query id
public void addMomentsCondition(java.lang.String queryID,
double weight,
java.lang.Object value,
java.util.List addList)
computeMoments.
addMomentsCondition in interface IndexqueryID - query idweight - condition weightvalue - comparison value
public void computeMoments(java.lang.String queryID,
java.util.List ruleList)
computeMoments in interface IndexqueryID - query idpublic double getRD(java.lang.String key)
rd relation.
Currently, only extensionally added values (via
setRD(String,double)) can be retrieved, but not computed
values.
getRD in interface Indexkey - value key
public double getRD(java.lang.String key,
double defaultValue)
rd or idb_rd relations or a default value
if no entry is found.
getRD in interface Indexkey - value keydefaultValue - default value used if no value is found
public void setRD(java.lang.String key,
double value)
rd
relation.
setRD in interface Indexkey - value keyvalue - valuepublic void add(Fact fact)
add in interface Indexfact - fact to be addedpublic void compute(Rule rule)
compute in interface Indexrule - single rule for target relation
public void compute(IDBRelation relation,
java.util.Collection rules)
compute in interface Indexrelation - target relationrules - collection of rules for target relation
public void compute(java.lang.String relationName,
int arity,
java.util.Collection rules)
relationName - target relation namearity - target relation arityrules - collection of rules for target relation
public void computeDisjoint(IDBRelation relation,
java.util.Collection rules)
computeDisjoint in interface Indexrelation - target relationrules - collection of rules for target relation
public void computeDisjoint(java.lang.String relationName,
int arity,
java.util.Collection rules)
computeDisjoint in interface IndexrelationName - target relation namearity - arityrules - collection of rules for target relationpublic java.util.Iterator iterator(java.lang.String relation)
iterator in interface Indexrelation - relation name
public Relation getRelation(java.lang.String name)
name - relation name
public EDBRelation addEDBRelation(java.lang.String name,
int arity,
boolean create)
addEDBRelation in interface Indexname - 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)
addIDBRelation in interface Indexname - name of the relationarity - arity of the relationcreate - if true, the relation is physically created
public void completeRelation(java.lang.String name)
completeRelation in interface Indexname - relation namepublic void removeRelation(java.lang.String name)
removeRelation in interface Indexname - relation name
public java.lang.String getRSVRelation(java.lang.String queryID,
java.lang.String subqueryID)
getRSVRelation in interface IndexqueryID - subqueryID -
public java.lang.String getProbRelation(java.lang.String queryID,
java.lang.String subqueryID)
getProbRelation in interface IndexqueryID - subqueryID -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||