NISTIR 7662

QOD Standalone Users Guide

Julien Cuvillier

KC Morris

1
NISTIR XXXX

QOD Standalone Users Guide

Julien Cuvillier

KC Morris

Manufacturing Systems Integration Division

Manufacturing Engineering Laboratory

October 2009

U.S. Department of Commerce

Carlos M. Gutierrez, Secretary

National Institute of Standards and Technology

Patrick D. Gallagher, Deputy Director

2
Abstract

This report describes installation and use of the XML Schema [1] Quality

of Design Standalone testing system, or QOD Standalone. QOD Standalone

is one of several tools produced by NIST’s XML Testbed project within

the Manufacturing Systems Integration Division at NIST. These tools aid in

producing high quality XML schemas using a standards-based approach to

manufacturing systems integration.

QOD may be used by an XML schema developer to ensure compliance

with a set of guidelines for XML schema development, a.k.a. Naming and

Design Rules (NDR). QOD Standalone, derived from the original web-based

system, may be used for off-line testing, hence the name ”Standalone.”

While the tool is configurable to use NDR from any number of original

sources, it is distributed with tests of NDR from the Open Applications

Group (OAG) [2] and Department of the Navy (DON) [3]. Tests for other

NDR may be loaded into the system as they are available.

Contents

1 Introduction 4

1.1 About QOD Standalone . . . . . . . . . . . . . . . . . . . . . 4

1.2 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.3 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Getting started 5

2.1 Starting QOD Standalone . . . . . . . . . . . . . . . . . . . . 5

2.2 GUI Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Using QOD Standalone 7

3.1 Test Cases selection . . . . . . . . . . . . . . . . . . . . . . . . 7

3.2 Schema selection and execution . . . . . . . . . . . . . . . . . 7

3.3 Display Results . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.4 Export Results . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.5 Load and Save Results . . . . . . . . . . . . . . . . . . . . . . 8

4 Example 8

3
1 Introduction

1.1 About QOD Standalone

QOD Standalone is based on the Quality of Design tool for testing XML

schemas and described in the Background section below. QOD Standalone

is suitable for offline use and for users not wanting to share their tests or test

results with others. The software is distributed with a set of tests based on

rules from the Open Applications Group [2] and the Department of the Navy

[3].

The web based version of QOD, available at http://www.nist.gov/qod, provides more functionality in terms of collaboration during use and development of rules. For further information about QOD or NIST see:

• The QOD web site: http://www.nist.gov/qod

Contact: xmlTestbed@cme.nist.gov

• The NIST web site: http://www.nist.gov

To learn more about the test materials used in this tool, see [4].

1.2 Background

A common problem in manufacturing systems integration is the need to

exchange data between software applications. One technical approach to

solving this problem is to use the W3C XML Schema Definition Language

to define the data structure. This approach is being widely used in projects

ranging from small activities involving only a single application to industrial

and international standardization activities.

The XML Schema language is designed for describing and constraining

the content of XML documents. It is well suited to the task of defining

structured file formats for data definition, but as with any general purpose

language a disciplined use of the language is needed to create a structure

that is generally acceptable and reusable. Moreover, for consensus standardization activities, consistent use of the language is indispensible to achieving

common understanding and agreement. To this end many organizations have

taken the approach of defining how the language will be used for their community. The rules are written down in what is commonly called a ”Naming

and Design Rules (NDR)” document.

4
Unfortunately, the proliferation of NDR documents can become a problem in itself for an XML user. The question becomes what NDR to use. The

reason that there are so many different practices for how to use XML Schema

is that there are different needs for different types of integration problems.

What is perfectly reasonable and useful in one context may be problematic

in another context. Reaching agreement on what is the right set of rules to

use may be an endless task.

NIST is addressing this problem by providing tools that support the development and use of XML Schema including naming and design rules. There

are several tools available. The XML Schema Qualify of Design (QOD) tool

supports users in both specifying rules, enforcing those rules, and sharing

those rules. QOD was originally developed as a web-based system. This is

a stand-alone version of that system. The stand-alone system allows people

to enforce selected rules on their own machines as they are developing the

schemas.

1.3 Requirements

