SlideShare a Scribd company logo
1 of 31
MEDIN Standards Workshop

 Standards / XML / Validation /
    Transformation / ESRI
Introduction

– XML
– Schema and Validation
  • XSD Schema
  • Schematron
– Transformation
  • Stylesheets
– ESRI ArcGIS
– Search
XML
XML

•Extensible Markup Language (XML)
   – A metamarkup language
   – The basic unit is called an element
                             Element


  <tag attribute="attribute value">element value</tag>

                 Attribute
Opening tag                                     Closing tag


    – Apparently similar to HTML but…
Metamarkup?

•What does metamarkup mean?
  – There is no predefined and fixed set of tags
    for XML
  – XML allows implementers to define their
    own set of tags to meet their needs
Examples
 • Office Open XML (ISO/IEC 29500)
 • Geography Markup Language (ISO 19136)
Markup – ESRI ArcGIS 10 XML
<idCitation>
  <resTitle>Title</resTitle>
  <date>
    <createDate>20110906</createDate>
  </date>
</idCitation>
Markup – ISO 19139 XML
<gmd:citation>
  <gmd:CI_Citation>
    <gmd:title>
<gco:CharacterString>Title</gco:CharacterString>
    </gmd:title>
    <gmd:date>
      <gmd:CI_Date>
        <gmd:date>
          <gco:Date>2011-09-06</gco:Date>
        </gmd:date>
        <gmd:dateType>
          <gmd:CI_DateTypeCode
codeList="...#CI_DateTypeCode"
codeListValue="creation">creation</gmd:CI_DateTypeCode>
        </gmd:dateType>
      </gmd:CI_Date>
    </gmd:date>
  </gmd:CI_Citation>
</gmd:citation>
Well-Formed

•XML has strict rules, e.g.:
  – There must be one, and only one root
    element
  – All elements must have an opening
    and closing tag
  – Element names are case sensitive:
     • <citation/> is different from <Citation/>


  – XML conforming to the rules is said to
    be well-formed
Well-Formed
             <idCitation>
               <resTitle>Title</resTitle>
               <date>
                 <createDate>20110906</createDate>
               </date>
             </idCitation>



                  <idCitation>                        Opening and closing tags
                    <resTitle>Title</ResTitle>        are different
                    <date>
Two root elements     <createDate>20110906       No closing tag
                    </date>
                  </idCitation>
                  <idPurp>Summary</idPurp>
Structure

•The markup defines data structure:
   – It signifies which elements are
     associated
   – It can define semantics:
   <date>
       <createDate>20110906</createDate>
   </date>



  – It says nothing about how to display
    data (there are exceptions to this rule)
XML is machine readable

•And…
  – Human readable… honestly
Schema and Validation
Schema

•Schemas document the elements that are
permitted in an XML application
   – XML that conforms to a schema is said
     to be schema-valid
   – XML that does not conform to a
     schema is said to be invalid
XML Schema Definition Language
<xs:complexType name="CI_Citation_Type">
  ...
  <xs:complexContent>
    <xs:extension base="gco:AbstractObject_Type">
      <xs:sequence>
        <xs:element name="title"
                     type="gco:CharacterString_PropertyType"/>
        <xs:element name="alternateTitle"
                     type="gco:CharacterString_PropertyType"
                     minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="date"
                     type="gmd:CI_Date_PropertyType"
                     maxOccurs="unbounded"/>
        ...
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
Markup – ISO 19139 XML
<gmd:citation>
  <gmd:CI_Citation>
    <gmd:title>
<gco:CharacterString>Title</gco:CharacterString>
    </gmd:title>
    <gmd:date>
      <gmd:CI_Date>
        <gmd:date>
          <gco:Date>2011-09-06</gco:Date>
        </gmd:date>
        <gmd:dateType>
          <gmd:CI_DateTypeCode
codeList="...#CI_DateTypeCode"
codeListValue="creation">creation</gmd:CI_DateTypeCode>
        </gmd:dateType>
      </gmd:CI_Date>
    </gmd:date>
  </gmd:CI_Citation>
</gmd:citation>
Schematron

•Schematron is:
   – A schema language for XML
     • Document Schema Definition Language
       (DSDL)
  – Written in XML
  – It’s an ISO Standard – ISO 19757-3

  Find out more at: http://www.schematron.com/
Why use Schematron?
•XSD schema is unable to test some
constraints:
   – The ability to specify a choice of
     attributes
   – The ability to vary the content model
     based on the value of an element or
     attribute (this sort of constraint is
     common in the ISO 19115 logical
     model)
