publish-xsd#
Introduction#
Generates an XML schema for the data model.
Requires that dotnet is installed.
Command Line Arguments#
Required inputs for the publish-xsd command (must be specified in order).
[CogsLocation]The location of the folder containing the model.
[TargetLocation]The location of the folder where the output will be created.
Command Line Flags#
Optional inputs for the publish-xsd command.
-?|-h|--helpDisplays all possible command arguments and flags for the publish-xsd command.
-o|--overwriteIf the
[TargetLocation]is not empty, erase all files in the folder before generation.-n|--namespaceOverrides the XML namespace URI.
-p|--namespacePrefixAllows the user to specify the prefix for the XML namespace.
Command Line Usage#
Format
$ cogs publish-xsd (-h) (-o) (-n [namespace]) (-p [prefix]) [CogsLocation] [TargetLocation]
Examples
A few examples of how the command line arguments and flags can be used together.
$ cogs publish-xsd -h $ cogs publish-xsd MyCogsModelDirectory MyOutputDirectory $ cogs publish-xsd -o MyCogsModelDirectory MyOutputDirectory $ cogs publish-xsd -n http://example.org/cogs -p cogs -o MyCogsModelDirectory MyOutputDirectory
Primitive Type Mappings to XML#
Primitive Type |
XML representation |
|---|---|
AnyURI |
|
Boolean |
|
CogsDate |
Union of date, dateTime, duration, gYear, and gYearMonth primitive types. |
Date |
|
DateTime |
|
Decimal |
|
Double |
|
Duration |
|
Float |
|
GDay |
|
GMonth |
|
GMonthDay |
|
GYear |
|
GYearMonth |
|
Int |
|
Integer |
|
Language |
|
Long |
|
NegativeInteger |
|
NonNegativeInteger |
|
NonPositiveInteger |
|
PositiveInteger |
|
String |
|
Time |
|
UnsignedLong |
COGS limits the year component of Date, DateTime, GYear, and GYearMonth to a
nonzero signed 32-bit integer. The generated XSD retains the native XSD 1.0
types and documents this additional constraint; use validate-instance for
authoritative enforcement.
Reference Schema Components#
The generated schema exposes a global IdentificationGroup containing all
base and mixin identification elements in their required order. Every
top-level or property item-reference type reuses that group and follows it
with its own TypeOfObject restriction.
Reference types also permit an optional, unqualified
isReference attribute of type xs:boolean with fixed value true.
Generated runtimes write isReference="true" on every new XML reference,
while the optional declaration keeps older unmarked XML valid. Full item
definitions never carry the marker. See
XML Schema Generation for the complete reader and query
contract.