XML Schema Analysis View for TPR2
Jeri Lockhart
14 December 2005
revised 13 January 2006
Purpose
Screens
Features
Implementation
Other Useful Features
that are Outside the Scope of the Analysis View
Resources
Purpose
- To answer questions that a user may have about his or her Schema
in the form of a filtered graph.
- To help a Schema developer understand the structure of a Schema,
especially a large Schema, by providing a graph showing the
relationship between Schema components, such as where a certain global
component is reused in a Schema.
- To help a Schema developer identify possible problems in his or
her Schema by providing predefined queries, such as "Show all Complex
Types that do not contain an Any element?", which could, for
example, indicate limited extensibility.
Screens
This is the "Show Usages" query from TPR1 in the new columnar
format. The predefined queries will be listed in the "Queries"
column. The column to the right of the Queries column will be
used for customizing the query. The third column contains the
graph.
This illustrates the format of query list and query customizer
column. The content of the list is still to be determined.
Features
Provide a list of predefined queries.
At least three of these queries will be implemented for TPR2.
- Show "Red Flags" in a Schema - [see Resources]
- Find CTs containing an all group
- Find CTs containing a choice group
- Find xs:QNames with default values
- Find restricted/extended CTs
- Find optional elements that do not specify nillable='true'
and minOccurs='0'
- Find elements using nillable=true (not the same as null)
- Find attribute elements with "fixed=" attribute
- Find which Global Elements
are substitutable
- Find CTs that do not contain an <any> elements -
- Find CTs that do not contain an <anyAttribute>
- Find usages of date and time types
- Find user-defined Simple Types
- Find chameleon elements (Schemas with included files that have
elements that are not prefixed with a namespace)
- Find unqualified Schema elements, e.g., type='string',
instead of type='xs:string'
- Find wildcards
- Find dynamic typing (xsi:type)
- Show relationships between Schema components
- Enumerations of a primitive or ST (String, NMToken, etc)
- Sequences, Choices, or Alls that contain Elements A, B, C...
- Sequences, Choices, or Alls that contain Types X, Y, Z...
- Elements that use a specific substitution group G
- Is Element X used as a substitution group?
- Find keys, uniques and associated keyrefs (filter by name)
- Show relationships between files comprising a Schema
- What are the relationships between files that comprise this
schema? (layered digraph)
- Where is this global component used? (TPR1 view
extended to show files)
- Where is this type, base, or ref defined?
- Provide customization of the queries.
- Filter by name "starts with" or "contains",
case-sensitive/insensitive
- Provide linking from the Schema Column View (Explore View) for
appropriate queries.
- Provide linking to Schema Column View from the vertices in the
graph (
- Provide linking to Schema Source from the vertices in the graph
- Activate property sheets for vertices in the graph
Implementation
The open-source prefuse graphing toolkit (
http://prefuse.sourceforge.net/)
was used for the TPR1. At some point, a hierarchical
directed graph layout, such as one that implements the Sugiyama,
Tagawa, Toda 1981 algorithm, will be needed to graph the relationships
between the files comprising a multifile Schema. The prefuse
toolkit does not have such a layout, so it will have to be implemented
in prefuse.
The visdev 2.0 module that is used by the SOA orchestration module is
another possibility, but this hasn't been tested.
Other Useful
Features that are Outside the Scope of the Analysis View
- Help developer to create "venetian blind" style schemas.
- Nest repeated elements in their own container. Giving
each repeated element a wrapper element worked best
with tools which mapped XML to data structures and help avoid
invalidating the UPA rules.
- Find violations of UPA constraint. Optionally ignore UPA
constraint violations.
Resources
These two documents discuss best practices for writing Schemas:
These documents from the W3C User Experiences Workshop, June
2005 (
http://www.w3.org/2005/03/xml-schema-user-cfp.html)
discuss pitfalls to avoid in authoring Schemas:
Sketches for TPR2
Find Global Elements that
are substitutable
(Sketched with Graffle)