•Implementing profiles (e.g. MEDIN):
   – With Schematron there’s no need to
     edit the underlying standardised XSD
Validation Workflow

   XSD Schema Validation



                           Schematron Validation
Validation Tools
Select profile




XSD Schema



 Schematron
 schemas
Transformation
XSLT

•Extensible Stylesheet Language
Transformations (XSLT)
   – Specifies rules for transforming one
     XML instance into another XML
     instance
   – The output XML instance will have a
     different structure from the input XML
     instance
ESRI XML to MEDIN XML
•MEDIN XML must be follow the ISO 19139 XML
encoding
   – Users may wish to use other software to
     create and manage metadata (e.g. ESRI
     desktop GIS)
   – ESRI software manages metadata using XML
   – The XML does not following the ISO 19139
     standard
   – The XML can be transformed to ISO 19139
   – MEDIN provides resources to support this
Stylesheet Tools
ESRI ArcGIS
Versions

•ArcGIS 9
   – FGDC / ISO

•ArcGIS 10
   – ESRI Core Metadata

  – Both use XML encoding
  – The encodings are slightly different
  – Why the change at version 10?
ESRI ArcCatalog – Options
ESRI ArcCatalog
Transformation
e.g. Internal use                         e.g. External / Publish to DAC


ArcGIS 9 Metadata




                         Transformation      MEDIN Metadata




ArcGIS 10 Metadata
Transform Options

•Use MEDIN stylesheets
   – ArcGIS 9 version
   – ArcGIS 10 version (or the Validate
     button)
•Implementation
   – Any XSL stylesheet processor
     (version1.0), e.g:
     • ArcGIS 9 or 10 ArcToolBox
     • Metadata Maestro

More Related Content

What's hot

What's hot (14)

Xsd examples
Xsd examplesXsd examples
Xsd examples
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
 
XML DTD and Schema
XML DTD and SchemaXML DTD and Schema
XML DTD and Schema
 
XSD
XSDXSD
XSD
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlXml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5
 
4 wordprocessing ml subject - custom markup
4   wordprocessing ml subject - custom markup4   wordprocessing ml subject - custom markup
4 wordprocessing ml subject - custom markup
 
fundamentals of XML
fundamentals of XMLfundamentals of XML
fundamentals of XML
 
XML Schema
XML SchemaXML Schema
XML Schema
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
The Document Object Model
The Document Object ModelThe Document Object Model
The Document Object Model
 
Week 12 CSS - Review from last week
Week 12 CSS - Review from last weekWeek 12 CSS - Review from last week
Week 12 CSS - Review from last week
 

Similar to Standards / XML / Validation / Transformation / ESRI

Similar to Standards / XML / Validation / Transformation / ESRI (20)

XML-athon with Don and Dean
XML-athon with Don and DeanXML-athon with Don and Dean
XML-athon with Don and Dean
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
XML introduction and Uses of XML in JSBSim
XML introduction and Uses of XML in JSBSimXML introduction and Uses of XML in JSBSim
XML introduction and Uses of XML in JSBSim
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml schema
Xml schemaXml schema
Xml schema
 
Xml schema
Xml schemaXml schema
Xml schema
 
NAPSG 2010 Fire/EMS Conference - Data Sharing Basics
NAPSG 2010 Fire/EMS Conference - Data Sharing BasicsNAPSG 2010 Fire/EMS Conference - Data Sharing Basics
NAPSG 2010 Fire/EMS Conference - Data Sharing Basics
 
Xsd
XsdXsd
Xsd
 
Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)
Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)
Rebuilding Solr 6 examples - layer by layer (LuceneSolrRevolution 2016)
 
Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 
Xsd Basics R&D with ORACLE SOA
Xsd Basics R&D with ORACLE SOAXsd Basics R&D with ORACLE SOA
Xsd Basics R&D with ORACLE SOA
 
Xsd basics
Xsd basicsXsd basics
Xsd basics
 
23xml
23xml23xml
23xml
 
Mazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml ToolsMazda Use of Third Generation Xml Tools
Mazda Use of Third Generation Xml Tools
 
Relational data as_xml
Relational data as_xmlRelational data as_xml
Relational data as_xml
 
Apache MetaModel - unified access to all your data points
Apache MetaModel - unified access to all your data pointsApache MetaModel - unified access to all your data points
Apache MetaModel - unified access to all your data points
 

More from Marine Environmental Data and Information Network (MEDIN) (7)

MEDIN Achievements 2016
MEDIN Achievements 2016MEDIN Achievements 2016
MEDIN Achievements 2016
 
