Data transformation involves transforming data from a first structure into data of a second structure. Data transformation is performed based on a map that relates data elements from an input or source structure to an output or target structure and captures any requisite transformations. Code can be generated from the data map that converts data from a source structure to a target structure. For example, code can be generated that transforms a source structure that specifies a person with two fields, such as first name and last name, to an target structure that utilizes a single name field, by concatenating a first name and a last name from the source and supplying the resultant single field to the target.
One significant data transformation technology is XSLT (eXtensible Style sheet Language Transformation). XSLT is a transformation language used to transform XML (eXtensible Markup Language) documents. An XSLT processor takes as input a source XML document and an XSLT style sheet and produces a new target XML document with a different schema. The XSLT style sheet, which can be specified by hand, includes a collection of template rules that guide the production of a target XML document.
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed subject matter. This summary is not an extensive overview. It is not intended to identify key/critical elements or to delineate the scope of the claimed subject matter. Its sole purpose is to present some concepts in a simplified form as a prelude to the more detailed description that is presented later.
Briefly described, the subject disclosure pertains to format independent data transformation. An individual can author a transform, or map, of input data to output data in terms of structure and without regard to format. A mechanism is provided to facilitate transform specification, for instance through use of a graphical user interface. Further, maplets, which capture repeatable transformations, can be saved and re-used to aid transform specification. The transform can be encoded in a form that is independent of any input or output format. Subsequently, data transformation can be performed as a function of the transform and input data. For example, the transform can be used to generate executable code that performs data transformation upon execution. Access to input data and population of output data of specific formats can be enabled through implementation of one or more common interfaces.
To the accomplishment of the foregoing and related ends, certain illustrative aspects of the claimed subject matter are described herein in connection with the following description and the annexed drawings. These aspects are indicative of various ways in which the subject matter may be practiced, all of which are intended to be within the scope of the claimed subject matter. Other advantages and novel features may become apparent from the following detailed description when considered in conjunction with the drawings.
Data transformation conventionally concerns bridging mismatches in data schemas, or structures. In addition to variations in structure, various data formats can be encountered in the data transformation domain, such as where multiple software systems are employed that were not designed to communicate with each other. By way of example, a mashup application could obtain data in different formats from different web services including an XML (eXtensible Markup Language) document, a JSON (JavaScript Object Notation) object, and a CLR (Common Language Runtime) object. Specialized code is written by programmers to enable desired communication with diverse systems. In particular, code is authored to normalized input data to a specific format, typically XML. In the above example, the JSON object and the CLR object can be converted in their entirety to XML. Next, data transformation can be performed using XSLT over XML documents. Additional code can subsequently be utilized to convert a produced XML document to a desired format. In addition to requiring programming experience, the above approach incurs significant overhead with respect to converting input data completely from its original format to a specific format, here XML, and converting from the specific format to a desired output format.
Details below are generally directed toward format independent data transformation. Stated differently, data transformation can be employed with respect to arbitrary input and output data formats as well as differing structure. A mechanism, such as a graphical user interface, can be provided to facilitate specification of transform, which maps input data of a first structure to output data of a second structure without regard to format. Additionally, maplets, which capture repeatable transformations, can be saved and reused to aid authoring transforms. The transforms can be encoded in a form independent of input and output data formats. Data transformation can subsequently be performed as a function of at least the transform and the input data. In one instance, one or more common interfaces can be employed that abstract away details of input and output data formats. In other words, a universal data transformation system is disclosed that can take in any data format and output any data format.
Various aspects of the subject disclosure are now described in more detail with reference to the annexed drawings, wherein like numerals refer to like or corresponding elements throughout. It should be understood, however, that the drawings and detailed description relating thereto are not intended to limit the claimed subject matter to the particular form disclosed. Rather, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the claimed subject matter.
Referring initially to
Code generator component 120 is configured to generate executable code 122 from the transform 112. In one instance, the code generator component 120 can form part of a compiler (not shown) that parses the transform, performs syntactic and sematic analysis, and generates computer executable code. In one particular scenario, the code generator component 120 can form part of just-in-time (JIT) compiler or the like. Alternatively, it is also possible and contemplated that such code generation can be avoided where the produced transform 112 can be interpreted rather than compiled. This scenario is depicted with a dashed arrow associated with the transform 112.
Executor component 130 is configured to execute executable code 122, or indirectly execute, or interpret, transform 112. Upon execution, input data 132 can be transformed to output data 134. More specifically, input data of a first structure is transformed to output data of a second structure, where the first and second structures are different. Further, since transformation typically does not alter the input data 132, it can be said that the executor component 130 generates, or produces, the output data 134 as a function of the input data 132 and transform 112 that maps the input data 132 to the output data 134. As will be described further below, the executor component 130 can perform structural data transformation with much regard for format. For example, the executable code 122 can rely on a common object system, or the like, to perform transformation in a format agnostic manner. In other words, the executable code 122 assumes that it can deal with data of any format in the same way. This can be accomplished by wrapping access to data operated on by the code through the same interface or set of interfaces. Such an interface or set interfaces can provide a normalized view of data. The executor component 130 can also output one or more error messages, for instance if the data transformation cannot be completed for some reason.
Users of a data transformation system are typically not skilled computer programmers. Thus, such users will appreciate a user-friendly interaction mechanism, for example clicking and dragging with respect to graphic representations. However, for users that are skilled programmers, the author component 110 can expose an interface that allows coding a transform from scratch or supplementing other interaction mechanisms. In one instance, coding can be performed with respect to an underlying transformation programming language. Additionally or alternatively, the user interface component 210 can expose and accept a declarative manner of specifying transforms. For example, a declarative programming language can be employed and subsequently utilized to generated underlying code supported by the data transformation system.
The transform generation component 220 is configured to generate the transform 112 of
The user interface component 210 can expose functionality supported by an underlying transformation language and runtime of the data transformation system 100.
Functoid component 320 is configured to enable use of functions or methods over data. Functions or methods, also referred to as functoids, can be defined and stored in functoid store 322. Subsequently, previously defined functoids (including user—defined and out-of-box functoids) can be employed to facilitate specification of data transformation. A functoid can take a number of values as input and produce a value as output, wherein input values are integers or strings, for instance. By way of example, a functoid can be defined and utilized to concatenate data from two or more data fields. For instance, a first name and a last name can be concatenated to produce a full name. However, functoids can be arbitrarily complex in a manner that exploits supported functionality.
Loop component 330 can be employed to specify transformations over input data collections. More specifically, one or more repeating nodes of an input data structure can be linked to a single repeating node in the output data structure. For example, consider a company with many departments where each department has many employees. In this instance, looping can be employed to specify a particular transform for each employee of each department. Looping can also be conditional and nested, among other things.
Referring briefly to
Returning to
In accordance with one embodiment, the subject data-transformation system 100 can employ intermediate language (IL) as an underlying transformation programming language to express transformation of structures. What follows is a description of concepts of such an intermediate programming language as well as pseudo code. Additionally, a common, format-agnostic object system is described that can be employed by the IL. This description is meant to aid clarity and understanding with respect to aspects of the disclosed subject matter and not to limit the scope of the appended claims.
Further, the description utilizes the term “object” as it relates to input and output data. Various data formats utilize different terms to describe a collection of structured data including object, document, and message, among other things. It is not intended that aspects of this disclosure be limited to objects but rather can related to any input and output data regardless of whether the format is termed an object, a document, a message, or something else.
Consider the exemplary input data structure 410 (a.k.a. source) and output data structure 420 (a.k.a. target) provided in
The input and output data participating in the transform, “source” and “target” in the above snippet, can be represented through named values in the IL. A named value is a value that can be referred to using a name. Any intermediate data, like “fullname” in the above snippet, that is computed in order to perform a transformation can also be represented through a named value. Input and output data participating in the transform can be treated the same way by the IL regardless of structure or format. In order to express data access, whether it is for retrieving data from input or populating data into output, the IL can rely on a path construct. In the above snippet, strings containing “/” characters, like “source/Company” and “tgtEmp/FullName,” are path expressions.
The IL used to express transforms includes constructs that fall into two categories: initialization constructs and map statements. Initialization constructs perform the task of binding a name to a value. The line “var fullName= . . . ” shown the above code sample is an example of an initialization construct. There are two kinds of initialization constructs. Variable initialization is one kind that provides the ability to bind a value produced by a “MapExpression” (as explained below) to a name. List initialization is another kind that provides the ability to bind a list of values generated by a block of intermediate language code to a name.
The map statement category includes the following constructs:
Here, mapping is performed for each company department. Further, if the department is research then the mapping also includes a research area.
“MapExpressions” provide the ability to represent the computation of a value in the IL. They can represent constant values, function invocations, or textual expressions. The following kinds of map expression are defined:
There can be some built-in functions for use with “FunctionInvocationExpression,” in order to provide some commonly used operations while performing transformations. Some of the operations defined can include:
“TextBasedExpressions” provide the ability to write expression text in a syntax similar to that of C#® arithmetic and logical expressions in order to enable users to easily perform such computations. For example, a user can write the expression “a+b*c” in a text based expression, define what “MapExpressions” correspond to “a,” “b,” and “c,” and compute the desired result during execution of a transform. “LambdaExpressions” provide the ability to write functions through text expressions that can be passed to other functions like “ListSelectValue” and “ListSelectEntries.”
Lists are provided to enable users to accumulate any intermediate data that may be needed to filter and transform data, and finally output data in a desired structure. One typical scenario in which lists might be used is where data in the input and output objects are pivoted on different axes. Lists can be used in such a scenario to collect a flat list of normalized data and produce the output based on the desired pivot.
Below is a pseudo code snippet that demonstrates a subset of list operations available in the exemplary intermediate language:
As mentioned above, the IL assumes that it can deal with data in any format uniformly. This can be enabled by wrapping access to objects being operated on by the transformation through an interface. This interface can enable navigation of paths on objects participating in a transformation and population of objects via paths. For example, the following operations can be performed by the interface:
In accordance with one embodiment, two application programming interfaces can represent the object model utilized by the intermediate language. As shown in
The interface “ITransformObject” 610 is an abstraction of objects that the transform operates on during runtime. Of course, the transform's execution can also utilize common objects like integers and strings as well. The interface “ITransfromObject” 610 can represents objects of many kinds. For example, an object tree can be represented. In this case, the object can be visualized as the root of a tree with labeled edges pointing to child objects (e.g., the edge labels are member names). The methods “GetMember( )” “SetMember,” “GetMemberValue( ),” and “SetMemberValue( )” as well as the property “Value” can be used to access members of a given object or to obtain a value from a given “ITransformObject. Note that the description does not levy the restriction that edge-labels in the object tree, for a given object, have to be unique. It is possible that multiple members with the same name are present (e.g., in XML documents, repeating nodes can viewed this way). The method “GetMembers( )” enables retrieval of members with a given name. In cases of objects such as JSON arrays or CLR collections, a single object includes a collection of items. Getting and setting object contained in such collection objects is enabled by the methods “GetItems( )” and “AddItem( ).”
The interface “PathNavigator” 620 provides common object-navigation functionality based on paths that can be utilized by the IL. The methods “GetPathValue( )” and “SetPathValue( )” enable the IL to obtain values from input objects and to set values on output objects. The methods “GetCollection( ),” “EnsureCollectionExists( ),” and “AddToCollection( )” enable the IL to obtain collection of “ITransformObjects” from the named-values during transform execution, and to create and populate collection objects in the output objects as well. The methods “Exists( )” and “IsNil( )” are used to query the object tree as to whether objects exist at specified paths, and whether the objects at specified paths are nil.
The above-described or similar interfaces can be implemented for any data format. For example, interfaces can be implemented for XML documents, JSON objects, CLR objects, or EDI messages, among others.
Generated executable code can rely on a common object system as previously described. However, an alternate implementation is to produce format-specific code from an abstract syntax tree, for example, depending on the formats of the input and output objects. For example, if it is known that both the input and output objects use the XML format, XSLT can be generated from the abstract syntax tree and XSLT can be executed.
Yet another alternate implementation to a common object system can involve use an existing object system to wrap input data in other formats. In this manner, it is possible to generate executable code in a language specific to that object system to perform the transformation. For example, XPathNavigator and an information set can be employed. XPathNavigator is a mechanism that enables navigation of an information set (a.k.a. Infoset). An information set is an abstraction of the data model of an XML document that is expressed as a set of information items as nodes of a tree. Accordingly, interfaces can be employed on top of different data formats to view data as an information set. Subsequently, XPathNavigator in conjunction with XPath expressions can be utilized to perform data transformation.
The aforementioned systems, architectures, environments, and the like have been described with respect to interaction between several components. It should be appreciated that such systems and components can include those components or sub-components specified therein, some of the specified components or sub-components, and/or additional components. Sub-components could also be implemented as components communicatively coupled to other components rather than included within parent components. Further yet, one or more components and/or sub-components may be combined into a single component to provide aggregate functionality. Communication between systems, components and/or sub-components can be accomplished in accordance with either a push and/or pull model. The components may also interact with one or more other components not specifically described herein for the sake of brevity, but known by those of skill in the art.
Furthermore, various portions of the disclosed systems above and methods below can include or employ of artificial intelligence, machine learning, or knowledge or rule-based components, sub-components, processes, means, methodologies, or mechanisms (e.g., support vector machines, neural networks, expert systems, Bayesian belief networks, fuzzy logic, data fusion engines, classifiers . . . ). Such components, inter alia, can automate certain mechanisms or processes performed thereby to make portions of the systems and methods more adaptive as well as efficient and intelligent. By way of example, and not limitation, the author component 110 can employ such functionality to infer functoids or maplets to suggest to a user based on context.
In view of the exemplary systems described supra, methodologies that may be implemented in accordance with the disclosed subject matter will be better appreciated with reference to the flow charts of
Referring to
At numeral 820, computer-executable code is generated from the transform. Such generation can result from a compilation process, for example where links and functoids are read, an intermediate abstract syntax tree representation is created, syntactic and semantic analysis are performed with respect to the tree, and computer executable code is generated.
At reference numeral 830, the executable code is executed over input data to produce output data. During such execution, interfaces can be utilized to interact with different data formats. Where a common interface is employed, the interface is the same but the implementation of the interface is different to accommodate distinct data formats (CLR object, XML document . . . ). In other words, the set of interfaces differs based data format.
As described herein, interfaces have been disclosed as a mechanism for use in viewing data of different formats in a uniform or normalized manner. This has the benefit of not requiring conversion of an input document to a normalized form. Nevertheless, aspects of the claimed subject matter can be utilized in conjunction with conversion of an input document of an arbitrary first format to a normalized format and subsequently converting the normalized format to an arbitrary output format.
The word “exemplary” or various forms thereof are used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other aspects or designs. Furthermore, examples are provided solely for purposes of clarity and understanding and are not meant to limit or restrict the claimed subject matter or relevant portions of this disclosure in any manner It is to be appreciated a myriad of additional or alternate examples of varying scope could have been presented, but have been omitted for purposes of brevity.
As used herein, the terms “component,” and “system,” as well as various forms thereof (e.g., components, systems, sub-systems . . . ) are intended to refer to a computer-related entity, either hardware, a combination of hardware and software, software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, a processor, an object, an instance, an executable, a thread of execution, a program, and/or a computer. By way of illustration, both an application running on a computer and the computer can be a component. One or more components may reside within a process and/or thread of execution and a component may be localized on one computer and/or distributed between two or more computers.
The conjunction “or” as used this description and appended claims in is intended to mean an inclusive “or” rather than an exclusive “or,” unless otherwise specified or clear from context. In other words, “‘X’ or ‘Y’” is intended to mean any inclusive permutations of “X” and “Y.” For example, if “‘A’ employs ‘X,’” “‘A employs ‘Y,’” or “‘A’ employs both ‘X’ and ‘Y,’” then “‘A’ employs ‘X’ or ‘Y’” is satisfied under any of the foregoing instances.
As used herein, the term “inference” or “infer” refers generally to the process of reasoning about or inferring states of the system, environment, and/or user from a set of observations as captured via events and/or data. Inference can be employed to identify a specific context or action, or can generate a probability distribution over states, for example. The inference can be probabilistic—that is, the computation of a probability distribution over states of interest based on a consideration of data and events. Inference can also refer to techniques employed for composing higher-level events from a set of events and/or data. Such inference results in the construction of new events or actions from a set of observed events and/or stored event data, whether or not the events are correlated in close temporal proximity, and whether the events and data come from one or several event and data sources. Various classification schemes and/or systems (e.g., support vector machines, neural networks, expert systems, Bayesian belief networks, fuzzy logic, data fusion engines . . . ) can be employed in connection with performing automatic and/or inferred action in connection with the claimed subject matter.
Furthermore, to the extent that the terms “includes,” “contains,” “has,” “having” or variations in form thereof are used in either the detailed description or the claims, such terms are intended to be inclusive in a manner similar to the term “comprising” as “comprising” is interpreted when employed as a transitional word in a claim.
In order to provide a context for the claimed subject matter,
While the above disclosed system and methods can be described in the general context of computer-executable instructions of a program that runs on one or more computers, those skilled in the art will recognize that aspects can also be implemented in combination with other program modules or the like. Generally, program modules include routines, programs, components, data structures, among other things that perform particular tasks and/or implement particular abstract data types. Moreover, those skilled in the art will appreciate that the above systems and methods can be practiced with various computer system configurations, including single-processor, multi-processor or multi-core processor computer systems, mini-computing devices, mainframe computers, as well as personal computers, hand-held computing devices (e.g., personal digital assistant (PDA), phone, watch . . . ), microprocessor-based or programmable consumer or industrial electronics, and the like. Aspects can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. However, some, if not all aspects of the claimed subject matter can be practiced on stand-alone computers. In a distributed computing environment, program modules may be located in one or both of local and remote memory storage devices.
With reference to
The processor(s) 920 can be implemented with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any processor, controller, microcontroller, or state machine. The processor(s) 920 may also be implemented as a combination of computing devices, for example a combination of a DSP and a microprocessor, a plurality of microprocessors, multi-core processors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The computer 910 can include or otherwise interact with a variety of computer-readable media to facilitate control of the computer 910 to implement one or more aspects of the claimed subject matter. The computer-readable media can be any available media that can be accessed by the computer 910 and includes volatile and nonvolatile media, and removable and non-removable media. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media.
Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to memory devices (e.g., random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM) . . . ), magnetic storage devices (e.g., hard disk, floppy disk, cassettes, tape . . . ), optical disks (e.g., compact disk (CD), digital versatile disk (DVD) . . . ), and solid state devices (e.g., solid state drive (SSD), flash memory drive (e.g., card, stick, key drive . . . ) . . . ), or any other medium which can be used to store the desired information and which can be accessed by the computer 910.
Communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of any of the above should also be included within the scope of computer-readable media.
Memory 930 and mass storage 950 are examples of computer-readable storage media. Depending on the exact configuration and type of computing device, memory 930 may be volatile (e.g., RAM), non-volatile (e.g., ROM, flash memory . . . ) or some combination of the two. By way of example, the basic input/output system (BIOS), including basic routines to transfer information between elements within the computer 910, such as during start-up, can be stored in nonvolatile memory, while volatile memory can act as external cache memory to facilitate processing by the processor(s) 920, among other things.
Mass storage 950 includes removable/non-removable, volatile/non-volatile computer storage media for storage of large amounts of data relative to the memory 930. For example, mass storage 950 includes, but is not limited to, one or more devices such as a magnetic or optical disk drive, floppy disk drive, flash memory, solid-state drive, or memory stick.
Memory 930 and mass storage 950 can include, or have stored therein, operating system 960, one or more applications 962, one or more program modules 964, and data 966. The operating system 960 acts to control and allocate resources of the computer 910. Applications 962 include one or both of system and application software and can exploit management of resources by the operating system 960 through program modules 964 and data 966 stored in memory 930 and/or mass storage 950 to perform one or more actions. Accordingly, applications 962 can turn a general-purpose computer 910 into a specialized machine in accordance with the logic provided thereby.
All or portions of the claimed subject matter can be implemented using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof to control a computer to realize the disclosed functionality. By way of example and not limitation, the data transformation system 100, or portions thereof, can be, or form part, of an application 962, and include one or more modules 964 and data 966 stored in memory and/or mass storage 950 whose functionality can be realized when executed by one or more processor(s) 920.
In accordance with one particular embodiment, the processor(s) 920 can correspond to a system on a chip (SOC) or like architecture including, or in other words integrating, both hardware and software on a single integrated circuit substrate. Here, the processor(s) 920 can include one or more processors as well as memory at least similar to processor(s) 920 and memory 930, among other things. Conventional processors include a minimal amount of hardware and software and rely extensively on external hardware and software. By contrast, an SOC implementation of processor is more powerful, as it embeds hardware and software therein that enable particular functionality with minimal or no reliance on external hardware and software. For example, the data transformation system 100 and/or associated functionality can be embedded within hardware in a SOC architecture.
The computer 910 also includes one or more interface components 970 that are communicatively coupled to the system bus 940 and facilitate interaction with the computer 910. By way of example, the interface component 970 can be a port (e.g., serial, parallel, PCMCIA, USB, FireWire . . . ) or an interface card (e.g., sound, video . . . ) or the like. In one example implementation, the interface component 970 can be embodied as a user input/output interface to enable a user to enter commands and information into the computer 910 through one or more input devices (e.g., pointing device such as a mouse, trackball, stylus, touch pad, keyboard, microphone, joystick, game pad, satellite dish, scanner, camera, other computer . . . ). In another example implementation, the interface component 970 can be embodied as an output peripheral interface to supply output to displays (e.g., CRT, LCD, plasma . . . ), speakers, printers, and/or other computers, among other things. Still further yet, the interface component 970 can be embodied as a network interface to enable communication with other computing devices (not shown), such as over a wired or wireless communications link.
What has been described above includes examples of aspects of the claimed subject matter. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the claimed subject matter, but one of ordinary skill in the art may recognize that many further combinations and permutations of the disclosed subject matter are possible. Accordingly, the disclosed subject matter is intended to embrace all such alterations, modifications, and variations that fall within the spirit and scope of the appended claims.