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|--help

    Displays all possible command arguments and flags for the publish-xsd command.

  • -o|--overwrite

    If the [TargetLocation] is not empty, erase all files in the folder before generation.

  • -n|--namespace

    Overrides the XML namespace URI.

  • -p|--namespacePrefix

    Allows 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

anyURI

Boolean

boolean

CogsDate

Union of date, dateTime, duration, gYear, and gYearMonth primitive types.

Date

date

DateTime

dateTime

Decimal

decimal

Double

double

Duration

duration

Float

float

GDay

gDay

GMonth

gMonth

GMonthDay

gMonthDay

GYear

gYear

GYearMonth

gYearMonth

Int

int

Integer

integer

Language

language

Long

long

NegativeInteger

negativeInteger

NonNegativeInteger

nonNegativeInteger

NonPositiveInteger

nonPositiveInteger

PositiveInteger

positiveInteger

String

string

Time

time

UnsignedLong

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.