MEDIN Achievements 2015
MEDIN Achievements 2015MEDIN Achievements 2015
MEDIN Achievements 2015
 
MEDIN Discovery Metadata Standard
MEDIN Discovery Metadata StandardMEDIN Discovery Metadata Standard
MEDIN Discovery Metadata Standard
 
Controlled Vocabularies
Controlled VocabulariesControlled Vocabularies
Controlled Vocabularies
 
Metadata Maestro
Metadata MaestroMetadata Maestro
Metadata Maestro
 
MEDIN data guidelines
MEDIN data guidelinesMEDIN data guidelines
MEDIN data guidelines
 
MEDIN introduction
MEDIN introductionMEDIN introduction
MEDIN introduction
 

Standards / XML / Validation / Transformation / ESRI

  • 1. MEDIN Standards Workshop Standards / XML / Validation / Transformation / ESRI
  • 2. Introduction – XML – Schema and Validation • XSD Schema • Schematron – Transformation • Stylesheets – ESRI ArcGIS – Search
  • 3. XML
  • 4. XML •Extensible Markup Language (XML) – A metamarkup language – The basic unit is called an element Element <tag attribute="attribute value">element value</tag> Attribute Opening tag Closing tag – Apparently similar to HTML but…
  • 5. Metamarkup? •What does metamarkup mean? – There is no predefined and fixed set of tags for XML – XML allows implementers to define their own set of tags to meet their needs Examples • Office Open XML (ISO/IEC 29500) • Geography Markup Language (ISO 19136)
  • 6. Markup – ESRI ArcGIS 10 XML <idCitation> <resTitle>Title</resTitle> <date> <createDate>20110906</createDate> </date> </idCitation>
  • 7. Markup – ISO 19139 XML <gmd:citation> <gmd:CI_Citation> <gmd:title> <gco:CharacterString>Title</gco:CharacterString> </gmd:title> <gmd:date> <gmd:CI_Date> <gmd:date> <gco:Date>2011-09-06</gco:Date> </gmd:date> <gmd:dateType> <gmd:CI_DateTypeCode codeList="...#CI_DateTypeCode" codeListValue="creation">creation</gmd:CI_DateTypeCode> </gmd:dateType> </gmd:CI_Date> </gmd:date> </gmd:CI_Citation> </gmd:citation>
  • 8. Well-Formed •XML has strict rules, e.g.: – There must be one, and only one root element – All elements must have an opening and closing tag – Element names are case sensitive: • <citation/> is different from <Citation/> – XML conforming to the rules is said to be well-formed
  • 9. Well-Formed <idCitation> <resTitle>Title</resTitle> <date> <createDate>20110906</createDate> </date> </idCitation> <idCitation> Opening and closing tags <resTitle>Title</ResTitle> are different <date> Two root elements <createDate>20110906 No closing tag </date> </idCitation> <idPurp>Summary</idPurp>
  • 10. Structure •The markup defines data structure: – It signifies which elements are associated – It can define semantics: <date> <createDate>20110906</createDate> </date> – It says nothing about how to display data (there are exceptions to this rule)
  • 11. XML is machine readable •And… – Human readable… honestly
  • 12.
  • 14. Schema •Schemas document the elements that are permitted in an XML application – XML that conforms to a schema is said to be schema-valid – XML that does not conform to a schema is said to be invalid
  • 15. XML Schema Definition Language <xs:complexType name="CI_Citation_Type"> ... <xs:complexContent> <xs:extension base="gco:AbstractObject_Type"> <xs:sequence> <xs:element name="title" type="gco:CharacterString_PropertyType"/> <xs:element name="alternateTitle" type="gco:CharacterString_PropertyType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="date" type="gmd:CI_Date_PropertyType" maxOccurs="unbounded"/> ... </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
  • 16. Markup – ISO 19139 XML <gmd:citation> <gmd:CI_Citation> <gmd:title> <gco:CharacterString>Title</gco:CharacterString> </gmd:title> <gmd:date> <gmd:CI_Date> <gmd:date> <gco:Date>2011-09-06</gco:Date> </gmd:date> <gmd:dateType> <gmd:CI_DateTypeCode codeList="...#CI_DateTypeCode" codeListValue="creation">creation</gmd:CI_DateTypeCode> </gmd:dateType> </gmd:CI_Date> </gmd:date> </gmd:CI_Citation> </gmd:citation>
  • 17. Schematron •Schematron is: – A schema language for XML • Document Schema Definition Language (DSDL) – Written in XML – It’s an ISO Standard – ISO 19757-3 Find out more at: http://www.schematron.com/
  • 18. Why use Schematron? •XSD schema is unable to test some constraints: – The ability to specify a choice of attributes – The ability to vary the content model based on the value of an element or attribute (this sort of constraint is common in the ISO 19115 logical model) •Implementing profiles (e.g. MEDIN): – With Schematron there’s no need to edit the underlying standardised XSD
  • 19.
  • 20. Validation Workflow XSD Schema Validation Schematron Validation
  • 21. Validation Tools Select profile XSD Schema Schematron schemas
  • 23. XSLT •Extensible Stylesheet Language Transformations (XSLT) – Specifies rules for transforming one XML instance into another XML instance – The output XML instance will have a different structure from the input XML instance
  • 24. ESRI XML to MEDIN XML •MEDIN XML must be follow the ISO 19139 XML encoding – Users may wish to use other software to create and manage metadata (e.g. ESRI desktop GIS) – ESRI software manages metadata using XML – The XML does not following the ISO 19139 standard – The XML can be transformed to ISO 19139 – MEDIN provides resources to support this
  • 27. Versions •ArcGIS 9 – FGDC / ISO •ArcGIS 10 – ESRI Core Metadata – Both use XML encoding – The encodings are slightly different – Why the change at version 10?
  • 30. Transformation e.g. Internal use e.g. External / Publish to DAC ArcGIS 9 Metadata Transformation MEDIN Metadata ArcGIS 10 Metadata
  • 31. Transform Options •Use MEDIN stylesheets – ArcGIS 9 version – ArcGIS 10 version (or the Validate button) •Implementation – Any XSL stylesheet processor (version1.0), e.g: • ArcGIS 9 or 10 ArcToolBox • Metadata Maestro

