Method of Converting Resource definitions into XSD Group Name: WG3 (PRO) Source: Shingo Fujimoto, FUJITSU, [email protected] Meeting Date: 2014-01-07 Agenda Item: Core Protocol TS © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD Introduction • Initial version of Resource definitions in Stage 2 are provided • We need to map them into XML Schema • This contribution propose the method for developing XSD files from Architecture TS • This contribution also explain identified issues © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD 2 Method of conversion • Architecture TS contains most of information to generate XSD • oneM2M-ARC-2013-0576R02 is implemented for automated processing • All we should do is specifying the rule to convert ‘Resource’ definition into XSD © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD 3 Conversion Rules • Resource Types are mapped to the top level node on XSD data • Each attributes are mapped as child node of the top level node, and should not have any child nodes • Each child resources are mapped as child node of the top level node, and should be referred by ‘ref’ attribute • Use of pre-defined types are recommended, but may be restricted by defining oneM2M specific data types • Common ‘Simple types’ are collected as dedicated XSD file, which is named ‘ simple_types.xsd’ © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD 4 Pre-defined Types • XSD types – ‘xs:’ prefixed • oneM2M IDs, common attributes – ‘m2m:’ prefixed © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD 5 Identified Issues • Description text for simple data type in TS – Template for Resource description in Core TS ? – Dedicated section for ‘common attributes’ ? • Organizing XSD files – Top level node (=‘Resource Type’) as XSD file – Child nodes should be part of XSD file for the top level Resource – Work in separate files and finalize as single file ? • Handling ‘binary’ data – Base64 encoding is typical way – We may define ‘m2m:binary’ type for comversion © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD 6 Example Refer definition in other XSD file <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:m2m="http://www.onem2m.org/2014/DataType"> <xs:element name="accessRight"> <xs:complexType> <xs:sequence> <xs:element ref="subscription" minOccurs="0" maxOccurs="maxInclusive"/> <xs:element name="resourceType" fixed="accessRight"/> <xs:element name="parentId" type="xs:dateTime"/> <xs:element name="expirationTime" type="xs:dateTime"/> <xs:element name="labels" minOccurs="0" maxOccurs="1" type="xs:string"/> <xs:element name="creationTime" type="xs:dateTime"/> <xs:element name="lastModifiedTime" type="xs:dateTime"/> <xs:element name="permissions"/> <xs:element name="selfPermissions"/> </xs:sequence> </xs:complexType> If the data </xs:element> ..n should be max integer in system ? There are no description in Arch TS for fixed values We better to describe data types for ‘common attributes’ type are not defined yet, should we complete them later ? © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD 7 Conclusion • WG member should consider identified issues • Volunteers should start drafting description text based on given feedback © 2013 oneM2M Partners oneM2M-PRO-2014-0104-Convert_Resource_Defs_into_XSD 8
© Copyright 2026 Paperzz