|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.retrieval.pire.PIRE
An IR engine based on probabilistic Datalog ("Probabilistic Datalog IR Engine").
This IR engine uses a document models consisting of attributes (which refer
to a datatype). Datatypes are modelled by special classes in the package
de.unidu.is.retrieval.pire.dt, where the class name is the
datatype name plus DT.
Probabilistic Datalog is used in an Index. Currently a
PDatalogIndex is used, which used the code in
de.unidu.is.pdatalog. If another pDatalog implementation
should be used, only the method newIndex(String) has to be
overwritten in a subclass.
| Field Summary | |
protected RelationBase |
base
The relation base. |
protected java.lang.String |
collectionName
The name of this collection. |
protected java.util.Map |
conditions
Map with temporary conditions for retrieval with weighted-sum queries. |
protected PropertyMap |
counts
Property map with temporary counter for sub-queries. |
protected Index |
dummyIndex
Dummy index used for retrieval. |
protected java.util.Map |
indexes
Indexes, specified by their name. |
protected java.util.Map |
rules
Map with temporary rules for retrieval with Boolean-style queries. |
protected Schema |
schema
Schema. |
| Constructor Summary | |
PIRE(DB db,
java.lang.String collectionName)
Creates a new instance. |
|
| Method Summary | |
void |
addCondition(java.lang.String queryID,
java.lang.String attName,
java.lang.String operator,
double weight,
java.lang.Object value)
Adds a condition for a weighted sum query. |
void |
addCondition(java.lang.String queryID,
WeightedQueryCondition cond)
Adds a condition for a weighted sum query. |
void |
addConjunction(java.lang.String queryID,
QueryCondition[] conditions)
Adds a conjunction for a Boolean-style query in disjunctive form. |
void |
addMomentsCondition(java.lang.String queryID,
java.lang.String attName,
java.lang.String operator,
double weight,
java.lang.Object value)
Adds a query condition. |
void |
addMomentsCondition(java.lang.String queryID,
WeightedQueryCondition cond)
Adds a query condition. |
void |
addToIndex(java.lang.String docID)
Add the document id to the corresponding table. |
void |
addToIndex(java.lang.String docID,
java.lang.String attName,
java.lang.Object value)
Add the document value of the specified attribute to the index. |
void |
closeQuery(java.lang.String queryID)
Finishes the processing of this query and frees used resources. |
void |
computeIndex()
Computes the index, based on the document values added. |
void |
computeMoments()
Computes the moments of the indexing weights. |
void |
computeProbs(java.lang.String queryID)
Computes probabilities of relevance based on the documents' RSV. |
java.lang.String |
getCollectionName()
Return the name of this collection. |
protected java.util.List |
getConditionList(java.lang.String queryID)
Returns a list of conditions for the specified query id. |
protected DT |
getDT(SchemaElement element)
Returns a data type object for the specified schema element |
protected SchemaElement |
getElement(java.lang.String attName)
Returns the attribute with the specified name. |
protected Index |
getIndex(java.lang.String key)
Returns the index specified by its name. |
Index |
getIndex(java.lang.String attName,
java.lang.String operator)
Returns the index specified by its name (created based on the attribute name and the operator name). |
Moments |
getMoments(java.lang.String queryID)
Returns the expectation and the variance of the RSVs. |
double |
getRD(java.lang.String attName,
java.lang.String operator,
java.lang.String key)
Returns the value corresponding to the specified key in the rd relation in the specified index. |
java.util.List |
getResult(java.lang.String queryID,
int numDocs)
Returns the probabilities of relevance for the top-ranked documents in decreasing order. |
protected java.util.List |
getRuleList(java.lang.String queryID)
Returns a list of rules for the specified query id. |
void |
initIndex()
Inits the index. |
void |
initQuery(java.lang.String queryID)
Inits the query. |
protected Index |
newIndex(java.lang.String key)
Creates a new PDatalog index with the specified name. |
void |
registerAttribute(java.lang.String attName,
java.lang.String datatype,
java.util.List operators)
Registers the specified attribute. |
void |
removeIndex()
Removes the index. |
void |
setRD(java.lang.String attName,
java.lang.String operator,
java.lang.String key,
double value)
Sets the value corresponding to the specified key in the rd
relation in the specified index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String collectionName
protected java.util.Map indexes
protected Schema schema
protected java.util.Map conditions
protected java.util.Map rules
protected PropertyMap counts
protected Index dummyIndex
protected RelationBase base
| Constructor Detail |
public PIRE(DB db,
java.lang.String collectionName)
db - database parameterscollectionName - name of the collection| Method Detail |
protected DT getDT(SchemaElement element)
element - schema element
public Index getIndex(java.lang.String attName,
java.lang.String operator)
attName - attribute nameoperator - name
protected Index getIndex(java.lang.String key)
key - index name
protected Index newIndex(java.lang.String key)
key - index name
protected SchemaElement getElement(java.lang.String attName)
attName - attribute name
public void registerAttribute(java.lang.String attName,
java.lang.String datatype,
java.util.List operators)
attName - attribute namedatatype - corresponding datatypeoperators - list of operators
public double getRD(java.lang.String attName,
java.lang.String operator,
java.lang.String key)
rd relation in the specified index.
attName - schema attribute nameoperator - search operatorkey - value key
public void setRD(java.lang.String attName,
java.lang.String operator,
java.lang.String key,
double value)
rd
relation in the specified index.
attName - schema attribute nameoperator - search operatorkey - value keyvalue - valuepublic void initIndex()
public void addToIndex(java.lang.String docID)
docID - document id
public void addToIndex(java.lang.String docID,
java.lang.String attName,
java.lang.Object value)
docID - document idattName - attribute namevalue - attribute valuepublic void computeIndex()
public void computeMoments()
public void removeIndex()
public void initQuery(java.lang.String queryID)
queryID - query id
public void addCondition(java.lang.String queryID,
java.lang.String attName,
java.lang.String operator,
double weight,
java.lang.Object value)
computeProbs(String), as
conditions for the same attribute/operator pair have to be evaluated
together.
queryID - query idattName - schema attribute nameoperator - search operatorweight - condition weightvalue - comparison value
public void addCondition(java.lang.String queryID,
WeightedQueryCondition cond)
computeProbs(String), as
conditions for the same attribute/operator pair have to be evaluated
together.
queryID - query idcond - weighted query condition
public void addConjunction(java.lang.String queryID,
QueryCondition[] conditions)
computeProbs(String).
queryID - query idconditions - conditions forming a conjunctionpublic void computeProbs(java.lang.String queryID)
queryID - query id
public java.util.List getResult(java.lang.String queryID,
int numDocs)
computeProbs() has to be
called.
queryID - query idnumDocs - number of documents to retrieve
public void closeQuery(java.lang.String queryID)
queryID - query id
public void addMomentsCondition(java.lang.String queryID,
java.lang.String attName,
java.lang.String operator,
double weight,
java.lang.Object value)
queryID - query idattName - schema attribute nameoperator - search operatorweight - condition weightvalue - comparison value
public void addMomentsCondition(java.lang.String queryID,
WeightedQueryCondition cond)
queryID - query idcond - weighted query conditionpublic Moments getMoments(java.lang.String queryID)
queryID - query id
public java.lang.String getCollectionName()
protected java.util.List getRuleList(java.lang.String queryID)
queryID - query id
protected java.util.List getConditionList(java.lang.String queryID)
queryID - query id
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||