IVOA

XML Schemas for Resource Metadata: a Tutorial
Version 1.0

IVOA Note 27 November 2003

This version:
http://www.ivoa.net/Documents/Note/XML-RM/XML-RM-20031125.html
Latest version:
http://www.ivoa.net/Documents/Note/XML-RM/XML-RM-20031125.html
Previous versions:
none
Author:
Raymond Plante

Abstract

This document provides a tutorial view of the XML Resource Metadata schemas. VOResource represents the core set of metadta used for describing generic resources and services. Other schemas are extensions of this core which are used to describe speicific types of resources. While the schemas have been designed to accomadate a variety of applications, the most common use of the resource metadata is in communications with registries; thus, we discuss common practices for describing resources in the context of registries.

Status of this document

This is a Note. The first release of this document was 25 November 2003.

This is an IVOA Note expressing suggestions from and opinions of the authors. It is intended to share best practices, possible approaches, or other perspectives on interoperability with the Virtual Observatory. It should not be referenced or otherwise interpreted as a standard specification. A list of current IVOA Recommendations and other technical documents can be found at http://www.ivoa.net/Documents/.

Acknowledgements

This document has been developed with support from the National Science Foundation's Information Technology Research Program under Cooperative Agreement AST0122449 with The Johns Hopkins University, and from the UK Particle Physics and Astronomy Research Council (PPARC).

Prerequisites

A major goal of this document is to enable the reader to create compliant XML descriptions using the VOResource metadata. This document attempts to assume that the reader has a good understanding of XML basics but only a beginner's understanding of XML Schema. In particular, the reader should understand how to create well-formed XML. Experience using object-oriented languages and common XML technologies, such as DOM and SAX parsers, XPath, XSLT, and software binding tools, are helpful for understanding why the schemas are designed the way they are, but they should not be required in order to create compliant VOResource metadata. Some moderately advanced topics related to XML Schema (e.g. namespaces) are briefly reviewed in Appendix B; readers can consult them as necessary via links in the main text of this note.

Contents


1. Introduction

The VOResource family of XML Schemas are based on the IVOA Proposed Recommendation, "Resource Metadata" (Hanisch et al. 2003, hereafter RM), and thus are designed to describe resources. The metadata are most commonly used for passing descriptions of resources to and from IVOA registries. This document is intended as a primer for developers and data providers who wish to create resource descriptions. This introduction is intended to provide a general overview of the structure of the schemas and to explain a bit about why they are structured the way they are.

Note:
While the XML Schemas are based on the RM document, they are differences. In particular:

  • Some terms defined in RM may not (yet) appear in the VOResource family of schemas.
  • Not all metadata term names are identical.

The reason for this difference is that RM makes no assumptions about the restrictions or capabilities of the encoding format (e.g. XML, FITS, Java properties, etc.) used; RM recognizes that it may be appropriate to alter the names when adapting to a particular format. In the case of XML, the schemas take advantage of the hierarchical, object-oriented data model; in some cases, names have been altered to reflect this model. Regardless, the definitions for the concepts described in both are identical.

The RM document is intended primarily for schema developers: those interested in mapping the metadata terms into new metadata formats, or those who wish to propose modifications to the schema. VOResource users should prefer this document for information on creating and handling XML descriptions.

1.1. Files and Namespaces

The first thing you will notice about the metadata is that they are defined in several XML Schema definition (or XSD) files: VOResource represents the core metadata that applies generically to all resources. The others are extensions of the core metadata; they define specific types of resources, such as Organisations and Registries.

Each of the above schemas are defined within their own namespace, separating the metadata into logical sub-sets. This is done for three reasons:

The extension schemas draw on the concepts defined in the core VOResource, reusing elements and types where appropriate. They do this by importing the core VOResource schema; thus, if you are using the VOCommunity schema, you are also using the core VOResource schema. As you might guess from above, namespaces, are critical to metadata framework. It has an affect on how you create your XML instances (more on that below).

There are some additional files you should now about. Two of the schemas above have associated files that they include (much like a software source file includes an "include" file):

VOResource:
VOResourceRelType.xsd and VOResourceRelType-v0.2.xsd -- defines relationship types.
VODataService:
VODataServiceCoverage.xsd and VODataServiceCoverage-v0.2.xsd: defines coverage metadata.
The contents of these files could have been put directly into their parent XSD file; however, they were separated out because the definitions they contain are expected to be the most volatile part of the schema. For example, VOResourceRelType-v0.2.xsd defines types of resource relationships (e.g. "mirror-of", "derived-from"). If we later add a new relationship type, the core VOResource schema is not affected, nor are any XML instances that previously conformed to VOResource. The essential difference between importing and including is in that the namespace of the included definitions is the same as for the file that does the including.

1.2. A Sample Instance

Now let's look at an example. Below is a minimal description of an Organisation--minimal in that the Organisation element contains the minimum amount of information required by the Schemas.
    <?xml version="1.0" encoding="UTF-8"?>
1   <VOResource xmlns="http://www.ivoa.net/xml/VOResource/v0.9"
                xmlns:vc="http://www.ivoa.net/xml/VOCommunity/v0.2"
                xmlns:vr="http://www.ivoa.net/xml/VOResource/v0.9">

      <!-- A minimal example description of an organisation -->
