# US 2004/0083218 A1 · XML schema evolution

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2004/0083218 A1
- Document ID: US20040083218A1
- Status: Published application
- Kind: A1
- Application number: 10/279,481
- Filed: 2002-10-23
- Published: 2004-04-29
- Earliest claimed: 2002-10-23
- Assignees: AOL LLC, a Delaware Limited Liability Company
- Inventors: An Feng
- Web page: https://patentgrep.com/patent/US20040083218A1

## CPC

- G06F 16/986: {Document structures and storage, e.g. HTML extensions}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A technique for evolving XML schemas is disclosed. The technique involves methods for performing schema manipulating operations and for validating the schema changes so that the current XML documents remain valid against the new schema.

## Claims

### Claim 1

A method for evolving a first XML schema to a second XML schema in application involving a plurality XML documents which are valid against said first XML schema, comprising the steps of:
performing a plurality of schema manipulation operations to generate said second XML schema; and
validating said plurality of schema manipulation operations so that all existing XML documents are kept valid.

### Claim 2 (depends on 1)

The method of claim 1, wherein said step of schema manipulation operations further comprises the steps of:
finding an identified node in said first XML schema at a specified location; and
retrieving a segment of said identified node in said first XML schema.

### Claim 3 (depends on 2)

The method of claim 2, wherein said step of schema manipulation operations further comprises the step of:
inserting a new schema segment into said first XML schema at a relative position of said identified node in said first XML schema.

### Claim 4 (depends on 3)

The method of claim 3, wherein said step of schema manipulation operations further comprises the step of:
replacing said identified node in said first XML schema with a new schema segment.

### Claim 5 (depends on 4)

The method of claim 4, wherein said step of schema manipulation operations further comprises the step of:
deleting said identified node from said first XML schema.

### Claim 6 (depends on 5)

The method of claim 5, wherein said step of schema manipulation operations further comprise the step of:
eliminating unnecessary segments to make said first XML schema compact.

### Claim 7 (depends on 6)

The method of claim 6, wherein said step of schema manipulation operations further comprises the step of:
committing pending schema changes and assigning a new version to said second XML schema.

### Claim 8 (depends on 3)

The method of claim 3, wherein said relative position is one of the group containing:
immediately left sibling, immediately right sibling, first child, and last child of said identified node.

### Claim 9 (depends on 1)

The method of claim 1, wherein each of said schema manipulation operations is one of the group containing:
a query schema operation that retrieves a segment of an XML schema;
an insert schema operation that inserts a segment to an XML schema;
a replace schema operation that replaces a schema segment of an XML schema;
a delete schema operation that deletes a schema segment of an XML schema;
a compact schema operation that eliminates unnecessary segments to make an XML schema compact; and
an evolve schema operation that commits pending schema changes.

### Claim 10 (depends on 1)

The method of claim 1, wherein said validating step further comprises the step of:
determining whether a second set containing all valid XML documents of said second XML schema contains a first set containing all valid XML document of said first XML schema.

### Claim 11

A method for determining whether a first set of XML documents contains a second set of XML documents, said first set of XML documents being the set of all valid XML documents of a first XML schema and said second set of XML documents being the set of all valid XML documents of a second XML schema, the method comprising the steps of:
locating a first root element for said first XML schema and a second root node for said second schema;
removing all elements and attributes from said first XML schemas that are not reachable from said first root element and from said second XML schema that are not reachable from said second root element;
constructing a first total element list which contains elements in said first XML schema and a second total element list which contains elements in said second schema;
returning false if said first element list does not contain said second element list; and
performing detailed element comparison for each of said elements in said second element list with said corresponding elements in said first element list.

### Claim 12 (depends on 11)

The method of claim 11, wherein said element comparison step further comprises the steps of:
finding a first type definition of a first element in said first XML schema and a second type definition of a second element in said second XML schema; and
performing comparison of a first language set which represents all possible values covered by said first type definition and a second language set which represents all possible values covered by said second type definition; and
returning false if said first language set does not contain said second language set.

### Claim 13 (depends on 12)

The method of claim 12, wherein said element list set comparison step further comprises the steps of:
checking if said first type definition and said second type definition are both complex data type;
constructing a first regular expression for said first type definition and a second regular expression for said second type definition if both said first type definition and said second type definition are complex data types;
applying standard regular expression comparison algorithm to decide whether a first language represented by said first regular expression is equal to or larger than a second language represented by said second regular expression;
checking if said first type definition and said second type definition are both a simple data type;
returning false if said first type definition and said second type definition are not both simple data types; and
if both said first type definition and said second type definition are simple data types, performing direct comparison for said first type definition and said second type definition to determine whether said first language set represented by said first type definition is equal to or larger than said second language set represented by said second type definition.

### Claim 14 (depends on 11)

The method of claim 11, wherein said element comparison step further comprises the steps of:
constructing a first attribute set associated with said first element and a second attribute set associated with said second element;
returning false if said first attribute set does not contain said second attribute set;
returning false if any attribute in said first attribute set but not in said second attribute set is required; and
performing detailed attribute comparison for each of said attributes in said second attribute set with said corresponding attributes in said first attribute set.

### Claim 15 (depends on 14)

The method of claim 14, wherein said attribute comparison step further comprises the steps of:
finding a third data type of a first attribute and a fourth data type of same attribute in said second XML schema;
performing comparison of a third language set which represents all possible values covered by said third type definition and a fourth language set, which represents all possible values covered by said fourth document type;
returning false if said third language set does not contain said fourth language set; and
returning true if said third language set contains said fourth language set.

### Claim 16

An apparatus for evolving XML schemas in an application handling XML documents, comprising:
a schema manipulation means; and
a schema validation means;
wherein said schema manipulation means performs a plurality of schema manipulation operations to evolve a current XML schema into a new XML schema; and
wherein said schema validation means validates said new XML schema to make sure all current XML documents are still valid against said new XML schema.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein each of said schema manipulation operations is any of:
a query schema operation that retrieves a segment of an XML schema;
an insert schema operation that inserts a segment to an XML schema;
a replace schema operation that replaces a schema segment of an XML schema;
a delete schema operation that deletes a schema segment of an XML schema;
a compact schema operation that eliminates unnecessary segments to make an XML schema compact; and
an evolve schema operation that commits pending schema changes.

### Claim 18 (depends on 17)

The apparatus of claim 17, wherein said schema validating means further comprises:
a comparison module for determining whether a second set containing all valid XML documents of said second XML schema contains a first set containing all valid XML documents of said first XML schema.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein said application is a Web service that maps data containing in XML documents into a relational database.

### Claim 20 (depends on 19)

The apparatus of claim 19, further comprising:
means to providing gatekeeper control for better data and schema quality; and
means for triggering underlying database storage change for handling extended data corresponding to said new XML schema.
