∟Atomic, List, Atomic Union and List Union Datatypes
This section describes categories of datatypes, Atomic, List, Atomic Union and List Union. And rules of using them to construct new datatypes with 'restriction', 'union' and 'list' components.
In the previous tutorials, we learned how to construct user-defined simple datatypes from built-in datatypes
using "restriction", "union" and "list" components.
Of course, user-defined datatypes can be used in "restriction", "union" and "list" components to define
more user-defined datatypes in a multiple-tier hierarchy.
To help us understand datatype hierarchies and build them correctly, we need to divide simple datatypes into 4 categories:
Atomic Datatype - A datatype where the entire lexical representation is mapped to a single value in the value space.
And its base datatype is another atomic datatype.
List Datatype - A datatype where the entire lexical representation is mapped to a list of items separated by whitespaces.
And its item datatype is another atomic datatype or atomic union datatype.
Atomic Union Datatype - A datatype where the entire lexical representation is mapped to a single value in the value space.
And all of its member datatypes are atomic datatypes or atomic union datatypes.
List Union Datatype - A datatype where the entire lexical representation is mapped to a single value or a list of values
in the value space.
And one or more of its member datatypes are list datatypes or list union datatypes.
With these categories defined above, we can list some rules that we need to follow
when constructing new user-defined simple datatypes using the "restriction" component:
"restriction" component can be used with an atomic datatype as its base datatype to apply restrictions on facets
that are supported by the base datatype.
The resulting datatype is still an atomic datatype.
"restriction" component can be used with a list datatype as its base datatype to apply restrictions on only 5 facets:
"length", "minLength", "maxLength", "pattern", "enumeration" and "assertions".
The resulting datatype is still a list datatype.
"restriction" component can be used with an atomic union datatype as its base datatype to apply restrictions on only 2 facets:
"pattern", "enumeration" and "assertions".
The resulting datatype is an atomic union datatype.
"restriction" component can be used with a list union datatype as its base datatype to apply restrictions on only 2 facets:
"pattern", "enumeration" and "assertions".
The resulting datatype is a list union datatype.
Similarly, we need to follow these rules when constructing new user-defined simple datatypes using
the "union" component:
"union" component can be used with atomic datatypes as its member datatypes.
The resulting datatype is an atomic union datatype.
"union" component can be used with list datatypes as its member datatypes.
The resulting datatype is a list union datatype.
"union" component can be used with atomic union datatypes as its member datatypes.
The resulting datatype is still an atomic union datatype.
"union" component can be used with list union datatypess as its member datatypes.
The resulting datatype is still a list union datatype.
"union" component can be used with a mixed of one or more list datatypes and other datatypes.
The resulting datatype is still a list union datatype.
"union" component can be used with a mixed of one or more list union datatypes and other datatypes.
The resulting datatype is still a list union datatype.
Similarly, we need to follow these rules when constructing new user-defined simple datatypes using
the "list" component:
"list" component can be used with an atomic datatype as its item datatype.
The resulting datatype is a list datatype.
"list" component can not be used with a list datatype as its item datatype.
"list" component can be used with an atomic union datatype as its item datatype.
The resulting datatype is a list datatype.
"list" component can not be used with a list union datatype as its item datatype.