oneM2M Logo transparent 196x130

Standards for M2M and the Internet of Things

TR-0057 oneM2M resources

Resource Template

All entities in the oneM2M System, such as AEs, CSEs, application data representing sensors, commands, etc. are represented as resources in the CSE.  Each resource has its own specific type.

Each resource type has a defined set of mandatory and optional attributes as well as child resources.

A resource can contain child resources.

Each resource is addressable and can be the target of CRUD operations specified in oneM2M primitives.

resource template

 

 

Resource Structure

The root of the oneM2M resource structure is <CSEBase>. 

The <CSEBase> is assigned an absolute address.  All other child resources are addressed relative to <CSEBase>.

Depending on the type of child resource it is instantiated 0..n times.

resource tree

<CSEBase> Resource example

 

Resource attributes

Each resource contains attributes that store information pertaining to the resource itself.

The attributes are :

  • Universal Attributes : which appear in all resources
  • Common Attributes : which appear in more than one resource and have the same meaning whenever they do appear.
  • Resource-specific attributes

AE resource example

<AE> Resource example

 

Resource schema

oneM2M defines XML, JSON and CBOR schemas which define the attributes of each resource type.

Schemas bind oneM2M attributes to well-known data types defined by XML Schema definitions (e.g. xs:string, xs:anyURI, etc …).

Schemas also bind oneM2M attributes to oneM2M defined  data types (e.g. m2m:id, m2m:stringList, etc ...).

 

<xs:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.onem2m.org/xml/protocols"
	xmlns:m2m="http://www.onem2m.org/xml/protocols" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	elementFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:include schemaLocation="CDT-commonTypes-v3_8_0.xsd" />
	<xs:include schemaLocation="CDT-subscription-v3_8_0.xsd" />

	<xs:element name="request" substitutionGroup="m2m:sg_regularResource">
		<xs:complexType>
			<xs:complexContent>
				<!-- Inherit common attributes -->
				<xs:extension base="m2m:regularResource">
					<xs:sequence>
						<!-- Common Attribute, specific to <container>, <contentInstance>, <request> and <delivery> resources -->
						<xs:element name="stateTag" type="xs:nonNegativeInteger" />
						<!-- Resource Specific Attributes -->
						<xs:element name="operation" type="m2m:operation" />
						<xs:element name="target" type="xs:anyURI" />
						<xs:element name="originator" type="m2m:ID" />
						<xs:element name="requestID" type="m2m:requestID" />
						<xs:element name="metaInformation" type="m2m:metaInformation" />
						<xs:element name="primitiveContent" type="m2m:primitiveContent" minOccurs="0" />
						<xs:element name="requestStatus" type="m2m:requestStatus" />
						<xs:element name="operationResult" type="m2m:operationResult" />

						<!-- Child Resources -->
						<xs:choice minOccurs="0" maxOccurs="1">
							<xs:element name="childResource" type="m2m:childResourceRef" minOccurs="1" maxOccurs="unbounded" />
							<xs:choice minOccurs="1" maxOccurs="unbounded">
								<xs:element ref="m2m:subscription"></xs:element>
							</xs:choice>
						</xs:choice>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>
</xs:schema>

Example of schema

 

Subscribe to oneM2M News Please enter your name and email address, then click on submit.
Alternatively, you can send an email from your preferred email application with a blank subject to
Listserv@list.etsi.org with subscribe oneM2M_News in the message body.

Subscribe to oneM2M News

Your Name(*)
Please let us know your name.

Your Email(*)
Please let us know your email address.