|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcz.cuni.mff.ksi.jinfer.iss.objects.AMModel
public class AMModel
Class representing a model for attribute mappings operations. It is constructed from a specified grammar and provides various views of the mappings in that grammar, notably:
getFlat() method:
attribute mappings are returned as a list of Triplets.
JTree, returned by the
getTree().
getAMs() method:
mappings are returned in a map indexed by their IDs
(AttributeMappingId) containing the full mappings
(AttributeMapping).
| Constructor Summary | |
|---|---|
AMModel(List<Element> grammar)
Full constructor. |
|
| Method Summary | |
|---|---|
double |
coverage(AttributeMappingId targetMapping)
Please see the "Finding ID Attributes in XML Documents" article for the definition of this function. |
Map<AttributeMappingId,AttributeMapping> |
getAMs()
Returns all attribute mappings in the underlying grammar as a map indexed by their IDs ( AttributeMappingId) containing the full
mappings (AttributeMapping). |
List<Triplet> |
getFlat()
Extracts the attribute mapping from the underlying grammar as a flat list of Triplets (element name, attribute name, attribute content). |
TreeNode |
getTree()
Extracts the attribute mapping from the underlying grammar as a tree ready to be used in a JTree. |
Set<String> |
getTypes()
Returns all the element types represented in this model. |
int |
size()
Returns the total size of all attribute mappings represented in this model. |
double |
support(AttributeMappingId targetMapping)
Please see the "Finding ID Attributes in XML Documents" article for the definition of this function. |
double |
weight(AttributeMappingId mapping,
double alpha,
double beta)
Returns the weight of the provided AM in the context of this AM model as a weighted sum of its support and coverage. |
double |
weight(Collection<AttributeMappingId> mappings,
double alpha,
double beta)
Returns the sum of weights of all the mappings provided in the context this AM model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AMModel(List<Element> grammar)
grammar - Grammar from which the model should be created.| Method Detail |
|---|
public List<Triplet> getFlat()
Triplets (element name, attribute name, attribute content).
Note that the original content of the attribute is split into tokens on spaces.
For example an element e with attribute a that
contains the string "1 p p" in the original document will
produce 3 Triplets, containing the attribute content
1, p and p respectively.
Triplets is sorted
(see Triplet.compareTo(Triplet)).public TreeNode getTree()
JTree.
Please note that the attribute content is split into tokens on spaces,
see MappingUtils#extractFlat for details.
Element in the grammar. The element nodes then contain nodes for
each of the Attributes they contain.public Map<AttributeMappingId,AttributeMapping> getAMs()
AttributeMappingId) containing the full
mappings (AttributeMapping).
public int size()
public Set<String> getTypes()
public double weight(AttributeMappingId mapping,
double alpha,
double beta)
mapping - Mapping to compute weight for.alpha - Weight of the mapping support.beta - Weight of the mapping coverage.
MappingUtils#support(AttributeMappingId, AMModel),
MappingUtils#coverage(AttributeMappingId, AMModel)
public double weight(Collection<AttributeMappingId> mappings,
double alpha,
double beta)
mappings - List of the mappings to calculate the weight for.alpha - Weight of the mapping support.beta - Weight of the mapping coverage.
MappingUtils#weight(AttributeMappingId, AMModel)public double support(AttributeMappingId targetMapping)
targetMapping - Mapping for which support should be calculated.
public double coverage(AttributeMappingId targetMapping)
targetMapping - Mapping for which coverage should be calculated.
|
jInfer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||