This document specifies the data model, XML Schema components, and XML data for use with the National Information Exchange Model (NIEM) version 4.0.
Webb Roberts, Georgia Tech Research Institute (<webb.roberts@gtri.gatech.edu>), Lead Author
This document is a draft of the specification for XML Schema documents, components, and instances for use with NIEM 4. It presents a technical architecture that has evolved through the collaborative work of the NIEM Business Architecture Committee (NBAC), the NIEM Technical Architecture Committee (NTAC), and their predecessors.
This specification is a product of the NIEM Program Management Office (PMO).
Updates, revisions, and errata for this specification are posted to https://github.com/NIEM/NIEM-NDR. Please submit comments on this specification as issues at https://github.com/NIEM/NIEM-NDR/issues.
Representationpattern
nc:Activity
j:CrashDriver
, modeling the role of a driver in a crashj:CrashDriverType
, modeling a driver involved in a crashnc:RoleOfPerson
nc:PersonType
nc:PersonAugmentationPoint
appinfo:appliesToTypes
Representationpattern
structures:id
and structures:ref
structures:uri
holding an absolute URIstructures:uri
holding a relative URI, with an xml:base
structures:uri
holding a fragmentstructures:uri
, structures:id
, and structures:ref
identifying the same object.This Naming and Design Rules (NDR) document specifies XML Schema documents for use with the National Information Exchange Model (NIEM). NIEM is an information sharing framework based on the World Wide Web Consortium (W3C) Extensible Markup Language (XML) Schema standard. In February 2005, the U.S. Departments of Justice (DOJ) and Homeland Security (DHS) signed a cooperative agreement to jointly develop NIEM by leveraging and expanding the Global Justice XML Data Model (GJXDM) into multiple domains.
NIEM is a product of a combined government and industry effort to improve information interoperability and exchange within the United States at federal, state, tribal, and local levels of government. NIEM may have started in the U.S., but its reach does not stop there. International governments and private sector organizations can benefit from the value of NIEM, as well. Communities in Europe, North America, and Australia already use NIEM for their information exchange efforts. NIEM 4.0 represents an initial step toward evolving NIEM to support a more-global exchange environment
NIEM specifies a set of reusable information components for defining standard information exchange messages, transactions, and documents on a large scale: across multiple communities of interest and lines of business. These reusable components are rendered in XML Schema documents as type, element, and attribute declarations that comply with the W3C XML Schema specification. The resulting reference schemas are available to government practitioners and developers at http://niem.gov/.
The W3C XML Schema standard enables information interoperability and sharing by providing a common language for describing data precisely. The constructs it defines are basic metadata building blocks — baseline data types and structural components. Developers employ these building blocks to describe their own domain-oriented data semantics and structures, as well as structures for specific information exchanges and components for reuse across multiple information exchanges. Rules that profile allowable XML Schema constructs and describe how to use them help ensure that those components are consistent and reusable.
This document specifies principles and enforceable rules for NIEM data components and schemas. Schemas and components that obey the rules set forth here are considered to be conformant to specific conformance targets. These targets are defined in order that they may be leveraged for comprehensive definitions of NIEM conformance. Such definitions may include more than the level of conformance defined by this NDR, and may include specific patterns of use, additional quality criteria, and requirements to reuse NIEM release schemas.
This document was developed to specify NIEM 4.0. Later releases of NIEM may be specified by later versions of this document. The document covers the following issues in depth:
This document does NOT address the following:
A formal definition of the NIEM data model.
Such a definition would focus on the Resource Definition Framework (RDF) and concepts not strictly required for interoperability. This document instead focuses on definition of schemas that work with the data model, to ensure translatability and interoperability.
This document is intended as a technical specification. It is not intended to be a tutorial or a user guide.
This document targets practitioners and developers who employ NIEM for information exchange and interoperability. Such information exchanges may be between organizations or within an organization. The NIEM reference schemas provide system implementers much content on which to build specific exchanges. However, there is a need for extended and additional content. The purpose of this document is to define the rules for such new content, so that it will be consistent with the NIEM reference schemas. These rules are intended to establish and, more importantly, enforce a degree of standardization across a broad set of users.
This document uses formatting and syntactic conventions to clarify meaning and avoid ambiguity.
This document relies on references to many outside documents. Such references are noted by bold, bracketed inline terms. For example, a reference to RFC 3986 is shown as [RFC 3986]. All reference documents are recorded in Appendix A, References, below.
This document uses both Clark notation and QName notation to represent qualified names.
QName notation is defined by [XML Namespaces] Section 4, Qualified Names. A QName for the XML Schema string datatype is xs:string
. Namespace prefixes used within this specification are listed in Section 2.3, Use of namespaces and namespace prefixes, below.
This document sometimes uses Clark notation to represent qualified names in normative text. Clark notation is described by [ClarkNS], and provides the information in a QName without the need to first define a namespace prefix, and then to reference that namespace prefix. A Clark notation representation for the qualified name for the XML Schema string datatype is {http://www.w3.org/2001/XMLSchema}string
.
Each Clark notation value usually consists of a namespace URI surrounded by curly braces, concatenated with a local name. The exception to this is when Clark notation is used to represent the qualified name for an attribute with no namespace, which is ambiguous when represented using QName notation. For example, the element targetNamespace
, which has no [namespace name] property, is represented in Clark notation as {}targetNamespace
.
The following namespace prefixes are used consistently within this specification. These prefixes are not normative; this document issues no requirement that these prefixes be used in any conformant artifact. Although there is no requirement for a schema or XML document to use a particular namespace prefix, the meaning of the following namespace prefixes have fixed meaning in this document.
xs
: The namespace for the XML Schema definition language as defined by [XML Schema Structures] and [XML Schema Datatypes], http://www.w3.org/2001/XMLSchema
.xsi
: The XML Schema instance namespace, defined by [XML Schema Structures] Section 2.6, Schema-Related Markup in Documents Being Validated, for use in XML documents, http://www.w3.org/2001/XMLSchema-instance
.sch
: The Schematron namespace, as defined by [Schematron], http://purl.oclc.org/dsdl/schematron
.nf
: The namespace defined by this specification for XPath functions, http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#NDRFunctions
.ct
: The namespace defined by [CTAS] for the conformanceTargets
attribute, http://release.niem.gov/niem/conformanceTargets/3.0/
.appinfo
: The namespace for the appinfo namespace, http://release.niem.gov/niem/appinfo/4.0/
.structures
: The namespace for the structures namespace, http://release.niem.gov/niem/structures/4.0/
.In addition to the prefixes above, the prefix example
is used for XML examples, denoting a user-defined namespace, such as might be defined by an information exchange specification.
This document includes a variety of content. Some content of this document is normative, while other content is informative. In general, the informative material appears as supporting text, description, and rationales for the normative material.
The term normative
is as defined by [ConfReq] Section 7.2, Conformance by key words, which states:
NORMATIVE — statements provided for the prescriptive parts of the specification, providing that which is necessary in order to be able to claim conformance to the specification.
The term informative
is as defined by [ConfReq] Section 7.2, Conformance by key words, which states:
INFORMATIVE (NON-NORMATIVE) — statements provided for informational purposes, intended to assist the understanding or use of the specification and shall not contain provisions that are required for conformance.
Conventions used within this document include:
Definitions are normative. Uses of these terms are given special formatting, using raised dots to identify the term, for example this use of the term conformance target.
A guiding principle for NIEM.
The principles represent requirements, concepts, and goals that have helped shape NIEM. Principles are informative, not normative, but act as the basis on which the rules are defined.
Accompanying each principle is a short discussion that justifies the application of the principle to NIEM design.
Principles are numbered in the order in which they appear in the document.
A rule states a specific requirement on an artifact or on the interpretation of an artifact. The classes of artifacts are identified by conformance targets that are enumerated by this document in Section 4.1, Conformance targets defined, below. The rules are normative. Human-readable text in rules uses [BCP 14] terminology as described in Section 3.1, IETF Best Current Practice 14 terminology, below, for normative requirements and recommendations.
An enforceable rule for NIEM.
Each rule has a classification, which is either Constraint
or Interpretation
. If the classification is Constraint
, then the rule is a constraint rule. If the classification is Interpretation
, then the rule is an interpretation rule.
A constraint rule is a rule that sets a requirement on an artifact with respect to its conformance to a conformance target.
An interpretation rule is a rule that sets the methodology, pattern, or procedure for understanding some aspect of an instance of a conformance target.
Each rule identifies its applicability. This identifies the conformance targets to which the rule applies. Each entry in the list is a code from Table 4-1, Codes representing conformance targets, below. If a code appears in the applicability list for a rule, then the rule applies to the corresponding conformance target. The conformance targets are defined in Section 4, Conformance targets, below. For example, a rule with applicability (REF, EXT)
would be applicable to a reference schema document, as well as to an extension schema document.
Rules are stated with the help of XML Infoset terminology (e.g., elements and attributes), as described by Section 3.3, XML Information Set terminology, below, and XML Schema terminology (e.g., schema components), as described by Section 3.4, XML Schema terminology, below. The choice of terminology is driven by which terms best express a concept. Certain concepts are more clearly expressed using XML Infoset terms items, others using XML Schema terms; still others are best expressed using a combination of terminology drawn from each standard.
Rules are numbered according to the section in which they appear and the order in which they appear within that section. For example, the first rule in Section 7 is Rule 7-1.
This document defines many normative rules using Schematron rule-based validation syntax, as defined by [Schematron]. For example, see Rule 9-29, Complex type content is explicitly simple or complex (REF, EXT), below. Effort has been made to make the rules precise and unambiguous. Very detailed text descriptions of rules can introduce ambiguity, and they are not directly executable by users. Providing NDR rules that are expressed as Schematron rules ensures that the rules are precise, and that they are directly executable through commercially-available and free tools.
Many rules herein do not have executable Schematron supporting them. Some are not fit for automatic validation, and others may be difficult or cumbersome to express in Schematron. In neither case are such rules any less normative. A rule that has no Schematron is just as normative as a rule that does have Schematron. The level of requirements and recommendations within a rule is expressed using terminology from [BCP 14] as described in Section 3.1, IETF Best Current Practice 14 terminology, below.
The Schematron rules are written using XPath2 as defined by [XPath 2]. These executable rules are normative.
An execution of a Schematron pattern that issues a failed assertion (represented via sch:assert
) represents a validation error, and signifies that the assessed artifact violates a requirement (i.e., a MUST
) of a conformance rule. An example of a constraint rule that uses Schematron is Rule 9-10, Simple type definition is top-level (REF, EXT), below.
An execution of a Schematron pattern that issues a report (represented via sch:report
) indicates a warning. This may be an indication that an automated rule has found that the assessed artifact violates a recommendation of the specification (i.e., a SHOULD
, rather than a MUST
), and that attention should be paid to ensure that the artifact maintains the spirit of the specification. For example, see Rule 10-42, Name of element that ends in Representation
is abstract (REF, EXT), below.
In addition to the exclusive use of sch:report
for warnings, this document annotates sch:report
elements with attribute role="warning"
, which is interpreted by some Schematron platforms to indicate that a failure indicates a warning, rather than an error.
In either case, a diagnostic report generated by testing an XML document against the Schematron rules may identify specific locations (e.g., line numbers) within the document that need further attention.
The Schematron within this document is supported by functions, to make the rules more comprehensible, and to abstract away process-specific operations. Each function has a normative XPath interface and a normative text definition. Any implementation provided for these functions should be considered informative, not normative, but may be useful for certain implementations of the rules.
The following XPath functions are defined normatively when used within Schematron by this specification:
nf:get-document-element($context as element()) as element()
Yields the document element of the XML document in which $context
occurs.
This function provides the ability for a validator to consolidate multiple XML Schema documents and XML instance documents into a single XML document, which may simplify validation, and allow for preprocessing of xs:include
elements.
nf:get-target-namespace($element as element()) as xs:anyURI?
Yields the target namespace of the XML Schema document in which $element appears. If it is a schema document with no target namespace defined, then it yields the zero-length xs:anyURI
value (xs:anyURI('')
). If the XML document in which $element appears is not a schema document, then the function yields the empty sequence (()
).
nf:resolve-namespace($context as element(), $namespace-uri as xs:anyURI) as element(xs:schema)?
Yields the document element of the first available schema document that has the target namespace $namespace-uri. If there is no such schema document available, it yields the empty sequence (()
).
nf:resolve-type($context as element(), $qname as xs:QName) as element()?
Yields the first occurrence of an element xs:simpleType
or xs:complexType
that defines a type with a {target namespace} and {name} matching $qname, that is a [child] of the element yielded by nf:resolve-namespace()
, above. If there is no such occurrence, it yields the empty sequence (()
).
nf:resolve-element($context as element(), $qname as xs:QName) as element(xs:element)?
Yields the first occurrence of an element xs:element
that declares an element with a {target namespace} and {name} matching $qname, that is a [child] of the element yielded by nf:resolve-namespace()
, above. If there is no occurrence available, it yields the empty sequence. (()
)
nf:has-effective-conformance-target-identifier($context as element(), $match as xs:anyURI) as xs:boolean
Yields true if and only if an effective conformance target identifier of the XML document containing $context is $match.
The following Schematron namespace declarations are normative for the Schematron rules and supporting Schematron code within this specification:
<sch:ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/> <sch:ns prefix="xsl" uri="http://www.w3.org/1999/XSL/Transform"/> <sch:ns prefix="nf" uri="http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#NDRFunctions"/> <sch:ns prefix="ct" uri="http://release.niem.gov/niem/conformanceTargets/3.0/"/> <sch:ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance"/> <sch:ns prefix="appinfo" uri="http://release.niem.gov/niem/appinfo/4.0/"/> <sch:ns prefix="structures" uri="http://release.niem.gov/niem/structures/4.0/"/>
Note that the binding of the prefix xml
to the XML namespace (
) is implicit.http://www.w3.org/XML/1998/namespace
In addition to the special formatting above, this document uses additional formatting conventions.
[square brackets]: Terms in plain [square brackets] are properties of XML information set information items, as defined by [XML Infoset]. The information items and many of the information items’ properties are defined in that document. [XML Schema Structures] defines additional information item properties that are contributed by validation of an XML document against an XML Schema.
{curly brackets}: Terms in plain {curly brackets} are properties of schema components, as defined by [XML Schema Structures].
Courier
: All words appearing in Courier
font are values, objects, keywords, or literal XML text.
Italics: A phrase appearing in italics is one of:
Bold: A phrase appearing in bold is one of:
Throughout the document, fragments of XML Schema or XML instances are used to clarify a principle or rule. These fragments are specially formatted in Courier
font and appear in text boxes. An example of such a fragment follows:
<xs:complexType name="PersonType"> ... </xs:complexType>
This document uses standard terminology from other standards to explain the principles and rules that describe NIEM. In addition, it defines terms related to these other standards. This section enumerates this externally-dependent terminology.
The key words MUST
, MUST NOT
, REQUIRED
, SHALL
, SHALL NOT
, SHOULD
, SHOULD NOT
, RECOMMENDED
, NOT RECOMMENDED
, MAY
, and OPTIONAL
in this document are to be interpreted as described in [BCP 14] [RFC 2119] [RFC 8174] when, and only when, they appear in all capitals, as shown here.
The term XML document
is as defined by [XML] Section 2, Documents, which states:
A data object is an XML document if it is well-formed, as defined in this specification. In addition, the XML document is valid if it meets certain further constraints.
When discussing XML documents, this document uses terminology and language as defined by [XML Infoset].
[XML Infoset] uses the term information item
to describe pieces of XML documents. Documents, elements, and attributes are types of information items. The use of the term element information item
, for example, refers to the term as defined by [XML Infoset]. Shorthand terms may also be used to refer to information items, such as element, as defined below. The information items are identified and defined by [XML Infoset] Section 2, Information Items.
An element is an element information item, as defined by [XML Infoset] Section 2.2, Element Information Items
An attribute is an attribute information item, as defined by [XML Infoset] Section 2.3, Attribute Information Items
[XML Infoset] also describes properties of information items. Each class of information item carries a set of properties. Each property has a name, and the property is identified by putting the name into square brackets. For example, the element that contains an attribute is described as the [owner element] of an attribute information item, as defined in [XML Infoset] Section 2.3, Attribute Information Items.
Shorthand terms for properties of information items include:
root element.
This document uses many terms from [XML Schema Structures] and [XML Schema Datatypes] in a normative way.
The term schema component
is as defined by [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, which states:
Schema component is the generic term for the building blocks that comprise the abstract data model of the schema.
Note that this defines an abstract concept. This is not a direct reference to elements that are defined by the XML Schema definition language; this is an abstract concept that might be realized within a tool as an in-memory model of data objects.
The term XML Schema
is as defined by [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, which states:
An XML Schema is a set of schema components.
Note, again, that this is an abstract concept: the set of abstract schema components that are put together to define a schema against which an XML document might be validated.
The term XML Schema definition language
is as defined by [XML Schema Structures] subsection Abstract, which states:
XML Schema: Structures specifies the XML Schema definition language, which offers facilities for describing the structure and constraining the contents of XML 1.0 documents, including those which exploit the XML Namespace facility. The schema language, which is itself represented in XML 1.0 and uses namespaces, substantially reconstructs and considerably extends the capabilities found in XML 1.0 document type definitions (DTDs).
This describes the XML syntax (and related semantics) defined by the XML Schema specifications. It is through the XML Schema definition language that a complex type definition schema component is created using the xs:complexType
element.
The term schema document
is as defined by [XML Schema Structures] Section 3.1.2, XML Representations of Components, which states:
A document in this form (i.e. a <schema> element information item) is a schema document.
This definition describes an XML document that follows the syntax of the XML Schema definition language.
The term valid
is as defined by [XML Schema Structures] Section 2.1, Overview of XML Schema, which states:
[Definition:] the word valid and its derivatives are used to refer to clause 1 above, the determination of local schema-validity.
The referenced clause 1 is a part of a description of schema-validity:
Schema-validity assessment has two aspects:
- Determining local schema-validity, that is whether an element or attribute information item satisfies the constraints embodied in the relevant components of an XML Schema;
- Synthesizing an overall validation outcome for the item, combining local schema-validity with the results of schema-validity assessments of its descendants, if any, and adding appropriate augmentations to the infoset to record this outcome.
In addition, this specification locally defines terms relevant to XML Schema concepts:
An instance document (of an XML Schema) is an XML document that is valid against the XML Schema.
The term instance document
is used with [XML Schema Structures], but is not defined therein.
An XML Schema document set is a set of schema documents that together define an XML Schema suitable for assessing the validity of an XML document.
Schema assembly is a tricky topic that is not resolved by this document. Other specifications may express specifics about the process of turning a set of schema documents into an XML Schema. Methods used may include use of tool-specific schema caches and mappings, use of XML catalogs and entity resolvers, use of schemaLocation
attributes on xs:import
elements, and xsi:schemaLocation
attributes in XML documents, among others. The topic of schema assembly is discussed in Section 6.2.10, Schema locations provided in schema documents are hints, below. This specification abstracts away details of schema assembly through the use of XPath functions described by Section 2.4.3, Normative XPath functions, above.
In this document, the name of a referenced schema component may appear without the suffix schema component
to enhance readability of the text. For example, the term complex type definition
may be used instead of complex type definition schema component
.
The term base type definition
is as defined by [XML Schema Structures] Section 2.2.1.1, Type Definition Hierarchy, which states:
A type definition used as the basis for an extension or restriction is known as the base type definition of that definition.
The term simple type definition
is as defined by [XML Schema Structures] Section 2.2.1.2, Simple Type Definition.
The term complex type definition
is as defined by [XML Schema Structures] Section 2.2.1.3, Complex Type Definition.
The term element declaration
is as defined by [XML Schema Structures] Section 2.2.2.1, Element Declaration.
As described in Section 3.3, XML Information Set terminology, above, the XML Information Set specification defined properties of the content of XML documents. The XML Schema specification also provides properties of the content of XML documents. These properties are called Schema information set contribution, as described by [XML Schema Structures] Section 2.3, Constraints and Validation Rules, which defines them as:
Augmentations to post-schema-validation infosets expressed by schema components, which follow as a consequence of validation and/or assessment.
This document uses these property terms within definitions and other text. Terms used include:
xsi:type
in an XML document.This document uses XML Namespaces as defined by [XML Namespaces].
[CTAS] defines several terms used normatively within this specification.
The term conformance target
is as defined by [CTAS], which states:
A conformance target is a class of artifact, such as an interface, protocol, document, platform, process or service, that is the subject of conformance clauses and normative statements. There may be several conformance targets defined within a specification, and these targets may be diverse so as to reflect different aspects of a specification. For example, a protocol message and a protocol engine may be different conformance targets.
The term conformance target identifier
is as defined by [CTAS], which states:
A conformance target identifier is an internationalized resource identifier that uniquely identifies a conformance target.
The term effective conformance target identifier
is as defined by [CTAS] Section 4, Semantics and Use, which states:
An effective conformance target identifier of a conformant document is an internationalized resource identifier reference that occurs in the document’s effective conformance targets attribute.
This section defines and describes conformance targets of this specification. Each conformance target has a formal definition, along with a notional description of the characteristics and intent of each. These include:
A reference schema document is a schema document that is intended to provide the authoritative definitions of broadly reusable schema components. It is a conformance target of this specification. A reference schema document MUST conform to all rules of this specification that apply to this conformance target. An XML document with a conformance target identifier of http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument
MUST be a conformant reference schema document.
A reference schema document is a schema document that is intended to be the authoritative definition schema for a namespace. Examples include NIEM Core and NIEM domains.
Some characteristics of a reference schema document:
Any schema that defines components that are intended to be incorporated into NIEM Core or a NIEM domain will be defined as a reference schema.
The rules for reference schema documents are more stringent than are the rules for other classes of NIEM-conformant schemas. Reference schema documents are intended to support the broadest reuse. They are very uniform in their structure. As they are the primary definitions for schema components, they do not need to restrict other data definitions, and they are not allowed to use XML Schema’s restriction mechanism (e.g., Rule 9-30, Complex content uses extension (REF), below). Reference schema documents are intended to be as regular and simple as possible.
An extension schema document is a schema document that is intended to provide definitions of schema components that are intended for reuse within a more narrow scope than those defined by a reference schema document. It is a conformance target of this specification. An extension schema document MUST conform to all rules of this specification that apply to this conformance target. An XML document with a conformance target identifier of http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument
MUST be an extension schema document.
Characteristics of an extension schema document include:
An extension schema in an information exchange specification serves several functions. First, it defines new content within a new namespace, which may be an exchange-specific namespace or a namespace shared by several exchanges. This content is NIEM-conformant but has fewer restrictions on it than do reference schema documents. Second, the extension schema document bases its content on content from reference schema documents, where appropriate. Methods of deriving content include using (by reference) existing schema components, as well as creating extensions and restrictions of existing components.
For example, an information exchange specification may define a type for an exchange-specific phone number and base that type on a type defined by the NIEM Core reference schema document. This exchange-specific phone number type may restrict the NIEM Core type to limit those possibilities that are permitted of the base type. Exchange extensions and restrictions must include annotations and documentation to be conformant, but they are allowed to use restriction, choice, and some other constructs that are not allowed in reference schema documents.
Note that exchange specifications may define schemas that meet the criteria of reference schemas for those components that its developers wish to nominate for later inclusion in NIEM Core or in domains.
A conformant schema document set is a set of schema documents that are capable of validating XML documents.
A conformant schema document set is a collection of schema documents that together are capable of validating a conformant instance XML document. It is a conformance target of this specification. A conformant schema document set MUST conform to all rules of this specification that apply to this conformance target.
A conformant schema document set has strong dependencies on reference schema documents and extension schema documents. Without the guarantees provided by those conformance targets, the rules for a conformant schema document set would not be helpful. Those schemas in a schema set that are marked as reference or extension schemas are required to conform to the appropriate conformance targets.
Any schema document with an effective conformance target identifier of http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument
MUST be a reference schema document.
Any schema document with an effective conformance target identifier of http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument
MUST be an extension schema document.
This document has specific rules about how NIEM content should be used in XML documents. As well as containing rules for XML Schema documents, this NDR contains rules for NIEM-conformant XML content at a finer granularity than the XML document.
A conformant instance XML document is an XML document that is instance document valid to a conformant schema document set. It is a conformance target of this specification. A conformant instance XML document MUST conform to all rules of this specification that apply to this conformance target.
Characteristics of a conformant instance XML document include:
Schema-validity may be assessed against a single set of schemas or against multiple sets of schemas.
Assessment against schemas may be directed by a Model Package Description (MPD), by other instructions, or by other tools.
Note that this specification does not require the document element of a conformant instance XML document to be a conformant element information item. Other specifications, such as the MPD specification, may add additional constraints to these in order to specify MPD-specific or exchange-specific conformance constraints.
A conformant element information item is an element information item that satisfies all of the following criteria:
Because each NIEM-conformant element information item must be locally schema-valid, each element must validate against the schema definition of the element, even if the element information item is allowed within the document because of a wildcard that the {process contents} with a value of skip
. As described by [XML Schema Structures] Section 3.10.1, The Wildcard Schema Component, the content of an element introduced by a wildcard with {process contents} set to skip
does not have any schema validity constraint; it is only required to be well-formed XML. Within a NIEM-conformant XML document, each element that is from a NIEM namespace conforms to its schema specification.
Each rule within this document is applicable to one or more of the conformance targets identified by Section 4.1, Conformance targets defined, above. Each rule identifies its applicability as described in Section 2.4.1, Rules, above. The applicability field of each rule will contain one or more code values from Table 4-1, Codes representing conformance targets, below. A rule is applicable to the identified conformance targets.
Code | Conformance target |
---|---|
REF | reference schema document |
EXT | extension schema document |
SET | conformant schema document set |
INS | conformant instance XML document |
A conformant schema document claims to be conformant thorough the use of a set of conformance target identifiers.
The schema document MUST be a conformant document as defined by the NIEM Conformance Targets Attribute Specification.
The term conformant document
is defined by [CTAS] Section 3.2, Conformance to this Specification.
<sch:pattern> <sch:rule context="*[. is nf:get-document-element(.) or exists(@ct:conformanceTargets)]"> <sch:assert test="(. is nf:get-document-element(.)) = exists(@ct:conformanceTargets)" >The [document element] of the XML document, and only the [document element], MUST own an attribute {http://release.niem.gov/niem/conformanceTargets/3.0/}conformanceTargets.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[. is nf:get-document-element(.)]"> <sch:assert test="nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument'))" >The document MUST have an effective conformance target identifier of http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term effective conformance target identifier.
<sch:pattern> <sch:rule context="*[. is nf:get-document-element(.)]"> <sch:assert test="nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument'))" >The document MUST have an effective conformance target identifier of http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term effective conformance target identifier.
This section describes aspects of the RDF model, and provides a mapping between NIEM concepts and the RDF model.
Each release of NIEM provides a concrete data model, in the form of a set of schema documents. These schema documents may be used to build messages and information exchanges. The schema documents spell out what kinds of objects exist and how those objects may be related. A set of XML data that follows the rules of NIEM implies specific meaning. The varieties of schema components used within conformant schema documents are selected to clarify the meaning of XML data. That is, schema components that do not have a clear meaning have been avoided. NIEM provides a framework within which XML data has a specific meaning.
One limitation of XML and XML Schema is that they do not describe the meaning of an XML document. The XML specification defines XML documents and defines their syntax but does not address the meaning of those documents. The XML Schema specification defines the XML Schema definition language, which describes the structure and constrains the contents of XML documents through the construction and use of schema components.
In a schema, the meaning of a schema component may be described using the xs:documentation
element, or additional information may be included via use of the xs:appinfo
element. Although this may enable humans to understand XML data, more information is needed to support the machine-understandable meaning of XML data. In addition, inconsistency among the ways that schema components may be put together may be a source of confusion.
The RDF Core Working Group of the World Wide Web consortium has developed a simple, consistent conceptual model, the RDF model. The RDF model is described and specified through a set of W3C Recommendations, the Resource Description Framework (RDF) specifications, making it a very well defined standard. The NIEM model and the rules contained in this NDR are based on the RDF model. This provides numerous advantages:
With the exception of this section, NIEM rules are explained in this document without reference to RDF or RDF concepts. Understanding RDF is not required to understand NIEM-conformant schemas or data based on NIEM. However, understanding RDF concepts may deepen understanding of NIEM.
The goal of this section is to clarify the meaning of XML data that is NIEM-conformant and to outline the implications of various modeling constructs in NIEM. The rules for NIEM- conformant schemas and instances are in place to ensure that a specific meaning can be derived from data. That is, the data makes specific assertions, which are well understood since they are derived from the rules for NIEM.
This section identifies features of RDF and RDFS, in order to establish a mapping between RDF semantics and NIEM. A reader should read the referenced source documents to obtain a full understanding of the concepts mentioned in this section.
RDF establishes a graph-based data model, as described by [RDF Concepts] Section 1.1, Graph-based Data Model, which states:
The core structure of the abstract syntax is a set of triples, each consisting of a subject, a predicate and an object. A set of such triples is called an RDF graph.
[RDF Concepts] also states:
There can be three kinds of nodes in an RDF graph: IRIs, literals, and blank nodes.
[RDF Concepts] Section 1.2, Resources and Statements describes resources:
Any IRI or literal denotes something in the world (the
universe of discourse). These things are called resources. Anything can be a resource, including physical things, documents, abstract concepts, numbers and strings; the term is synonymous withentityas it is used in the RDF Semantics specification. The resource denoted by an IRI is called its referent, and the resource denoted by a literal is called its literal value.
[RDF Concepts] also describes relationships and blank nodes.
Asserting an RDF triple says that some relationship, indicated by the predicate, holds between the resources denoted by the subject and object. This statement corresponding to an RDF triple is known as an RDF statement. The predicate itself is an IRI and denotes a property, that is, a resource that can be thought of as a binary relation. (Relations that involve more than two entities can only be indirectly expressed in RDF.)
Unlike IRIs and literals, blank nodes do not identify specific resources. Statements involving blank nodes say that something with the given relationships exists, without explicitly naming it.
[RDF Concepts] Section 1.7, Equivalence, Entailment and Inconsistency describes the meaning of an RDF triple:
An RDF triple encodes a statement—a simple logical expression, or claim about the world. An RDF graph is the conjunction (logical AND) of its triples.
[RDF Concepts] Section 3.1, Triples defines an RDF triple:
An RDF triple consists of three components:
- the subject, which is an IRI or a blank node
- the predicate, which is an IRI
- the object, which is an IRI, a literal or a blank node
An RDF triple is conventionally written in the order subject, predicate, object.
The RDF view of the meaning of data carries into NIEM: NIEM elements form statements that make claims about the world: that a person has a name, a residence location, a spouse, etc. The assertion of one set of facts does not necessarily rule out other statements: A person could have multiple names, could have moved, or could be divorced. Each statement is a claim asserted to be true by the originator of the statement.
This NDR discusses NIEM data in XML terminology, complex types and elements, rather than using RDF terms, resources and properties. NIEM objects and associations coincide with RDF resources; both objects and associations correspond to RDF resources with additional constraints:
NIEM associations are defined as n-ary properties, as described in [N-ary], Use Case 3: N-ary relation with no distinguished participant
. NIEM associations are defined in Section 10.3, Associations, below. Assertions are made via NIEM-conformant XML data, described by Section 12, XML instance document rules, below.
The XML Schema types that define NIEM objects and associations are related to each other via elements and attributes. That is, a type contains elements and attributes, and an element or attribute has a value that is an instance of an XML Schema type. These elements and attributes are XML Schema representations, which correspond to RDF properties. NIEM-conformant XML Schemas describe things and their properties. NIEM-conformant data contains elements and attributes. These correspond to RDF resources and their properties, which describe their characteristics and relationships.
A NIEM data exchange may be ephemeral and ad hoc. That is, a message may be transmitted without any expectation of persistence. Such a message exists only to exchange data and may not have any universal meaning beyond that specific exchange. As such, a message may or may not have a URI as an identifier. NIEM was designed with the assumption that a given exchange need not have any unique identifier; NIEM does not require a unique identifier. NIEM also does not require any object carried by a message to be identified by a URI.
A NIEM-conformant instance XML document may carry any of these attributes to identify objects within messages:
Attribute xml:base
(of type xs:anyURI
) is defined by [XML Base] Section 3, xml:base
Attribute, which states:
The attribute
xml:base
may be inserted in XML documents to specify a base URI other than the base URI of the document or external entity.
An XML document has an implicit base URI, the identifier of the document itself. This attribute allows the base URI to be made explicit within a NIEM XML document.
structures:uri
(of type xs:anyURI
) may appear within an XML element to define a URI for that element. This may be an absolute URI (e.g., http://example.org/incident182#person12
), or may be a relative URI (e.g., #person12
). Relative URIs are resolved against a URI determined by the xml:base
attributes in scope, falling back to the base URI of the containing document.structures:id
(of type xs:ID
) provides a document-relative identifier for an element. Semantically, structures:id="abe92"
is equivalent to structures:uri="#abe92"
.structures:ref
(of type xs:IDREF
) provides a reference to another element within a document, by providing a value of a structures:id
attribute within the document. Semantically, structures:ref="abe92"
is equivalent to structures:uri="#abe92"
The values of URIs and IDs within NIEM XML documents are not presumed to have any particular significance. XML requires every ID to be unique within its XML document, and for every IDREF to refer to an ID within the same document. The mapping of IDs and IDREFs to URIs does not mean that the identifiers are persistent or significant.
These attributes provide the identifiers of objects. The properties of an object may be spread across several XML elements that have the same identifier. These properties must be merged together to provide all the properties of a single object, as described by [JSON LD] Section 8.2, Node Objects:
The properties of a node in a graph may be spread among different node objects within a document. When that happens, the keys of the different node objects need to be merged to create the properties of the resulting node.
Mapping of NIEM data to RDF frequently involves the use of blank nodes, instead of universally-meaningful resource IRIs.
The identifier of an object is constructed using the above attributes; if the above attributes do not appear on an object, then an object may be treated as a blank node, and assigned a blank node identifier.
In NIEM data, that which is not stated is not implied. If data says a person’s name is John,
it is not implicitly saying that he does not have other names, or that John
is his legal name, or that he is different from a person known as Bob.
The only assertion being made is that one of the names by which this person is known is John
.
This is one reason that definitions of NIEM content are so important. The definitions must state exactly what any given statement implies. The concept of legal name
may be defined that makes additional assertions about a name of a person. Such assertions must be made explicit in the definition of the relationship.
This section provides RDF implementations for many aspects of NIEM-conformant schemas and instance documents.
The term qualified name
is defined by [XML Namespaces] Section 2.1, Basic Concepts, which states:
A qualified name is a name subject to namespace interpretation.
A QName is used to represent a qualified name, as described by [XML Schema Datatypes] Section 3.2.18, QName, which states:
The value space of QName is the set of tuples {namespace name, local part}, where namespace name is an anyURI and local part is an NCName.
Certain components defined by NIEM schemas and instances have corresponding resource IRIs. Each IRI is taken from a qualified name, as follows:
#: concatenate(namespace name, local part)
#, local part)
Note that this is only meaningful when the namespace name is not empty and is an absolute URI.
The corresponding RDF resource IRIs for information items and schema components are:
A simple value may be incorporated into a conformant instance XML document as the value of an attribute information item, or as a child of an element information item. This section describes how a simple value is mapped to an RDF literal. Note that there is no mapping for the simple content of an element that is not a conformant element information item, nor for attributes defined by non-conformant schema documents, so there is no accommodation of mixed content, untyped values, or other cases outside of what conformant schema documents define.
For each occurrence of a simple value, the following may be relevant:
xml:lang
applicable to the value (described by [XML] Section 2.12, Language Identification), which may entail a language tag on the literal (described by [RDF Concepts] Section 3.3, Literal).The literal for a simple value $value is:
If $value has a base type definition that is derived from type xs:string
(and not an XML Schema-defined type derived from xs:string
), and a non-empty language specification is applied to $value using xml:lang
, as described by [XML] Section 2.12, Language Identification, then the literal is a language-tagged string, as described by [RDF Concepts] Section 3.3, Literals:
"$lexical-form"@$language-tag
Where:
xml:lang
.Otherwise, if $value has a base type definition $base-type that is listed as an RDF-compatible XSD type in [RDF Concepts] Section 5.1, The XML Schema Built-in Datatypes, and $base-type is not xs:string
, then the literal is:
"$lexical-form"^^$datatype-IRI
Where:
Otherwise, the literal is a simple literal, which is:
"$lexical-form"
Where: $lexical-form is a Unicode string for $value.
This section has the following subsections:
A conformant instance XML document entails a corresponding RDF graph, which is a set of triples, which are entailed by the mapping of the contents of the XML document to RDF.
A conformant element information item $element that has property [type definition] that is an object type or an association type, entails the RDF:
$object rdf:type $type .
Where:
If $element has a non-empty simple value, then it also entails the RDF:
$object rdf:value $literal .
Where:
A conformant element information item $element that
entails the RDF:
$context $predicate $object .
Where:
A conformant element information item $context that is an instance of an object type or association type, and that has a child conformant element information item $element that is an instance of an object type or an association type, entails the RDF:
$subject $predicate $object .
Where:
An attribute information item $attribute where:
entails the RDF:
$subject $predicate $literal .
Where:
An element of an augmentation type contains a set of elements and attributes that are applied to some base object or association.
For each element applied to a type via an augmentation type:
entails the RDF:
$subject $predicate $object .
Where:
An element of an augmentation type contains a set of elements and attributes that are applied to some base object or association.
For each attribute applied to a type via an augmentation type:
entails the RDF:
$subject $predicate $literal .
Where:
The following RDF mappings apply to the content of a reference schema document or extension schema document.
An object type or association type $type entails the following RDF:
$resource rdf:type rdf:Class .
Where $resource is the resource IRI for $type.
An object type or association type $type that has property {base type definition} $base also entails the RDF:
$resource rdfs:subClassOf $base-resource
Where $base-resource is the resource IRI for $base.
The following RDF mappings apply to the content of a reference schema document or extension schema document.
A top-level element declaration schema component $element-declaration that has property {type definition} that is
structures:ObjectType
, orstructures:AssociationType
entails the RDF:
$element-resource rdf:type rdf:Property .
Where $element-resource is the resource IRI for $element-declaration.
If $element-declaration has property {substitution group affiliation} with a value of element declaration $base, then it entails the RDF:
$element-resource rdfs:subPropertyOf $base-resource
Where:
If $element-declaration has property {type definition} with a value $type that is an object type or association type, then it entails the RDF:
$element-resource rdfs:range $type-resource
Where:
The following RDF mappings apply to the content of a reference schema document or extension schema document.
A top-level attribute declaration schema component $attribute-declaration that has property {type definition} that is a simple type definition defined within a reference schema document or an extension schema document, then it entails the RDF:
$attribute-resource rdf:type rdf:Property .
Where $attribute-resource is the resource IRI for $attribute-declaration.
Principles in this specification provide a foundation for the rules. These principles are generally applicable in most cases. They should not be used as a replacement for common sense or appropriate special cases.
The principles are not operationally enforceable; they do not specify constraints on XML Schema documents and instances. The rules are the normative and enforceable manifestation of the principles.
The principles discussed in this section are organized as follows:
The principles in this section address what material should be included in this NDR and how it should be represented.
This specification should state what is required for interoperability, not all that could be specified. Certain decisions (such as normative XML comments) could create roadblocks for interoperability, making heavy demands on systems for very little gain. The goal is not standardization for standardization’s sake. The goal is to maximize interoperability and reuse.
This specification SHOULD specify what is necessary for semantic interoperability and no more.
The term semantic interoperability is here defined as the ability of two or more computer systems to exchange information and have the meaning of that information automatically interpreted by the receiving system accurately enough to produce useful results.
This specification should try, as much as is possible, to specify schema-level content. This is a specification for schemas, and so it should specify schemas and their instance documents. It should avoid specifying complex data models or data dictionaries.
A rule should be as precise and specific as possible to avoid broad, hard-to-modify rules. Putting multiple clauses in a rule makes it harder to enforce. Using separate rules allows specific conditions to be clearly stated.
The principles in this section address how XML Schema technology should be used in designing NIEM-conformant schemas and instances.
The specification SHOULD focus on rules for XML Schemas in order to support:
XML Schema has features that can make the data provided by an XML Schema validating parser differ from that provided by a non-validating XML parser. For example, if an XML Schema attribute declaration has a default
value, and if an XML document omits the attribute where it might appear, an XML Schema validating parser will construct the attribute with the default value in the infoset that it provides to its caller. Without schema validation, there would be no attribute value, but after processing, the attribute value exists in the parsed data provided to the caller. Section 8.4, Ensure XML parsing does not construct values, below, provides more detail.
Within NIEM, the purpose of processing instances against schemas is primarily validation: testing that data instances match desired constraints and guidelines. It should not be used to alter the content of data passing through the parser.
NIEM is designed for XML Schema validation. One goal is to maximize the amount of validation that may be performed by XML Schema-validating parsers.
XML Schema validates content using content models: descriptions of what elements and attributes may be contained within an element, and what values are allowable. It is the XML element hierarchy (elements with attributes and unstructured content, contained by other elements) that the XML Schema definition language specifies and that XML Schema validating parsers can validate.
Mechanisms involving linking using attribute and element values are useful, but they should only be relied on when absolutely necessary, as XML Schema-validating parsers cannot readily validate them. For example, if a link is established via attribute values, an XML Schema-validating parser cannot determine that participants have appropriate type definitions. Whenever possible, NIEM content should rely on XML syntax that can be validated with XML Schema.
Systems that operate on XML data have the opportunity to perform multiple layers of processing. Middleware, XML libraries, schemas, and application software may process data. The primary purpose of validation against schemas is to restrict processed data to that data that conforms to agreed-upon rules. This restriction is achieved by marking as invalid that data that does not conform to the rules defined by the schema.
NIEM does not attempt to create a one-size-fits-all schema to perform all validation. Instead, it creates a set of reference schemas, on which additional constraints may be placed. Although NIEM is principally expressed as a set of reference schemas for a NIEM release, additional validation may be conducted through other mechanisms, which may include XML Schemas that express additional constraints, and business rules and structure-specifying languages other than the XML Schema definition language.
NIEM uses the concept of a reference schema, which defines the structure and content of a namespace. For each NIEM-conformant namespace, there is exactly one NIEM reference schema. A user may use a subset schema or constraint schema in place of a reference schema, but all NIEM-conformant XML documents must validate against a single reference schema for each namespace.
XML data that use mixed content are difficult to specify and complicate the task of data processing. Much of the payload carried by mixed content is unchecked and does not facilitate data standardization or validation.
Every schema component defined by a NIEM-conformant schema that can have a name has a name. This means that there are no anonymous types, elements, or other components defined by NIEM. Once an application has determined the name (i.e., namespace and local name) of an attribute or element used in NIEM-conformant instances, it will also know the type of that attribute or element.
There are no local attributes or elements defined by NIEM, only global attributes and elements. This maximizes the ability of application developers to extend, restrict, or otherwise derive definitions of local components from NIEM-conformant components. Using named global components in schemas maximizes the capacity for reuse.
Wildcards in NIEM-conformant schemas work in opposition to standardization. The goal of creating harmonized, standard schemas is to standardize definitions of data. The use of wildcard mechanisms (such as xs:any
, which allows insertion of arbitrary elements) allows unstandardized data to be passed via otherwise standardized exchanges.
Avoidance of wildcards in the standard schemas encourages the separation of standardized and unstandardized data. It encourages users to incorporate their data into NIEM in a standardized way. It also encourages users to extend in a way that may be readily incorporated into NIEM.
[XML Schema Structures] provides several mechanisms for acquiring components of an XML Schema for the purpose of assessing validity of an instance. [XML Schema Structures] Section 4.3.2, How schema definitions are located on the Web includes:
In addition, there are several ways for a processor to determine schema locations:
xsi:schemaLocation
or xsi:noNamespaceSchemaLocation
attributes in an XML document under assessment.xs:import
elements.[XML Schema Structures] characterizes several of these methods as hints of where to acquire a schema document for assessment. [XML Schema Structures] Section 2.6.3, xsi:schemaLocation, xsi:noNamespaceSchemaLocation states:
The
xsi:schemaLocation
andxsi:noNamespaceSchemaLocation
attributes can be used in a document to provide hints as to the physical location of schema documents which may be used for assessment.
[XML Schema Structures] Section 4.2.3, References to schema components across namespaces states:
The actual value of the
schemaLocation
, if present, gives a hint as to where a serialization of a schema document with declarations and definitions for that namespace (or none) may be found.
The specification explicitly maintains that schema location provided in schemas or instances may be overridden by applications or by user direction.
Schema locations specified within NIEM-conformant reference schemas SHOULD be interpreted as hints and as default values by processing applications.
In accordance with Section 1.1, Scope, above, this document does not provide normative guidance for location of schema documents or for schema assembly.
The cooperative efforts of many knowledgeable individuals have resulted in many important published information standards. Where appropriate and applicable, NIEM ought to leverage these standards.
The principles in this section address the design philosophy used in designing the NIEM conceptual model.
NIEM is designed to maximize reuse of namespaces and the schemas that define them. When referring to a concept defined by a NIEM-conformant schema, a user should ensure that instances and schemas refer to the namespace defined by NIEM. User-defined namespaces should be used for specializations and extension of NIEM constructs but should not be used when the NIEM structures are sufficient.
NIEM-conformant instances and schemas SHOULD reuse components from NIEM distribution schemas when possible.
NIEM relies heavily on XML namespaces to prevent naming conflicts and clashes. Reuse of any component is always by reference to both its namespace and its local name. All NIEM component names have global scope. An instance document or schema should use or reuse a NIEM component by referencing its NIEM-defined namespace and local name. An application that validates an instance document that contains a component in a NIEM namespace should conduct that validation using NIEM reference schema documents or profiles of NIEM reference schema documents, to ensure consistency across exchanges and implementations.
Example:
<xs:element ref="nc:BinaryCaptureDate" minOccurs="0" maxOccurs="unbounded"/>
In this example, nc:BinaryCaptureDate
is reused by referencing its element declaration through both its namespace (which is bound to the prefix nc:
) and its local name (BinaryCaptureDate
). If an element named BinaryCaptureDate
is declared in another namespace, it is an entirely different element than nc:BinaryCaptureDate
. There is no implicit relationship to nc:BinaryCaptureDate
.
From a business perspective, the two elements are likely to be related in the sense that they may have very similar semantic meanings. They may have essentially the same meaning, but slightly different properties. Such a relationship may commonly exist. However, any relationship between the two elements must be made explicit using methods outlined in this document.
NIEM is designed to be extended. Numerous methods are considered acceptable in creating extended and specialized components.
The principles in this section address issues pertaining to the implementation of applications that use NIEM.
XML data should be made human-understandable when possible, but it is not targeted at human consumers. HTML is intended for browsers. Browsers and similar technology provide human interfaces to XML and other structured content. Structured XML content does not belong in places targeting humans. Human-targeted information should be of a form suitable for presentation.
NIEM is intended to be an open specification supported by many diverse implementations. It was designed from data requirements and not from or for any particular system or implementation. Use of NIEM should not depend on specific software, other than XML Schema-validating parsers.
NIEM SHOULD NOT depend on specific software packages, software frameworks, or software systems for interpretation of XML instances.
The NIEM Naming and Design Rules (NDR) specify NIEM-conformant components, schemas, and instances. These guidelines influence and shape the more-specific principles and rules in this document. They are derived from best practices and from discussions within the NIEM Business Architecture Committee (NBAC) and the NIEM Technical Architecture Committee (NTAC). This list may grow and evolve as NIEM matures.
The principles in this section address decisions that data modelers must face when creating NIEM-conformant schema representations of domain data. These guidelines are not absolute (the key word is SHOULD). It may not be possible to apply all guidelines in every case. However, they should always be considered.
As will be described in later sections of this document, all NIEM components are documented through their definitions and names. Although it is often very difficult to apply, a schema component’s data definition should be drafted before the data component name is finalized.
Drafting the definition for a data component first ensures that the author understands the exact nature of the entity or concept that the data component represents. The component name should subsequently be composed to summarize the definition. Reversing this sequence often results in data definitions that very precisely describe the component name but do not adequately describe the entity or concept that the component is designed to represent. This can lead to the ambiguous use of such components.
The data definition of a component SHOULD be drafted before the component’s name is composed.
Components in NIEM should be given names that are consistent with names of other NIEM components. Having consistent names for components has several advantages:
NIEM provides a standard for data exchange. To help facilitate unambiguous understanding of NIEM reusable components, the names and structures should represent and model the informational aspects of objects and concepts that users are most familiar with. Types should not simply model collections of data.
Different users often have their own local practices for arranging components together, such as grouping components into sets and segments, or building in extra layers to help categorize components and make them easier to find when drilling down through an object. Since the broader community may not share the same practices, and grouping structures add additional complexity to both schemas and instances, NIEM components should model the real world as simply and closely as possible.
There should be no conflicts of meaning among types. This holds for types within a namespace, as well as types in different namespaces. A type should be used consistently in similar situations for similar purposes. Types should be defined for clear understanding and ease of intended use.
Specialization should not be applied simply for the sake of achieving property inheritance. Specialization should be applied only where it is meaningful and appropriate to model permanent sibling subclasses of a base class that are mutually exclusive of one another.
Complex type definitions in NIEM-conformant schemas SHOULD use type inheritance only for specialization.
Note that the use of augmentations allows developers to avoid type specialization in many cases; see Section 10.4, Augmentations, below.
A real-world entity should be modeled in only one way. The definition of a type or element should appear once and only once. Multiple components of identical or closely similar semantics hinder interoperability because too many valid methods exist for representing the same data. For each data concept that must be represented, there should be only one component (and associated type) to represent it.
Components with very similar semantics may exist in different contexts. For example, a complex type created for a particular exchange may appear to have identical or closely similar semantics to a complex type defined in the NIEM Core schema. However, the type defined at the exchange level will have much more precise business requirements and syntax, compared with the broad definitions that are heavily reused. Specific contextual definitions should be considered semantic changes.
Two components may have the same definition while having different representations. For example, a string may hold the complete name of a person, or the name may be represented by a structure that separates the components of the name into first, last, etc. The definition of alternative representations should not be considered duplication.
All NIEM content and structure is fundamentally based on business requirements for information exchange. To encourage adoption and use in practice, NIEM must implement business requirements in simple, consistent, practical ways.
The scope of components defined in NIEM-conformant schemas should be carefully considered. Some components represent simple data values, while others represent complex objects with many parts and relationships. Components should exist in layers. Components should exist as small, narrowly scoped, atomic entities that are used to consistently construct more broadly scoped, complex components (and so on).
Namespaces should maximize cohesion. The namespace methodology helps prevent name clashes among communities or domains that have different business perspectives and may choose identical data names to represent different data concepts. A namespace should be designed so that its components are consistent, may be used together, and may be updated at the same time.
There are numerous XML standards to which the instance and schema documents that constitute information exchanges must conform. This section applies XML specifications to the conformance targets of this document.
The XML specification [XML] defines the term XML document. NIEM XML documents, including instance documents and schema documents, must conform to the definition of this term.
This document establishes the term XML document, by reference to [XML].
The XML namespaces specification defines correct use of XML namespaces; NIEM-conformant XML artifacts (instance documents and schema documents) must use namespaces properly.
The document MUST be namespace-well-formed and namespace-valid.
The terms namespace-well-formed and namespace-valid are normatively defined by [XML Namespaces].
The XML Schema specification part 1 [XML Schema Structures] defines the syntax of the XML Schema definition language, and identifies an XML document that follows that syntax as a schema document. This section requires that NIEM reference and extension schema documents be schema documents.
This document establishes the term schema document, by reference to [XML Schema Structures].
<sch:pattern> <sch:rule context="*[. is nf:get-document-element(.)]"> <sch:assert test="self::xs:schema" >The [document element] of the [XML document] MUST have the name xs:schema.</sch:assert> </sch:rule> </sch:pattern>
This document establishes the terms document element by reference to [XML Infoset], and XML document by reference to [XML].
Good data definitions are fundamental to data interoperability. You cannot effectively exchange what you cannot understand. NIEM employs the guidance of [ISO 11179-4] as a baseline for its data component definitions.
To advance the goal of creating semantically rich NIEM-conformant schemas, it is necessary that data definitions be descriptive, meaningful, and precise. [ISO 11179-4] provides standard structure and rules for defining data definitions. NIEM uses this standard for component definitions.
Note that the metadata maintained for each NIEM component contains additional details, including domain-specific usage examples and keywords. Such metadata is used to enhance search and discovery of components in a registry, and therefore, is not included in schemas.
For convenience and reference, the summary requirements and recommendations in [ISO 11179-4] are reproduced here:
ISO 11179 Requirements
A data definition SHALL:
- Be stated in the singular.
- State what the concept is, not only what it is not.
- Be stated as a descriptive phrase or sentence(s).
- Contain only commonly understood abbreviations.
- Be expressed without embedding definitions of other data or underlying concepts.
ISO 11179 Recommendations
A data definition SHOULD:
- State the essential meaning of the concept.
- Be precise and unambiguous.
- Be concise.
- Be able to stand alone.
- Be expressed without embedding rationale, functional usage, or procedural information.
- Avoid circular reasoning.
- Use the same terminology and consistent logical structure for related definitions.
- Be appropriate for the type of metadata item being defined.
In addition to the requirements and recommendations of [ISO 11179-4], NIEM applies additional rules to data definitions. These rules are detailed in Section 11.6.1, Human-readable documentation, below.
These definitions leverage the term definition
as defined by [ISO 11179-4]:
representation of a concept by a descriptive statement which serves to differentiate it from related concepts
The data definition of a schema component is the content of the first occurrence of the element xs:documentation
that is an immediate child of an occurrence of an element xs:annotation
that is an immediate child of the element that defines the component.
In a NIEM-conformant schema, a documented component is schema component that has an associated data definition. Each documented component has a textual definition, so that the component may be well-understood.
An example of a data definition is provided in Figure 7-1, Example of data definition of element nc:Activity
, below.
<xs:element name="Activity" type="nc:ActivityType" nillable="true"> <xs:annotation> <xs:documentation>A single or set of related actions, events, or process steps.</xs:documentation> </xs:annotation> </xs:element>
See Rule 11-27, Data definition follows 11179-4 requirements (REF, EXT), below, and Rule 11-28, Data definition follows 11179-4 recommendations (REF, EXT), below, for application of [ISO 11179-4] to constrain NIEM data definitions.
Names are a simple but incomplete means of providing semantics to data components. Data definitions, structure, and context help to fill the gap left by the limitations of naming. The goals for data component names should be syntactic consistency, semantic precision, and simplicity. In many cases, these goals conflict and it is sometimes necessary to compromise or to allow exceptions to ensure clarity and understanding. To the extent possible, NIEM applies [ISO 11179-5] to construct NIEM data component names.
The set of NIEM data components is a collection of data representations for real-world objects and concepts, along with their associated properties and relationships. Thus, names for these components would consist of the terms (words) for object classes or that describe object classes, their characteristic properties, subparts, and relationships.
A NIEM component name SHOULD be formed by applying the informative guidelines and examples detailed in Annex A of [ISO 11179-5], with exceptions as specified in this document.
The guidelines and examples of [ISO 11179-5] provide a simple, consistent syntax for data names that captures context and thereby imparts a reasonable degree of semantic precision.
NIEM uses the guidelines and examples of [ISO 11179-5] as a baseline for normative naming rules. However, some NIEM components require bending of these rules. Special naming rules for these classes of components are presented and discussed in the relevant sections. In spite of these exceptions, most NIEM component names can be disassembled into their [ISO 11179-5] constituent words or terms.
Example:
The NIEM component name AircraftFuselageColorCode
disassembles as follows:
Aircraft
Fuselage
Color
Code
Section 10.8, Naming rules, below, details the specific rules for each kind of term and how to construct NIEM component names from it.
The Office of the Director of National Intelligence manages and maintains a set of specifications that support the requirements of the Intelligence Community (IC) to share and manage data across the IC enterprise. These specifications are available at http://purl.org/ic/standards/public. The design of NIEM supports the use of NIEM-conformant data across the IC.
The following features have been provided to support the use of NIEM-conformant data definitions across the IC, by supporting the use of IC-ISM and IC-NTK within NIEM-defined data:
xs:anyAttribute
declarations, which allow the use of attributes from the ISM and NTK namespaces. See Appendix B, Structures namespace, below, for the reference schema.These features ensure that payloads that correctly use IC-ISM AND IC-NTK are supported by NIEM-conformant schema definitions.
There are many constructs within XML Schema that act as wildcards. That is, they introduce buckets that may carry arbitrary or otherwise not-validated content. Such constructs violate [Principle 12], above, and as such provide implicit workarounds for the difficult task of agreeing on the content of data models. Such workarounds should be made explicitly, outside the core data model.
The following restrictions help to ban wildcards and arbitrary data:
xs:anyType
is prohibited.xs:anySimpleType
is prohibited in most cases.xs:any
is prohibited in reference schemas.xs:anyAttribute
is prohibited in reference schemas.Each component defined by a NIEM-conformant schema may be reused from outside the schema document. Every type definition, element declaration, or attribute declaration schema component that is defined by a NIEM-conformant schema is given an explicit name. These schema components are not defined as local or anonymous. These components are defined at the top level, as children of element xs:schema
.
This is supported by the rules:
Additional restrictions ensure that NIEM components are also defined such that new components may be derived from them and substituted for them. Reference schemas are defined to maximize reuse, while extension schemas are defined to enable a developer to customize schema definitions to match her exchange needs. In reference schemas, the following restrictions help enforce reusability through extension and substitution:
blockDefault
(per Rule 9-86, No disallowed substitutions (REF), below) or finalDefault
(per Rule 9-87, No disallowed derivations (REF), below).Element declarations and type definitions in a reference schema document may not use block
or final
, per the rules:
XML Schema provides the capability for model groups to be recursively defined. This means that a sequence may contain a sequence, and a choice may contain a choice. The rules in this document restrict the use of nested model groups, in order to keep content models simple, comprehensive, and reusable: The content of an element should boil down to a simple list of elements, defined in as straightforward a manner as is possible to meet requirements.
An XML document expresses an infoset (see [XML Infoset]); the infoset is the data carried by the XML document, and is expressed as a set of information items (e.g., element information items, attribute information items, etc.). [XML Schema Structures] Section 2.1, Overview of XML Schema describes the process followed by an XML Schema validating parser. Beyond the actions of a plain XML parser, which provides the data from an XML document to its caller in a structured way, an XML Schema validating parser does the following:
- Determining local schema-validity, that is whether an element or attribute information item satisfies the constraints embodied in the relevant components of an XML Schema;
- Synthesizing an overall validation outcome for the item, combining local schema-validity with the results of schema-validity assessments of its descendants, if any, and adding appropriate augmentations to the infoset to record this outcome.
In short, not only does an XML Schema validating parser yield data from an XML document to its caller, it determines whether the XML document is valid against an XML Schema, and also provides an augmented infoset to the caller, constructed to reflect information implied by the schema, which may not appear in the original XML document.
XML Schema allows element and attribute declarations to provide default values. When an XML document does not contain a value for a component that has a default, the XML Schema validating parser will construct a value for the component. This is done through the use of the attributes default
and fixed
, both of which provide default values to attributes and element content. An XML Schema validating parser that validates an XML document against a schema that uses default
or fixed
may yield an infoset that is augmented, constructing values in the provided XML infoset where none existed in the original XML document.
NIEM schemas should not produce constructed values in the infoset. The process of XML Schema validation against NIEM schemas should provide for marking data as valid or invalid, but should not modify original infoset data with constructed values. The XML infoset yielded by a non-validating XML parser should be the same as that yielded by an XML Schema validating parser. Turning on schema validation should not alter the data received by the caller of the parser.
The prohibition of constructed values is supported by Section 6.2.2, Prohibit XML parsing from constructing values, above. It is also supported through a prohibition on all uses of default
, and most uses of fixed
on attributes and elements defined by NIEM-conformant schema documents.
Every component defined by or used in a NIEM schema has a target namespace.
XML Schema requires that namespaces used in external references be imported using the xs:import
element. The xs:import
element appears as an immediate child of the xs:schema
element. A schema must import any namespace which is not the local namespace, and which is referenced from the schema.
The behavior of import statements is not necessarily intuitive. In short, the import introduces a namespace into the schema document in which the import appears; it has no transitive effect. If the namespace introduced by an import statement are not referenced from that schema document, then the import statement has no effect.
Certain tools have been seen introducing transitive behavior on imports, which is not portable across XML Schema validating parsers. If namespace 1 imports namespace 2 which imports namespace 3, a reference from namespace 1 to namespace 3 is not legal; namespace 1 must explicitly import namespace 3. A tool that imports transitively may allow schema 1 to reference 3 without a direct import of namespace 3. This is prohibited by rules which require imports of namespaces of referenced components.
The XML Schema specification defines two types of annotations: user information and application information. It defines that user information is for human consumption, while application information is for automatic processing.
[XML Schema Structures] Section 3.13, Annotations states:
Annotations provide for human- and machine-targeted annotations of schema components.
[XML Schema Structures] Section 3.13.1, The Annotation Schema Component states:
{user information} is intended for human consumption, {application information} for automatic processing.
The two types: human-targeted and machine-targeted, are kept separate by the use of two separate container elements defined by XML Schema: xs:documentation
and xs:appinfo
.
xs:documentation
elements express user information
. This information is targeted for reading by humans. The XML Schema specification does not say what form human-targeted information should take. Since it is intended for human consumption, xs:documentation
elements in conformant schemas do not contain structured XML data. As such, any XML content appearing within a documentation element should be human-targeted examples, and should be escaped (e.g., using <
and >
, or using CDATA blocks). Documentation within conformant schemas should be plain text; whitespace formatting may not be preserved across processing.
xs:appinfo
elements express application information
. This is generally information supporting automatic processing of schemas. Application information is addressed in Section 10.9, Machine-readable annotations, below.
XML comments are not XML Schema constructs and are not specifically associated with any schema-based component; they are not considered semantically meaningful by NIEM and may not be retained through processing of NIEM schemas.
NIEM-conformant schemas use a profile of XML Schema. The W3C XML Schema Language provides many features that allow a developer to represent a data model many different ways. A number of XML Schema constructs are not used within NIEM-conformant schemas. Many of these constructs provide capability that is not currently needed within NIEM. Some of these constructs create problems for interoperability, with tool support, or with clarity or precision of data model definition.
This section establishes a profile of XML Schema for NIEM-conformant schemas. Because the XML Schema specifications are flexible, comprehensive rules are needed to achieve a balance between establishing uniform schema design and providing developers flexibility to solve novel data modeling problems.
Note that external schema documents (i.e., non-NIEM-conformant schema documents) do not need to obey the rules set forth in this section. So long as schema components from external schema documents are adapted for use with NIEM according to the modeling rules in Section 10.2.3, External adapter types and external components, below, they may be used as they appear in the external standard, even if the schema components themselves violate the rules for NIEM-conformant schemas.
The following sections are broken down in the order provided by [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, followed by a section on a schema document as a whole and a section on schema namespaces and assembly:
Although the XML namespace is to be imported as if it is conformant, types from that namespace may not be the base type definition of any type.
<sch:pattern> <sch:rule context="xs:*[exists(@base)]"> <sch:assert test="namespace-uri-from-QName(resolve-QName(@base, .)) != xs:anyURI('http://www.w3.org/XML/1998/namespace')" >A schema component must not have a base type definition with a {target namespace} that is the XML namespace.</sch:assert> </sch:rule> </sch:pattern>
The term base type definition has a normative definition.
<sch:pattern> <sch:rule context="xs:*[exists(@base)]"> <sch:assert test="resolve-QName(@base, .) != xs:QName('xs:anyType')" >A schema component MUST NOT have an attribute {}base with a value of xs:anyType.</sch:assert> </sch:rule> </sch:pattern>
XML Schema has the concept of the ur-type,
a type that is the root of all other types. This type is realized in schemas as xs:anyType
.
NIEM-conformant schemas must not use xs:anyType
, because this feature permits the introduction of arbitrary content (i.e., untyped and unconstrained data) into an XML instance. NIEM intends that the schemas describing that instance describe all constructs within the instance.
<sch:pattern> <sch:rule context="xs:*[exists(@base)]"> <sch:assert test="resolve-QName(@base, .) != xs:QName('xs:anySimpleType')" >A schema component MUST NOT have an attribute {}base with a value of xs:anySimpleType.</sch:assert> </sch:rule> </sch:pattern>
XML Schema provides a restriction of the ur-type
that contains only simple content. This provides a wildcard for arbitrary text. It is realized in XML Schema as xs:anySimpleType
.
NIEM-conformant schemas must not use xs:anySimpleType
because this feature is insufficiently constrained to provide a meaningful starting point for content definitions. Instead, content should be based on one of the more specifically defined simple types defined by XML Schema.
<sch:pattern> <sch:rule context="xs:*[exists(@base)]"> <sch:assert test="resolve-QName(@base, .) != xs:QName('xs:NOTATION')" >A schema component MUST NOT have an attribute {}base with a value of xs:NOTATION.</sch:assert> </sch:rule> </sch:pattern>
XML Schema notations allow the attachment of system and public identifiers on fields of data. The notation mechanism does not play a part in validation of instances and is not supported by NIEM.
<sch:pattern> <sch:rule context="xs:simpleType"> <sch:assert test="exists(parent::xs:schema)" >A simple type definition MUST be top-level.</sch:assert> </sch:rule> </sch:pattern>
NIEM does not support anonymous types in NIEM-conformant schemas. All XML Schema top-level
types (children of the document element) are required by XML Schema to be named. By requiring NIEM type definitions to be top level, they are forced to be named and are globally reusable.
<sch:pattern> <sch:rule context="xs:simpleType"> <sch:assert test="empty(@final)" >An element xs:simpleType MUST NOT have an attribute {}final.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:simpleType"> <sch:assert test="some $definition in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($definition))) > 0" >A simple type MUST have a data definition.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term data definition.
An attribute fixed
on a constraining facet (e.g., xs:maxInclusive
) of a simple type $base prevents a simple type derived from $base from further restricting that facet. For example, if simpleType nc:LatitudeDegreeSimpleType
uses an xs:maxInclusive
facet that limits the maximum value to 90, a simple type derived from that type could not further restrict the type to limit the maximum value to 45.
The use of fixed
on simple type facets violates [Principle 17], above, since it prevents an extension schema from constraining a base type. As a result, the fixed
on simple type facets in reference schemas is prohibited.
<sch:pattern> <sch:rule context="xs:*[self::xs:length or self::xs:minLength or self::xs:maxLength or self::xs:whiteSpace or self::xs:maxInclusive or self::xs:maxExclusive or self::xs:minExclusive or self::xs:minInclusive or self::xs:totalDigits or self::xs:fractionDigits]"> <sch:assert test="empty(@fixed)" >A simple type constraining facet MUST NOT have an attribute {}fixed.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:enumeration"> <sch:assert test="some $definition in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($definition))) > 0" >An enumeration facet MUST have a data definition.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term data definition.
There is no explicit prohibition on the use of xs:NOTATION as list item type, because it is prohibited by [XML Schema Datatypes].
There is no prohibition on xs:anyType
as a list item type, because xs:anyType is not a simple type.
<sch:pattern> <sch:rule context="xs:*[exists(@itemType)]"> <sch:assert test="resolve-QName(@itemType, .) != xs:QName('xs:anySimpleType')" >A schema component MUST NOT have an attribute {}itemType with a value of xs:anySimpleType.</sch:assert> </sch:rule> </sch:pattern>
There is no explicit prohibition on the use of xs:NOTATION as a union member type, because it is prohibited by [XML Schema Datatypes].
There is no prohibition on xs:anyType
as a union member type, because xs:anyType is not a simple type.
<sch:pattern> <sch:rule context="xs:*[exists(@memberTypes)]"> <sch:assert test="every $type-qname in tokenize(normalize-space(@memberTypes), ' ') satisfies resolve-QName($type-qname, .) != xs:QName('xs:ID')" >A schema component MUST NOT have an attribute {}memberTypes that includes a value of xs:ID.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[exists(@memberTypes)]"> <sch:assert test="every $type-qname in tokenize(normalize-space(@memberTypes), ' ') satisfies resolve-QName($type-qname, .) != xs:QName('xs:IDREF')" >A schema component MUST NOT have an attribute {}memberTypes that includes a value of xs:IDREF.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[exists(@memberTypes)]"> <sch:assert test="every $type-qname in tokenize(normalize-space(@memberTypes), ' ') satisfies resolve-QName($type-qname, .) != xs:QName('xs:IDREFS')" >A schema component MUST NOT have an attribute {}memberTypes that includes a value of xs:IDREFS.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[exists(@memberTypes)]"> <sch:assert test="every $type-qname in tokenize(normalize-space(@memberTypes), ' ') satisfies resolve-QName($type-qname, .) != xs:QName('xs:anySimpleType')" >A schema component MUST NOT have an attribute {}memberTypes that includes a value of xs:anySimpleType.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[exists(@memberTypes)]"> <sch:assert test="every $type-qname in tokenize(normalize-space(@memberTypes), ' ') satisfies resolve-QName($type-qname, .) != xs:QName('xs:ENTITY')" >A schema component MUST NOT have an attribute {}memberTypes that includes a value of xs:ENTITY.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[exists(@memberTypes)]"> <sch:assert test="every $type-qname in tokenize(normalize-space(@memberTypes), ' ') satisfies resolve-QName($type-qname, .) != xs:QName('xs:ENTITIES')" >A schema component MUST NOT have an attribute {}memberTypes that includes a value of xs:ENTITIES.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType"> <sch:assert test="exists(parent::xs:schema)" >A complex type definition MUST be top-level.</sch:assert> </sch:rule> </sch:pattern>
Note that this implies that every xs:complexType
element has a name
attribute.
<sch:pattern> <sch:rule context="xs:complexType"> <sch:assert test="some $definition in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($definition))) > 0" >A complex type MUST have a data definition.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term data definition.
<sch:pattern> <sch:rule context="xs:complexType[exists(@mixed)]"> <sch:assert test="xs:boolean(@mixed) = false()" >A complex type definition MUST NOT have mixed content.</sch:assert> </sch:rule> </sch:pattern>
Mixed content allows the mixing of data tags with text. Languages such as XHTML use this syntax for markup of text. NIEM-conformant schemas define XML that is for data exchange, not text markup. Mixed content creates complexity in processing, defining, and constraining content.
Well-defined markup languages exist outside NIEM and may be used with NIEM data. External schema documents may include mixed content and may be used with NIEM. However, mixed content must not be defined by NIEM-conformant schemas in keeping with [Principle 10], above.
<sch:pattern> <sch:rule context="xs:complexContent[exists(@mixed)]"> <sch:assert test="xs:boolean(@mixed) = false()" >A complex type definition with complex content MUST NOT have mixed content.</sch:assert> </sch:rule> </sch:pattern>
See Rule 9-27, No mixed content on complex type (REF, EXT), above, for the rationale for this rule.
<sch:pattern> <sch:rule context="xs:complexType"> <sch:assert test="exists(xs:simpleContent) or exists(xs:complexContent)" >An element xs:complexType MUST have a child element xs:simpleContent or xs:complexContent.</sch:assert> </sch:rule> </sch:pattern>
XML Schema provides shorthand to defining complex content of a complex type, which is to define the complex type with immediate children that specify elements, or other groups, and attributes. In the desire to normalize schema representation of types and to be explicit, NIEM forbids the use of that shorthand.
<sch:pattern> <sch:rule context="xs:complexContent"> <sch:assert test="exists(xs:extension)" >An element xs:complexContent MUST have a child xs:extension.</sch:assert> </sch:rule> </sch:pattern>
NIEM does not support the use of complex type restriction in reference schemas. The use of restriction in a reference schema would reduce the ability for that schema to be reused. Restriction may be used in extension schemas.
These two rules addresses a peculiarity of the XML Schema definition language, which allows a complex type to be constructed using xs:complexContent
, and yet is derived from a complex type that uses xs:simpleContent
. These rules ensure that each type has the content style indicated by the schema. An example is included in the following figure. Note that type niem-xs:integer
is a complex type with simple content.
<xs:complexType name="TreeCountType"> <xs:annotation> <xs:documentation>A data type for a number of trees</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="niem-xs:integer"/> </xs:complexContent> </xs:complexType>
The first rule handles cases that can be determined within a single schema document, while the SET version handles cases that require cross-schema resolution.
<sch:pattern> <sch:rule context="xs:complexType/xs:complexContent/xs:*[ (self::xs:extension or self::xs:restriction) and (some $base-qname in resolve-QName(@base, .) satisfies namespace-uri-from-QName($base-qname) = nf:get-target-namespace(.))]"> <sch:assert test="some $base-type in nf:resolve-type(., resolve-QName(@base, .)) satisfies empty($base-type/self::xs:complexType/xs:simpleContent)" >The base type of complex type that has complex content MUST be a complex type with complex content.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType[ nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument')) or nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument')) ]/xs:complexContent"> <sch:assert test="some $derivation in xs:*[self::xs:extension or self::xs:restriction], $base-qname in resolve-QName($derivation/@base, $derivation), $base-type in nf:resolve-type($derivation, $base-qname) satisfies empty($base-type/self::xs:complexType/xs:simpleContent)" >The base type of complex type that has complex content MUST have complex content.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:simpleContent"> <sch:assert test="exists(xs:extension)" >A complex type definition with simple content schema component MUST have a derivation method of extension.</sch:assert> </sch:rule> </sch:pattern>
This rule ensures that the definition of a complex type with simple content will use XML Schema extension. Under this rule, the structure of these types will be more uniform, as alternate formats are prohibited. The above rule allows for use of xs:restriction
within xs:simpleContent
in extension schemas.
<sch:pattern> <sch:rule context="xs:complexType"> <sch:assert test="empty(@block)" >An element xs:complexType MUST NOT have an attribute {}block.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType"> <sch:assert test="empty(@final)" >An element xs:complexType MUST NOT have an attribute {}final.</sch:assert> </sch:rule> </sch:pattern>
Every element declaration in a NIEM-conformant schema document is a top-level element; rules prohibit the declaration of local elements.
Within a NIEM-conformant schema document, an element may be declared as abstract. Elements may be defined without a type, but any element declaration that has no type must be declared abstract, as specified by Rule 9-38, Untyped element is abstract (REF, EXT), below.
Within an element declaration, the attributes fixed
, nillable
, and substitutionGroup
may be used as per the XML Schema specification. The attribute form
is irrelevant to NIEM, as NIEM-conformant schemas may not contain local element declarations, as specified by Rule 9-36, Element declaration is top-level (REF, EXT), below.
<sch:pattern> <sch:rule context="xs:element[exists(@name)]"> <sch:assert test="exists(parent::xs:schema)" >An element declaration MUST be top-level.</sch:assert> </sch:rule> </sch:pattern>
All schema components defined by NIEM-conformant schemas must be named, accessible from outside the defining schema, and reusable across schemas. Local element declarations provide named elements that are not reusable outside the context in which they are defined. Requiring named NIEM elements to be top level ensures that they are globally reusable.
<sch:pattern> <sch:rule context="xs:element[exists(@name)]"> <sch:assert test="some $definition in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($definition))) > 0" >An element declaration MUST have a data definition.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term data definition.
<sch:pattern> <sch:rule context="xs:schema/xs:element[empty(@type)]"> <sch:assert test="exists(@abstract) and xs:boolean(@abstract) = true()" >A top-level element declaration that does not set the {type definition} property via the attribute "type" MUST have the {abstract} property with a value of "true".</sch:assert> </sch:rule> </sch:pattern>
Untyped element declarations act as wildcards that may carry arbitrary data. By declaring such types abstract, NIEM allows the creation of type independent semantics without allowing arbitrary content to appear in XML instances.
The type xs:anySimpleType
does not have any concrete semantics; The use of xs:anySimpleType
is limited to the case where an abstract element is of type xs:anySimpleType
, to act as a base for concrete implementations of the element.
<sch:pattern> <sch:rule context="xs:element[exists(@type) and resolve-QName(@type, .) = xs:QName('xs:anySimpleType')]"> <sch:assert test="exists(@abstract) and xs:boolean(@abstract) = true()" >An element declaration that has a type xs:anySimpleType MUST have the {abstract} property with a value of "true".</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[exists(@type)]"> <sch:assert test="for $type-qname in resolve-QName(@type, .) return $type-qname = xs:QName('xs:anySimpleType') or namespace-uri-from-QName($type-qname) != xs:anyURI('http://www.w3.org/2001/XMLSchema')" >An element type that is not xs:anySimpleType MUST NOT have a namespace name <namespace-uri-for-prefix>xs</namespace-uri-for-prefix>.</sch:assert> </sch:rule> </sch:pattern>
The prohibition of element types having the XML Schema namespace subsumes a prohibition of the type xs:anyType
.
The XML namespace may be imported into a conformant schema document as if it were conformant. This specification does not enable a reference to any types that may be defined by any implementation of a schema for that namespace.
<sch:pattern> <sch:rule context="xs:element[exists(@type)]"> <sch:assert test="namespace-uri-from-QName(resolve-QName(@type, .)) != 'http://www.w3.org/XML/1998/namespace'" >An element type MUST NOT have a namespace name that is in the XML namespace.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[@type]"> <sch:assert test="every $type-qname in resolve-QName(@type, .), $type-ns in namespace-uri-from-QName($type-qname), $type-local-name in local-name-from-QName($type-qname) satisfies ( $type-qname = xs:QName('xs:anySimpleType') or (($type-ns = nf:get-target-namespace(.) or exists(nf:get-document-element(.)/xs:import[ xs:anyURI(@namespace) = $type-ns and empty(@appinfo:externalImportIndicator)])) and not(ends-with($type-local-name, 'SimpleType'))))" >An element type that is not xs:anySimpleType MUST NOT be a simple type.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element"> <sch:assert test="empty(@block)" >An element xs:element MUST NOT have an attribute {}block.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element"> <sch:assert test="empty(@final)" >An element xs:element MUST NOT have an attribute {}final.</sch:assert> </sch:rule> </sch:pattern>
All elements declared by reference schemas allow a nil value. This enables the ID/IDREF mechanism linking structures:ref
and structures:id
, as described by Section 12.2, Identifiers and references, below.
A developer may constrain the use of nil
in an instance by setting nillable
to false in subset schemas, or by use of non-XML Schema mechanisms, such as Schematron.
<sch:pattern> <sch:rule context="xs:element[@name and (empty(@abstract) or xs:boolean(@abstract) = false())]"> <sch:assert test="exists(@nillable) and xs:boolean(@nillable) = true()" >An element declaration MUST have the {nillable} property with a value of true.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term element declaration.
This section is intentionally blank. It is present in order to ensure that section numbers correspond to [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, as described by Section 9, Rules for a NIEM profile of XML Schema, above.
Within an attribute declaration, the attribute form
is irrelevant to NIEM, as NIEM-conformant schemas may not contain local attribute declarations.
<sch:pattern> <sch:rule context="xs:attribute[exists(@name)]"> <sch:assert test="exists(parent::xs:schema)" >An attribute declaration MUST be top-level.</sch:assert> </sch:rule> </sch:pattern>
All schema components defined by NIEM-conformant schemas are named, accessible from outside the defining schema, and reusable across schemas. Local attribute declarations provide named attributes that are not reusable outside the context in which they are defined. Requiring named NIEM attributes to be top level ensures that they are globally reusable.
<sch:pattern> <sch:rule context="xs:attribute[exists(@name)]"> <sch:assert test="some $definition in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($definition))) > 0" >An attribute declaration MUST have a data definition.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term data definition.
<sch:pattern> <sch:rule context="xs:attribute[exists(@name)]"> <sch:assert test="exists(@type)" >A top-level attribute declaration MUST have a type.</sch:assert> </sch:rule> </sch:pattern>
Untyped XML Schema attributes allow arbitrary content, with no semantics. Attributes must have a type so that specific syntax and semantics will be provided.
There is no explicit prohibition on the use of xs:NOTATION as an attribute type, because it is prohibited by [XML Schema Datatypes].
These types are only explicitly prohibited from attributes, not elements, because the case is covered by a general prohibition against elements having simple types.
<sch:pattern> <sch:rule context="xs:attribute[exists(@type)]"> <sch:assert test="resolve-QName(@type, .) != xs:QName('xs:anySimpleType')" >A schema component MUST NOT have an attribute {}type with a value of xs:anySimpleType.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:attribute"> <sch:assert test="empty(@default)" >An element xs:attribute MUST NOT have an attribute {}default.</sch:assert> </sch:rule> </sch:pattern>
This rule helps to ensure that schema processing does not alter processed data, as described in Section 8.4, Ensure XML parsing does not construct values, above.
The fixed
attribute is described by [XML Schema Structures] Section 3.2.1, The Attribute Declaration Schema Component:
default specifies that the attribute is to appear unconditionally in the post-schema-validation infoset, with the supplied value used whenever the attribute is not actually present; fixed indicates that the attribute value if present must equal the supplied constraint value, and if absent receives the supplied value as for default.
<sch:pattern> <sch:rule context="xs:attribute[exists(@ref) and @use eq 'required']"> <sch:report test="false()" role="warning">This rule does not constrain attribute uses that are required</sch:report> </sch:rule> <sch:rule context="xs:attribute"> <sch:assert test="empty(@fixed)" >An element xs:attribute that is not a required attribute use MUST NOT have an attribute {}fixed.</sch:assert> </sch:rule> </sch:pattern>
This rule helps to ensure that schema processing does not alter processed data, as described in Section 8.4, Ensure XML parsing does not construct values, above. The use of the fixed
attribute may result in alteration of the post-schema-validation infoset, like the use of default
does. This behavior is described by [XML Schema Structures] Section 3.2.1, The Attribute Declaration Schema Component.
<sch:pattern> <sch:rule context="xs:notation"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:notation.</sch:assert> </sch:rule> </sch:pattern>
See Rule 9-7, No base type of xs:NOTATION
(REF, EXT), above, for comments about the use of notations.
Complex content definitions in XML Schema use model group schema components. These schema components, xs:all
, xs:choice
and xs:sequence
, also called compositors, provide for ordering and selection of particles within a model group.
XML Schema defines a particle as an occurrence of xs:element
, xs:sequence
, xs:choice
, xs:any
(wildcard) and xs:group
(model group) within a content model. For example, an xs:sequence
within an XML Schema complex type is a particle. An xs:element
occurring within an xs:sequence
is also a particle.
The use of model groups xs:all
, xs:sequence
, and xs:choice
MUST NOT define the semantics of an instance. The meaning of an element occurrence within an element occurrence MUST be identical, regardless of the model group used to define a schema component.
<sch:pattern> <sch:rule context="xs:all"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:all</sch:assert> </sch:rule> </sch:pattern>
The element xs:all
provides a set of particles (e.g., elements) that may be included in an instance, in no particular order. This compositor does not support a variety of cardinalities, has shown to be confusing in practice, and has functionality that overlaps with NIEM’s use of substitution groups. Use of substitution groups is the preferred method in NIEM schemas for obtaining flexible content models.
<sch:pattern> <sch:rule context="xs:sequence"> <sch:assert test="exists(parent::xs:extension)" >An element xs:sequence MUST be a child of element xs:extension.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:sequence"> <sch:assert test="exists(parent::xs:extension) or exists(parent::xs:restriction)" >An element xs:sequence MUST be a child of element xs:extension or xs:restriction.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:choice"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:choice</sch:assert> </sch:rule> </sch:pattern>
The element xs:choice
provides an exclusive set of particles, one of which may appear in an instance. This can greatly complicate processing and may be difficult to comprehend, satisfy, and reuse.
The element xs:choice
may be used in extension schemas, as it presents a simple way for a schema writer to represent a set of optional content.
<sch:pattern> <sch:rule context="xs:choice"> <sch:assert test="exists(parent::xs:sequence)" >An element xs:choice MUST be a child of element xs:sequence.</sch:assert> </sch:rule> </sch:pattern>
In NIEM schemas, an element use is an element declaration acting as a particle within a content model. Each such element declaration must reference a top-level named element declaration.
Element declarations acting as a particle (particles formed by xs:element
) may have any cardinality. NIEM does not provide additional constraints on the values of the XML Schema properties {min occurs} and {max occurs} on element uses. These properties are described by [XML Schema Structures] Section 3.9.1, The Particle Schema Component.
XML Schema allows each particle to specify cardinality (how many times the particle may appear in an instance). NIEM restricts the cardinality of xs:sequence
particles to exactly one, to ensure that content model definitions are defined in as straightforward a manner as possible.
A schema developer who requires the instance syntax that would be obtained from the use of specific cardinality on sequences should define cardinality on individual element uses.
<sch:pattern> <sch:rule context="xs:sequence"> <sch:assert test="empty(@minOccurs) or xs:integer(@minOccurs) = 1" >An element xs:sequence MUST either not have the attribute {}minOccurs, or that attribute MUST have a value of 1.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:sequence"> <sch:assert test="empty(@maxOccurs) or (@maxOccurs instance of xs:integer and 1 = xs:integer(@maxOccurs))" >An element xs:sequence MUST either not have the attribute {}maxOccurs, or that attribute MUST have a value of 1.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:choice"> <sch:assert test="empty(@minOccurs) or 1 = xs:integer(@minOccurs)" >An element xs:choice MUST either not have the attribute {}minOccurs, or that attribute MUST have a value of 1.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:choice"> <sch:assert test="empty(@maxOccurs) or (@maxOccurs instance of xs:integer and 1 = xs:integer(@maxOccurs))" >An element xs:choice MUST either not have the attribute {}maxOccurs, or that attribute MUST have a value of 1.</sch:assert> </sch:rule> </sch:pattern>
An attribute use has an {attribute declaration} property that is a top-level, named attribute declaration. NIEM-conformant schemas do not define local named attributes within type definitions. Within an attribute use, the attribute use
may be used as per the XML Schema specification.
<sch:pattern> <sch:rule context="xs:any"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:any.</sch:assert> </sch:rule> </sch:pattern>
The xs:any
particle (see Model Group Restrictions for an informative definition of particle) provides a wildcard that may carry arbitrary content. The particle xs:any
may appear within an extension schema document.
<sch:pattern> <sch:rule context="xs:anyAttribute"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:anyAttribute.</sch:assert> </sch:rule> </sch:pattern>
The xs:anyAttribute
element provides a wildcard, where arbitrary attributes may appear.
XML Schema provides NIEM with the ability to apply uniqueness constraints to schema-validated content. These mechanisms, however, establish relationships in a way that is very difficult to understand, extend, and keep consistent through schema reuse.
Note that there is no prohibition on the use of xs:selector
and xs:field
, since according to the rules of the XML Schema definition language, they can only appear within xs:key
, xs:keyref
, and xs:unique
, which are themselves prohibited.
<sch:pattern> <sch:rule context="xs:group"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:group.</sch:assert> </sch:rule> </sch:pattern>
NIEM does not allow groups of elements to be named other than as named complex types. A group in XML Schema creates a named entity that may be included in multiple types, and which consists of a sequence of or choice between element particles. NIEM has not developed a semantic model for these components, and they are not integrated into NIEM’s design.
Per Rule 11-22, Schema uses only known attribute groups (REF, EXT), below, the only attribute groups used in NIEM-conformant schemas are structures:SimpleObjectAttributeGroup
and attribute groups defined by the IC-ISM and IC-NTK schemas. Therefore, NIEM-conformant schemas do not define additional attribute groups.
Note that this rule is written with a context that is not as precise as it could be. Its context is the parent node of the comment node, in order to avoid error messages when executed with common Schematron implementations.
<sch:pattern> <sch:rule context="node()[comment()]"> <sch:report test="true()" role="warning" >An XML Comment is not an XML Schema annotation component; an XML comment SHOULD NOT appear in the schema.</sch:report> </sch:rule> </sch:pattern>
Since XML comments are not associated with any specific XML Schema construct, there is no standard way to interpret comments. XML Schema annotations should be preferred for meaningful information about components. NIEM specifically defines how information should be encapsulated in NIEM-conformant schemas via xs:annotation
elements.
XML Schema provides special annotations for support of automatic processing. The XML Schema specification provides the element xs:appinfo
to carry such content and does not specify what style of content they should carry. In NIEM, xs:appinfo
elements carry structured XML content.
<sch:pattern> <sch:rule context="xs:appinfo/node()"> <sch:assert test="self::comment() or self::element() or self::text()[string-length(normalize-space(.)) = 0]" >A child of element xs:appinfo MUST be an element, a comment, or whitespace text.</sch:assert> </sch:rule> </sch:pattern>
Application information elements are intended for automatic processing; the meaning of an appinfo annotation is provided via elements.
<sch:pattern> <sch:rule context="xs:appinfo/*"> <sch:assert test="namespace-uri() != xs:anyURI('')" >An element that is a child of xs:appinfo MUST have a namespace name.</sch:assert> </sch:rule> </sch:pattern>
The XML namespaces specification includes the concept of content not in a namespace. Use of elements without namespaces can lead to conflicting data definitions, and makes it difficult to identify relevant data definitions.
<sch:pattern> <sch:rule context="xs:appinfo//xs:*"> <sch:assert test="false()" >An element with a namespace name of xs: MUST NOT have an ancestor element xs:appinfo.</sch:assert> </sch:rule> </sch:pattern>
NIEM-conformant schemas are designed to be very easily processed. Although uses of XML Schema elements as content of xs:appinfo
elements could be contrived, it is not current practice and complicates the processing of XML elements by their namespaces and names. Forbidding the use of XML Schema elements outside valid uses of schema simplifies such processing.
The XML Schema language defines that the document element xs:schema
may contain the optional attributes attributeFormDefault
and elementFormDefault
. The values of these attributes are not material to a conformant schema, as each attribute and element defined by a conformant schema is defined as a top-level component, and so each is qualified by its target namespace.
<sch:pattern> <sch:rule context="xs:schema"> <sch:assert test="some $definition in (xs:annotation/xs:documentation)[1] satisfies string-length(normalize-space(string($definition))) > 0" >An element xs:schema MUST have a data definition.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:schema"> <sch:assert test="exists(@targetNamespace)" >The schema MUST define a target namespace.</sch:assert> </sch:rule> </sch:pattern>
Schemas without defined namespaces provide definitions that are ambiguous, in that they are not universally identifiable.
The value of the attribute targetNamespace MUST match the production <absolute-URI> as defined by RFC 3986.
Absolute URIs are the only universally meaningful URIs. URIs include both URLs and URNs. Finding the target namespace using standard XML Base technology is complicated and not specified by XML Schema. Relative URIs are not universally identifiable, as they are context-specific. <absolute-URI>
is a grammar production defined by [RFC 3986] Section 4.3, Absolute URI.
It is very useful to be able to tell one version of a schema from another. Apart from the use of namespaces for versioning, it is sometimes necessary to release multiple versions of schema documents. Such use might include:
In such cases, a different value for the version
attribute implies a different version of the schema. No specific meaning is assigned to specific version identifiers.
An author of an application schema or exchange may use the version
attribute for these purposes within their schemas.
<sch:pattern> <sch:rule context="xs:schema"> <sch:assert test="some $version in @version satisfies string-length(normalize-space(@version)) > 0" >An element xs:schema MUST have an attribute {}version that MUST NOT be empty.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:schema"> <sch:assert test="empty(@blockDefault)" >An element xs:schema MUST NOT have an attribute {}blockDefault.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:schema"> <sch:assert test="empty(@finalDefault)" >An element xs:schema MUST NOT have an attribute {}finalDefault.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:redefine"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:redefine.</sch:assert> </sch:rule> </sch:pattern>
The xs:redefine
element allows an XML Schema document to restrict and extend components from a namespace, in a separate schema document from the one that initially defined that namespace. Such redefinition introduces duplication of definitions, allowing multiple definitions to exist for components from a single namespace. This violates [Principle 9], above, that a single reference schema defines a NIEM-conformant namespace.
<sch:pattern> <sch:rule context="xs:include"> <sch:assert test="false()" >The schema MUST NOT contain the element xs:include.</sch:assert> </sch:rule> </sch:pattern>
Element xs:include
brings schemas defined in separate files into the current namespace. It breaks a namespace up into arbitrary partial schemas, which needlessly complicates the schema structure, making it harder to reuse and process, and also increases the likelihood of conflicting definitions.
Inclusion of schemas that do not have namespaces also complicates schema understanding. This inclusion makes it difficult to find the realization of a specific schema artifact and create aliases for schema components that should be reused. Inclusion of schemas also violates [Principle 9], above, as it uses multiple schemas to construct a namespace.
<sch:pattern> <sch:rule context="xs:import"> <sch:assert test="exists(@namespace)" >An element xs:import MUST have an attribute {}namespace.</sch:assert> </sch:rule> </sch:pattern>
An import that does not specify a namespace is enabling references to components without namespaces. NIEM requires that all components have a defined namespace. It is important that the namespace declared by a schema be universally defined and unambiguous.
An XML Schema document set defines an XML Schema that may be used to validate an XML document. This rule ensures that a schema document set under consideration contains definitions for everything that it references; it has everything necessary to do a complete validation of XML documents, without any unresolved references. Note that some tools may allow validation of documents using partial schemas, when components that are not present are not exercised by the XML document under validation. Such a schema does not meet qualify as a conformant schema document set.
The schema document set must constitute a complete XML Schema; it must contain the definition of every schema component referenced by any component defined by the schema set.
The XML Schema definition language requires that, when a schema document references a component in some other namespace, it must use xs:import
to import the namespace of the referenced component. The use of xs:import
is described by [XML Schema Structures] Section 4.2.3, References to schema components across namespaces.
Some tools do not enforce this constraint; one such tool carries imports from a schema document into schema documents that it imports. This has the potential to introduce incompatibility into schema documents and schema document sets that exercise this bug. To maintain compatibility across tool sets, this requirement is an explicit rule for NIEM-conformant schemas.
<sch:pattern> <sch:rule context="xs:*[@type]"> <sch:assert test="every $namespace in namespace-uri-from-QName(resolve-QName(@type, .)) satisfies ( $namespace = nf:get-target-namespace(.) or $namespace = xs:anyURI('http://www.w3.org/2001/XMLSchema') or nf:get-document-element(.)/xs:import[xs:anyURI(@namespace) = $namespace])" >The namespace of a type referenced by @type MUST be the target namespace, the XML Schema namespace, or be imported.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[@base]"> <sch:assert test="every $namespace in namespace-uri-from-QName(resolve-QName(@base, .)) satisfies ( $namespace = nf:get-target-namespace(.) or $namespace = xs:anyURI('http://www.w3.org/2001/XMLSchema') or nf:get-document-element(.)/xs:import[xs:anyURI(@namespace) = $namespace])" >The namespace of a type referenced by @base MUST be the target namespace, the XML Schema namespace, or be imported.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[@itemType]"> <sch:assert test="every $namespace in namespace-uri-from-QName(resolve-QName(@itemType, .)) satisfies ( $namespace = nf:get-target-namespace(.) or $namespace = xs:anyURI('http://www.w3.org/2001/XMLSchema') or nf:get-document-element(.)/xs:import[xs:anyURI(@namespace) = $namespace])" >The namespace of a type referenced by @itemType MUST be the target namespace, the XML Schema namespace, or be imported.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[@memberTypes]"> <sch:assert test="every $type in tokenize(normalize-space(@memberTypes), ' '), $namespace in namespace-uri-from-QName(resolve-QName($type, .)) satisfies ( $namespace = nf:get-target-namespace(.) or $namespace = xs:anyURI('http://www.w3.org/2001/XMLSchema') or nf:get-document-element(.)/xs:import[xs:anyURI(@namespace) = $namespace])" >The namespace of a type referenced by @memberTypes MUST be the target namespace, the XML Schema namespace, or be imported.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[@ref]"> <sch:assert test="every $namespace in namespace-uri-from-QName(resolve-QName(@ref, .)) satisfies $namespace = nf:get-target-namespace(.) or nf:get-document-element(.)/xs:import[xs:anyURI(@namespace) = $namespace]" >The namespace of a component referenced by @ref MUST be the target namespace or be imported.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[@substitutionGroup]"> <sch:assert test="every $namespace in namespace-uri-from-QName(resolve-QName(@substitutionGroup, .)) satisfies $namespace = nf:get-target-namespace(.) or nf:get-document-element(.)/xs:import[xs:anyURI(@namespace) = $namespace]" >The namespace of a component referenced by @substitutionGroup MUST be the target namespace or be imported.</sch:assert> </sch:rule> </sch:pattern>
This section focuses on building NIEM data models using the XML Schema definition language. Whereas Section 9, Rules for a NIEM profile of XML Schema, above, addressed shrinking the XML Schema definition language to a smaller set of features, this section constructs new NIEM-specific features to address modeling and interoperability problems. This includes naming rules, categories of types, and augmentations.
NIEM provides a framework for modeling concepts and relationships as XML artifacts. The data model is implemented via XML Schema. However, XML Schema does not provide sufficient structure and constraint to enable translating from a conceptual model to a schema and then to instances of the concepts. NIEM provides additional support for modeling concepts as schemas and provides rules for creating and connecting data that realizes those concepts.
Underlying the NIEM data model are two namespaces: the structures namespace and the appinfo namespace. These two namespaces provide schema components that serve two functions:
These namespaces are distributed with the NIEM data model content but are not themselves considered to be content of the data model. They are, instead, part of the structure on which the data model is built.
This section is organized by concept, rather than component type. This section is integrated with the following sections:
Concepts covered by this section include:
Representationpattern
The rules in this document use the name of a type as the key indicator of the type’s category. This makes the rules much simpler than doing a deep examination of each type (and its base types) to identify its category. For example, for complex types, the names follow a pattern:
AssociationType→ type is an association type.
MetadataType→ type is a metadata type.
AugmentationType→ type is an augmentation type.
Within the schema, a complex type definition MUST be one of the following:
This rule establishes the categories of NIEM complex types. It is a limited set, and each category has distinct semantics, as described by following sections.
The categories of objects are covered by the following sections:
In a NIEM-conformant schema, an object type is a complex type definition, an instance of which asserts the existence of an object. An object type represents some kind of object: a thing with its own lifespan that has some existence. The object may or may not be a physical object. It may be a conceptual object.
<sch:pattern> <sch:rule context="xs:complexType[exists(xs:complexContent) and not(ends-with(@name, 'AssociationType') or ends-with(@name, 'MetadataType') or ends-with(@name, 'AugmentationType'))]"> <sch:assert test=" every $derivation-method in (xs:complexContent/xs:extension, xs:complexContent/xs:restriction), $base in $derivation-method/@base, $base-qname in resolve-QName($base, $derivation-method), $base-local-name in local-name-from-QName($base-qname) satisfies ( $base-qname = xs:QName('structures:ObjectType') or not(ends-with($base-local-name, 'AssociationType') or ends-with($base-local-name, 'MetadataType') or ends-with($base-local-name, 'AugmentationType')))" >An object type with complex content MUST be derived from structures:ObjectType or from another object type.</sch:assert> </sch:rule> </sch:pattern>
A base type definition with a {target namespace} that is the XML namespace is prohibited by Rule 9-1, No base type in the XML namespace (REF, EXT), above. A base type definition with a {target namespace} that is not imported as conformant is prohibited by Rule 11-2, Base type definition defined by conformant schema (REF, EXT), below.
NIEM differentiates between an object and a role of the object. The term role
is used here to mean a function or part played by some object. The simplest way to represent a role of an object is to use an element. The following element declaration models the role of a person who undergoes an assessment:
<xs:element name="AssessmentPerson" type="nc:PersonType" nillable="true"> <xs:annotation> <xs:documentation>A person who undergoes an assessment.</xs:documentation> </xs:annotation> </xs:element>
In many cases, there is a further need to represent characteristics and additional information associated with a role of an object. In such cases, the above element is insufficient. When a role must be modeled with additional information, a role type is called for.
For example, when a person is a driver involved in an automotive crash, that person has a particular role in the crash, which is modeled by the element j:CrashDriver
.
<xs:element name="CrashDriver" type="j:CrashDriverType" nillable="true"> <xs:annotation> <xs:documentation>A motor vehicle driver involved into a traffic accident.</xs:documentation> </xs:annotation> </xs:element>
There is more information associated with this role of the driver than just his identity as a person. Information associated with this role include the drivers license, contributing circumstances, distractions, and other properties. These characteristics are modeled as shown in the following figure. The role is modeled as a role type:
<xs:complexType name="CrashDriverType"> <xs:annotation> <xs:documentation>A data type for a motor vehicle driver involved in a traffic accident.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="structures:ObjectType"> <xs:sequence> <xs:element ref="nc:RoleOfPerson" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:DriverLicense" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:CrashDriverContributingCircumstances" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:CrashDriverDistraction" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:CrashDriverViolation" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:CrashDrivingViolation" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:CrashDriverAugmentationPoint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
Role types were introduced into NIEM after XML Schema extension proved to be insufficient in certain situations. An object may have multiple functions in the same instance document, each with associated data. For example, a person might be both a j:CrashDriver
and a j:ArrestSubject
. Without roles, information about the person would be duplicated in extensions, or would be left ambiguously blank in some places.
Role types and RoleOf elements enable more precise semantics. With roles, a single base object (e.g., a person) can have multiple roles or functions within a message (e.g., a victim, a witness, and a subject). A role type can reference a base object, rather than duplicate it. Role types allow function information to be defined once for multiple base objects, such as a single j:VictimType
, which represents victim information for persons, organizations, and items (e.g., via nc:RoleOfPerson
, nc:RoleOfOrganization
, and nc:RoleOfItem
).
The term role type has a normative definition:
A role type is an object type that represents a particular function, purpose, usage, or role of one or more objects of its base type.
A role type describes a role of a thing. A role is a function or position played by something in a particular situation or context. A role type holds information that is specific to the role, but that is not specific to the context, and is not specific to thing that plays the role.
In the example (Figure 10-5, An XML instance of a role type, below), a person (John Doe) has the role of being a driver in a crash. Associated with this role are descriptions of a law violation related to him and a law violation related to his driving behavior. These are properties of his role as a driver in a crash.
This data is described by a role type, j:CrashDriverType
(described by Figure 10-3, Role type j:CrashDriverType
, modeling a driver involved in a crash, above), which carries elements and attributes that are properties of the role. The role type also carries a RoleOf element, which indicates the base type for the role. The role type describes a role of the base type, which in this case is nc:PersonType
, as identified by the type of nc:RoleOfPerson
defined by Figure 10-4, Declaration of RoleOf element nc:RoleOfPerson
, below.
Developers of NIEM-conformant schemas and exchanges should create and use role types whenever they have information specific to a base object’s function. Such information is a characteristic of the role, and not of the base object. Information that is a characteristic of a base object probably does not belong in a role type.
A RoleOf element is an element declaration that
RoleOf.
A RoleOf element represents a base type for a role type.
We saw the use of RoleOf element nc:RoleOfPerson
in Figure 10-3, Role type j:CrashDriverType
, modeling a driver involved in a crash, above. Its definition is the following figure:
<xs:element name="RoleOfPerson" type="nc:PersonType" substitutionGroup="nc:RoleOf" nillable="true"> <xs:annotation> <xs:documentation>A person of whom the role object is a function.</xs:documentation> </xs:annotation> </xs:element>
Here is an example of the j:CrashDriver
role type used in an instance:
<j:CrashDriver> <nc:RoleOfPerson structures:ref="BRAVO" xsi:nil="true"/> <j:CrashDriverViolationCode>A10</j:CrashDriverViolationCode> <j:CrashDrivingViolationCode>S16</j:CrashDrivingViolationCode> </j:CrashDriver> <nc:Person structures:id="BRAVO"> <nc:PersonBirthDate> <nc:Date>1966-06-06</nc:Date> </nc:PersonBirthDate> <nc:PersonName> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:Person>
Note that the value of the j:CrashPerson
element was indicated above using a reference; it could have been shown as a content element, instead.
<sch:pattern> <sch:rule context="xs:element[@name[starts-with(., 'RoleOf')]]"> <sch:assert test="every $type in @type, $type-local-name in local-name-from-QName(resolve-QName($type, .)) satisfies not(ends-with($type-local-name, 'AssociationType') or ends-with($type-local-name, 'MetadataType') or ends-with($type-local-name, 'AugmentationType'))" >The type definition of a RoleOf element MUST be an object type.</sch:assert> </sch:rule> </sch:pattern>
Note that by Rule 11-12, Element type is from conformant namespace (REF, EXT), below, the element’s type must be from a conformant namespace.
<sch:pattern> <sch:rule context="xs:complexType[ empty(@appinfo:externalAdapterTypeIndicator) and exists(descendant::xs:element[ exists(@ref[ starts-with(local-name-from-QName(resolve-QName(., ..)), 'RoleOf')])])]"> <sch:assert test="not(ends-with(@name, 'AssociationType') or ends-with(@name, 'MetadataType') or ends-with(@name, 'AugmentationType'))" >A complex type that includes a RoleOf element in its content model MUST be an object type.</sch:assert> </sch:rule> </sch:pattern>
Note that RoleOf element and object type are defined terms.
An element declaration that has a local name that begins with the string RoleOf
MUST represent a base type, of which the containing element instance represents a role.
When a parent element has a child element valid to an element declaration that is a RoleOf element,
An instance of a RoleOf element indicates the base object of a role. The prefix RoleOf
on the element ensures that a role object may be distinguished from other objects and that its link to the base object is also distinguishable from the additional properties that are characteristics or other data of the role.
NIEM does not require that there be only one RoleOf element within a single type, nor does it require that a particular role object have only a single occurrence of a RoleOf element. However, the use of multiple RoleOf elements may not make sense in all cases. An exchange specification may restrict RoleOf elements to a single occurrence within a type.
This specification does not require that a RoleOf element occur in an instance of a role type. In such a case, the instance of the role type behaves like any other type; it simply does not have a reference to its base object. For example, we may talk about a weapon’s use in an incident without referring to the car that acted as the weapon.
There are a variety of commonly used standards that are represented in XML Schema. Such schemas are generally not NIEM-conformant. NIEM-conformant schemas may reference components defined by these external schema documents. This section provides rules under which NIEM-conformant components may be constructed from schema components that are not NIEM-conformant.
An external schema document is any schema document that is not one of
Note that, although the schema document for the structures namespace is not conformant, it is not considered an external schema document because it defines the fundamental framework on which NIEM is built; it is considered a supporting namespace. It is not considered an external schema document because of its supporting nature and is thus a special case of this definition.
A schema component defined by an external schema document may be called an external component. A NIEM-conformant type may use external components in its definition. There are two ways to integrate external components into a NIEM-conformant schema:
For example, a NIEM-conformant type may be created to represent a bibliographic reference from an external standard. Such an object may be composed of multiple elements (of multiple types) from the external standard. These pieces are put together to form a single NIEM-conformant external adapter type. For example, an author element, a book element, and a publisher element may be used to define a single bibliographic entry type.
A NIEM-conformant type built from these components may be used as any other NIEM-conformant type. That is, elements may be constructed from such a type, and those elements are fully NIEM-conformant.
To construct such a component, a NIEM-conformant schema must import the namespace defined by the external schema document.
Rule 11-48, Reference schema document imports reference schema document (SET), below, and Rule 11-49, Extension schema document imports reference or extension schema document (SET), below, require that xs:import
elements be consistent with an importing schema document.
A NIEM-conformant schema has well-known documentation points. Therefore, a schema that imports a NIEM-conformant namespace need not provide additional documentation for the imported namespace. However, when an external schema document is imported, appropriate documentation must be provided on the xs:import
element. This ensures that documentation for all external schema documents will be both available and accessible in a consistent manner.
<sch:pattern> <sch:rule context="xs:import[@appinfo:externalImportIndicator]"> <sch:assert test="some $definition in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($definition))) > 0" >An element xs:import that is annotated as importing an external schema document MUST be a documented component.</sch:assert> </sch:rule> </sch:pattern>
An external adapter type is a NIEM-conformant type that adapts external components for use within NIEM. An external adapter type creates a new class of object that embodies a single concept composed of external components. A NIEM-conformant schema defines an external adapter type.
A type is an external adapter type if and only if it is a complex type with application information of attribute appinfo:externalAdapterTypeIndicator
with a value of true
.
An external adapter type should contain the information from an external standard to express a complete concept. This expression should be composed of content entirely from an external schema document. Most likely, the external schema document will be based on an external standard with its own legacy support.
In the case of an external expression that is in the form of model groups, attribute groups, or types, additional elements and type components may be created in an external schema document, and the external adapter type may use those components.
In normal (conformant) type definition, a reference to an attribute or element is a reference to a documented component. Within an external adapter type, the references to the attributes and elements being adapted are references to undocumented components. These components must be documented to provide comprehensibility and interoperability. Since documentation made available by nonconformant schemas is undefined and variable, documentation of these components is required at their point of use, within the conformant schema.
<sch:pattern> <sch:rule context="xs:complexType[@appinfo:externalAdapterTypeIndicator]"> <sch:assert test="xs:complexContent/xs:extension[ resolve-QName(@base, .) = xs:QName('structures:ObjectType') ]/xs:sequence" >An external adapter type definition MUST be a complex type definition with complex content that extends structures:ObjectType, and that uses xs:sequence as its top-level compositor.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[@ref and exists(ancestor::xs:complexType[exists(@appinfo:externalAdapterTypeIndicator)])]"> <sch:assert test="some $ref-namespace in namespace-uri-from-QName(resolve-QName(@ref, .)) satisfies nf:get-document-element(.)/xs:import[ $ref-namespace = xs:anyURI(@namespace) and @appinfo:externalImportIndicator]" >An element reference that appears within an external adapter type MUST have a target namespace that is imported as external.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[(self::xs:extension or self::xs:restriction) and (some $base-qname in resolve-QName(@base, .), $base-namespace in namespace-uri-from-QName($base-qname) satisfies nf:get-target-namespace(.) = $base-namespace)]"> <sch:assert test="nf:resolve-type(., resolve-QName(@base, .))[ empty(@appinfo:externalAdapterTypeIndicator)]" >An external adapter type definition MUST NOT be a base type definition.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:*[(self::xs:extension or self::xs:restriction) and (nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument')) or nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument'))) and (some $base-qname in resolve-QName(@base, .), $base-namespace in namespace-uri-from-QName($base-qname) satisfies not($base-namespace = (nf:get-target-namespace(.), xs:anyURI('http://www.w3.org/2001/XMLSchema'))))]"> <sch:assert test="nf:resolve-type(., resolve-QName(@base, .))[ empty(@appinfo:externalAdapterTypeIndicator)]" >An external adapter type definition MUST NOT be a base type definition.</sch:assert> </sch:rule> </sch:pattern>
Each external adapter type is meant to stand alone; each type expresses a single concept, and is built from schema components from one or more external schema documents.
A complex type that is defined by a reference schema document is permitted to contain an attribute use schema component only if it is an external adapter type. This does not apply to a complex type defined by an extension schema document, which is permitted to use external attributes, as long as each attribute use is a documented component, per Rule 10-14, External attribute use has data definition (REF, EXT), below.
<sch:pattern> <sch:rule context="xs:attribute[some $ref-namespace in namespace-uri-from-QName(resolve-QName(@ref, .)), $import in ancestor::xs:schema[1]/xs:import satisfies ( xs:anyURI($import/@namespace) = $ref-namespace and exists($import/@appinfo:externalImportIndicator))]"> <sch:assert test="exists(ancestor::xs:complexType[1]/@appinfo:externalAdapterTypeIndicator)" >An external attribute use MUST be in an external adapter type.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term external adapter type.
<sch:pattern> <sch:rule context="xs:attribute[some $ref-namespace in namespace-uri-from-QName(resolve-QName(@ref, .)), $import in ancestor::xs:schema[1]/xs:import satisfies ( xs:anyURI($import/@namespace) = $ref-namespace and exists(@appinfo:externalImportIndicator))]"> <sch:assert test="some $documentation in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($documentation))) > 0" >An external attribute use MUST be a documented component with a non-empty data definition.</sch:assert> </sch:rule> </sch:pattern>
The terms documented component and data definition are defined.
NIEM schemas use structures:id
to enable references between components. Each NIEM-defined complex type must incorporate a definition for structures:id
. [XML] Section 3.3.1, Attribute Types entails that a complex type may have no more than one ID attribute. This means that an external attribute use must not be an ID attribute.
An attribute use schema component MUST NOT have an {attribute declaration} with an ID type.
The term attribute use schema component
is defined by [XML Schema Structures] Section 3.5.1, The Attribute Use Schema Component. Attribute type ID is defined by [XML] Section 3.3.1, Attribute Types.
<sch:pattern> <sch:rule context="xs:element[ some $ref-namespace in namespace-uri-from-QName(resolve-QName(@ref, .)) satisfies nf:get-document-element(.)/self::xs:schema//xs:import[ xs:anyURI(@namespace) = $ref-namespace and @appinfo:externalImportIndicator]]"> <sch:assert test="some $documentation in xs:annotation/xs:documentation[1] satisfies string-length(normalize-space(string($documentation))) > 0" >An external attribute use MUST be a documented component with a non-empty data definition.</sch:assert> </sch:rule> </sch:pattern>
The terms documented component and data definition are defined.
A code type is a NIEM object type for which each simple value carried by the type corresponds to an entry in a list of distinct conceptual entities.
These types represent lists of values, each of which has a known meaning beyond the text representation. These values may be meaningful text or may be a string of alphanumeric identifiers that represent abbreviations for literals.
Many code types have simple content composed of xs:enumeration
values. Code types may also be constructed using the NIEM Code Lists Specification [Code Lists], which supports code lists defined using a variety of methods, including CSV spreadsheets.
<sch:pattern> <sch:rule context="xs:complexType[exists(xs:simpleContent[ exists(xs:*[local-name() = ('extension', 'restriction') and (ends-with(@base, 'CodeSimpleType') or ends-with(@base, 'CodeType'))])])]"> <sch:report role="warning" test="not(ends-with(@name, 'CodeType'))" >A complex type definition with a {base type definition} of a code type or code simple type SHOULD have a {name} that ends in 'CodeType'.</sch:report> </sch:rule> </sch:pattern>
See Section 11.1.2.3, Code simple types, below, for the definition of code simple type.
<sch:pattern> <sch:rule context="xs:element[exists(@name) and exists(@type) and ends-with(@type, 'CodeType')]"> <sch:report role="warning" test="not(ends-with(@name, 'Code'))" >An element with a type that is a code type SHOULD have a name with representation term "Code"</sch:report> </sch:rule> </sch:pattern>
Using the qualifier Code
(e.g. CodeType
, CodeSimpleType
) immediately identifies that a data component may carry values from a fixed list of codes. These types may be handled in specific ways, as lists of codes are expected to have their own lifecycles, including versions and periodic updates. Codes may also have responsible authorities behind them who provide concrete semantic bindings for the code values.
The NIEM 4.0 release schema niem/proxy/xsd/4.0/xs.xsd
provides complex type bases for some of the simple types in the XML Schema namespace. The complex types in this schema reuse the local names of the XML Schema simple types they extend, even though those names don’t follow the naming structure of most conformant complex types. There is a special exception to naming rules to allow the reuse of the XML Schema simple type names in conformant schemas. This is done to make conformant schemas more understandable to people that are familiar with the names of the XML Schema namespace simple types.
A complex type that is a direct extension of a simple type from the XML Schema namespace (e.g., xs:string
, xs:integer
, xs:boolean
) is allowed to have the same local name as the XML Schema simple type, if and only if the extension adds no content other than the attribute group structures:SimpleObjectAttributeGroup
. This allows for an intuitive name when using an XML Schema simple type in a conformant schema.
<sch:pattern> <sch:rule context="xs:complexType[some $name in @name, $extension in xs:simpleContent/xs:extension, $base-qname in resolve-QName($extension/@base, $extension) satisfies $base-qname = QName('http://www.w3.org/2001/XMLSchema', $name)]"> <sch:assert test="xs:simpleContent[ xs:extension[ empty(xs:attribute) and count(xs:attributeGroup) = 1 and xs:attributeGroup[ resolve-QName(@ref, .) = xs:QName('structures:SimpleObjectAttributeGroup')]]]" >A proxy type MUST have the designated structure. It MUST use xs:extension. It MUST NOT use xs:attribute. It MUST include exactly one xs:attributeGroup reference, which must be to structures:SimpleObjectAttributeGroup.</sch:assert> </sch:rule> </sch:pattern>
Within NIEM data, an association is a specific relationship between objects. Associations are used when a simple NIEM property is insufficient to model the relationship clearly, or when you want to model properties of the relationship itself.
Here is an example of an association in an XML instance:
<scr:PersonPhoneAssociation> <nc:Person> <nc:PersonName> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:Person> <nc:TelephoneNumber> <nc:FullTelephoneNumber> <nc:TelephoneNumberFullID>(212)555-1212</nc:TelephoneNumberFullID> </nc:FullTelephoneNumber> </nc:TelephoneNumber> </scr:PersonPhoneAssociation>
This example shows an association between a person and a phone number. This relationship is defined by the association element declaration scr:PersonPhoneAssociation
, the structure of which is defined by the association type scr:PersonPhoneAssociationType
. In practice, an association type usually defines what kinds of things the association relates, while the association element may refine the meaning of the association.
An example of an association type defined by an XML Schema document follows, in Figure 10-8, A definition of an association type, below.
Note that the NIEM Core schema in NIEM 4.0 defines a type nc:AssociationType
, which acts as the base type for all of the other association types defined within NIEM Core. This is a convention adopted by that version of NIEM Core namespace, but is not a requirement of this document. An implementer of a NIEM-conformant schema is not required by this specification to base a new association type on nc:AssociationType
.
<xs:complexType name="PersonPhoneAssociationType"> <xs:annotation> <xs:documentation>A data type for a relationship between a PERSON and a PHONE.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="nc:AssociationType"> <xs:sequence> <xs:element ref="nc:Person" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="nc:TelephoneNumber" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="PersonPhoneAssociation" type="scr:PersonPhoneAssociationType" nillable="true"> <xs:annotation> <xs:documentation>An association between a PERSON and a PHONE.</xs:documentation> </xs:annotation> </xs:element>
This schema fragment shows the definition of an association type that defines a relationship between a person and a telephone number. This is followed by the definition of an association element declaration that uses the association type.
An association is a conformant element information item that establishes a relationship between two or more objects, optionally including properties of that relationship. An association is an instance of an association element declaration, and has a type that is an association type.
An association element declaration is an element declaration declared in a reference schema document or extension schema document that describes a relationship between two or more objects, optionally including properties of that relationship.
In a NIEM-conformant schema, an association type is a complex type definition defined in a reference schema document or extension schema document that establishes a relationship between two or more objects, optionally including the properties of that relationship.
<sch:pattern> <sch:rule context="xs:complexType"> <sch:let name="is-association-type" value="exists(@name[ends-with(., 'AssociationType')])"/> <sch:let name="has-association-base-type" value=" exists(xs:complexContent[ exists(xs:*[local-name() = ('extension', 'restriction') and exists(@base[ends-with(., 'AssociationType')])])])"/> <sch:assert test="$is-association-type = $has-association-base-type" >A type MUST have an association type name if and only if it is derived from an association type.</sch:assert> </sch:rule> </sch:pattern>
Associations types are easily identifiable as such and have a common base type, structures:AssociationType
. Using the qualifier Association
immediately identifies a type as an association type.
<sch:pattern> <sch:rule context="xs:element[exists(@name)]"> <sch:assert test="exists(@type[ends-with(., 'AssociationType')]) = exists(@name[ends-with(., 'Association')])" >An element MUST have a name that ends in 'Association' if and only if it has a type that is an association type.</sch:assert> </sch:rule> </sch:pattern>
Using the qualifier Association
immediately identifies an element as representing an association. This document defines the term association type.
Developers of domain schemas and other schemas that build on and extend the NIEM release schemas need to be able to define additional characteristics of common types. For example, the JXDM domain, which addresses justice and public safety concerns, considers the following elements to be characteristics of a person, as defined by nc:PersonType
:
j:PersonMedicalInsuranceIndicator
j:PersonProfessionalCertificateText
j:PersonSightedIndicator
j:PersonFBIIdentification
There are several approaches that could be used to by a domain to add elements to a common type. One method is to have each domain create an extension of nc:PersonType
(using xs:extension
) that adds elements and attributes for the needed content. Some of the problems with this approach include:
nc:PersonType
, each with common content and extension-specific content.nc:PersonType
, j:PersonType
, and im:PersonType
.This approach turns into a morass that is difficult to use and maintain, and which does not scale to support the breadth of the NIEM community.
To handle this need, NIEM has adopted augmentations. There are several parts that fit together for the definition and use of augmentations:
Each object type and association type carries an augmentation point element, which provides a place for domain- and extension-specific content in the type. Augmentation points are optional in extension schema documents, but must appear in reference schema documents. Augmentation points are also defined for the base types for object types and association types:
structures:ObjectType
has augmentation point structures:ObjectAugmentationPoint
.structures:AssociationType
has augmentation point structures:AssociationAugmentationPoint
.A developer of an information exchange may choose, through selection and subsetting reference schemas:
structures:ObjectType
and structures:AssociationType
. This allows schema developers to define elements that may be applied to any object or association.In addition, a developer may create an extension of a base type and have it carry augmentation elements, in order to avoid element substitution and flexible content models; whether to substitute or concretely use the elements is at the discretion of the developers and implementers of an information exchange.
The term augmentation describes any element in a NIEM-conformant instance XML document that appears as a result of being substituted for an augmentation point element. Such an element may have a type that is an augmentation type, or it may be a direct element that represents a property.
An augmentation is a conformant element information item that:
As an example, here is a definition for nc:PersonType
, which includes its augmentation point element:
<xs:complexType name="PersonType"> <xs:annotation> <xs:documentation>A data type for a human being.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="structures:ObjectType"> <xs:sequence> <xs:element ref="nc:PersonBirthDate" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="nc:PersonName" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="nc:PersonAugmentationPoint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
Note that the augmentation point element has the same namespace and name as the type, with the suffix Type
replaced by AugmentationPoint
. The augmentation point is also defined with cardinality (minOccurs 0, maxOccurs unbounded) to ensure that it can support an arbitrary number of augmentations, and can be subset or constrained as needed. The augmentation point is the last element used by its type; it is always last in the sequence. The definition of the augmentation point is pretty simple:
<xs:element name="PersonAugmentationPoint" abstract="true"> <xs:annotation> <xs:documentation>An augmentation point for PersonType.</xs:documentation> </xs:annotation> </xs:element>
The augmentation point element is abstract and typeless. This enables the substitution of elements that have simple content, elements that have complex content, or elements that are of an augmentation type. The JXDM domain defines an augmentation type and a corresponding augmentation element that substitutes for this augmentation point:
<xs:complexType name="PersonAugmentationType"> <xs:annotation> <xs:documentation>A data type for additional information about a person.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="structures:AugmentationType"> <xs:sequence> <xs:element ref="j:PersonMedicalInsuranceIndicator" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:PersonProfessionalCertificateText" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:PersonSightedIndicator" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="j:PersonFBIIdentification" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="PersonAugmentation" type="j:PersonAugmentationType" substitutionGroup="nc:PersonAugmentationPoint"> <xs:annotation> <xs:documentation>Additional information about a person.</xs:documentation> </xs:annotation> </xs:element>
The augmentation type is derived from structures:AugmentationType
and has a name ending in AugmentationType
. The augmentation element uses the type, and has a name ending in Augmentation
. Note that the thing that binds the augmentation type to the augmentation point is the augmentation element’s use of the augmentation point element as its substitution group. This means that an augmentation type can be reused for multiple types, by creating more augmentation elements that have that type, each with its own substitution group for a different augmentation point.
In addition to defining elements that use an augmentation type, a schema document may define an element that substitutes for an augmentation point element, but does not use an augmentation type. For example, the following CBRN namespace defines an augmentation to nc:ScheduleType
. While an element of an augmentation type acts as a container, holding elements that apply to an augmented object, this element is a direct property of a schedule, providing a meaningful characteristic (hours of operation) for a schedule. The resulting syntax is briefer than it would be using an augmentation type; the resulting instance looks similar to how it might look if the schedule type had been extended, rather than augmented.
<xs:element name="OperatingSchedule" type="cbrn:OperatingScheduleType" substitutionGroup="nc:ScheduleAugmentationPoint"> <xs:annotation> <xs:documentation>A schedule providing the beginning and ending hours of operation by weekday, for a designated time period.</xs:documentation> </xs:annotation> </xs:element>
The type of this element is not an augmentation type. Instead, it is its own object, not meant to just add to another type:
<xs:complexType name="OperatingScheduleType"> <xs:annotation> <xs:documentation>A data type for a schedule providing the beginning and ending hours of operation by weekday, for a designated time period.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="structures:ObjectType"> <xs:sequence> <xs:element ref="cbrn:ScheduleStartDateTime" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="cbrn:ScheduleEndDateTime" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="cbrn:OperatingScheduleAugmentationPoint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
This method can be used by an information exchange developer to define individual attributes that can be applied to any augmentable type.
Note that the augmentation method can introduce an additional element into every object type or association type in an exchange, which provides opportunity for some errors in schema development. It is important that developers of exchanges not introduce elements substitutable for an augmentation point into complex types multiple ways, as it can introduce XML Schema’s Unique Particle Attribution errors. A single complex type should not introduce an element via both element substitution and element reference. This constraint is also supported by Rule 11-19, Element or attribute declaration introduced only once into a type (REF, EXT), below.
An augmentable type is complex type definition that
is either
<sch:pattern> <sch:rule context="xs:complexType[ @name[not(ends-with(., 'MetadataType')) and not(ends-with(., 'AugmentationType'))] and empty(@appinfo:externalAdapterTypeIndicator) and xs:complexContent]"> <sch:let name="augmentation-point-qname" value="QName(string(nf:get-target-namespace(.)), replace(./@name, 'Type$', 'AugmentationPoint'))"/> <sch:assert test="xs:complexContent/xs:extension/xs:sequence/xs:element[ @ref[resolve-QName(., ..) = $augmentation-point-qname]]" >An augmentable type MUST contain an element use of its corresponding augmentation point element.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType[ @name[not(ends-with(., 'MetadataType')) and not(ends-with(., 'AugmentationType'))] and empty(@appinfo:externalAdapterTypeIndicator) and xs:complexContent]"> <sch:let name="augmentation-point-qname" value="QName(string(nf:get-target-namespace(.)), replace(./@name, 'Type$', 'AugmentationPoint'))"/> <sch:assert test="count(xs:complexContent/xs:extension/xs:sequence/xs:element[ @ref[resolve-QName(., ..) = $augmentation-point-qname]]) le 1" >An augmentable type MUST contain no more than one element use of its corresponding augmentation point element.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[exists(@name[ matches(., 'AugmentationPoint$')])]"> <sch:let name="element-name" value="@name"/> <sch:assert test="exists( parent::xs:schema/xs:complexType[ @name = replace($element-name, 'AugmentationPoint$', 'Type') and exists(@name[ not(ends-with(., 'MetadataType')) and not(ends-with(., 'AugmentationType'))]) and empty(@appinfo:externalAdapterTypeIndicator) and exists(child::xs:complexContent)])" >A schema document containing an element declaration for an augmentation point element MUST also contain a type definition for its base type, a corresponding augmentable type.</sch:assert> </sch:rule> </sch:pattern>
This document defines the terms schema document, element declaration, and augmentable type.
<sch:pattern> <sch:rule context="xs:element[exists(@name[ matches(., 'AugmentationPoint$')])]"> <sch:assert test="empty(@type)" >An augmentation point element MUST have no type.</sch:assert> </sch:rule> </sch:pattern>
Because an augmentation point element has no type, it will be abstract, per Rule 9-38, Untyped element is abstract (REF, EXT), above
<sch:pattern> <sch:rule context="xs:complexType//xs:element[exists(@ref[ matches(local-name-from-QName(resolve-QName(., ..)), 'AugmentationPoint$')]) ]"> <sch:assert test="QName(string(nf:get-target-namespace(ancestor::xs:complexType[1])), ancestor::xs:complexType[1]/@name) = QName(string(namespace-uri-from-QName(resolve-QName(@ref, .))), replace(local-name-from-QName(resolve-QName(@ref, .)), 'AugmentationPoint$', 'Type'))" >An augmentation point element MUST only be referenced by its base type.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType//xs:element[exists(@ref[ matches(local-name-from-QName(resolve-QName(., ..)), 'AugmentationPoint$')]) ]"> <sch:assert test="exists(@minOccurs) and xs:integer(@minOccurs) = 0" >An augmentation point element particle MUST have attribute minOccurs equal to 0.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType//xs:element[exists(@ref[ matches(local-name-from-QName(resolve-QName(., ..)), 'AugmentationPoint$')]) ]"> <sch:assert test="exists(@maxOccurs) and string(@maxOccurs) = 'unbounded'" >An augmentation point element particle MUST have attribute maxOccurs set to unbounded.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType//xs:element[exists(@ref[ matches(local-name-from-QName(resolve-QName(., ..)), 'AugmentationPoint$')]) ]"> <sch:assert test="empty(following-sibling::*)" >An augmentation point element particle MUST be the last element occurrence in its content model.</sch:assert> </sch:rule> </sch:pattern>
An augmentation type is a complex type definition that
An augmentation element declaration is an element declaration that
This term may be mistaken for the term augmentation. An augmentation element declaration is an element declaration defined by a schema, while an augmentation is an element information item within an XML document that appears as the result of being substituted for an augmentation point.
Given:
Element $relationship establishes a relationship between $base-value and the value of $relationship.
A schema component that has a name that ends in AugmentationType
MUST be an augmentation type.
The primary indicator that a complex type is an augmentation type is its name. Using the qualifier Augmentation
immediately identifies a type as an augmentation type.
<sch:pattern> <sch:rule context="xs:*[ends-with(@name, 'AugmentationType')]"> <sch:assert test="self::xs:complexType/xs:complexContent/xs:*[ (self::xs:extension or self::xs:restriction) and ends-with(@base, 'AugmentationType')]" >An augmentation type definition schema component with {name} ending in 'AugmentationType' MUST be an augmentation type definition that is a complex type definition with complex content that extends or restricts an augmentation type.</sch:assert> </sch:rule> </sch:pattern>
The base type definition of an augmentation type is required to be from a conformant namespace by Rule 11-2, Base type definition defined by conformant schema (REF, EXT), below.
<sch:pattern> <sch:rule context="xs:*[(self::xs:restriction or self::xs:extension) and ends-with(@base, 'AugmentationType')]"> <sch:assert test="ancestor::xs:complexType[ends-with(@name, 'AugmentationType')]" >A type definition derived from an augmentation type MUST be an augmentation type definition</sch:assert> </sch:rule> </sch:pattern>
This rule ensures that any type that is derived from an augmentation type, including structures:AugmentationType
, is itself an augmentation type.
<sch:pattern> <sch:rule context="xs:element[exists(@name)]"> <sch:assert test="exists(@type[ends-with(., 'AugmentationType')]) = exists(@name[ends-with(., 'Augmentation')])" >An element declaration MUST have a name that ends in "Augmentation" if and only if it has a type that is an augmentation type.</sch:assert> </sch:rule> </sch:pattern>
Using the qualifier Augmentation
immediately identifies an element as representing an augmentation.
Within a reference schema document, a complex type definition MUST NOT have an element use of
There are rules for the use of metadata in instance in Section 12.3, Instance metadata, below.
Within NIEM, metadata is defined as data about data.
This may include information such as the security of a piece of data or the source of the data. These pieces of metadata may be composed into a metadata type. The types of data to which metadata may be applied may be constrained.
A metadata type describes data about data, that is, information that is not descriptive of objects and their relationships, but is descriptive of the data itself. It is useful to provide a general mechanism for data about data. This provides required flexibility to precisely represent information.
A metadata type establishes a specific, named aggregation of data about data. Any type transitively derived from structures:MetadataType
is a metadata type. Such metadata types should be used as is and additional metadata types defined for additional content.
<sch:pattern> <sch:rule context="xs:complexType"> <sch:let name="is-metadata-type" value="exists(@name[ends-with(., 'MetadataType')])"/> <sch:let name="has-metadata-base-type" value="exists(xs:complexContent[ exists(xs:*[local-name() = ('extension', 'restriction') and exists(@base[ends-with(., 'MetadataType')])])])"/> <sch:assert test="$is-metadata-type = $has-metadata-base-type" >A type MUST be a metadata type if and only if it is derived from a metadata type.</sch:assert> </sch:rule> </sch:pattern>
A metadata type is derived from another metadata type, terminating in the base type structures:MetadataType
. A type is easily identified as a metadata type by its name, qualified with the term Metadata
.
A metadata element declaration is an element declaration defined by a reference schema document or an extension schema document that defines a metadata object. A metadata element declaration has a name ending in Metadata
, and a {type definition} that is a metadata type.
There are limitations on the meaning of a metadata element in an instance; it does not establish existence of an object, nor is it a property of its containing object.
<sch:pattern> <sch:rule context="xs:element[exists(@name)]"> <sch:assert test="exists(@type[ends-with(., 'MetadataType')]) = exists(@name[ends-with(., 'Metadata')])" >An element MUST have a name that ends in 'Metadata' if and only if it has a type that is a metadata type.</sch:assert> </sch:rule> </sch:pattern>
Using the qualifier Metadata
immediately identifies an element as representing metadata. This document defines the term metadata type.
Each metadata element declaration may be applied to a set of elements. Any element to which a metadata element may be validly applied is called an applicable element
for the metadata element. A metadata element that does not explicitly specify applicability information may be applied to any NIEM-conformant element.
The set of applicable elements for a metadata element declaration are as follows:
appinfo:appliesToTypes
nor an attribute appinfo:appliesToElements
may be applied to any element.A metadata element declaration that has either an attribute appinfo:appliesToTypes
or an attribute appinfo:appliesToElements
may be applied to
appinfo:appliesToElements
, or any element with a declaration that is in the substitution group of the declaration of such an element, and toappinfo:appliesToTypes
, or any element with a type that is validly derived from such a type.Figure 10-14, Sample use of appinfo:appliesToTypes
, below, shows an example of appinfo:appliesToTypes
, defining a metadata element that is applicable to all objects and all associations.
<xs:element name="Metadata" type="nc:MetadataType" nillable="true" appinfo:appliesToTypes="structures:ObjectType structures:AssociationType"> <xs:annotation> <xs:documentation>Information that further qualifies primary data; data about data.</xs:documentation> </xs:annotation> </xs:element>
All NIEM properties establish a relationship between the object holding the property and the value of the property. For example, an activity object of type nc:ActivityType
may have an element nc:ActivityDescriptionText
. This element will be of type nc:TextType
and represents a NIEM property owned by that activity object. An occurrence of this element within an activity object establishes a relationship between the activity object and the text: the text is the description of the activity.
In a NIEM-conformant instance, an element establishes a relationship between the object that contains it and the element’s value. This relationship between the object and the element may be semantically strong, such as the text description of an activity in the previous example, or it may be semantically weak, with its exact meaning left unstated. In NIEM, the contained element involved in a weakly defined semantic relationship is commonly referred to as a container element.
A container element establishes a weakly defined relationship with its containing element. For example, an object of type nc:ItemDispositionType
may have a container element nc:Item
of type nc:ItemType
. The container element nc:Item
does not establish what relationship exists between the object of nc:ItemDispositionType
and itself. There could be any of a number of possible semantics between an object and the value of a container element. It could be a contained object, a subpart, a characteristic, or some other relationship. The appearance of this container element inside the nc:ItemDispositionType
merely establishes that the disposition has an item.
The name of the container element is usually based on the NIEM type that defines it: nc:PersonType
uses a container element nc:Person
, while nc:ActivityType
uses a container element nc:Activity
. The concept of an element as a container element is a notional one.
There are no formalized rules addressing what makes up a container element. A container element is vaguely defined and carries very little semantics about its context and its contents. Accordingly, there is no formal definition of container elements in NIEM: There are no specific artifacts that define a container element; there are no appinfo
or other labels for container elements.
The appearance of a container element within a NIEM type carries no additional semantics about the relationship between the property and the containing type. The use of container elements indicates only that there is a relationship; it does not provide any semantics for interpreting that relationship.
For example, a NIEM container element nc:Person
would be associated with the NIEM type nc:PersonType
. The use of the NIEM container element nc:Person
in a containing NIEM type indicates that a person has some association with the instances of the containing NIEM type. But because the nc:Person
container element is used, there is no additional meaning about the association of the person and the instance containing it. While there is a person associated with the instance, nothing is known about the relationship except its existence.
The use of the Person container element is in contrast to a NIEM property named nc:AssessmentPerson
, also of NIEM type nc:PersonType
. When the NIEM property nc:AssessmentPerson
is contained within an instance of a NIEM type, it is clear that the person referenced by this property was responsible for an assessment of some type, relevant to the exchange being modeled. The more descriptive name, nc:AssessmentPerson
, gives more information about the relationship of the person with the containing instance, as compared with the semantic-free implications associated with the use of the nc:Person
container element.
When a NIEM-conformant schema requires a new container element, it may define a new element with a concrete type and a general name, with general semantics. Any schema may define a container element when it requires one.
One need frequently faced by schema developers is for multiple representations for a single concept. For example, for a general concept of a point in time, there are numerous base representations, and innumerable ways to combine them. For example, the XML Schema definition language defines the types xs:dateTime
, xs:time
, xs:date
, xs:gYearMonth
, xs:gYear
, xs:gMonthDay
, xs:gDay
, and xs:gMonth
, each representing a point in time, or perhaps a span of time. There is a need in XML Schema to be able to represent a general concept like a point in time, along with a variety of representations for the concept.
Note that this need is a bit different than specialization of relationships (e.g., rdfs:subPropertyOf
), in that it specifically is to be used to describe and carry the variety of representations for a particular concept. The need is to be able to represent an abstract point in time using a single type, and then to add a set of specific representations for that basic concept.
There are a variety of methods that could be used to satisfy this need. A method could be devised that uses an abstract type, along with a set of concrete extensions of that abstract type. However, there would still be a need for a set of concrete elements to carry the types, as type substitution (distinct from element substitution) is not widely adopted across the NIEM community. As well, it is difficult to create a network of complex types with complex content and complex types with simple content that all substitute for a base type; the XML Schema syntax is complicated. Other alternatives each have their pros and cons.
To handle this need, NIEM has adopted the Representation
pattern, in which a type contains a representation element, and the various representations for that type are in the substitution group for that representation element.
For example, the definition of nc:DateType
uses this pattern:
<xs:complexType name="DateType"> <xs:annotation> <xs:documentation>A data type for a calendar date.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="structures:ObjectType"> <xs:sequence> <xs:element ref="nc:DateRepresentation" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="nc:DateAccuracy" minOccurs="0" maxOccurs="1"/> <xs:element ref="nc:DateMarginOfErrorDuration" minOccurs="0" maxOccurs="1"/> <xs:element ref="nc:DateAugmentationPoint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
The type has elements that represent accuracy and margin of error, as well as an augmentation point. The actual date value, however, is carried by an element that substitutes for nc:DateRepresentation
. That base element, and several substitutions are defined by the NIEM Core namespace:
<xs:element name="DateRepresentation" abstract="true"> <xs:annotation> <xs:documentation>A data concept for a representation of a date.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="Date" type="niem-xs:date" substitutionGroup="nc:DateRepresentation" nillable="true"> <xs:annotation> <xs:documentation>A full date.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="DateTime" type="niem-xs:dateTime" substitutionGroup="nc:DateRepresentation"> <xs:annotation> <xs:documentation>A full date and time.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="YearDate" type="niem-xs:gYear" substitutionGroup="nc:DateRepresentation"> <xs:annotation> <xs:documentation>A year.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="YearMonthDate" type="niem-xs:gYearMonth" substitutionGroup="nc:DateRepresentation"> <xs:annotation> <xs:documentation>A year and month.</xs:documentation> </xs:annotation> </xs:element>
This method has several benefits:
A representation element declaration is an element declaration that is abstract, and that has a {name} that ends in Representation
.
<sch:pattern> <sch:rule context="xs:element[@name[ends-with(., 'Representation')]]"> <sch:report role="warning" test="empty(@abstract) or xs:boolean(@abstract) = false()" >An element declaration with a name that ends in 'Representation' SHOULD have the {abstract} property with a value of "true".</sch:report> </sch:rule> </sch:pattern>
This section outlines the rules used to create names for NIEM data components previously discussed in this document. Data component names must be understood easily both by humans and by machine processes. These rules improve name consistency by restricting characters, terms, and syntax that could otherwise allow too much variety and potential ambiguity. These rules also improve readability of names for humans, facilitate parsing of individual terms that compose names, and support various automated tasks associated with dictionary and controlled vocabulary maintenance.
The name of any XML Schema component defined by the schema SHOULD be composed of words from the English language, using the prevalent U.S. spelling, as provided by [OED].
The English language has many spelling variations for the same word. For example, American English program
has a corresponding British spelling programme.
This variation has the potential to cause interoperability problems when XML components are exchanged because of the different names used by the same elements. Providing users with a dictionary standard for spelling will mitigate this potential interoperability issue.
<sch:pattern> <sch:rule context="xs:*[exists(@name)]"> <sch:assert test="matches(@name, '^[A-Za-z0-9\-_\.]*$')" >The name of an XML Schema component defined by the schema must be composed of only the characters uppercase 'A' through 'Z', lowercase 'a' through 'z', numbers '0' through '9', underscore, hyphen, and period.</sch:assert> </sch:rule> </sch:pattern>
Only the following characters are allowed in the name of an XML Schema component defined by the schema:
A
–Z
).a
–z
).0
–9
)._
).-
)..
).Other characters, such as unicode characters outside the ASCII character set, are explicitly prohibited from the name of an XML Schema component defined by the schema.
The characters hyphen (
), underscore (-
) MAY appear in a component name only when used as a separator between parts of a word, phrase, or value, which would otherwise be incomprehensible without the use of a separator. The period character (_
) MAY appear in component names only when appearing as a separator (as above) or as a decimal within a numeric value. A punctuation character MUST NOT be used as a substitute for camel case in component names, or as a method to avoid camel case in component names..
Names of standards and specifications, in particular, tend to consist of series of discrete numbers. Such names require some explicit separator to keep the values from running together.
Names of NIEM components follow the rules of XML Schema, by Rule 7-3, Document is a schema document (REF, EXT), above. NIEM components also follow the rules specified herein for each type of XML Schema component.
Names of conformant components use camel case formatting. Camel case is the convention of writing compound words or phrases with no spaces and an initial lowercase or uppercase letter, with each remaining word element beginning with an uppercase letter. UpperCamelCase is written with an initial uppercase letter, and lowerCamelCase is written with an initial lowercase letter.
<sch:pattern> <sch:rule context="xs:attribute"> <sch:report test="false()" role="warning">This rule does not apply to an attribute.</sch:report> </sch:rule> <sch:rule context="xs:complexType[some $name in @name, $extension in xs:simpleContent/xs:extension, $base-qname in resolve-QName($extension/@base, $extension) satisfies $base-qname = QName('http://www.w3.org/2001/XMLSchema', $name)]"> <sch:report test="false()" role="warning">This rule does not apply to a proxy types.</sch:report> </sch:rule> <sch:rule context="xs:*[exists(@name)]"> <sch:assert test="matches(@name, '^[A-Z]')" >Within the schema, an XML Schema component that is not an attribute declaration or proxy type MUST have a name that begins with an upper-case letter ('A'-'Z').</sch:assert> </sch:rule> </sch:pattern>
The preceding rules establish lowerCamelCase for NIEM attributes, and UpperCamelCase for all other NIEM components, except proxy types, defined by Section 10.2.5, Proxy types, above.
Acronyms and abbreviations have the ability to improve readability and comprehensibility of large, complex, or frequently used terms. They also obscure meaning and impair understanding when their definitions are not clear or when they are used injudiciously. They should be used with great care. Acronyms and abbreviations that are used must be documented and used consistently.
The schema SHOULD use, in defined names, the abbreviations identified by Table 10-1, Abbreviations used in schema component names, rather than their full meanings.
Abbreviation | Full Meaning |
---|---|
ID | Identifier |
URI | Uniform Resource Identifier |
Consistent, controlled, and documented abridged terms that are commonly used in place of full terms can support readability, clarity, and reduction of name length.
The NDR establishes appinfo for local terminology that introduces such terms into the schema document in which the appinfo appears.
In a conformant schema document, a local term is a word, phrase, acronym, or other string of characters for which all of the following are true:
appinfo:LocalTerm
.Local terminology is introduced into a schema document by the use of appinfo:LocalTerm
within the schema.
See additional rules constraining the use of local terminology in Section 10.9.2, Local terminology, below.
An element appinfo:LocalTerm
MUST establish the meaning of a local term only within the XML Schema document in which it occurs. There MUST NOT be any transitive inheritance of local terminology within schema documents that import the containing schema document.
An element information item appinfo:LocalTerm
MUST establish a term as follows:
term
is the local term; it may occur as a term within the name of a schema component within the schema document.literal
is the meaning of the local term, provided as a full, plain-text form of the term. This may be useful when a local term is an abbreviation, acronym, or diminutive form of a longer term.definition
is a dictionary-style description of the meaning of the local term.sourceURIs
is a list of URIs, each of which is an identifier or locator for an originating or authoritative document defining the term.appinfo:SourceText
is a plain text citation of, reference to, or bibliographic entry for an originating or authoritative document defining the term.Articles (e.g., a, an, the), conjunctions (e.g., and, or, but), and prepositions (e.g., at, by, for, from, in, of, to) are all disallowed in NIEM component names, unless they are required. For example, PowerOfAttorneyCode
requires the preposition. These rules constrain slight variations in word forms and types to improve consistency and reduce potentially ambiguous or confusing component names.
Elements and attributes in NIEM-conformant schemas are given names that follow a specific pattern. This pattern comes from [ISO 11179-5].
Except as specified elsewhere in this document, any element or attribute defined within the schema SHOULD have a name that takes the form:
Consistent naming rules are helpful for users who wish to understand components with which they are unfamiliar, as well as for users to find components with known semantics. This rule establishes the basic structure for an element or attribute name, in line with the rules for names under [ISO 11179-5]. Note that many elements with complex type should not have a representation term.
NIEM adopts an object-oriented approach to representation of data. Object classes represent what [ISO 11179-5] refers to as things of interest in a universe of discourse that may be found in a model of that universe.
An object class or object term is a word that represents a class of real-world entities or concepts. An object-class term describes the applicable context for a NIEM component.
The object-class term of a NIEM component MUST consist of a term identifying a category of concrete concepts or entities.
The object-class term indicates the object category that this data component describes or represents. This term provides valuable context and narrows the scope of the component to an actual class of things or concepts.
Example:
Concept term: Activity
Entity term: Vehicle
Objects or concepts are usually described in terms of their characteristic properties, data attributes, or constituent subparts. Most objects can be described by several characteristics. Therefore, a property term in the name of a data component represents a characteristic or subpart of an object class and generally describes the essence of that data component.
Qualifier terms modify object, property, representation, or other qualifier terms to increase semantic precision and reduce ambiguity. Qualifier terms may precede or succeed the terms they modify. The goal for the placement of qualifier terms is to generally follow the rules of ordinary English while maintaining clarity.
The order of qualifiers MUST NOT be used to differentiate names.
Very large vocabularies may have many similar and closely related properties and concepts. The use of object, property, and representation terms alone is often not sufficient to construct meaningful names that can uniquely distinguish such components. Qualifier terms provide additional context to resolve these subtleties. However, swapping the order of qualifiers rarely (if ever) changes meaning; qualifier ordering is no substitute for meaningful terms.
The representation terms for a component name serve several purposes in NIEM:
Type
.If any word in the representation term is redundant with any word in the property term, one occurrence SHOULD be deleted.
This rule, carried over from 11179, is designed to prevent repeating terms unnecessarily within component names. For example, this rule allows designers to avoid naming an element PersonFirstNameName.
The valid value set of a data element or value domain is described by the representation term. NIEM uses a standard set of representation terms in the representation portion of a NIEM-conformant component name. Table 10-2, Representation terms, below, lists the primary representation terms and a definition for the concept associated with the use of that term. The table also lists secondary representation terms that may represent more specific uses of the concept associated with the primary representation term.
Primary Representation Term | Secondary Representation Term | Definition |
---|---|---|
Amount | - | A number of monetary units specified in a currency where the unit of currency is explicit or implied. |
BinaryObject | - | A set of finite-length sequences of binary octets. |
Graphic | A diagram, graph, mathematical curves, or similar representation | |
Picture | A visual representation of a person, object, or scene | |
Sound | A representation for audio | |
Video | A motion picture representation; may include audio encoded within | |
Code | A character string (i.e., letters, figures, and symbols) that for brevity, language independence, or precision represents a definitive value of an attribute. | |
DateTime | A particular point in the progression of time together with relevant supplementary information. | |
Date | A particular day, month, and year in the Gregorian calendar. | |
Time | A particular point in the progression of time within an unspecified 24-hour day. | |
Duration | An amount of time; the length of a time span. | |
ID | A character string to identify and distinguish uniquely one instance of an object in an identification scheme from all other objects in the same scheme together with relevant supplementary information. | |
URI | A string of characters used to identify (or name) a resource. The main purpose of this identifier is to enable interaction with representations of the resource over a network, typically the World Wide Web, using specific protocols. A URI is either a Uniform Resource Locator (URL) or a Uniform Resource Name (URN). The specific syntax for each is defined by [RFC 3986]. | |
Indicator | A list of two mutually exclusive Boolean values that express the only possible states of a property. | |
Measure | A numeric value determined by measuring an object along with the specified unit of measure. | |
Numeric | Numeric information that is assigned or is determined by calculation, counting, or sequencing. It does not require a unit of quantity or unit of measure. | |
Value | A result of a calculation. | |
Rate | A relative speed of change or progress. | |
Percent | A representation of a unitless ratio, expressed as parts of a hundred, with 100 percent representing a ratio of 1 to 1. | |
Quantity | A counted number of non-monetary units possibly including fractions. | |
Text | - | A character string (i.e., a finite sequence of characters) generally in the form of words of a language. |
Name | A word or phrase that constitutes the distinctive designation of a person, place, thing, or concept. | |
List | A sequence of values. This representation term is used in tandem with another of the listed representation terms. | |
Abstract | An element that may represent a concept, rather than a concrete property. This representation term may be used in tandem with another of the listed representation terms. |
Within the schema, the name of an element declaration that is of simple content SHOULD use an appropriate representation term as found in Table 10-2, Representation terms.
This rule is also supported by Rule 11-14, Name of element declaration with simple content has representation term (REF, EXT), below, and Rule 11-15, Name of element declaration with simple content has representation term (SET), below, which provide tests that a top-level declaration has a representation term.
Within the schema, the name of an element declaration that is of complex content, and that corresponds to a concept listed in Table 10-2, Representation terms, SHOULD use a representation term from that table.
An element that represents a value listed in the table should have a representation term. It should do so even if its type is complex with multiple parts. For example, a type with multiple fields may represent an audio binary, a date, or a name.
Within the schema, the name of an element declaration that is of complex content and that does not correspond to a concept listed in Table 10-2, Representation terms SHOULD NOT use a representation term.
XML Schema provides application information schema components to provide for automatic processing and machine-readable content for schemas, as described by [XML Schema Structures] Section 3.13.2, XML Representation of Annotation Schema Components. XML Schema also allows the use of attributes (with namespaces other than the XML Schema namespace) to carry additional information in schemas. NIEM uses these machine-readable annotations convey information that is outside schema definition and outside human-readable text definitions.
XML elements, attributes, and text content may appear as machine-readable annotations within an XML Schema document. The methods provided by XML Schema for machine-readable annotations are:
xs:schema
, xs:complexType
, …) may carry attributes from namespaces other than the XML Schema namespace. By the rules of XML Schema, any XML Schema element may have attributes that are from other namespaces. These attributes do not participate in XML Schema validation, but may carry information useful to tools that process schemas. In [XML Schema Structures], these attributes are described in the XML Representation summary of XML Schema elements as {any attributes with non-schema namespace . . .}, for example in Section 3.2.2, XML Representation of Attribute Declaration Schema Components.
xs:appinfo
elements, which may include arbitrary XML content. This XML does not participate in XML Schema validation, but may communicate useful information to schema readers or processors. These are described by [XML Schema Structures] in Section 3.13.1, The Annotation Schema Component and Section 3.13.2, XML Representation of Annotation Schema Components.This document defines the term machine-readable annotation to normatively refer to such annotations within XML Schema documents:
An information item within a schema is defined to be a machine-readable annotation when all of the following are true:
It is one of the following:
xs:appinfo
element.{any attributes with non- schema namespace . . .}clause within the declaration of an XML Schema element.
Attributes from the XML namespace, the XML Schema namespace, and the XML Schema instance namespace have special meanings within XML Schema, and may have effects on validation, and so are not considered machine-readable annotations.
A component is said to have application information of some element $element when the XML Schema element that defines the component has an immediate child element xs:annotation
, which has an immediate child element xs:appinfo
, which has as an immediate child the element $element.
If a component is described as having some application information, this means that the elements in question appear in an xs:appinfo
annotation of the element that defines the component.
The majority of uses of application information from the appinfo namespace are described in the modeling rules for the specific component.
Every element information item or attribute information item that appears as a machine-readable annotation in a schema MUST be a valid instance, according to its specification.
The specification for an element or attribute may be via an XML Schema, a Schematron schema, via a DTD, by some other specification, or by other means. This rule is intended to allow NIEM schema developers to leverage relevant vocabularies without being limited by the vocabulary’s method of specification, while ensuring that developers do not subvert or misuse those vocabularies.
NIEM defines a single namespace that holds components for use in NIEM-conformant schema application information. This namespace is referred to as the appinfo namespace.
The appinfo namespace is the namespace represented by the URI
.http://release.niem.gov/niem/appinfo/4.0/
The appinfo namespace defines attributes which provide additional semantics for components built by NIEM-conformant schemas. The XML Schema document for the appinfo namespace appears in Appendix C, Appinfo namespace, below.
The appinfo
schema provides a construct for indicating that a construct is deprecated. A deprecated component is one whose use is not recommended. A deprecated component may be kept in a schema for support of older versions but should not be used in new efforts. A deprecated component may be removed, replaced, or renamed in a later version of a namespace.
A deprecated component is one that developers are discouraged from using, typically because a better alternative exists, yet which is maintained in the schema for compatibility with previous versions of the namespace.
The definition for deprecated component is adapted from [JLS] Section 9.6.4.6, @Deprecated.
A schema component that has an attribute appinfo:deprecated
with a value of true
MUST be a deprecated component.
Deprecation can allow version management to be more consistent; versions of schema may be incrementally improved without introducing validation problems and incompatibility. As XML Schema lacks a deprecation mechanism, NIEM defines such a mechanism.
<sch:pattern> <sch:rule context="*[exists(@appinfo:deprecated)]"> <sch:assert test="namespace-uri-from-QName(node-name(.)) = xs:anyURI('http://www.w3.org/2001/XMLSchema')" >The attribute appinfo:deprecated MUST be owned by an element with a namespace name <namespace-uri-for-prefix>xs</namespace-uri-for-prefix>.</sch:assert> </sch:rule> </sch:pattern>
The annotation attributes appinfo:externalImportIndicator
and appinfo:externalAdapterTypeIndicator
document, in a machine-readable way, which components are external (i.e., defined by schemas that are not NIEM-conformant), and which support the use of external components.
<sch:pattern> <sch:rule context="*[exists(@appinfo:externalImportIndicator)]"> <sch:assert test="exists(self::xs:import)" >The attribute {http://release.niem.gov/niem/appinfo/4.0/}externalImportIndicator MUST be owned by an element xs:import.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[exists(@appinfo:externalAdapterTypeIndicator)]"> <sch:assert test="exists(self::xs:complexType)" >The attribute appinfo:externalAdapterTypeIndicator MUST be owned by an element xs:complexType.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[exists(@appinfo:appliesToTypes)]"> <sch:assert test="exists(self::xs:element[exists(@name) and ends-with(@name, 'Metadata')])" >The attribute appinfo:appliesToTypes MUST be owned by a metadata element.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[exists(@appinfo:appliesToTypes)]"> <sch:assert test="every $item in tokenize(normalize-space(@appinfo:appliesToTypes), ' ') satisfies exists(nf:resolve-type(., resolve-QName($item, .)))" >Every item in @appinfo:appliesToTypes MUST resolve to a type.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[exists(@appinfo:appliesToElements)]"> <sch:assert test="exists(self::xs:element[ exists(@name) and ends-with(@name, 'Metadata')])" >The attribute appinfo:appliesToElements MUST be owned by a metadata element.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[exists(@appinfo:appliesToElements)]"> <sch:assert test="every $item in tokenize(normalize-space(@appinfo:appliesToElements), ' ') satisfies count(nf:resolve-element(., resolve-QName($item, .))) = 1" >Every item in @appinfo:appliesToElements MUST resolve to an element.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="appinfo:LocalTerm"> <sch:assert test="parent::xs:appinfo[parent::xs:annotation[parent::xs:schema]]" >The element appinfo:LocalTerm MUST be application information on an element xs:schema.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term application information.
NIEM provides the structures schema that contains base types for types defined in NIEM- conformant schemas. It provides base elements to act as heads for substitution groups. It also provides attributes that provide facilities not otherwise provided by XML Schema. These structures should be used to augment XML data. The structures provided are not meant to replace fundamental XML organization methods; they are intended to assist them.
The structures namespace is the namespace represented by the URI
.http://release.niem.gov/niem/structures/4.0/
The structures namespace is a single namespace, separate from namespaces that define NIEM-conformant data. This document refers to this content via the prefix structures
.
Any schema or instance MUST use the NIEM structures namespace consistent with the schema as it is defined in Appendix B, Structures namespace, below.
This rule further enforces uniform and consistent use of the NIEM structures
namespace, without addition. Users are not allowed to insert types, attributes, etc. that are not specified by this document. However, users may profile the structures namespace, as needed.
This section focuses on building NIEM data models using XML schema. Whereas Section 9, Rules for a NIEM profile of XML Schema, above, addressed shrinking the XML Schema definition language to a smaller set of features, this section constructs new NIEM-specific features to address modeling and interoperability problems. This includes naming rules, categories of types, and augmentations.
<sch:pattern> <sch:rule context="xs:complexType[some $name in @name, $extension in xs:simpleContent/xs:extension, $base-qname in resolve-QName($extension/@base, $extension) satisfies $base-qname = QName('http://www.w3.org/2001/XMLSchema', $name)]"> <sch:report test="false()" role="warning">The name of a proxy type does not end in "Type".</sch:report> </sch:rule> <sch:rule context="xs:*[(self::xs:simpleType or self::xs:complexType) and exists(@name)]"> <sch:assert test="ends-with(@name, 'Type')" >A type definition schema component that does not define a proxy type MUST have a name that ends in "Type".</sch:assert> </sch:rule> </sch:pattern>
Use of the representation term Type
immediately identifies XML types in a NIEM-conformant schema and prevents naming collisions with corresponding XML elements and attributes. The exception for proxy types ensures that simple NIEM-compatible uses of base XML Schema types are familiar to people with XML Schema experience.
Note that the first sch:rule
and subsequent sch:report
serve to provide an exception to the rule for proxy types. It does not establish a constraint on the data.
<sch:pattern> <sch:rule context="xs:*[exists(@base)]"> <sch:assert test="some $base-namespace in namespace-uri-from-QName(resolve-QName(@base, .)) satisfies ( $base-namespace = (nf:get-target-namespace(.), xs:anyURI('http://www.w3.org/2001/XMLSchema')) or exists(ancestor::xs:schema[1]/xs:import[exists(@namespace) and $base-namespace = xs:anyURI(@namespace) and empty(@appinfo:externalImportIndicator)]))" >The {base type definition} of a type definition MUST have the target namespace or the XML Schema namespace or a namespace that is imported as conformant.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:simpleType[@name]"> <sch:assert test="ends-with(@name, 'SimpleType')" >A simple type definition schema component MUST have a name that ends in "SimpleType".</sch:assert> </sch:rule> </sch:pattern>
Specific uses of type definitions have similar syntax but very different effects on data definitions. Schemas that clearly identify complex and simple type definitions are easier to understand without tool support. This rule ensures that names of simple types end in SimpleType
.
Within the schema, a simple type definition that uses xs:list
SHOULD NOT be defined if any member of the list requires a property or metadata that is different than other members of the list. All members of the list SHOULD have the same metadata, and should be related via the same properties.
The use of lists should be reserved for cases where the data is fairly uniform.
Items in a list are not individually addressable by NIEM metadata techniques. The items may not be individually referenced by elements or attributes; one will have a value of the entire list, including all the items in the list. NIEM provides no method for individually addressing an item in a list. If an individual item in a list needs to be marked up in a manner different than other items in the list, the use of individual elements may be preferred to the definition of a list simple type.
<sch:pattern> <sch:rule context="xs:list[exists(@itemType)]"> <sch:let name="namespace" value="namespace-uri-from-QName(resolve-QName(@itemType, .))"/> <sch:assert test="$namespace = (nf:get-target-namespace(.), xs:anyURI('http://www.w3.org/2001/XMLSchema')) or exists(ancestor::xs:schema[1]/xs:import[exists(@namespace) and $namespace = xs:anyURI(@namespace) and empty(@appinfo:externalImportIndicator)])" >The item type of a list simple type definition MUST have a target namespace equal to the target namespace of the XML Schema document within which it is defined, or a namespace that is imported as conformant by the schema document within which it is defined.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:union[exists(@memberTypes)]"> <sch:assert test="every $qname in tokenize(normalize-space(@memberTypes), ' '), $namespace in namespace-uri-from-QName(resolve-QName($qname, .)) satisfies ($namespace = nf:get-target-namespace(.) or exists(ancestor::xs:schema[1]/xs:import[exists(@namespace) and $namespace = xs:anyURI(@namespace) and empty(@appinfo:externalImportIndicator)]))" >Every member type of a union simple type definition MUST have a target namespace that is equal to either the target namespace of the XML Schema document within which it is defined or a namespace that is imported as conformant by the schema document within which it is defined.</sch:assert> </sch:rule> </sch:pattern>
A code simple type is a simple type definition schema component for which each value carried by the type corresponds to an entry in a list of distinct conceptual entities.
These types represent lists of values, each of which has a known meaning beyond the text representation. These values may be meaningful text or may be a string of alphanumeric identifiers that represent abbreviations for literals.
Many code simple types are composed of xs:enumeration
values. Code simple types may also be constructed using the NIEM Code Lists Specification [Code Lists], which supports code lists defined using a variety of methods, including CSV spreadsheets.
<sch:pattern> <sch:rule context="xs:simpleType[exists(@name) and (xs:restriction/xs:enumeration or xs:restriction[ends-with(local-name-from-QName(resolve-QName(@base, .)), 'CodeSimpleType')])]"> <sch:report test="not(ends-with(@name, 'CodeSimpleType'))" role="warning" >A simple type definition schema component that has an enumeration facet or that is derived from a code simple type SHOULD have a name that ends in "CodeSimpleType".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:attribute[exists(@name) and exists(@type) and ends-with(@type, 'CodeSimpleType')]"> <sch:report test="not(ends-with(@name, 'Code'))" role="warning" >An attribute with a type that is a code simple type SHOULD have a name with representation term "Code"</sch:report> </sch:rule> </sch:pattern>
Using the qualifier Code
(e.g. CodeType
, CodeSimpleType
) immediately identifies that a data component may carry values from a fixed list of codes. Such a component may be handled in specific ways, as lists of codes are expected to have their own lifecycles, including versions and periodic updates. Codes may also have responsible authorities behind them who provide concrete semantic bindings for the code values.
Within a reference schema document, a complex type with simple content can be created in one of two ways:
Both of these methods use the element xs:extension
. Although these two methods have similar syntax, there are subtle differences. NIEM’s conformance rules ensure that any complex type has the necessary attributes for representing IDs, references, metadata, and relationship metadata. Case 1 does not require adding these attributes, as they are guaranteed to occur in the base type. However, in case 2, in which a new complex type is created from a simple type, the attributes for complex types must be added. This is done by reference to the attribute group structures:SimpleObjectAttributeGroup
.
<sch:pattern> <sch:rule context="xs:simpleContent/xs:extension[ some $base-qname in resolve-QName(@base, .) satisfies namespace-uri-from-QName($base-qname) = xs:anyURI('http://www.w3.org/2001/XMLSchema') or ends-with(local-name-from-QName($base-qname), 'SimpleType')]"> <sch:assert test="xs:attributeGroup[ resolve-QName(@ref, .) = xs:QName('structures:SimpleObjectAttributeGroup')]" >A complex type definition with simple content schema component with a derivation method of extension that has a base type definition that is a simple type MUST incorporate the attribute group {http://release.niem.gov/niem/structures/4.0/}SimpleObjectAttributeGroup.</sch:assert> </sch:rule> </sch:pattern>
This rule ensures that a complex type with simple content that is created as an immediate extension of a simple type adds the attributes required for specific NIEM linking mechanisms.
This creates a pattern for complex type with simple content definition as follows:
<xs:complexType name="PassportCategoryCodeType"> <xs:annotation> <xs:documentation>A data type for a kind of passport.</xs:documentation> </xs:annotation> <xs:simpleContent> <xs:extension base="nc:PassportCategoryCodeSimpleType"> <xs:attributeGroup ref="structures:SimpleObjectAttributeGroup"/> </xs:extension> </xs:simpleContent> </xs:complexType>
This rule, in conjunction with Rule 11-3, Name of simple type ends in SimpleType
(REF, EXT), above, ensures that all conformant elements will have complex types that contain attributes from the structures namespace, enabling a consistent approach for using IDs, references, metadata, relationship metadata, and security markup data.
<sch:pattern> <sch:rule context="xs:element[exists(@type)]"> <sch:assert test="not(ends-with(@type, 'SimpleType'))" >The {type definition} of an element declaration MUST NOT have a {name} that ends in 'SimpleType'.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term element declaration.
<sch:pattern> <sch:rule context="xs:element[exists(@type)]"> <sch:assert test="for $type-qname in resolve-QName(@type, .), $type-namespace in namespace-uri-from-QName($type-qname) return $type-namespace = nf:get-target-namespace(.) or exists(nf:get-document-element(.)/xs:import[ xs:anyURI(@namespace) = $type-namespace and empty(@appinfo:externalImportIndicator)])" >The {type definition} of an element declaration MUST have a {target namespace} that is the target namespace, or one that is imported as conformant.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term element declaration.
Additional prohibitions on element types are defined by Rule 9-41, Element type not in the XML namespace (REF, EXT), above, and Rule 9-42, Element type is not simple type (REF, EXT), above.
<sch:pattern> <sch:rule context="xs:element[@name]"> <sch:report role="warning" test="not(exists(@abstract[xs:boolean(.) = true()]) eq (ends-with(@name, 'Abstract') or ends-with(@name, 'AugmentationPoint') or ends-with(@name, 'Representation')))" >An element declaration SHOULD have a name that ends in 'Abstract', 'AugmentationPoint', or 'Representation' if and only if it has the {abstract} property with a value of "true".</sch:report> </sch:rule> </sch:pattern>
This rule checks all cases that are testable in a single schema document.
<sch:pattern> <sch:rule context="xs:element[@name and @type and (some $type-qname in resolve-QName(@type, .) satisfies ( nf:get-target-namespace(.) = namespace-uri-from-QName($type-qname) and nf:resolve-type(., $type-qname)/xs:simpleContent))]"> <sch:report role="warning" test="every $representation-term in ('Amount', 'BinaryObject', 'Graphic', 'Picture', 'Sound', 'Video', 'Code', 'DateTime', 'Date', 'Time', 'Duration', 'ID', 'URI', 'Indicator', 'Measure', 'Numeric', 'Value', 'Rate', 'Percent', 'Quantity', 'Text', 'Name', 'List') satisfies not(ends-with(@name, $representation-term))" >The name of an element declaration that is of simple content SHOULD use a representation term.</sch:report> </sch:rule> </sch:pattern>
Representation terms are defined by Table 10-2, Representation terms, above. This Schematron rule supports Rule 10-63, Element with simple content has representation term (REF, EXT), above.
This rule only checks the cases not testable in the (REF, EXT) version.
<sch:pattern> <sch:rule context="xs:element[@name and @type and (nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument')) or nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument'))) and (some $type-qname in resolve-QName(@type, .) satisfies ( nf:get-target-namespace(.) != namespace-uri-from-QName($type-qname) and nf:resolve-type(., $type-qname)/xs:simpleContent))]"> <sch:report role="warning" test="every $representation-term in ('Amount', 'BinaryObject', 'Graphic', 'Picture', 'Sound', 'Video', 'Code', 'DateTime', 'Date', 'Time', 'Duration', 'ID', 'URI', 'Indicator', 'Measure', 'Numeric', 'Value', 'Rate', 'Percent', 'Quantity', 'Text', 'Name', 'List') satisfies not(ends-with(@name, $representation-term))" >the name of an element declaration that is of simple content SHOULD use a representation term.</sch:report> </sch:rule> </sch:pattern>
Representation terms are defined by Table 10-2, Representation terms, above. This rule supports Rule 10-63, Element with simple content has representation term (REF, EXT), above.
<sch:pattern> <sch:rule context="xs:element[exists(@substitutionGroup)]"> <sch:let name="namespace" value="namespace-uri-from-QName(resolve-QName(@substitutionGroup, .))"/> <sch:assert test="$namespace = nf:get-target-namespace(.) or exists(ancestor::xs:schema[1]/xs:import[exists(@namespace) and $namespace = xs:anyURI(@namespace) and empty(@appinfo:externalImportIndicator)])" >An element substitution group MUST have either the target namespace or a namespace that is imported as conformant.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:attribute[exists(@type)]"> <sch:let name="namespace" value="namespace-uri-from-QName(resolve-QName(@type, .))"/> <sch:assert test="$namespace = (nf:get-target-namespace(.), xs:anyURI('http://www.w3.org/2001/XMLSchema')) or exists(ancestor::xs:schema[1]/xs:import[exists(@namespace) and $namespace = xs:anyURI(@namespace) and empty(@appinfo:externalImportIndicator)])" >The type of an attribute declaration MUST have the target namespace or the XML Schema namespace or a namespace that is imported as conformant.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:attribute[exists(@name)]"> <sch:report role="warning" test="every $representation-term in ('Amount', 'BinaryObject', 'Graphic', 'Picture', 'Sound', 'Video', 'Code', 'DateTime', 'Date', 'Time', 'Duration', 'ID', 'URI', 'Indicator', 'Measure', 'Numeric', 'Value', 'Rate', 'Percent', 'Quantity', 'Text', 'Name', 'List') satisfies not(ends-with(@name, $representation-term))" >An attribute name SHOULD end with a representation term.</sch:report> </sch:rule> </sch:pattern>
NIEM does not define any additional features relating to notation declarations. This section is present to maintain with [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, See Section 9.2.4, Notation declaration, above, for rules related to notation declarations.
NIEM does not define any additional features relating to model groups. This section is present to maintain with [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, See Section 9.3.1, Model group, above, for rules related to model groups.
Within the schema, an element declaration or attribute declaration MUST NOT be introduced more than once into a type definition. This applies to content acquired by a type by any means, including from a base type definition, via element substitution groups, or through the use of attribute groups.
This rule ensures that a type definition does not incorporate a component multiple times. As information exchange specifications often contain multiple versions of schemas, including reference schemas as well as subset and constraint schemas, it may be easy to omit an element or attribute in one version of the schema, only to reincorporate it via an extension. This can cause difficulties in integrating such schemas, as it may be impossible to use a reference schema if an attribute is added twice, in both a base type and an extension type, since that would make it an invalid schema.
Incorporating a component multiple times can also make it difficult to avoid violating XML Schema’s unique particle attribution constraint, which is described by [XML Schema Structures] Section 3.8.6, Constraints on Model Group Schema Components. This can create difficulty if an element is added both directly, and via a substitution group head. In such a case, a parser may not be able to determine which element use is responsible for an element in an instance, which is a violation of the UPA constraint.
This rule is also intended to prevent developers from creating complicated sequences of recurring elements. Such definitions are difficult for developers to satisfy in code, and can cause havoc with XML Schema language binding tools. If an element is needed more than once, or if a particular sequence of elements is needed, a developer should consider the use of flexible content models (via substitution groups) along with additional rules.
<sch:pattern> <sch:rule context="xs:element[exists(ancestor::xs:complexType[empty(@appinfo:externalAdapterTypeIndicator)]) and @ref]"> <sch:let name="namespace" value="namespace-uri-from-QName(resolve-QName(@ref, .))"/> <sch:assert test="$namespace = nf:get-target-namespace(.) or exists(ancestor::xs:schema[1]/xs:import[exists(@namespace) and $namespace = xs:anyURI(@namespace) and empty(@appinfo:externalImportIndicator)])" >An element reference MUST be to a component that has a namespace that is either the target namespace of the schema document in which it appears, or which is imported as conformant by that schema document.</sch:assert> </sch:rule> </sch:pattern>
The term schema document is a defined term.
<sch:pattern> <sch:rule context="xs:attribute[@ref]"> <sch:let name="namespace" value="namespace-uri-from-QName(resolve-QName(@ref, .))"/> <sch:assert test="some $namespace in namespace-uri-from-QName(resolve-QName(@ref, .)) satisfies ( $namespace = nf:get-target-namespace(.) or ancestor::xs:schema[1]/xs:import[ @namespace and $namespace = xs:anyURI(@namespace) and empty(@appinfo:externalImportIndicator)])" >An attribute {}ref MUST have the target namespace or a namespace that is imported as conformant.</sch:assert> </sch:rule> </sch:pattern>
In conformant schemas, use of attribute groups is restricted. The only attribute group defined by NIEM for use in conformant schemas is structures:SimpleObjectAttributeGroup
. This attribute group provides the attributes necessary for IDs, references, metadata, and relationship metadata. In addition, there are attributes defined by ISM and NTK namespaces, which may be used in conformant schemas. Rationale for this use is provided in Section 7.6, IC-ISM and IC-NTK, above.
<sch:pattern> <sch:rule context="xs:attributeGroup[@ref]"> <sch:assert test="some $ref in resolve-QName(@ref, .) satisfies ( $ref = xs:QName('structures:SimpleObjectAttributeGroup') or namespace-uri-from-QName($ref) = (xs:anyURI('urn:us:gov:ic:ism'), xs:anyURI('urn:us:gov:ic:ntk')))" >An attribute group reference MUST be structures:SimpleObjectAttributeGroup or have the IC-ISM or IC-NTK namespace.</sch:assert> </sch:rule> </sch:pattern>
NIEM does not define any additional features relating to wildcards. This section is present to maintain with [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, See Section 9.3.4, Wildcard, above, for rules related to wildcards.
NIEM does not define any additional features relating to identity-constraint definition components. This section is present to maintain with [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, See Section 9.4, Identity-constraint definition components, above, for rules related to identity-constraint definition components.
NIEM does not define any additional features relating to model group definitions. This section is present to maintain with [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, See Section 9.5.1, Model group definition, above, for rules related to model group definitions.
NIEM does not define any additional features relating to attribute group definitions. This section is present to maintain with [XML Schema Structures] Section 2.2, XML Schema Abstract Data Model, See Section 9.5.2, Attribute group definition, above, for rules related to attribute group definitions.
NIEM-conformant schemas define data models for the purpose of information exchange. A major part of defining data models is the proper definition of the contents of the model. What does a component mean, and what might it contain? How should it be used? NIEM- conformant schemas contain the invariant part of the definitions for the data model. The set of definitions includes:
xs:appinfo
).When possible, meaning is expressed via XML Schema mechanisms: type derivation, element substitution, specific types and structures, as well as names that may be easily parsed. Beyond that, NIEM-specific syntax must be used, as discussed in this section.
Note that Rule 11-27, Data definition follows 11179-4 requirements (REF, EXT), below, and Rule 11-28, Data definition follows 11179-4 recommendations (REF, EXT), below, apply [ISO 11179-4] definition rules to documented components.
Words or synonyms for the words within a data definition MUST NOT be reused as terms in the corresponding component name if those words dilute the semantics and understanding of, or impart ambiguity to, the entity or concept that the component represents.
This document defines the term data definition.
An object class MUST NOT be redefined within the definitions of the components that represent properties or subparts of that entity or class.
Data definitions should be concise, precise, and unambiguous without embedding additional definitions of data elements that have already been defined once elsewhere (such as object classes). [ISO 11179-4] says that definitions should not be nested inside other definitions. Furthermore, a data dictionary is not a language dictionary. It is acceptable to reuse terms (object class, property term, and qualifier terms) from a component name within its corresponding definition to enhance clarity, as long as the requirements and recommendations of [ISO 11179-4] are not violated. This further enhances brevity and precision.
A data definition SHOULD NOT contain explicit representational or data typing information such as number of characters, classes of characters, range of mathematical values, etc., unless the very nature of the component can be described only by such information.
A component definition is intended to describe semantic meaning only, not representation or structure. How a component with simple content is represented is indicated through the representation term, but the primary source of representational information should come from the XML Schema definition of the types themselves. A developer should try to keep a component’s data definition decoupled from its representation.
Each data definition MUST conform to the requirements for data definitions provided by [ISO 11179-4] Section 5.2, Requirements.
Each data definition SHOULD conform to the recommendations for data definitions provided by [ISO 11179-4] Section 5.3, Recommendations.
In order to provide a more consistent voice across NIEM, a model built from requirements from many different sources, component data definitions should begin with a standard opening phrase, as defined below.
<sch:pattern> <sch:rule context="xs:element[ends-with(@name, 'AugmentationPoint')]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(starts-with(lower-case(normalize-space(.)), 'an augmentation point '))" >The data definition for an augmentation point element SHOULD begin with standard opening phrase "An augmentation point...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[ends-with(@name, 'Augmentation')]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="every $phrase in ('supplements ', 'additional information about ') satisfies not(starts-with(lower-case(normalize-space(.)), $phrase))" >The data definition for an augmentation element SHOULD begin with the standard opening phrase "Supplements..." or "Additional information about...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[ends-with(@name, 'Metadata') and not(xs:boolean(@abstract) eq true())]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '(metadata about|information that further qualifies)'))" >The data definition for a metadata element SHOULD begin with the standard opening phrase "Metadata about..." or "Information that further qualifies...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[ends-with(@name, 'Association') and not(xs:boolean(@abstract) eq true())]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^an?( .*)? (relationship|association)'))" >The data definition for an association element that is not abstract SHOULD begin with the standard opening phrase "An (optional adjectives) (relationship|association)...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:element[xs:boolean(@abstract) = true() and not(ends-with(@name, 'AugmentationPoint'))]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(starts-with(lower-case(normalize-space(.)), 'a data concept'))" >The data definition for an abstract element SHOULD begin with the standard opening phrase "A data concept...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[(self::xs:element or self::xs:attribute) and ends-with(@name, 'Date') and not(xs:boolean(@abstract) eq true())] /xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^an?( .*)? (date|month|year)'))" >The data definition for an element or attribute with a date representation term SHOULD begin with the standard opening phrase "(A|An) (optional adjectives) (date|month|year)...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[(self::xs:element or self::xs:attribute) and ends-with(@name, 'Quantity') and not(xs:boolean(@abstract) eq true())] /xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^an?( .*)? (count|number)'))" >The data definition for an element or attribute with a quantity representation term SHOULD begin with the standard opening phrase "An (optional adjectives) (count|number)...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[(self::xs:element or self::xs:attribute) and ends-with(@name, 'Picture') and not(xs:boolean(@abstract) eq true())] /xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^an?( .*)? (image|picture|photograph)'))" >The data definition for an element or attribute with a picture representation term SHOULD begin with the standard opening phrase "An (optional adjectives) (image|picture|photograph)".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[(self::xs:element or self::xs:attribute) and ends-with(@name, 'Indicator') and not(xs:boolean(@abstract) eq true())] /xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^true if .*; false (otherwise|if)'))" >The data definition for an element or attribute with an indicator representation term SHOULD begin with the standard opening phrase "True if ...; false (otherwise|if)...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[(self::xs:element or self::xs:attribute) and ends-with(@name, 'Identification') and not(xs:boolean(@abstract) eq true())] /xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^an?( .*)? identification'))" >The data definition for an element or attribute with an identification representation term SHOULD begin with the standard opening phrase "(A|An) (optional adjectives) identification...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[(self::xs:element or self::xs:attribute) and ends-with(@name, 'Name') and not(xs:boolean(@abstract) eq true())] /xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^(a|an)( .*)? name'))" >The data definition for an element or attribute with a name representation term SHOULD begin with the standard opening phrase "(A|An) (optional adjectives) name...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="*[(self::xs:element or self::xs:attribute) and @name and not(ends-with(@name, 'Indicator')) and not(ends-with(@name, 'Augmentation')) and not(ends-with(@name, 'Metadata')) and not(xs:boolean(@abstract) eq true())] /xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^an? '))" >The data definition for an element or attribute declaration SHOULD begin with the standard opening phrase "(A|An)".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType[ends-with(@name, 'AssociationType')]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^a data type for (a relationship|an association)'))" >The data definition for an association type SHOULD begin with the standard opening phrase "A data type for (a relationship|an association)...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType[ends-with(@name, 'AugmentationType')]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^a data type (that supplements|for additional information about)'))" >The data definition for an augmentation type SHOULD begin with the standard opening phrase "A data type (that supplements|for additional information about)...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType[ends-with(@name, 'MetadataType')]/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^a data type for (metadata about|information that further qualifies)'))" >The data definition for a metadata type SHOULD begin with the standard opening phrase "A data type for (metadata about|information that further qualifies)...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:complexType/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^a data type'))" >The data definition for a complex type SHOULD begin with the standard opening phrase "A data type...".</sch:report> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:simpleType/xs:annotation/xs:documentation[1]"> <sch:report role="warning" test="not(matches(lower-case(normalize-space(.)), '^a data type'))" >The data definition for a simple type SHOULD begin with a standard opening phrase "A data type...".</sch:report> </sch:rule> </sch:pattern>
These rules embody the basic philosophy behind NIEM’s use of components with namespaces: A component is uniquely identified by its class (e.g. element, attribute, type), its namespace (a URI), and its local name (an unqualified string). Any two matching component identifiers refer to the same component, even if the versions of the schemas containing each are different.
<sch:pattern> <sch:rule context="xs:import[ nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument')) and exists(@namespace) and empty(@appinfo:externalImportIndicator) and not(xs:anyURI(@namespace) = (xs:anyURI('http://release.niem.gov/niem/structures/4.0/'), xs:anyURI('http://www.w3.org/XML/1998/namespace')))]"> <sch:assert test="some $schema in nf:resolve-namespace(., @namespace) satisfies nf:has-effective-conformance-target-identifier($schema, xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument'))" >A namespace imported as conformant from a reference schema document MUST identify a namespace defined by a reference schema document.</sch:assert> </sch:rule> </sch:pattern>
This document defines the term reference schema document.
<sch:pattern> <sch:rule context="xs:import[ nf:has-effective-conformance-target-identifier(., xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument')) and exists(@namespace) and empty(@appinfo:externalImportIndicator) and not(xs:anyURI(@namespace) = (xs:anyURI('http://release.niem.gov/niem/structures/4.0/'), xs:anyURI('http://www.w3.org/XML/1998/namespace')))]"> <sch:assert test="some $schema in nf:resolve-namespace(., @namespace) satisfies ( nf:has-effective-conformance-target-identifier($schema, xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ReferenceSchemaDocument')) or nf:has-effective-conformance-target-identifier($schema, xs:anyURI('http://reference.niem.gov/niem/specification/naming-and-design-rules/4.0/#ExtensionSchemaDocument')))" >A namespace imported as conformant from an extension schema document MUST identify a namespace defined by a reference schema document or an extension schema document.</sch:assert> </sch:rule> </sch:pattern>
This document defines the terms extension schema document and reference schema document.
There are several namespaces that are treated specially by the NIEM NDR. When the following namespaces are imported into a conformant schema document, they must be imported as if they are conformant. That is, the xs:import
element must not have an attribute appinfo:externalImportIndicator
with a value of true
.
<sch:pattern> <sch:rule context="xs:import[exists(@namespace) and xs:anyURI(@namespace) = xs:anyURI('http://release.niem.gov/niem/structures/4.0/')]"> <sch:assert test="empty(@appinfo:externalImportIndicator)" >An import of the structures namespace MUST NOT be labeled as an external import.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:import[exists(@namespace) and xs:anyURI(@namespace) = xs:anyURI('http://www.w3.org/XML/1998/namespace')]"> <sch:assert test="empty(@appinfo:externalImportIndicator)" >An import of the XML namespace MUST NOT be labeled as an external import.</sch:assert> </sch:rule> </sch:pattern>
<sch:pattern> <sch:rule context="xs:schema[exists(@targetNamespace) and (some $element in nf:resolve-namespace(., xs:anyURI(@targetNamespace)) satisfies $element is .)]"> <sch:assert test="count(nf:resolve-namespace(., xs:anyURI(@targetNamespace))) = 1" >A namespace may appear as a root schema in a schema set only once.</sch:assert> </sch:rule> </sch:pattern>
XML Schemas allows multiple xs:import elements for the same namespace, which allows for multiple sets of annotations and schema locations.
<sch:pattern> <sch:rule context="xs:import"> <sch:let name="namespace" value="@namespace"/> <sch:let name="is-conformant" value="empty(@appinfo:externalImportIndicator)"/> <sch:let name="first" value="exactly-one(parent::xs:schema/xs:import[@namespace = $namespace][1])"/> <sch:assert test=". is $first or $is-conformant = empty($first/@appinfo:externalImportIndicator)" >All xs:import elements that have the same namespace MUST have the same conformance marking via appinfo:externalImportIndicator.</sch:assert> </sch:rule> </sch:pattern>
This specification attempts to restrict XML instance data as little as possible while still maintaining interoperability.
NIEM does not require a specific encoding or specific requirements for the XML prologue, except as specified by [XML].
The XML document MUST be schema-valid, as assessed against a conformant schema document set, composed of authoritative, comprehensive schema documents for the relevant namespaces.
The schemas that define the exchange must be authoritative. Each is the reference schema or extension schema for the namespace it defines. Application developers may use other schemas for various purposes, but for the purposes of determining conformance, the authoritative schemas are relevant.
This rule should not be construed to mean that XML validation must be performed on all XML instances as they are served or consumed; only that the XML instances validate if XML validation is performed. The XML Schema component definitions specify XML documents and element information items, and the instances should follow the rules given by the schemas, even when validation is not performed.
NIEM embraces the use of XML Schema instance attributes, including xsi:type
, xsi:nil
, and xsi:schemaLocation
, as specified by [XML Schema Structures].
The main way that NIEM XML data represents relationships and values is via the hierarchy of XML elements in an XML document. For example, the following fragment of an XML document:
<nc:Person> <nc:PersonName> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:Person>
In this instance, the XML elements describe relationships between data objects:
XML description | The Meaning of the data |
---|---|
The top element occurs within some context, about which we do not know anything. | There is some object, representing whatever is outside the outer element. |
The top element is nc:Person . The NIEM reference schema defines the type of the element as nc:PersonType . | There is a relationship, called nc:Person , between the unknown context object and an object of type nc:PersonType . |
The next element is nc:PersonName . The schema indicates that element is of type nc:PersonNameType . | There is a relationship called nc:PersonName between the object of type nc:PersonType and an object of type nc:PersonNameType . |
The next element is nc:PersonFullName . The schema shows that the element is of type nc:PersonNameTextType . | There is a relationship, called nc:PersonFullName from the object of type nc:PersonNameType and an object of type nc:PersonNameTextType . |
Within that element is the simple value John Doe. The schema tells us the content of that element is of simple type xs:string . | The object of type nc:PersonNameTextType has a value that is the literal John Doe. |
To summarize:
NIEM is designed so that NIEM XML data is a form of RDF data. This is described in some detail by Section 5, The NIEM conceptual model, above, in particular Section 5.6.3, NIEM instance mappings to RDF, above. The XML data, above, corresponds to the following graph. Here, the circles are data objects, and the arrows show relationships, between the objects, and between the objects and their types:
Within the instance, the meaning of an element with no content is that additional properties are not asserted. There MUST NOT be additional meaning interpreted for an element with no content.
Elements without content only show a lack of asserted information. That is, all that is asserted is what is explicitly stated, through a combination of XML instance data and its schema. Data that is not present makes no claims. It may be absent due to lack of availability, lack of knowledge, or deliberate withholding of information. These cases should be modeled explicitly, if they are required.
Nested elements, shown above, are sufficient to represent simple data that takes the form of a tree. However, the use of nested elements has limitations; expression of all relationships via nested elements is not always possible. Situations that cause problems include:
NIEM provides two different ways to solve this problem: the use of local references pointing to local identifiers, and the use of uniform resource identifiers (URIs). These two methods are similar, and can interoperate, but have distinctions, as described by Section 12.2.3, Differentiating reference-to-identifier links and use of URIs, below.
<sch:pattern> <sch:rule context="*[exists(@structures:id) or exists(@structures:ref) or exists(@structures:uri)]"> <sch:assert test="count(@structures:id | @structures:ref | @structures:uri) le 1" >An element MUST NOT have more than one attribute that is structures:id, structures:ref, or structures:uri.</sch:assert> </sch:rule> </sch:pattern>
The XML specifications define ID and IDREF attributes, which act as references in XML data. This is supported by XML Schema, and NIEM uses ID and IDREF as one way to reference data across data objects. Under this framework:
xs:ID
must be unique. For example, if an element has an attribute of type xs:ID
with the value of Bob, then there may not be any other attribute in the document that is of type
xs:ID
that also has the value Bob. NIEM provides attribute
structures:id
of type xs:ID
to act as a standard local identifier.xs:IDREF
must appear somewhere within the document as the value of some attribute of type xs:ID
. For example, if an attribute of type xs:IDREF
has the value Bob, then somewhere within that XML document there must be an attribute of type
xs:ID
with the value Bob. NIEM provides attribute
structures:ref
of type xs:IDREF
as a standard local reference.In short, within a NIEM-conformant XML document, an attribute structures:ref
refers to an attribute structures:id
. These attributes may appear in an XML document to express that an object that is the value of an element is the same as some other object within the document. For example, in the following example, the user of the weapon (Bart) is the same person that is the subject of the arrest:
<j:Arrest> <j:ArrestInvolvedWeapon> <nc:WeaponUser structures:id="bart"> <nc:PersonName> <nc:PersonGivenName>Bart</nc:PersonGivenName> </nc:PersonName> </nc:WeaponUser> </j:ArrestInvolvedWeapon> <j:ArrestSubject> <nc:RoleOfPerson structures:ref="bart" xsi:nil="true"/> </j:ArrestSubject> </j:Arrest>
Note that rules below establish that relationships established using structures:id
and structures:ref
have the exact same meaning as relationships established using nested elements. An information exchange specification may constrain them differently, or prefer one over the other, but from a NIEM perspective, they have the same meaning.
Although many attributes with ID and IDREF semantics are defined by many vocabularies, for consistency, within a NIEM XML document any attribute structures:ref
must refer to an attribute structures:id
, and not any other attribute.
<sch:pattern> <sch:rule context="*[@structures:ref]"> <sch:let name="ref" value="@structures:ref"/> <sch:assert test="exists(//*[@structures:id = $ref])" >The value of an attribute structures:ref MUST match the value of an attribute structures:id of some element in the XML document.</sch:assert> </sch:rule> </sch:pattern>
This mirrors the terminology in [XML] subsection Validity constraint: IDREF within Section 3.3.1, Attribute Types, except it requires the target attribute to be structures:id
, rather than any attribute of type ID
.
NIEM supports type-safe references: references using structures:ref
and structures:id
must preserve the type constraints that would apply if nested elements were used instead of a reference. For example, an element of type nc:PersonType
must always refer to another element of type nc:PersonType
, or a type derived from nc:PersonType
, when using structures:ref
to establish the relationship.
Given that:
structures:ref
with value $refstructures:id
with value $refEvery element that has an attribute structures:ref
MUST have a referencing element validation root that is equal to the referenced element validation root.
The term validation root
is defined by [XML Schema Structures] Section 5.2, Assessing Schema-Validity. It is established as a part of validity assessment of an XML document. It is required because relationships between the types of elements cannot be established if those elements were not assessed together.
Given that:
structures:ref
with value $refstructures:id
with value $refEvery element that has an attribute structures:ref
MUST have a referenced element type definition that is validly derived from the referencing element type definition.
The term validly derived is as established by [XML Schema Structures] subsection Schema Component Constraint: Type Derivation OK (Complex) within Section 3.4.6, Constraints on Complex Type Definition Schema Components.
This rule requires that the type of the element pointed to by a structures:ref
attribute must be of (or derived from) the type of the reference element.
NIEM supports the linked data methodology through the use of uniform resource identifiers (URIs), expressed through the attribute structures:uri
in XML documents . This attribute works much like structures:ref
and structures:id
, and overlaps somewhat. Linked data introduces key terminology:
As described in Section 5.4, Unique identification of data objects, above, structures:uri
, structures:id
, and structures:ref
each denote a resource identifier. Although a structures:ref
must always refer to a structures:id
, and a value of structures:id
must be unique within its document, a structures:uri
may refer to any of structures:uri
, structures:ref
, or structures:id
.
The value of an attribute structures:uri
is a URI-reference, as defined by [RFC 3986], which denotes a resource identifier on the element holding the attribute, in accordance with evaluation consistent with [RFC 3986] and [XML Base].
The following example shows a reference to an absolute URI, using the URN namespace for UUIDs:
<example:ArrestMessage> <j:Arrest xsi:nil="true" structures:uri="urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"/> </example:ArrestMessage>
The following example shows a relative URI, using xml:base
to carry the base URI for the document. The person object identified by the structures:uri
attribute has the URI http://state.example/scmods/B263-1655-2187
.
<example:ArrestMessage xml:base="http://state.example/scmods/"> <j:Arrest> <j:ArrestSubject> <nc:RoleOfPerson structures:uri="B263-1655-2187"/> </j:ArrestSubject> </j:Arrest> </example:ArrestMessage>
The following example shows a URI fragment. The example has no xml:base
, so supposing the example was from file https://example.org/path/to/file.xml
, the person object has the identifier https://example.org/path/to/file.xml#first
.
<example:ArrestMessage> <j:Arrest> <j:ArrestSubject> <nc:RoleOfPerson structures:uri="#first"/> </j:ArrestSubject> </j:Arrest> </example:ArrestMessage>
The attributes structures:id
and structures:ref
each have a mapping to equivalent values of structures:uri
.
The value of an attribute structures:id
with a value of $value, or an attribute structures:ref
with a value of $value, denotes a resource identifier on the element holding the attribute, as would be denoted by an attribute structures:uri
with a value of
$value.#
For example, structures:id="hello"
and structures:ref="hello"
each denote the same resource identifier for an element as if it held an attribute structures:uri="#hello"
.
Consistent with Section 5.4, Unique identification of data objects, above, a set of elements that each have the same resource identifier denote the same object, which has that given identifier. This means that, in an XML representation, the properties of an object may be spread across a set of elements that share an identifier.
The following example contains four references to the same object, which has the identifier https://state.example/98723987/results.xml#delta
.
<example:ArrestMessage xml:base="https://state.example/98723987/results.xml"> <j:Arrest> <j:ArrestSubject> <nc:RoleOfPerson structures:id="delta"/> </j:ArrestSubject> </j:Arrest> <j:Arrest> <j:ArrestSubject> <nc:RoleOfPerson structures:ref="delta"/> </j:ArrestSubject> </j:Arrest> <j:Arrest> <j:ArrestSubject> <nc:RoleOfPerson structures:uri="#delta"/> </j:ArrestSubject> </j:Arrest> <j:Arrest> <j:ArrestSubject> <nc:RoleOfPerson structures:uri="https://state.example/98723987/results.xml#delta"/> </j:ArrestSubject> </j:Arrest> </example:ArrestMessage>
These two methods are similar, and can interoperate, but have distinctions:
structures:ref
and structures:id
are required to be within the same document.structures:id
and structures:ref
are required to be validated against the same schema.structures:ref
must be consistent with the referencing element’s type declaration.structures:id
must be unique for IDs within the document.structures:ref
must appear within the document as the value of an attribute structures:id
.structures:uri
is a URI-reference that can reference any resource, inside or outside the document.structures:uri
can reference any structures:id
within the same document, or in another conformant document.structures:uri
can reference any structures:ref
within the same document, or in another conformant document.structures:uri
may reference any other structures:uri
, within the same document, or in another conformant document.An important aspect of the use of nested elements, ref-to-id references, and URI references, is that they all have the same meaning. Expressing a relationship as a nested element, versus as a ref-to-id reference is merely for convenience and ease of serialization. There is no change in meaning or semantics between relationships expressed by sub-elements versus relationships expressed by structures:ref
or structures:uri
.
Any claim that nested elements represent composition, while references represent aggregation is incorrect. No life cycle dependency is implied by either method. Similarly, any claim that included data is intrinsic (i.e., a property inherent to an object), while referenced data is extrinsic (i.e., a property derived from a relationship to other things), is false. A property represented as a nested element has the exact same meaning as that property represented by a reference.
There MUST NOT be any difference in meaning between a relationship established via an element declaration instantiated by a nested element, and that element declaration instantiated via reference.
There is no difference in meaning between relationships established by sub-elements and those established by references. They are simply two mechanisms for expressing connections between objects. Neither mechanism implies that properties are intrinsic or extrinsic; such characteristics must be explicitly stated in property definitions.
Being of type xs:ID
and xs:IDREF
, validating schema parsers will perform certain checks on the values of structures:id
and structures:ref
. Specifically, no two IDs may have the same value. This includes structures:id
and other IDs that may be used within an XML document. Also, any value of structures:ref
must also appear as the value of an ID.
By this rule, the following three XML fragments have a very similar meaning. First, Figure 12-8, Example with no reference, below, shows a witness that is a role of a person.
<j:Witness> <nc:RoleOfPerson> <nc:PersonName> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:RoleOfPerson> </j:Witness>
Figure 12-9, Example with a backward reference, below, also expresses a witness object that is a role of a person. It first expresses the person object, then the witness object as a role of a that person, expressed as a reference back to the person.
<nc:Person structures:id="c58"> <nc:PersonName> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:Person> <j:Witness> <nc:RoleOfPerson structures:ref="c58" xsi:nil="true"/> </j:Witness>
Figure 12-10, Example with a forward reference, below, shows a witness as a role of a person, with a separate person object expressed as a forward reference to the person object that is expressed later, within the definition of the witness.
<nc:Person structures:ref="t85" xsi:nil="true"/> <j:Witness> <nc:RoleOfPerson structures:id="t85"> <nc:PersonName> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:RoleOfPerson> </j:Witness>
NIEM-conformant data instances may use either representation as needed, to represent the meaning of the fundamental data. There is no difference in meaning between reference and content data representations. The two different methods are available for ease of representation. No difference in meaning should be implied by the use of one method or the other.
NIEM provides the metadata mechanism for giving information about object assertions. An object may have an attribute that refers to one or more metadata objects. A structures:metadata
attribute indicates that a data item has the given metadata. A structures:relationshipMetadata
attribute asserts that the link (or relationship) established by an element has the given metadata.
<nc:Person> <nc:PersonBirthDate structures:metadata="j86"> <nc:Date>1945-12-01</nc:Date> </nc:PersonBirthDate> <nc:PersonName structures:metadata="s22 j86" structures:relationshipMetadata="k25"> <nc:PersonFullName>John Doe</nc:PersonFullName> </nc:PersonName> </nc:Person> <nc:Metadata structures:id="s22"> <nc:SourceText>Adam Barber</nc:SourceText> </nc:Metadata> <nc:Metadata structures:id="j86"> <nc:ReportedDate> <nc:Date>2005-04-26</nc:Date> </nc:ReportedDate> </nc:Metadata> <nc:Metadata structures:id="k25"> <nc:ProbabilityPercent>25</nc:ProbabilityPercent> </nc:Metadata>
This example shows a person named John Doe, born 12/1/1945. This data has several pieces of metadata on it:
s22
asserts Adam Barber gave the name.j86
asserts the name and the birth date were reported on 4/26/2005.k25
asserts a 25% probability that the name goes with the person.This shows several characteristics of metadata:
An instance would not be valid XML if the structures:metadata
or structures:relationshipMetadata
attributes contained references for which there were no defined IDs. The instance would not be NIEM-conformant if the references were not to IDs defined with the structures:id
attribute.
Application of metadata to a type or element to which it is not applicable is not NIEM-conformant. A metadata element may be labeled as applicable to multiple elements via attribute appinfo:appliesToElements
, or to multiple types via attribute appinfo:appliesToTypes
. In either case it may apply to an instance of any of the listed elements or types. For an example, see Figure 10-14, Sample use of appinfo:appliesToTypes
, above. A metadata element with neither attribute appinfo:appliesToElements
nor attribute appinfo:appliesToTypes
may be applied to any element of any type.
Within an element instance, when an object $O links to a metadata object via an attribute structures:metadata
, the information in the metadata object MUST be applied to the object $O.
structures:metadata
applies metadata to an object.
Within an element instance, when an object $O1 contains an element $E, with content object $O2 or with a reference to object $O2, and $O2 links to a metadata object via an attribute structures:relationshipMetadata
, the information in the metadata object MUST be applied to the relationship $E between $O1 and $O2.
structures:relationshipMetadata
applies metadata to a relationship between two objects.
Given that each IDREF in the value of an attribute structures:metadata
must match the value of an ID attribute on some element in the XML document, that ID attribute MUST be an occurrence of the attribute structures:id
.
Given that each IDREF in the value of an attribute structures:relationshipMetadata
must match the value of an ID attribute on some element in the XML document, that ID attribute MUST be an occurrence of the attribute structures:id
.
Each element referenced by an attribute structures:metadata
or an attribute structures:relationshipMetadata
MUST have [element declaration] that is a metadata element declaration.
Although not implemented in Schematron, this rule covers the cases not covered by Rule 12-15, Attribute structures:metadata
references metadata element (INS), below.
<sch:pattern> <sch:rule context="*[exists(@structures:metadata)]"> <sch:assert test="every $metadata-ref in tokenize(normalize-space(@structures:metadata), ' ') satisfies exists(//*[exists(@structures:id[. = $metadata-ref]) and ends-with(local-name(), 'Metadata')])" >Each item in the value of an attribute structures:metadata MUST appear as the value of an attribute structures:id with an owner element that is a metadata element.</sch:assert> </sch:rule> </sch:pattern>
Note that this will NOT diagnose a scenario in which the element with a name ending in Metadata
is an external element; additional tests would be required to catch that.
<sch:pattern> <sch:rule context="*[exists(@structures:relationshipMetadata)]"> <sch:assert test="every $metadata-ref in tokenize(normalize-space(@structures:relationshipMetadata), ' ') satisfies exists(//*[exists(@structures:id[. = $metadata-ref]) and ends-with(local-name(), 'Metadata')])" >Each item in the value of an attribute structures:relationshipMetadata MUST appear as the value of an attribute structures:id with an owner element that is a metadata element.</sch:assert> </sch:rule> </sch:pattern>
Note that this will NOT diagnose a scenario in which the element with a name ending in Metadata
is an external element; additional tests would be required to catch that.
Given that an element $SUBJECT-ELEMENT uses a metadata element $METADATA-ELEMENT through a value in either an attribute structures:metadata
or an attribute structures:relationshipMetadata
, the element $SUBJECT-ELEMENT MUST be an applicable element for $METADATA-ELEMENT.
The applicable elements for a metadata element are identified by Rule 10-41, Metadata element has applicable elements (REF, EXT, SET), above.
[BCP 14]: Internet Engineering Task Force Best Current Practice 14. Available from https://www.ietf.org/rfc/bcp/bcp14.txt. BCP 14 is composed of:
[RFC 2119]: Bradner, S., Key words for use in RFCs to Indicate Requirement Levels
, BCP 14, RFC 2119, March 1997. Available from http://www.ietf.org/rfc/rfc2119.txt.
[RFC 8174]: Leiba, B., Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
, BCP 14, RFC 8174, May 2017. Available from https://www.ietf.org/rfc/rfc8174.txt.
[ClarkNS]: Clark, J. XML Namespaces
, 4 February 1999. Available from http://www.jclark.com/xml/xmlns.htm.
[Code Lists]: Webb Roberts. NIEM Code Lists Specification.
NIEM Technical Architecture Committee (NTAC), November 7, 2017. Available from https://reference.niem.gov/niem/specification/code-lists/4.0/niem-code-lists-4.0.html.
[ConfReq]: Lynne Rosenthal, and Mark Skall, eds. Conformance Requirements for Specifications v1.0.
The Organization for the Advancement of Structured Information Standards (OASIS), March 15, 2002. https://www.oasis-open.org/committees/download.php/305/conformance_requirements-v1.pdf.
[CTAS]: Roberts, Webb. NIEM Conformance Targets Attribute Specification, Version 3.0.
NIEM Technical Architecture Committee, July 31, 2014. http://reference.niem.gov/niem/specification/conformance-targets-attribute/3.0/NIEM-CTAS-3.0-2014-07-31.html.
[ISO 11179-4]: ISO/IEC 11179-4 Information Technology — Metadata Registries (MDR) — Part 4: Formulation of Data Definitions Second Edition
, 15 July 2004. Available from http://standards.iso.org/ittf/PubliclyAvailableStandards/c035346_ISO_IEC_11179-4_2004(E).zip.
[ISO 11179-5]: ISO/IEC 11179-5:2005, Information technology — Metadata registries (MDR) — Part 5: Naming and identification principles
. Available from http://standards.iso.org/ittf/PubliclyAvailableStandards/c035347_ISO_IEC_11179-5_2005(E).zip.
[JLS]: James Gosling, Bill Joy, Guy Steele, Gilad Bracha, and Alex Buckley. The Java Language Specification, Java SE 8 Edition.
Oracle Corp, March 3, 2014. http://docs.oracle.com/javase/specs/jls/se8/html/.
[JSON LD]: Manu Sporny, Dave Longley, Gregg Kellogg, Markus Lanthaler, and Niklas Lindstrom. JSON-LD 1.0, A JSON-Based Serialization for Linked Data, W3C Recommendation.
Edited by Manu Sporny, Gregg Kellogg, and Markus Lanthaler. W3C, January 16, 2014. https://www.w3.org/TR/2014/REC-json-ld-20140116/.
[N-ary]: Defining N-ary Relations on the Semantic Web
, W3C Working Group Note, 12 April 2006. Available from http://www.w3.org/TR/2006/NOTE-swbp-n-aryRelations-20060412//.
[OED]: Oxford English Dictionary, Third Edition
, Oxford University Press, November 2010. http://dictionary.oed.com/.
[RDF Concepts]: Richard Cyganiak, David Wood, and Markus Lanthaler, eds. RDF 1.1 Concepts and Abstract Syntax.
The World Wide Web Consortium (W3C), February 25, 2014. http://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/.
[RFC 3986]: Berners-Lee, T., et al. Uniform Resource Identifier (URI): Generic Syntax
, Request for Comments 3986, January 2005. Available from http://tools.ietf.org/html/rfc3986.
[Schematron]: ISO/IEC STANDARD 19757-3: Information technology — Document Schema Definition Languages (DSDL) Part 3: Rule-based validation — Schematron
, ISO/IEC, 1 June 2006. Retrieved from http://standards.iso.org/ittf/PubliclyAvailableStandards/c040833_ISO_IEC_19757-3_2006(E).zip.
[XML]: Extensible Markup Language (XML) 1.0 (Fourth Edition)
, W3C Recommendation, 16 August 2006. Available from http://www.w3.org/TR/2008/REC-xml-20081126/.
[XML Base]: Jonathan Marsh, and Richard Tobin, eds. XML Base (Second Edition), W3C Recommendation.
W3C, January 28, 2009. Available from http://www.w3.org/TR/2009/REC-xmlbase-20090128/.
[XML Infoset]: Cowan, John, and Richard Tobin. XML Information Set (Second Edition)
, 4 February 2004. http://www.w3.org/TR/2004/REC-xml-infoset-20040204/.
[XML Namespaces]: Namespaces in XML 1.0 (Third Edition)
, W3C Recommendation, 8 December 2009. Available from http://www.w3.org/TR/2009/REC-xml-names-20091208/.
[XML Schema Datatypes]: XML Schema Part 2: Datatypes Second Edition
, W3C Recommendation, 28 October 2004. Available at http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/.
[XML Schema Structures]: XML Schema Part 1: Structures Second Edition
, W3C Recommendation, 28 October 2004. Available from http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/.
[XPath 2]: Berglund, Anders, Scott Boag, Don Chamberlin, Mary F. Fernández, Michael Kay, Jonathan Robie, and Jérôme Siméon. XML Path Language (XPath) 2.0 (Second Edition)
, W3C Recommendation, 3 January 2011. http://www.w3.org/TR/2010/REC-xpath20-20101214/.
<?xml version="1.0" encoding="US-ASCII"?> <xs:schema targetNamespace="http://release.niem.gov/niem/structures/4.0/" version="4.0" xmlns:structures="http://release.niem.gov/niem/structures/4.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:attribute name="id" type="xs:ID"/> <xs:attribute name="ref" type="xs:IDREF"/> <xs:attribute name="uri" type="xs:anyURI"/> <xs:attribute name="metadata" type="xs:IDREFS"/> <xs:attribute name="relationshipMetadata" type="xs:IDREFS"/> <xs:attributeGroup name="SimpleObjectAttributeGroup"> <xs:attribute ref="structures:id"/> <xs:attribute ref="structures:ref"/> <xs:attribute ref="structures:uri"/> <xs:attribute ref="structures:metadata"/> <xs:attribute ref="structures:relationshipMetadata"/> <xs:anyAttribute namespace="urn:us:gov:ic:ism urn:us:gov:ic:ntk" processContents="lax"/> </xs:attributeGroup> <xs:complexType name="ObjectType" abstract="true"> <xs:sequence> <xs:element ref="structures:ObjectAugmentationPoint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute ref="structures:id"/> <xs:attribute ref="structures:ref"/> <xs:attribute ref="structures:uri"/> <xs:attribute ref="structures:metadata"/> <xs:attribute ref="structures:relationshipMetadata"/> <xs:anyAttribute namespace="urn:us:gov:ic:ism urn:us:gov:ic:ntk" processContents="lax"/> </xs:complexType> <xs:element name="ObjectAugmentationPoint" abstract="true"> <xs:annotation> <xs:documentation>An augmentation point for ObjectType</xs:documentation> </xs:annotation> </xs:element> <xs:complexType name="AssociationType" abstract="true"> <xs:sequence> <xs:element ref="structures:AssociationAugmentationPoint" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute ref="structures:id"/> <xs:attribute ref="structures:ref"/> <xs:attribute ref="structures:uri"/> <xs:attribute ref="structures:metadata"/> <xs:attribute ref="structures:relationshipMetadata"/> <xs:anyAttribute namespace="urn:us:gov:ic:ism urn:us:gov:ic:ntk" processContents="lax"/> </xs:complexType> <xs:element name="AssociationAugmentationPoint" abstract="true"> <xs:annotation> <xs:documentation>An augmentation point for AssociationType</xs:documentation> </xs:annotation> </xs:element> <xs:complexType name="MetadataType" abstract="true"> <xs:attribute ref="structures:id"/> <xs:attribute ref="structures:ref"/> <xs:attribute ref="structures:uri"/> <xs:anyAttribute namespace="urn:us:gov:ic:ism urn:us:gov:ic:ntk" processContents="lax"/> </xs:complexType> <xs:complexType name="AugmentationType" abstract="true"> <xs:attribute ref="structures:id"/> <xs:attribute ref="structures:ref"/> <xs:attribute ref="structures:uri"/> <xs:attribute ref="structures:metadata"/> <xs:anyAttribute namespace="urn:us:gov:ic:ism urn:us:gov:ic:ntk" processContents="lax"/> </xs:complexType> </xs:schema>
<?xml version="1.0" encoding="US-ASCII"?> <xs:schema targetNamespace="http://release.niem.gov/niem/appinfo/4.0/" version="4.0" xmlns:appinfo="http://release.niem.gov/niem/appinfo/4.0/" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:annotation> <xs:documentation>The appinfo schema provides support for high level data model concepts and additional syntax to support the NIEM conceptual model and validation of NIEM-conformant instances.</xs:documentation> </xs:annotation> <xs:attribute name="deprecated"> <xs:annotation> <xs:documentation>The Deprecated element provides a method for identifying schema components as being deprecated. A deprecated component is one that is provided, but the use of which is not recommended.</xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:boolean"> <xs:pattern value="true"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="appliesToTypes"> <xs:annotation> <xs:documentation>The appliesToTypes attribute appears on the element declaration of a metadata element. It indicates a set of types to which the metadata element may be applied. The metadata element will also be applicable to any type that is derived from a listed type.</xs:documentation> </xs:annotation> <xs:simpleType> <xs:list itemType="xs:QName"/> </xs:simpleType> </xs:attribute> <xs:attribute name="appliesToElements"> <xs:annotation> <xs:documentation>The appliesToElements attribute appears on the element declaration of a metadata element. It indicates a set of elements to which the metadata element may be applied. The metadata element will also be applicable to any element that is in the substitution group of a listed element.</xs:documentation> </xs:annotation> <xs:simpleType> <xs:list itemType="xs:QName"/> </xs:simpleType> </xs:attribute> <xs:attribute name="externalAdapterTypeIndicator"> <xs:annotation> <xs:documentation>The externalAdapterTypeIndicator attribute indicates that a complex type is an external adapter type. An external adapter type is composed of elements and attributes from non-NIEM-conformant schemas.</xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:boolean"> <xs:pattern value="true"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="externalImportIndicator"> <xs:annotation> <xs:documentation>The externalImportIndicator attribute is true if and only if a namespace identified via xs:import is expected to be non-conformant.</xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:boolean"> <xs:pattern value="true"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:element name="LocalTerm"> <xs:complexType> <xs:sequence> <xs:element name="SourceText" type="appinfo:NonemptyStringSimpleType" minOccurs="0" maxOccurs="unbounded" form="qualified"/> </xs:sequence> <xs:attribute name="term" type="appinfo:NonemptyStringSimpleType" use="required"/> <xs:attribute name="literal" type="appinfo:NonemptyStringSimpleType"/> <xs:attribute name="definition" type="appinfo:NonemptyStringSimpleType"/> <xs:attribute name="sourceURIs"> <xs:simpleType> <xs:restriction> <xs:simpleType> <xs:list itemType="xs:anyURI"/> </xs:simpleType> <xs:minLength value="1"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:simpleType name="NonemptyStringSimpleType"> <xs:restriction base="xs:string"> <xs:minLength value="1"/> </xs:restriction> </xs:simpleType> </xs:schema>
Representationpattern
ct:conformanceTargets
(REF, EXT): Section 4.3, Conformance target identifiersxs:schema
(REF, EXT): Section 7.3, Conformance to XML Schemaxs:ID
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesxs:IDREF
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesxs:IDREFS
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesxs:anyType
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesxs:anySimpleType
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesxs:NOTATION
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesxs:ENTITY
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesxs:ENTITIES
(REF, EXT): Section 9.1.1.1, Types prohibited as base typesfixedon simple type facets (REF): Section 9.1.2, Simple type definition
xs:ID
(REF, EXT): Section 9.1.2.1, Simple types prohibited as list item typesxs:IDREF
(REF, EXT): Section 9.1.2.1, Simple types prohibited as list item typesxs:anySimpleType
(REF, EXT): Section 9.1.2.1, Simple types prohibited as list item typesxs:ENTITY
(REF, EXT): Section 9.1.2.1, Simple types prohibited as list item typesxs:ID
(REF, EXT): Section 9.1.2.2, Simple types prohibited as union member typesxs:IDREF
(REF, EXT): Section 9.1.2.2, Simple types prohibited as union member typesxs:IDREFS
(REF, EXT): Section 9.1.2.2, Simple types prohibited as union member typesxs:anySimpleType
(REF, EXT): Section 9.1.2.2, Simple types prohibited as union member typesxs:ENTITY
(REF, EXT): Section 9.1.2.2, Simple types prohibited as union member typesxs:ENTITIES
(REF, EXT): Section 9.1.2.2, Simple types prohibited as union member typesxs:anySimpleType
is abstract (REF, EXT): Section 9.2.1, Element declarationxs:ID
(REF, EXT): Section 9.2.3.1, Prohibited attribute typesxs:IDREF
(REF, EXT): Section 9.2.3.1, Prohibited attribute typesxs:IDREFS
(REF, EXT): Section 9.2.3.1, Prohibited attribute typesxs:ENTITY
(REF, EXT): Section 9.2.3.1, Prohibited attribute typesxs:ENTITIES
(REF, EXT): Section 9.2.3.1, Prohibited attribute typesxs:anySimpleType
(REF, EXT): Section 9.2.3.1, Prohibited attribute typesxs:notation
(REF, EXT): Section 9.2.4, Notation declarationxs:all
(REF, EXT): Section 9.3.1, Model groupxs:sequence
must be child of xs:extension
(REF): Section 9.3.1.1, Sequencexs:sequence
must be child of xs:extension
or xs:restriction
(EXT): Section 9.3.1.1, Sequencexs:choice
(REF): Section 9.3.1.2, Choicexs:choice
must be child of xs:sequence
(EXT): Section 9.3.1.2, Choicexs:any
(REF): Section 9.3.4, Wildcardxs:anyAttribute
(REF): Section 9.3.4, Wildcardxs:unique
(REF, EXT): Section 9.4, Identity-constraint definition componentsxs:key
(REF, EXT): Section 9.4, Identity-constraint definition componentsxs:keyref
(REF, EXT): Section 9.4, Identity-constraint definition componentsxs:group
(REF, EXT): Section 9.5.1, Model group definitionxs:appinfo
children are comments, elements, or whitespace (REF, EXT): Section 9.6.1, Application information annotationxs:redefine
(REF, EXT): Section 9.8, Schema assemblyxs:include
(REF, EXT): Section 9.8, Schema assemblyxs:import
must have namespace (REF, EXT): Section 9.8, Schema assemblytype
is imported (REF, EXT): Section 9.8.1, Namespaces for referenced components are importedbase
is imported (REF, EXT): Section 9.8.1, Namespaces for referenced components are importeditemType
is imported (REF, EXT): Section 9.8.1, Namespaces for referenced components are importedmemberTypes
is imported (REF, EXT): Section 9.8.1, Namespaces for referenced components are importedref
is imported (REF, EXT): Section 9.8.1, Namespaces for referenced components are importedsubstitutionGroup
is imported (REF, EXT): Section 9.8.1, Namespaces for referenced components are importedstructures:ObjectType
(REF, EXT): Section 10.2.1.1, Object types with complex contentCodeType(REF, EXT): Section 10.2.4, Code types
structures:AssociationType
(REF, EXT): Section 10.3.1, Association typesAugmentationType(REF, EXT): Section 10.4.4, Augmentation types
AugmentationTypeis an augmentation type (REF, EXT): Section 10.4.4, Augmentation types
structures:AugmentationType
is an augmentation type (REF, EXT): Section 10.4.4, Augmentation typesstructures:MetadataType
(REF, EXT): Section 10.5.1, Metadata typesRepresentationis abstract (REF, EXT): Section 10.7, The
Representationpattern
appinfo:appliesToTypes
annotates metadata element (REF, EXT): Section 10.9.1.3, appinfo:appliesToTypes
annotationappinfo:appliesToTypes
references types (SET): Section 10.9.1.3, appinfo:appliesToTypes
annotationappinfo:appliesToElements
annotates metadata element (REF, EXT): Section 10.9.1.4, appinfo:appliesToElements
annotationappinfo:appliesToElements
references elements (SET): Section 10.9.1.4, appinfo:appliesToElements
annotationappinfo:LocalTerm
annotates schema (REF, EXT): Section 10.9.2, Local terminologyappinfo:LocalTerm
has literal or definition (REF, EXT): Section 10.9.2, Local terminologyType(REF, EXT): Section 11.1, Type definition components
SimpleType(REF, EXT): Section 11.1.2, Simple type definition
CodeSimpleType(REF, EXT): Section 11.1.2.3, Code simple types
structures:SimpleObjectAttributeGroup
(REF, EXT): Section 11.1.3, Complex type definitionAbstractis abstract (REF, EXT): Section 11.2.1, Element declaration
xs:schema
document element restrictionsxs:schema
document element restrictionsstructures:ref
must reference structures:id
(INS): Section 12.2.1, Local identifiers and referencesstructures:ref
references element of correct type (INS): Section 12.2.1, Local identifiers and referencesstructures:uri
denotes resource identifier (INS): Section 12.2.2, Uniform resource identifiers in NIEM datastructures:id
and structures:id
denote resource identifier (INS): Section 12.2.2, Uniform resource identifiers in NIEM datastructures:relationshipMetadata
annotates relationship (INS): Section 12.3, Instance metadatastructures:metadata
refer to values of structures:id
(INS): Section 12.3, Instance metadatastructures:relationshipMetadata
refer to values of structures:id
(INS): Section 12.3, Instance metadatastructures:metadata
and structures:relationshipMetadata
refer to metadata elements (INS): Section 12.3, Instance metadatastructures:metadata
references metadata element (INS): Section 12.3, Instance metadatastructures:relationshipMetadata
references metadata element (INS): Section 12.3, Instance metadata