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.

Analysis View Screenshot



This illustrates the format of query list and query customizer column.  The content of the list is still to be determined.

Query Customizer Column

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

  1. Find CTs containing an all group
  2. Find CTs containing a choice group
  3. Find xs:QNames with default values
  4. Find restricted/extended CTs
  5. Find optional elements that do not specify  nillable='true' and minOccurs='0'
  6. Find elements using nillable=true (not the same as null)
  7. Find attribute elements with "fixed=" attribute
  8. Find which Global Elements are substitutable
  9. Find CTs that do not contain an <any> elements -
  10. Find CTs that do not contain an <anyAttribute>
  11. Find usages of date and time types
  12. Find user-defined Simple Types
  13. Find chameleon elements (Schemas with included files that have elements that are not prefixed with a namespace)
  14. Find unqualified Schema elements, e.g., type='string', instead of  type='xs:string'
  15. Find wildcards
  16. Find dynamic typing (xsi:type)
  • Show relationships between Schema components
  1. Enumerations of a primitive or ST (String, NMToken, etc)
  2. Sequences, Choices, or Alls that contain Elements A, B, C...
  3. Sequences, Choices, or Alls that contain Types X, Y, Z...
  4. Elements that use a specific substitution group G
  5. Is Element X used as a substitution group?
  6. Find keys, uniques and associated keyrefs (filter by name)
  • Show relationships between files comprising a Schema
  1.  What are the relationships between files that comprise this schema? (layered digraph)
  2.  Where is this global component used?  (TPR1 view extended to show files)
  3.  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

Sketch of Substitution  Group Query done with Graffle

Find Global Elements that are substitutable

(Sketched with Graffle)

Project Features

About this Project

XML was started in November 2009, is owned by dstrupl, and has 58 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close