Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the XML schema with metadata #120 #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions v2-0-RC3/doc/01Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ Representation of dates and times
8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1

[ISO 10383:2012](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=61067)
Securities and related financial instruments - Codes for exchanges and
market identification (MIC)
Securities and related financial instruments - Codes for exchanges and market identification (MIC)

[ISO 15836-1:2017](https://www.iso.org/standard/71339.html) Information and documentation — The Dublin Core metadata element set — Part 1: Core elements

*W3C XML Schema version 1.0* [Part 1](https://www.w3.org/TR/xmlschema-1/) [Part 2](https://www.w3.org/TR/xmlschema-2/)

Expand Down
26 changes: 17 additions & 9 deletions v2-0-RC3/doc/04MessageSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,23 @@ their encodings.

### Schema versioning

Changes to a message schema may be tracked by its `version` attribute. A
version of a schema is a snapshot in time. All elements in a given
generation of the schema share the same version number. That is,
elements are not versioned individually. By convention, the initial
version of a schema is version zero, and subsequent changes increment
the version number.

The `package` attribute should remain constant between versions, if it is
supplied.
Changes to a message schema may be tracked by its `version` attribute. A version of a schema is a snapshot in time. All elements in a given generation of the schema share the same version number. That is, elements are not versioned individually. By convention, the initial version of a schema is version zero, and subsequent changes increment the version number.

The `package` attribute should remain constant between versions, if it is supplied.

### Metadata

Optionally, an SBE message schema may be identified and described using industry standard Dublin Core metadata terms. Any of those standard terms may be contained by a `<metadata>` element. The Dublin Core XML schema is imported by the SBE XML schema to support that usage.

Metadata example
```xml
<metadata>
<dcterms:publisher>FIX Trading Community</dcterms:publisher>
<dcterms:title>SBE example</dcterms:title>
<dcterms:rights>© Copyright 2014-2020 FIX Protocol Limited</dcterms:rights>
<dcterms:created>2020-06-10T10:07-05:00</dcterms:created>
</metadata>
```

Data encodings
------------------------------------------------------------------------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion v2-0-RC3/resources/xml/examples.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<messageSchema xmlns="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" package="examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocation="http://fixprotocol.io/2017/sbe ../xsd/sbe-2.0rc3.xsd">
<messageSchema xmlns="http://fixprotocol.io/2017/sbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:dcterms="http://purl.org/dc/terms/" package="examples" id="91" version="0" byteOrder="littleEndian" xsi:schemaLocation="http://fixprotocol.io/2017/sbe ../xsd/sbe-2.0rc3.xsd">
<metadata>
<dcterms:publisher>FIX Trading Community</dcterms:publisher>
<dcterms:title>SBE example</dcterms:title>
<dcterms:rights>© Copyright 2014-2020 FIX Protocol Limited</dcterms:rights>
<dcterms:created>2020-06-10T10:07-05:00</dcterms:created>
</metadata>
<!-- include commonly used types -->
<xi:include href="types-include.xml"/>
<types>
Expand Down
119 changes: 119 additions & 0 deletions v2-0-RC3/resources/xsd/dc.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://purl.org/dc/elements/1.1/"
targetNamespace="http://purl.org/dc/elements/1.1/"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:annotation>
<xs:documentation xml:lang="en">
DCMES 1.1 XML Schema
XML Schema for http://purl.org/dc/elements/1.1/ namespace

Created 2008-02-11

Created by

Tim Cole (t-cole3@uiuc.edu)
Tom Habing (thabing@uiuc.edu)
Jane Hunter (jane@dstc.edu.au)
Pete Johnston (p.johnston@ukoln.ac.uk),
Carl Lagoze (lagoze@cs.cornell.edu)

This schema declares XML elements for the 15 DC elements from the
http://purl.org/dc/elements/1.1/ namespace.

It defines a complexType SimpleLiteral which permits mixed content
and makes the xml:lang attribute available. It disallows child elements by
use of minOcccurs/maxOccurs.

However, this complexType does permit the derivation of other complexTypes
which would permit child elements.

All elements are declared as substitutable for the abstract element any,
which means that the default type for all elements is dc:SimpleLiteral.

</xs:documentation>

</xs:annotation>


<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/03/xml.xsd">
</xs:import>

<xs:complexType name="SimpleLiteral">
<xs:annotation>
<xs:documentation xml:lang="en">
This is the default type for all of the DC elements.
It permits text content only with optional
xml:lang attribute.
Text is allowed because mixed="true", but sub-elements
are disallowed because minOccurs="0" and maxOccurs="0"
are on the xs:any tag.

This complexType allows for restriction or extension permitting
child elements.
</xs:documentation>
</xs:annotation>

<xs:complexContent mixed="true">
<xs:restriction base="xs:anyType">
<xs:sequence>
<xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
</xs:sequence>
<xs:attribute ref="xml:lang" use="optional"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>

<xs:element name="any" type="SimpleLiteral" abstract="true"/>

<xs:element name="title" substitutionGroup="any"/>
<xs:element name="creator" substitutionGroup="any"/>
<xs:element name="subject" substitutionGroup="any"/>
<xs:element name="description" substitutionGroup="any"/>
<xs:element name="publisher" substitutionGroup="any"/>
<xs:element name="contributor" substitutionGroup="any"/>
<xs:element name="date" substitutionGroup="any"/>
<xs:element name="type" substitutionGroup="any"/>
<xs:element name="format" substitutionGroup="any"/>
<xs:element name="identifier" substitutionGroup="any"/>
<xs:element name="source" substitutionGroup="any"/>
<xs:element name="language" substitutionGroup="any"/>
<xs:element name="relation" substitutionGroup="any"/>
<xs:element name="coverage" substitutionGroup="any"/>
<xs:element name="rights" substitutionGroup="any"/>

<xs:group name="elementsGroup">
<xs:annotation>
<xs:documentation xml:lang="en">
This group is included as a convenience for schema authors
who need to refer to all the elements in the
http://purl.org/dc/elements/1.1/ namespace.
</xs:documentation>
</xs:annotation>

<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="any"/>
</xs:choice>
</xs:sequence>
</xs:group>

<xs:complexType name="elementContainer">
<xs:annotation>
<xs:documentation xml:lang="en">
This complexType is included as a convenience for schema authors who need to define a root
or container element for all of the DC elements.
</xs:documentation>
</xs:annotation>

<xs:choice>
<xs:group ref="elementsGroup"/>
</xs:choice>
</xs:complexType>


</xs:schema>
<!--#include virtual="/schemas/xmls/qdc/2008/02/11/dc.xsd" -->
53 changes: 53 additions & 0 deletions v2-0-RC3/resources/xsd/dcmitype.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://purl.org/dc/dcmitype/"
targetNamespace="http://purl.org/dc/dcmitype/"
elementFormDefault="qualified"
attributeFormDefault="unqualified">

<xs:annotation>
<xs:documentation xml:lang="en">
DCMI Type Vocabulary XML Schema
XML Schema for http://purl.org/dc/dcmitype/ namespace

Created 2008-02-11

Created by

Tim Cole (t-cole3@uiuc.edu)
Tom Habing (thabing@uiuc.edu)
Jane Hunter (jane@dstc.edu.au)
Pete Johnston (p.johnston@ukoln.ac.uk),
Carl Lagoze (lagoze@cs.cornell.edu)

This schema defines a simpleType which enumerates
the allowable values for the DCMI Type Vocabulary.
</xs:documentation>


</xs:annotation>


<xs:simpleType name="DCMIType">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:Name">
<xs:enumeration value="Collection"/>
<xs:enumeration value="Dataset"/>
<xs:enumeration value="Event"/>
<xs:enumeration value="Image"/>
<xs:enumeration value="MovingImage"/>
<xs:enumeration value="StillImage"/>
<xs:enumeration value="InteractiveResource"/>
<xs:enumeration value="Service"/>
<xs:enumeration value="Software"/>
<xs:enumeration value="Sound"/>
<xs:enumeration value="Text"/>
<xs:enumeration value="PhysicalObject"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>

</xs:schema>
<!--#include virtual="/schemas/xmls/qdc/2008/02/11/dcmitype.xsd" -->
Loading