2     <vc:Organisation>
3       <Identifier>
          <AuthorityID>NCSA.Astro</AuthorityID>
          <ResourceKey>RAI</ResourceKey>
        </Identifier>
        <Title>NCSA Radio Astronomy Imaging Group</Title>
        <Summary>
          <Description>
            The Radio Astronomy Imaging Group is focused on applying
            high-performance computing to astronomical research.  Our
            projects include the NCSA Astronomy Digital Image Library, 
            the BIMA Data Archive, the BIMA Image Pipeline, and AIPS++.  
          </Description>
          <ReferenceURL>http://rai.ncsa.uiuc.edu/</ReferenceURL>
        </Summary>
4       <Curation>
          <Publisher>
             <Title>NCSA Radio Astronomy Imaging</Title>
          </Publisher>
          <Contact>
             <Name>Dr. Raymond Plante</Name>
          </Contact>
        </Curation>
5     </vc:Organisation>
    </VOResource>
The first thing you might notice in this example (if you are reading this on-line) is that all the element names are highlighted as links. Following one of these links will take you to a definition of the term in a hypertext metadata dictionary. These links are used throughout this document.

Now let's look at a few things in detail:

  1. In this example, the root element of the document is VOResource which is used to hold a description of a single resource.

    As the root element, we include in it a declaration of the schemas that are used to validate the document using the xmlns attribute. The first use declares all elements without a namespace prefix belong to the VOResource schema, identified by the schema's namespace URI. The second attribute says that elements with the "vc" namespace prefix belongs to the VOCommunity schema. The third associates "vr" with our default namespace. Our example doesn't actually use "vr", but its a good habit to include it anyway for cases when we do need it.

    Note that for IVOA schemas, the namespace URIs resolve to the actual XML Schema document. This is not required by the XML Schema standard; however, many parsers will use the URL to get the schema by default. More about retrieving schemas is discussed in the section, Using Namespaces.

  2. The child of a VOResource element

1.3. Which Element should be the Document Root?

The short answer to this question is, any element you wish.

Most elements in the VOResource family of schemas can be used as a root element, by virtue of being defined as global elements. Which element "should" be the root is completely a choice of the application. This allows the schema to be used in many different ways. For example, a Web Service may wish simply to pass only contact information and, thus, use Contact as the root element.

Registry applications generally use either VOResource or VODescription as the root element.

1.4. Using Namespaces

1.5. Resource Classes: Metadata Inheritance using Substitution Groups

Appendix A. Metadata Dictionaries

Metadata dictionaries are created on-the-fly from the XML Schema documents, and serve as a reference manual for all elements and types defined in the schema. Below are links to the dictionaries for each of the schemas described in this document. They are all cross-linked for ease of browsing.

Metadata Dictionaries:
Schema Name Prefix* Namespace identifier
VOResource (v0.9) vr http://www.ivoa.net/xml/VOResource/v0.9
VOCommunity (v0.2) vc http://www.ivoa.net/xml/VOCommunity/v0.2
VORegistry (v0.2) vg http://www.ivoa.net/xml/VORegistry/v0.2
VODataService (v0.4) vc http://www.ivoa.net/xml/VODataService/v0.4
ConeSearch (v0.2) cs http://www.ivoa.net/xml/ConeSearch/v0.2
SIA (v0.4) sia http://www.ivoa.net/xml/SIA/v0.6
*the commonly-used namespace prefix; use of this prefix is not required.

Element Index: Click on the name to see element description.
vs:Access vr:AccessURL vs:AllSky
vg:Authority vr:AuthorityID vr:Capability
vs:CenterPosition vs:CircleRegion vs:Column
cs:ConeSearch vr:Contact vr:ContentLevel
vr:Contributor vs:CoordFrame vs:CoordRange
vs:Coverage vr:Creator vr:Curation
vs:DataCollection vs:DataType vr:Date
vr:Description vr:Email vs:EndTime
vr:Facility vs:Format vs:HTTPResults
vr:Identifier sia:ImageServiceType vr:Instrument
vr:Interface vr:Invocation vr:LogicalIdentifier
vr:Logo vg:ManagedAuthority vg:ManagingOrg
sia:MaxFileSize sia:MaxImageExtent sia:MaxImageSize
sia:MaxQueryRegionSize cs:MaxRecords sia:MaxRecords
cs:MaxSR vr:Name vc:Organisation
vs:Param vs:ParamHTTP vc:Project
vr:Publisher vr:ReferenceURL vs:Region
vs:RegionOfRegard vg:Registry vr:RelatedResource
vr:RelatedTo vr:Relationship vr:Resource
vr:ResourceKey vs:Rights vr:Service
vr:ShortName sia:SimpleImageAccess vs:SkyService
vr:Source vs:Spatial vs:SpatialResolution
vs:Spectral vs:SpectralResolution vr:StandardID
vr:StandardURL vs:StartTime vr:Subject
vr:Summary vs:Table vs:TabularSkyService
vs:Temporal vs:TemporalResolution vr:Title
vr:Type vs:UCD vs:Unit
vr:VODescription vr:VOResource vs:VOTableColumns
cs:Verbosity vr:Version vs:Waveband
vs:WavelengthRange

Appendix C: Changes from v0.1

References

[Hanish et al. 2003]
Hanisch, Robert (ed.) 2003. Resource Metadata for the Virtual Observatory, IVOA Working Draft, http://www.ivoa.net/Documents/WD/WD-RM.htm

Last modified: Tue Mar 2 15:19:53 2004