Method of compiling schema mapping
First Claim
1. A method of generating code representing a mapping between a source schema, and a target schema, the source schema comprising a source tree having a source node and the target schema comprising a target tree having a target node, the method comprising:
- initializing node dependencies memory comprising;
allocating memory for a compiler node;
associating the compiler node with the target node;
allocating memory for compiler variable classes; and
associating compiler variable classes with functoids;
determining source node dependencies for the target node by tracing from the target node through the mapping to the source schema, wherein the mapping comprises defined data transformations from the source schema to the target schema, and wherein determining source node dependencies comprises;
creating a target dependencies list for the target node;
creating a source dependencies list for the target node;
tracing back to the source tree through all possible paths recursively, adding source tree nodes to corresponding source dependencies lists;
setting a flag for the compiler nodes associated with the target node and an associated parent compiler node if there is a path from the target tree node to the source tree;
adding the target tree node to the target dependency list of an associated parent record node if the target node is a field node;
consolidating the target dependency list for target record nodes;
consolidating the source dependency list for target record nodes;
selecting a source loop path node for the target node according to the consolidated source dependency lists; and
storing the source loop path node in the compiler node associated with the target node;
matching hierarchy by generating a hierarchy match list for the target node; and
generating code according to the hierarchy match list.
3 Assignments
0 Petitions
Accused Products
Abstract
A method for compiling a mapping between a source schema and a target schema is provided. The method comprises multiple passes, including determining source node dependencies, matching hierarchy, and generating code. The method may further comprise initializing node dependency memory prior to determining source node dependencies, and freeing node dependency memory after code generation. The compiler algorithm provides for compiling user-defined functions in the mapping into the compiled representation. Another aspect of the invention provides for generating an XSL code representation of the mapping. An XSL style sheet representation may thus be generated from a visual mapping in accordance with the invention.
89 Citations
32 Claims
-
1. A method of generating code representing a mapping between a source schema, and a target schema, the source schema comprising a source tree having a source node and the target schema comprising a target tree having a target node, the method comprising:
-
initializing node dependencies memory comprising;
allocating memory for a compiler node;
associating the compiler node with the target node;
allocating memory for compiler variable classes; and
associating compiler variable classes with functoids;
determining source node dependencies for the target node by tracing from the target node through the mapping to the source schema, wherein the mapping comprises defined data transformations from the source schema to the target schema, and wherein determining source node dependencies comprises;
creating a target dependencies list for the target node;
creating a source dependencies list for the target node;
tracing back to the source tree through all possible paths recursively, adding source tree nodes to corresponding source dependencies lists;
setting a flag for the compiler nodes associated with the target node and an associated parent compiler node if there is a path from the target tree node to the source tree;
adding the target tree node to the target dependency list of an associated parent record node if the target node is a field node;
consolidating the target dependency list for target record nodes;
consolidating the source dependency list for target record nodes;
selecting a source loop path node for the target node according to the consolidated source dependency lists; and
storing the source loop path node in the compiler node associated with the target node;
matching hierarchy by generating a hierarchy match list for the target node; and
generating code according to the hierarchy match list. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A method of generating code representing a mapping between a source schema and a target schema, the source schema comprising a source tree having a source node and the target schema comprising a target tree having a target node, the method comprising:
-
initializing node dependencies memory comprising;
allocating memory for a compiler node;
associating the compiler node with the target node;
allocating memory for compiler variable classes; and
associating compiler variable classes with functoids;
determining source node dependencies for the target node by tracing from the target node through the mapping to the source schema, wherein the mapping comprises defined data transformations from the source schema to the target schema;
matching hierarchy by generating a hierarchy match list for the target node, wherein matching hierarchy by generating a hierarchy match list for the target node comprises;
creating a hierarchy match list for the target node if the target node has a source loop path node;
determining a consolidated compiler link option using links on target node dependencies; and
matching hierarchy according to the consolidated compiler link option; and
generating code according to the hierarchy match list.
-
-
18. A method of generating code representing a mapping between a source schema and a target schema, the source schema comprising a source tree having a source node and the target schema comprising a target tree having a target node, the method comprising:
-
initializing node dependencies memory comprising;
allocating memory for a compiler node;
associating the compiler node with the target node;
allocating memory for compiler variable classes; and
associating compiler variable classes with functoids;
determining source node dependencies for the target node by tracing from the target node through the mapping to the source schema, wherein the mapping comprises defined data transformations from the source schema to the target schema;
matching hierarchy by generating a hierarchy match list for the target node; and
generating code according to the hierarchy match list, wherein generating code according to the hierarchy match list comprises;
generating a code header for a root node;
generating a code trailer for the root node;
processing target record nodes in a preexecuteparent function, a postexecuteparent function, and an executeleaf function, wherein processing target record nodes in a preexecuteparent function, a postexecuteparent function, and an executeleaf function comprises;
generating <
xsl;
for-each>
code in the preexecuteparent function using the hierarchy match list;
generating <
xsl;
if>
code in the preexecuteparent function if there is an incoming link from a conditional functoid;
generating a start tag code for the target record node in the preexecuteparent function;
generating <
/xsl;
if>
code in the postexecuteparent function for record nodes if there is an incoming link from a conditional functoid;
generating <
xsl;
value-of>
code in the postexecuteparent function for record nodes if the incoming link is not from a conditional link by traversing a grid to source nodes, and generating code for constant node values;
generating <
/xsl;
for-each>
code in the postexecuteparent function for record nodes using the hierarchy match list;
generating <
xsl;
for-each>
code in the executeleaf function for leaf record nodes using the hierarchy match list;
generating <
xsl;
if>
code in the executeleaf function for leaf record nodes if there is an incoming link from a conditional functoid;
generating a start tag code in the executeleaf function for leaf records;
generating <
xsl;
if>
code in the executeleaf function for leaf record nodes if there is an incoming link from a conditional functoid;
generating <
xsl;
value-of>
code in the executeleaf function for leaf record nodes if the incoming link is not from a conditional link by traversing the grid to source nodes, and generating code for constant node values; and
generating <
xsl;
value-of>
code in the executeleaf function for field nodes by traversing grid to source nodes, and generating code for constant node values; and
processing field nodes in the executeleaf function.
-
-
19. A method of generating code representing a mapping between a source schema and a target schema, the source schema comprising a source tree having a source node and the target schema comprising a target tree having a target node, the method comprising:
-
initializing node dependencies memory comprising;
allocating memory for a compiler node;
associating the compiler node with the target node;
allocating memory for compiler variable classes; and
associating compiler variable classes with functoids;
determining source node dependencies for the target node by tracing from the target node through the mapping to the source schema, wherein the mapping comprises defined data transformations from the source schema to the target schema;
matching hierarchy by generating a hierarchy match list for the target node;
generating code according to the hierarchy match list, wherein generating code according to the hierarchy match list comprises;
generating a code header for a root node;
generating a code trailer for the root node;
processing target record nodes in a preexecuteparent function, a postexecuteparent function, and an executeleaf function, wherein processing target record nodes in a preexecuteparent function, a postexecuteparent function, and an executeleaf function comprises;
generating looping start code in the preexecuteparent function using the hierarchy match list;
generating conditional start code in the preexecuteparent function if there is an incoming link from a conditional functoid;
generating a start tag code for the target record node in the preexecuteparent function;
generating conditional end code in the postexecuteparent function for record nodes if there is an incoming link from a conditional functoid;
generating value code in the postexecuteparent function for record nodes if the incoming link is not from a conditional link by traversing a grid to source nodes, and generating code for constant node values;
generating looping end code in the postexecuteparent function for record nodes using the hierarchy match list;
generating looping start code in the executeleaf function for leaf record nodes using the hierarchy match list;
generating conditional start code in the executeleaf function for leaf record nodes if there is an incoming link from a conditional functoid;
generating a start tag code in the executeleaf function for leaf records;
generating conditional end code in the executeleaf function for leaf record nodes if there is an incoming link from a conditional functoid;
generating value code in the executeleaf function for leaf record nodes if the incoming link is not from a conditional link by traversing the grid to source nodes, and generating code for constant node values; and
generating value code in the executeleaf function for field nodes by traversing grid to source nodes, and generating code for constant node values; and
processing field nodes in the executeleaf function.
-
-
20. A method for compiling a mapping between a source schema having source nodes associated therewith, and a target schema having target nodes associated therewith, comprising:
-
determining source node dependencies for at least one target node by tracing from the at least one target node through the mapping to the source schema, wherein determining source node dependencies comprises picking a source loop path for each target node, and detecting multiple source loop paths and wherein the mapping comprises defined data transformations from the source schema to the target schema;
matching hierarchy by generating a hierarchy match list for the at least one target node; and
generating code according to the hierarchy match list. - View Dependent Claims (21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32)
-
Specification