uk.ac.bbk.dcs.automed.xml
Class XMLRestructurer
java.lang.Object
uk.ac.bbk.dcs.automed.xml.XMLRestructurer
public class XMLRestructurer
- extends java.lang.Object
Class that automatically integrates two fully conformed AutoMed XML DataSource Schemas S1 and S2.
Main Pseudocode:
Apply the growing phase on S1 (with NestList reordering)
Apply the growing phase on S2 (without NestList reordering)
Apply ident transformation on S1 and S2
Growing Phase Pseudocode:
Traverse target schema in a depth-first way. For each element e in T, do:
- If e does not exist in S:
- If parent(e,S) has an attribute a with the same tag as e in T: attribute-to-element transformation
- Else, insert e in S with an extend transformation. Populate e by generating one instance of e for every instance of
parent(e,S).
- Treat NestList to e:
- If parent(e,S)==parent(e,T), make sure ordering is correct (NestList may have already existed, or inserted from an
attribute-to-element transformation).
- Else, insert a NestList from parent(e,T) in S to e. Populate it by using the existing path from parent(e,T) in S to e.
- For each attribute a of e in T, if e in S does not contain a:
- If e in S has a child element with the same tag as a and has PCData/CData: element to attribute transformation.
- Else, insert a with an extend transformation. Do not populate it, i.e. treat it as an optional attribute
- If e in T is connected to the PCData/CData construct with m NestLists, while e in S is connected to the PCData/CData
construct with n NestLists, where n<m, insert (m-n) NestLists from e in S to the PCData/CData construct using extend
transformations and the constants Void and Any.
NOTE Synthetic structure is inserted with add transformations - if this is not wanted, the user has to switch it off.
NOTE The only case where synthetic structure is inserted with extend transformations is when TODO
- Author:
- Lucas Zamboulis
|
Field Summary |
protected java.util.logging.Logger |
logger
|
|
Constructor Summary |
XMLRestructurer(Schema sourceSchema,
org.w3c.dom.Document sourceUIDXMLDSS,
Schema targetSchema,
org.w3c.dom.Document targetUIDXMLDSS,
org.w3c.dom.Document mappingsFile)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected java.util.logging.Logger logger
XMLRestructurer
public XMLRestructurer(Schema sourceSchema,
org.w3c.dom.Document sourceUIDXMLDSS,
Schema targetSchema,
org.w3c.dom.Document targetUIDXMLDSS,
org.w3c.dom.Document mappingsFile)
restructure
public void restructure()
throws XMLRestructuringException
- After instantiating the class, this method restructures the source XMLDSS to match the target, by transforming both source
and target schemas. This means that a growing phase is applied to both schemas and an ident transformation is applied on
the transformed schemas.
- Throws:
XMLRestructuringException
XMLException
setSyntheticSwitch
public void setSyntheticSwitch(boolean value)
- Parameters:
value - determines whether synthetic structure is created or not during restructuring; controls all other switches
simulataneously
setElement2AttributeSwitch
public void setElement2AttributeSwitch(boolean value)
- Parameters:
value - determines whether element-to-attribute transformations occur or not during restructuring
setAttribute2ElementSwitch
public void setAttribute2ElementSwitch(boolean value)
- Parameters:
value - determines whether attribute-to-element transformations occur or not during restructuring
setSkolemOn
public void setSkolemOn(boolean value)
- Parameters:
value - determines whether synthetic structure based on skolemisation is created or not during restructuring
setClassSubClassSwitch
public void setClassSubClassSwitch(boolean value)
getOverallTime
public long getOverallTime()
getIOTime
public long getIOTime()
getPhase1Time
public long getPhase1Time()
getPhase2Time
public long getPhase2Time()
getNumberOfRepositoryInteractions
public int getNumberOfRepositoryInteractions()
getNumberOfTransformations
public int getNumberOfTransformations()