Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:s="analytic-output:2" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="analytic-output:2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0" id="analytic-output-v2.0">
<xs:element name="analyticOutput">
<xs:annotation>
<xs:documentation>Top level element to wrap a number of statistic events of the same type</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="runTime" type="s:DateTimeSimpleType">
<xs:annotation>
<xs:documentation>The time the analytic output was produced</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="analyticDetail" type="s:AnalyticType">
<xs:annotation>
<xs:documentation>Details of the analytic that produced the output.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="record" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="tag" type="s:NameValueType" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Tags/values are used to optionally further qualify the record. E.g. ipAddress|192.168.0.1, user|joe bloggs, hostname|server1.mydomain.com</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" name="associatedEvent" type="s:EventIdType">
<xs:annotation>
<xs:documentation>The unique identifiers for the event(s) that are associated with this record.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="outputValue" maxOccurs="unbounded" type="s:OutputValueType">
<xs:annotation>
<xs:documentation>Defines a data value for this record, qualified by name, e.g. earthMoversDistance|45678.
Names should be unique within a record element.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="recordNumber" nillable="false" minOccurs="0">
<xs:annotation>
<xs:documentation>Where the records have some form of order (e.g the result of a top-n query) this can be used to record the postion in the sorted results, even if the records are unsorted in the XML document.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:int">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:unique name="uniqueOutputValueName">
<xs:selector xpath="s:outputValue"/>
<xs:field xpath="name"/>
</xs:unique>
<xs:unique name="uniqueTagName">
<xs:selector xpath="s:tag"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="AnalyticType">
<xs:sequence>
<xs:element name="name" type="xs:string">
<xs:annotation>
<xs:documentation>The name of the generic form of the analytic being run.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="version" type="xs:string">
<xs:annotation>
<xs:documentation>The version of the analytic, e.g. v1.2.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="instance" type="xs:string">
<xs:annotation>
<xs:documentation>The name of the instance of the analytic, e.g. where a generic anaytic has been applied to a specific use case.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="0" name="configuration" type="s:NameValueType">
<xs:annotation>
<xs:documentation>Details of the configuration of the analytic, e.g. any input parameters.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="EventIdType">
<xs:sequence>
<xs:element name="eventId" type="xs:string"/>
<xs:element name="streamId" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NameValueType">
<xs:attribute name="name" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="50"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="OutputValueType">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="value" type="xs:anyType"/>
<xs:element minOccurs="0" name="dataType" type="xs:string">
<xs:annotation>
<xs:documentation>Assumed to be string if not supplied</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="DateTimeSimpleType">
<xs:annotation>
<xs:documentation>This type constrains the date time format further so that is always represented as 'yyyy-MM-ssThh:mm:ss.sssZ'.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:dateTime">
<xs:pattern value="[\d]{4}-[\d]{2}-[\d]{2}T[\d]{2}:[\d]{2}:[\d]{2}.[\d]{3}Z"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.1" encoding="UTF-8"?>
<xmlSchema>
<deprecated>false</deprecated>
<description/>
<name>analytic-output v2.0</name>
<namespaceURI>analytic-output:2</namespaceURI>
<schemaGroup>ANALYTIC_OUTPUT</schemaGroup>
<systemId>file://analytic-output-v2.0.xsd</systemId>
<uuid>24ee4b26-8bb8-4037-92a1-f1eb783d0daf</uuid>
</xmlSchema>