This chapter introduces schema definitions, which InterSystems IRIS® uses to validate virtual documents (and to access data in them, as discussed in the chapter “Virtual Property Paths”).
Introduction to Schema Definitions
Because a virtual document is not represented as an object (with a corresponding class definition), InterSystems IRIS requires additional tools to parse and validate the virtual document. These tools start with schema definitions.
An InterSystems IRIS schema definition is a set of descriptions that represent a specific EDI standard or an XML schema. A schema definition is an InterSystems IRIS concept, not to be confused with other concepts such as a database schema or XML schema. It is, however, based on the corresponding EDI or XML schema.
Schema definitions are specific to a given interoperability-enabled namespace and are stored in the InterSystems IRIS database for that namespace.
Each schema definition provides InterSystems IRIS with a complete view of an EDI standard (or of an XML schema). There is one schema definition for X12, for example. In practical terms, a schema definition may contain only a subset of the standard in question; this depends on how the corresponding EDI schema was imported into InterSystems IRIS.
In a schema definition, a schema category is a grouping convention. Each schema definition contains one or more schema categories.
In a schema definition, each schema category contains one or more document structures. Each document structure describes one type of document.
Depending on the EDI standard, InterSystems IRIS uses different approaches to organize a schema definition into schema categories and document structures. For example, for X12, a schema definition has a flatter organization, commonly with only one document structure per schema category:
Document Types (DocType)
Each virtual document has a document type, often simply called DocType (which is the name of the property that stores this information). This corresponds to a specific part of a schema definition, the part that describes the expected structure of and values in this virtual document. The DocType enables InterSystems IRIS to validate and parse that virtual document.
The DocType for a virtual document is identified by a combination of the schema category and document structure. Specifically, the syntax for the DocType property is as follows:
category is the name of a schema category.
structure is the name of a document structure within the referenced category. This piece is always required, even if the schema category has only one document structure.
The Management Portal provides the Schema Structures page, where you can import EDI or XML schemas (thus creating schema definitions), export schemas, and browse schema definitions. See “Portal Tools,” later in this book.