Editor's Notes

  1. XML is a metamarkup language (explained later) The example shows an XML element, with a start and end tag, its value (the text “element value”), an attribute and its value (the text “attribute value”).
  2. XML describes a means for marking up information. It does not provide a predefined set of tags for all users. In this sense it is a meta markup language. Instead, implementers are free to define their own set of tags.
  3. This is an example from ESRI ArcGIS 10 metadata. idCitation is an element that contains other elements.
  4. This is an example of the same data encoded according to ISO 19139.
  5. The top example is well-formed XML. The second example is not well-formed. The following errors exist: There’s more than one root element (idCitation and idPurp) The start and end tag name of resTitle are different (ResTitle is considered different because of the character case) The element createDate has no closing tag
  6. The XML here encodes a date, and specifically a creation date. This is expressed in the markup.
  7. Some real XML
  8. This is a sample from an XSD schema – actually from ISO 19139. The first thing to note is that it is encoded in XML.
  9. This XML conforms to the previous XSD schema snippet.
  10. Schematron is another type of schema language for XML. It is written in XML too. It’s an ISO standard – ISO 19757-3 (this is not one of the ISO / TC 211 standards).
  11. XSD schema is unable to perform certain tests that are necessary to validate ISO 19115 metadata. Schematron plugs the gap.
  12. ISO 19115 contains constraints which can not be tested with XSD schema. They can be tested with Schematron.
  13. The overall validation process looks like this – for metadata.
  14. MEDIN provides applications, such as Metadata Maestro, that implement all the necessary validation steps. This is a screen shot from the validation application of Metadata Maestro.
  15. MEDIN provides applications, such as Metadata Maestro, which provide a means of applying XSL Stylesheets (version 1.0) to XML.
  16. At version 10 of ESR ArcGIS there has been a change in the metadata encoding. It has been consolidated because ESRI need to support a range of different profiles. More information can be found at: http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2011/01/03/A-new-approach-for-Metadata-with-ArcGIS-10.aspx
  17. A screenshot of ESRI ArcCatalog. Users can select the metadata style – which includes INSPIRE metadata. Note that, no matter which style is selected, the metadata are still encoded according to the ESRI core metadata encoding. The style selected in options controls how metadata are imported and exported.
  18. The metadata editing interface of ArcCatalog: A table of contents – select sections of metadata to edit – includes common names recognisable from ISO 19115 The data entry fields and controls Context help is displayed for data entry controls when they have focus Metadata can be saved
  19. It’s necessary to apply an XSL stylesheet to transform from ESRI metadata to MEDIN metadata. MEDIN supplies stylesheets for this purpose. There’s one for ArcGIS version 9 and one for ArcGIS version 10. You can also use the Validate button in Arc 10.1 to do this.
  20. Stylesheets can be implemented using Metadata Maestro or the ArcGIS 9 or 10 ArcToolBox