During synchronization, it is fundamentally important to consistently identify individual data items or a collection of data items. Sometimes it is necessary to identify the actual device or network server that is the intended recipient of a package. At other times it is necessary to identify a collection of data such as a database. At yet other times it may be necessary to identify individual data items in a datastore or a set of data items that satisfy certain criteria. SyncML uses the notion of Target and Source for identification. Each SyncML package contains Target and Source elements in various places. Depending on the context, the Target and Source may refer to a particular machine, a particular datastore, a set of data items, or an individual data item.
Target and Source Addressing
Typically, each Target or Source element contains a Uniform Resource Identifier (URI) or a Uniform Resource Name (URN). The URI naming scheme is a flexible naming scheme that can be used to uniquely name any network resource, such as a machine, a datastore, or a data item. A URI begins with the identification of a scheme such as "http" or "IMEI" (International Mobile Equipment Identifier), and the part that follows the scheme is specific to the identified scheme. For example, "http://www.syncml.org/sync-Server" is a valid URI identifying a network Server in the "http" scheme. "IMEI:098712345" is a valid URI identifying a mobile device by its unique numeric identifier.
The meaning of the URI included in a Target or Source element inside a SyncML Message is completely determined by its context. For example, when used in the "header" part of a SyncML Message, the Target and Source refer to a mobile device or the network address of a Server. The header of a SyncML Message sent from a mobile Client to a Server may contain the following snippet:
<Target> <LocURI>http://www.syncml.org/sync-Server</LocURI> </Target> <Source> <LocURI>IMEI:098712345</LocURI> </Source>
The Target and Source information in this case signify that the originating entity of the SyncML Message is a mobile device with a particular unique numeric identifier and the destination entity of the package is a network Server in the "syncml.org" domain.
In some cases, the Target or Source element may refer to the name of a datastore. For example, SyncML has some container elements, such as Sync, that refer to entire datastores and additionally contain other individual elements such as Add or Replace. The following snippet from a Sync command uses an absolute URI to refer to the datastore called "calendar" in the mobile device identified above.
<Source> <LocURI>IMEI:098712345/calendar</LocURI> </Source>
Since the Target and Source elements are context sensitive, sometimes the specified URIs can be relative URIs. For example, within a SyncML Message where the header already uniquely identifies a device as the source, the following relative source address refers to the same absolute source address specified above.
<Source> <LocURI>./calendar</LocURI> </Source>
During synchronization, identification of individual data items in a datastore is also required. For example, a Replace command must uniquely identify the actual data item being replaced. The following Source snippet extracted from a Replace command uses an absolute URI to signify that item "1001" from the calendar datastore of the mobile device is to be replaced.
<Source> <LocURI>IMEI:098712345/calendar/1001</LocURI> </Source>
The context-sensitive Target and Source addressing in SyncML and the use of Uniform Resource Identifiers provide for a consistent way to identify machines, datastores, and individual data items. SyncML uses established standards, such as URIs or URNs, and attempts to provide a flexible, open identification scheme. In particular, SyncML does not enforce its own, specially designed identification scheme.
Target Address Filtering
Sometimes it is important to be able to address only a subset of a datastore. Consider, for example, a scenario where a mobile health care worker has lost all her appointment information while traveling. If she synchronizes with her Server application, an undesirable slow synchronization over a wireless link will be initiated, one that will involve the transfer of a large amount of appointment information perhaps including appointments from the past few weeks and a few months into the future. At that moment, however, the mobile worker is most concerned with obtaining appointment information for that date only. Target address filtering will enable her to specify a selective target within a Get command that will fetch only the data that she needs most. The following snippet shows a Target Address Filter that can be used to have the desired effect of retrieving the calendar information for only January 5, 2002.
<Target> <LocURI>.calendar/Anna?DTSTART&GE;20020105T000000&AND; DTEND<20020105T000000</LocURI> </Target>
SyncML specifies search grammars that are to be used for various types of datastores, such as arbitrary databases (searched by unique identifiers), XML documents (searched by element type), contacts, calendars, and email.