<?xml version="1.0"?>
<!DOCTYPE training SYSTEM "../../../Program%20Files/SoftQuad/XMetaL%203/Rules/training.dtd">
<?xml-stylesheet href="Training-to-slidy.xsl" type="text/xsl"?>
<training>
<training-material id="NDR"> 
  <title>Validating XML Naming and Design Rules </title><authorinfo><name>Betty
  Harvey </name> <company>Electronic Commerce Connection, Inc.</company> 
  <e-mail>harvey@eccnet.com</e-mail></authorinfo> 
  <introduction id="intro"> 
  	<note>Many of the slides used in this presentation were developed jointly by K. C. Morris (NIST), Josh Lubell (NIST) and myself.</note>
	 <para>This presentation will provide the following information:</para> 
	 <list role="incremental"> 
		<item>What is an NDR</item> 
		<item>Why we need NDR's</item> 
		<item>The importance of validating NDR's</item> 
		<item>NDRProfile schema</item> 
		<item>Demonstration of validating NDR's using the National Institute of
		Technology and Standards (NIST) Quality of Design (QOD) tool.</item> 
	 	
	 </list> 
  </introduction><section id="section93"> 
  <title>Naming and Design Rules (NDR)</title> 
  <introduction id="NDRintro"> 
	 <para>XML schemaNaming and Design Rules (NDRs) are intended to help
		organizations enforce best practices, a particular modeling methodology, or
		conformance to common nomenclature policies. </para> 
  </introduction> 
  <slide id="slide276"> 
	 <title>Why Do Organizations Create Rules for Schema Design</title> 
	 <list> 
		<item>Many optional features </item> 
		<item>Poorly understood features</item> 
		<item>Too many choices in schema design 
		  <list> 
			 <item>lowercase, lowerCamelCase, UpperCamelCase, or UPPERCASE</item> 
			 <item> URL or URN for namespaces</item> 
			 <item>declare local or global scope for elements</item> 
			 <item> versioning, modularity, and extensions</item> 
			 <item>etc... </item> 
		  </list></item> 
	 </list> 
  </slide> 
  <slide id="slide6"> 
	 <title>Purpose of NDR</title> 
	 <list> 
		<item>Standard set of rules for describing NDR rules </item> 
		<item>Use of open standards when developing </item> 
		<item>NDRs Standard structured vocabulary for describing NDR rules
		  </item> 
	 </list> 
  </slide> 
  <slide id="slidedf"> 
	 <title>Interoperability Disaster</title> <figure id="figfallen"> 
	 <caption></caption><graphic name="graphics/FallingBridge.jpg"
	 alt="Falling Bridge" width="495" height="341"/></figure> 
	 <list role="incremental"> 
		<item>A 'paper' NDR does not provide a complete picture for
		  interoperability </item> 
		<item>A process to ensure interoperability of data models </item> 
		<item>We need a building process</item> 
	 </list> 
  </slide> 
  <slide id="slide12"> 
	 <title>Building Process</title> 
	 <list role="incremental"> 
		<item>Design the bridge </item> 
		<item>Test the design </item> 
		<item>Build the foundation </item> 
		<item>Assemble the structure </item> 
		<item>Test the bridge </item> 
		<item>Many components are standardized </item> 
		<item>Many standards are used</item> 
	 </list><figure align="right" id="fig-bridge"><caption></caption><graphic
	 name="graphics/Bridge.jpg" width="267" height="318" alt="Building the bridge"
	 align="right"/></figure> 
  </slide> 
  <slide id="slide985038220"> 
	 <title>Benefits of NDR Schema </title> 
	 <list> 
		<item>Enables exchange of NDR profiles between parties. </item> 
		<item>Facilitates import/export of NDR rules with QOD. </item> 
		<item>Can be developed using standard-based tools Is machine (computer)
		  readable </item> 
		<item>Multiple presentation methods for human visualization of rules
		  HTML/PDF/Excel, etc. </item> 
	 </list> 
  </slide> 
  <slide id="slide51"> 
	 <title>Organizations that Currently have NDR's</title> 
	 <para>Most organizations that are developing enterprise-wide XML develop an
		NDR. A few of the organizations that have created NDR's.</para> 
	 <list role="launch"> 
		<item><xlink
		  href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=ubl">Universal
		  Business Language</xlink></item> 
		<item><xlink
		  href="http://www.unece.org/cefact/xml/XML-Naming-and-Design-Rules-V2.0.pdf">UN/CEFACT</xlink></item>
		
		<item><xlink
		  href="http://www.niem.gov/files/NIEM-NDRno_lines.pdf">National Information
		  Exchange Model (NEIM)</xlink></item> 
		<item><xlink
		  href="https://collab.core.gov/adl/en-US/4430/File/3264/02%20DON%20XML%20Naming%20and%20Design%20Rules_Version%202.0%20Jan%2005.pdf">US
		  Department of Navy</xlink></item> 
		<item><xlink
		  href="http://www.yesser.gov.sa/documents%5CYEFI_XML_Schema_Naming_and_design_rules.doc">Saudi
		  Arabia Government</xlink></item> 
	 </list> 
  </slide></section><section id="methodologies"> 
  <title>Methodologies for Validating NDR</title> 
  <introduction id="met-intro"> 
	 <para>In this section we will briefly provide information about
		methodologies for validaint NDR's.</para> 
  </introduction> 
  	<slide id="slide13"> 
	 <title>Methodologies for Validating NDR</title> 
	 <para>The following methods can be used for validation of NDR.</para> 
	 <list> 
		<item>Human Analysis</item> 
		<item>Schematron Assertion Language</item> 
		<item>NIST Quality of Design (QOD) Tool</item> 
	 </list> 
  </slide> 
  	<slide id="slide14"> 
	 <title>Schematron</title> 
	 <list> 
		<item>ISO/IEC 19757-3 </item> 
		<item>XML schema language 
		  <list> 
			 <item>Rule based, not grammar based</item> 
		  </list> </item> 
		<item> Unlike DTD and XSD, Schematron supports natural language
		  assertions and invokes a query language 
		  <list> 
			 <item>Default query language is extended version of XPath 1.0
				specified in XSLT 1.0 </item> 
			 <item>Can be used with XPath 2.0, XSLT 2.0 </item> 
		  </list></item> 
	 </list> <note>Schematron can be used for business rules-based assertions
	 for any XML construct, not just XSD.</note> 
  </slide> 
  	<slide id="slide15"> 
	 <title>Schematron Advantages/Disadvantages</title> 
	 <list> 
		<header>Advantages</header> 
		<item>XML-native (based on XPath) </item> 
		<item>Rule-based </item> 
		<item>Can test for co-occurrence constraints </item> 
		<item>User-configurable diagnostic messages </item> 
		<item>ISO standard </item> 
		<item>Easy to combine with XSD or RELAX NG </item> 
	 </list> 
	 <list> 
		<header>Disadvantages</header> 
		<item> Less convenient than grammar-based schema languages for checking
		  document structure </item> 
		<item>XPath expertise required to write rules </item> 
	 </list> 
  </slide> 
  <slide id="slide7554"> 
	 <title>Quality of Design (QOD) Tool</title> 
	 <para>NIST created the Quality of Design (QOD) web application
		(<url>http://www.nist.gov/qod</url>) to address these barriers. QOD provides a
		mechanism for checking XML schema design quality against NDRs in a
		collaborative environment. Plans for the next version include better support
		for sharing and publication of rules with the intention of maintaining an
		extensive set of reusable test cases.</para> 
	 <para>NIST has developed a web-based application for validating NDR
		Rules.</para> 
	 <list> 
		<item>Import and export of rule collections into and from the QOD.
		  </item> 
		<item>The ability to publish NDR documentation from XML. </item> 
		<item>The ability to exchange NDR rule collections, including tests for
		  the rules.</item> 
		<item>The ability reo reuse rules that have test cases included.</item> 
		<item>A repository for managing collections of NDR rules.</item> 
	 </list><note>URL for QOD: <url>http://www.nist.gov/qod</url>.</note> 
  </slide> 
  	<slide id="slide16"> 
	 <title>QOD - Three Flavors</title> 
	 <list> 
		<item>Web-based hosted by NIST [Strawberry]</item> 
		<item>In-house web-based [Chocolate]</item> 
		<item>Standalone (single machine - not web interface) [Vanilla]</item> 
	 </list> 
  </slide> 
  	<slide id="slide17"> 
	 <title>QOD Test Cases</title> 
	 <para>QOD supports test cases encoded in either Schematron or JESS.</para> 
	 <list> 
		<item><vocabulary><word>Schematron</word><definition>An
		  <vocabulary><acronym>ISO</acronym><definition>
		  <xlink
			href="http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html">ISO/IEC
		  International Standard for Schematron</xlink> </definition>
		  </vocabulary>.</definition></vocabulary> 
		  <list> 
			 <item>Schematron 1.5</item> 
			 <item>ISO Schematron</item> 
		  </list></item> 
		<item><vocabulary><acronym>JESS</acronym><definition>Java Expert System
		  Shell</definition></vocabulary> -<url>http://www.jessrules.com/</url></item> 
	 </list> 
  </slide> 
  <slide id="slide2"> 
	 <title>Developing Test Cases In QOD</title> 
	 <para>QOD has two methods for adding test cases into QOD.</para> 
	 <list> 
		<item>Creating test cases directly using QOD user interface</item> 
		<item>Importing profiles into QOD from an XML schema conforming to the
		  NDR Profile Schema.</item> 
	 </list><figure id="testcase-fig"><caption>QOD Test Case
	 Interface</caption><graphic name="graphics/AddTestCase.jpg" width="584"
	 height="477" alt="Add Test Case Interface."/><graphic
	 name="graphics/AddTestCase2.jpg" width="589" height="482"
	 alt="Completed Test Case"/></figure> 
  </slide> 
  <slide id="slide9302771"> 
	 <title>QOD Status</title> 
	 <list> 
		<item>QOD currently at Version 1</item> 
		<item>Version 2 will be available soon. Many enhancements. 
		  <list> 
			 <item>More intuitive user interface</item> 
			 <item>Enhanced inheritance of components in the NDR Profile
				Schema.</item> 
		  </list></item> 
	 </list> 
  </slide> 
  	<slide  id="slide18"> 
	 <title>Where to Get QOD</title> 
	 <list> 
		<item>QOD use is open to the public at:
		  <url>http://www.nist.gov/qod</url></item> 
		<item>QOD can be downloaded for internal use on SourceForge:
		  <url>http://sourceforge.net/projects/qod/</url></item> 
		<item>Standalone version of QOD
		  <url>http://www.mel.nist.gov/msid/XML_testbed/QOD_Standalone.html</url></item> 
	 </list> 
  </slide> 
  	<slide id="slide19">
	 <title>QOD - Next Steps</title>
	 <list>
		<item>Version 2.0 expected to be available in late summer or early fall,
		  2009
		  <list>
			 <item>Enhanced functionality</item>
			 <item>Enhanced user interface</item>
			 <item>Support NDRProfile 2.0 Schema</item>
		  </list></item>
	 </list>
  </slide></section><section id="section458690822"> 
  <title>NDR Profile Exchange Schema</title> 
  <introduction id="NDRProfileintro"> 
	 <para>This section will provide information and structures of the
		NDRProfile Exchange Schema.</para> 
  </introduction> 
  	<slide  id="slide20"> 
	 <title>NDR Profile Schema Purpose</title> 
	 <list> 
		<item>Ability to import NDR rules into QOD</item> 
		<item>Ability to export NDR rules from QOD</item> 
		<item>Edit NDR Rules with standard XML authoring tools</item> 
		<item>Create new NDR Profiles from existing rules in QOD.</item> 
	 </list> 
  </slide> 
  <slide id="slide5062167"> 
	 <title>NDR Schema Model</title><figure id="ndrprofile-fig"> 
	 <caption>NDRProfile Data Model</caption><graphic name="graphics/NDRProfile.jpg"
	 width="362" height="305" alt="NDRProfile Data model"/></figure> 
	 <para><xlink type="internal" href="schema/NDRProfile-v2.xsd">Walk through
		the Schema</xlink></para> 
  </slide> 
  	<slide id="slide21"> 
	 <title>Guidance Data Model</title> 
	 <para>Every rule in an NDR that can be tested is required to have a
		separate &lt;guidance&gt; element.</para><figure id="Guidance-fig"> 
	 <caption>Guidance Data Model</caption><graphic name="graphics/Guidance.jpg"
	 width="436" height="1012" alt="Guidance Data Model"/></figure> 
  </slide> 
  	<slide  id="slide22"> 
	 <title>Guidance XML Example</title> 
	 <example>
	&lt;Guidance guidanceID="ELD2" documentationID="rule-ELD2" prefixNumber="2" prefixToken="ELD"&gt; 
		  &lt;OrganizationInformation&gt; 
			 &lt;OrganizationName&gt;Universal Business Language&lt;/OrganizationName&gt; 
			 &lt;OrganizationPrefix&gt;UBL&lt;/OrganizationPrefix&gt; 
		  &lt;/OrganizationInformation&gt; 
		  &lt;SourceNDR&gt; 
			 &lt;SourceName&gt;Local&lt;/SourceName&gt; 
			 &lt;SourceVersion&gt;2.0&lt;/SourceVersion&gt; 
		  &lt;/SourceNDR&gt; 
		  &lt;DerivedFrom&gt; 
			 &lt;SourceName&gt;UBL&lt;/SourceName&gt; 
			 &lt;SourceVersion&gt;1.0.1&lt;/SourceVersion&gt; 
			 &lt;SourceDate&gt;2004-11-05&lt;/SourceDate&gt; 
		  &lt;/DerivedFrom&gt; 
		  &lt;Testability&gt;Fully-Testable&lt;/Testability&gt;&lt;GuidanceText&gt; [ELD2] All element declarations MUST be global.
			 &lt;/GuidanceText&gt; 
		  &lt;TestCases&gt; 
			 &lt;TestCase ruleType="Schematron1.5" testCaseID="ELD2-1"&gt; 
				&lt;TestName&gt;ELD2&lt;/TestName&gt; 
				&lt;Script&gt;&lt;![CDATA[
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron"&gt;
        &lt;sch:ns uri="http://www.w3.org/3301/XMLSchema" prefix="xsd"/&gt;
        &lt;sch:pattern id="UBL-2.0-ELD-2"&gt;
            &lt;sch:rule context="*[(local-name(.) = 'sequence') and (namespace-uri(.) = 'http://www.w3.org/2001/XMLSchema')]"&gt;
                &lt;sch:report diagnostics="UBL-2.0-ELD-2d" test="not(element[@name])"&gt;
                    [ELD2] All element declarations MUST be global.&lt;/sch:report&gt;
            &lt;/sch:rule&gt;
            &lt;sch:rule context="*[(local-name(.) = 'choice') and (namespace-uri(.) = 'http://www.w3.org/2001/XMLSchema')]"&gt;
                &lt;sch:report diagnostics="UBL-2.0-ELD-2d" test="not(element[@name])"&gt;
                    [ELD2] All element declarations MUST be global.&lt;/sch:report&gt;
            &lt;/sch:rule&gt;
        &lt;/sch:pattern&gt;
        &lt;sch:diagnostics&gt;
            &lt;sch:diagnostic id="UBL-2.0-ELD-2d"&gt; .   
              Mixed content is not allowed in UBL schemas.&lt;/sch:diagnostic&gt;
        &lt;/sch:diagnostics&gt;
&lt;/sch:schema&gt;
                         ]]&gt;&lt;/Script&gt; 
			 &lt;/TestCase&gt; 
		  &lt;/TestCases&gt; 
		&lt;/Guidance&gt; 
</example>

  </slide></section> <section id="section2"> 
  <title>NDR Profile Authoring</title> 
  <introduction id="Authoring-intro"> 
	 <para>This section will provide information about how to develop NDR
		Profile documents (instances).</para> 
  </introduction> 
  <slide id="slide4780"> 
	 <title>NDR Profile Authoring with XML Editor</title> 
	 <para>The NDR Profile and can be developed using any native XML validating
		editors.</para> 
	 <list> 
		<item>XMetal, </item> 
		<item>Arbortext Editor</item> 
		<item>XML Spy</item> 
		<item>Oxygen</item> 
		<item>Syntext (now Open Source)</item> 
		<item>etc. </item> 
	 </list> 
	 <para>CSS and XSLT stylesheets have been developed that can be used by many
		XML Editor to provide Word-like interface in many tools. These are available on
		Source Forge.</para> 
  </slide> 
  <slide id="slide08449"> 
	 <title>Other Authoring Environments</title> 
	 <para>NIST has provided methods for developing/creating NDR Profile XML
		Exchange Documents conforming to the NDR Profile Schema </para> 
	 <list> 
		<item>Export from QOD XForms creation </item> 
		<item>Client Side 
		  <list> 
			 <item>Available on SourceForge</item> 
		  </list></item> 
		<item>Server Side – Orbeon XForms Server (prototype) 
		  <list> 
			 <item><url>http://www.eccnet.com:8080/XForms/ndr/</url></item> 
		  </list></item> 
		<item> Excel Spreadsheet Template 
		  <list> 
			 <item>XSLT transform from Excel to NDR Profile</item> 
			 <item>XSLT Available on SourceForce</item> 
		  </list> </item> 
	 </list> 
  </slide> 
  	<slide  id="slide23"> 
	 <title>More Information About NIST Tools</title> 
	 <para>The Manufacturing Interoperability Program (MIP) XML Testbed has been
		developed by NIST's Manufacturing Systems Integration Division in the
		Manufacturing Engineering Laboratory. They have developed a number of tools to
		support system integration. Information about the tools can be found at:
		<url>http://www.mel.nist.gov/msid/XML_testbed/tools.html</url></para> 
	 <list role="launch"> 
		<item>Content Checker and QOD
		  <url>http://www.mel.nist.gov/msid/XML_testbed/</url></item> 
		<item>NDRProfile <url>http://qod.sourceforge.net/ndrprofile/</url></item>
		
		<item>Constraint Generator and QOD Standalone
		  <url>http://www.mel.nist.gov/msid/XML_testbed/QOD_Standalone.html</url></item> 
	 </list> 
  </slide> 
  <slide id="slide15795314"> 
	 <title>QOD Demo</title> 
	 <para>Demo of QOD</para> 
	 <para><xlink
		href="http://www.mel.nist.gov/msid/XML_testbed/QOD.html">http://www.mel.nist.gov/msid/XML_testbed/QOD.html</xlink></para>
	 
  </slide></section>
</training-material></training>