QoD standalone is fully cross-platform and requires Java 5.0 or higher (Available at http://java.com/en). It has not been tested with earlier Java versions.

It also needs the following libraries:

• Saxon [5]: This library is provided with this software in the directory

resources/lib/. The version used is 8.

• JESS [6]: This library is not provided with this software. Download

it and put the .jar files in the directory resources/lib or modify your

classpath.

2 Getting started

2.1 Starting QOD Standalone

You can start QOD Standalone in the following ways:

• By double-clicking on QODStandalone.jar (Your system can be configured to open the jar as an archive, to launch QOD Standalone, right

click → Open with → Java, or use the command line)

• The command line : java -jar QODStandalone.jar [myNDR.xml]

5
2.2 GUI Overview

The GUI consists of one main window divided into 4 panes as illustrated in

figure 1. The large pane on the right hand side of the screen contains a tree

view of the rules and associated test cases from the NDR you have selected.

The three smaller panes on the right hand side of the screen contain test

results in various forms.

Figure 1: QOD Standalone User Interface

Figure 2: QOD Standalone Execution panel

6
Panel 1. This is the Test Case selection area. Here you select the Test Cases

you want to execute. By default, all the Test Cases are selected.

Panel 2. This window is the execution panel. You select the schema or the

zip file containing the schemas you want to execute and launch the

execution.

Panel 3. This area provides the results. The results are sorted by Test Case

and by schema.

Panel 4. This area is used to provide the error’s location as an XPath

query [7].

Panel 5. This is the schema area. When an error is selected in the results

tree, the error is highlighted here.

3 Using QOD Standalone

3.1 Test Cases selection

To select the Test Cases you want to use, first load an NDR or Test Profile

(File → Open Test Profile). You can open the application with an NDRProfile already loaded by using the command line:

java -jar QODStandalone.jar myNDR.xml

A few profiles are provided with this software, others are available on the webbased QOD. An account is needed in order to export existing Test Profiles

or to create a new one (For further information about NDRProfile see [8]).

Then in the tree view select the Test Cases you want to execute. By default,

all the Test Cases are selected.

• The symbol indicates that a test case is selected.

• The symbol is next to a test case that is not selected.

3.2 Schema selection and execution

To select the schemas to be tested, open the Execution Panel (Action →

Test Schema). (You must have at least one Test Case selected.) Using the

browse button, choose the schema file or the zip file containing the schemas

to be tested.

7
Click on the OK button of the Execution Panel to launch the execution.

Click on the Cancel button to cancel it or to close the Execution Panel if no

execution is running.

3.3 Display Results

The results are displayed in a tree view in the upper right hand panel. By

clicking on a node in the tree, the error will be highlighted in the corresponding schema and displayed on the lower right hand side of the screen.

The path will be provided in the middle section titled ”Error location.” The

xpath can be copied and pasted from the screen into your own XML editor.

3.4 Export Results

The results can be exported in a file in a human readable way (Action →

Export result). It contains the following information:

• Test Case ID and number of errors

• Error message

• For each Test Case, Schema name and number of errors

• Element name

3.5 Load and Save Results

All the files generated are deleted when the software is closed. So the results

can be saved in order to be loaded in a new session (File → Save/Load

results).

4 Example

This is an example of how QOD Standalone works. We will use one of the

example rules provided.

The Test Requirement is DON-CDL7 from the Department of Navy the

NDR [3] and the schema tested is a fabricated example schema.

8
First we select the example Test Profile : QODSA-Examples.xml.

We select the single Test Case : DON-2.0-CDL-7-1.

9
Then we select the corresponding schema in the samples directory and

launch the execution.

10
The errors appear in the tree view at the top of the screen. When we

highlight the error by clicking on the line, the schema segment containing

the error appears on the bottom of the screen with the error highlighted.

Also the xpath expression to locate the error in the schema appears in the

middle of the screen. This xpath can be cut and pasted into your favorite

XML editor to locate the error in that editor.

11
Disclaimer

Unless otherwise noted, this software was developed at the National Institute

of Standards and Technology by employees of the Federal Government in the

course of their official duties. Pursuant to title 17 Section 105 of the United

States Code this software is not subject to copyright protection and is in the

public domain. NIST’s XML Testbed Tools are experimental systems. NIST

assumes no responsibility whatsoever for its use by other parties, and makes

no guarantees, expressed or implied, about its quality, reliability, or any other

characteristic. We would appreciate acknowledgement if the software is used.

Links to non-Federal Government Web sites do not imply NIST endorsement of any particular product, service, organization, company, information

provider, or content.

References

[1] World Wide Web Consortium. XML Schema.

http://www.w3.org/XML/Schema.

[2] Open Application Group. OAGIS 9.0 Documentation.

http://www.oagi.org/oagi/downloads/oagis/oagis9_doc.htm.

[3] Department of the Navy. Department of the Navy XML Naming

and Design Rules Version 2.0, January 2005.

[4] Morris K. C., Frechette S. P., Goyal P., Lubell J., Kulvatunyou B.,

Sidi Malick S., Brayard N., and Tixier S. User’s Guide for the Quality

of Design Testing Tool and the Content Checker. NISTIR 7538,

November 2008.

[5] Michael H. Kay. SAXON The XSLT and XQuery Processor.

http://saxon.sourceforge.net/.

[6] Sandia National Laboratories. JESS, the Rule Engine for the

JavaTMPlatform. http://herzberg.ca.sandia.gov/.

[7] World Wide Web Consortium. XML Path Language Version 1.0.

http://www.w3.org/TR/xpath.

[8] J. Lubell, B. Harvey, P. Goyal, and Morris K. C. NDRProfile Schema

Version 1.0 User Guide. NISTIR 7547, December 2008.

12