In upcoming posts we will talk about the resources that are exposed by the Live Framework. The following diagram provides a complete picture of the various resources that are currently available.

image

We will take a bottom up approach to explain the various resources. The Live Framework Resource Model describes various resources and their relationships to other resources. It is based on a simple Property, Entity, Collection based information model. Each resource is an entity which contains various properties and a set of entities make up a collection. Every collection and entity is uniquely addressable and is identified by a URL. The relationships between entries are represented through hyperlinks. This allows for navigation from one resource to the related resource (entity) or collection of resources (collection). Note that such an entity/collection based model can be transformed trivially to an item/feed based information model of that of RSS or an entry/feed based model of that of ATOM.

At the heart of the resource model is Data Entry. Data Entry is the representation of a single unit of data such as photo, a document, a blog post etc. Each data entry contains textual information which describes the data and the link to the binary information, the media (if any, such as in case of a photo). Here is an example of a data entry in JSON format –

{
    "AuthorProfileLink" : "email-brian.perry@live.com/Profiles",
    "Authors" : [
        {
            "Name" : "Brian Perry",
            "Uri" : "email-brian.perry@live.com/Profiles",
            "Email" : "brian.perry@live.com"
        }
    ],
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Categories" : [
        {
            "Label" : "DataEntry",
            "Name" : "DataEntry",
            "Scheme" : "http://user.windows.net/Resource"
        }
    ],
    "Id" : "urn:uuid:29c29a60-6bc0-6888-72fc-5719596cf4c6",
    "LastUpdatedTime" : "/Date(1225235053000)/",
    "PublishDate" : "/Date(1225235053000)/",
    "SelfLink" : "Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/Entries/MCNMEKOANOEGQ4X4K4MVS3HUYY",
    "Summary" : " ",
    "Title" : "Amanda.wma",
    "EditMediaLink" : "Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/MediaResources/MCNMEKOANOEGQ4X4K4MVS3HUYY-QLSVIDRQUCZLSAGEUVKWYJIPQA",
    "MediaResource" : {
        "Hash" : "guVUDjCgsrkAxKVVbCUPgA==",
        "Id" : "d73533c0-271b-4879-b5c8-021b94e874e2",
        "IsUploaded" : true,
        "LastUpdatedTime" : "/Date(1225235053495)/",
        "Length" : 4990823,
        "MediaType" : "audio/x-ms-wma",
        "Name" : "Amanda.wma",
        "PublishDate" : "/Date(1225235053495)/"
    },
    "ParentId" : "urn:uuid:00000000-0000-0000-0000-000000000000",
    "Type" : "File"
}

The same data entry in ATOM format is represented as follows –

<entry xml:base="https://user-ctp.windows.net/V0.1/">
 <id>urn:uuid:29c29a60-6bc0-6888-72fc-5719596cf4c6</id>
 <title type="text">Amanda.wma</title>
 <summary type="text"/>
 <published>2008-10-28T23:04:13Z</published>
 <updated>2008-10-28T23:04:13Z</updated>
 <author>
 <name>Brian Perry</name>
 <uri>email-brian.perry@live.com/Profiles</uri>
 <email>brian.perry@live.com</email>
 </author>
 <link rel="edit-media"title="Amanda.wma"href="Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/MediaResources/MCNMEKOANOEGQ4X4K4MVS3HUYY-QLSVIDRQUCZLSAGEUVKWYJIPQA"/>
 <link rel="self"title="self"href="Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/Entries/MCNMEKOANOEGQ4X4K4MVS3HUYY"/>
 <link rel="edit"title="edit"href="Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/Entries/MCNMEKOANOEGQ4X4K4MVS3HUYY"/>
 <link rel="LiveFX/AuthorProfile"title="LiveFX/AuthorProfile"href="email-brian.perry@live.com/Profiles"/>
 <category term="File"label="File"scheme="http://user.windows.net/DataEntry"/>
 <category term="DataEntry"label="DataEntry"scheme="http://user.windows.net/Resource"/>
 <content type="audio/x-ms-wma"src="https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/MediaResources/MCNMEKOANOEGQ4X4K4MVS3HUYY-QLSVIDRQUCZLSAGEUVKWYJIPQA"/>
 <Properties>
 <MediaResource>
 <Hash>guVUDjCgsrkAxKVVbCUPgA==</Hash>
 <Id>d73533c0-271b-4879-b5c8-021b94e874e2</Id>
 <IsUploaded>true</IsUploaded>
 <LastUpdatedTime>2008-10-28T23:04:13.4950863Z</LastUpdatedTime>
 <Length>4990823</Length>
 <MediaType>audio/x-ms-wma</MediaType>
 <Name>Amanda.wma</Name>
 <PublishDate>2008-10-28T23:04:13.4950863Z</PublishDate>
 </MediaResource>
 <ParentId>urn:uuid:00000000-0000-0000-0000-000000000000</ParentId>
 </Properties>
 </entry>

And the same data entry in POX is represented as follows –

<DataEntry>
 <AuthorProfileLink>email-brian.perry@live.com/Profiles</AuthorProfileLink>
 <Authors>
 <Person>
 <Name>Brian Perry</Name>
 <Uri>email-brian.perry@live.com/Profiles</Uri>
 <Email>brian.perry@live.com</Email>
 </Person>
 </Authors>
 <BaseUri>https://user-ctp.windows.net/V0.1/</BaseUri>
 <Categories>
 <Category>
 <Label>DataEntry</Label>
 <Name>DataEntry</Name>
 <Scheme>http://user.windows.net/Resource</Scheme>
 </Category>
 </Categories>
 <Id>urn:uuid:29c29a60-6bc0-6888-72fc-5719596cf4c6</Id>
 <LastUpdatedTime>2008-10-28T23:04:13Z</LastUpdatedTime>
 <PublishDate>2008-10-28T23:04:13Z</PublishDate>
 <SelfLink>Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/Entries/MCNMEKOANOEGQ4X4K4MVS3HUYY</SelfLink>
 <Summary/>
 <Title>Amanda.wma</Title>
 <EditMediaLink>Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/MediaResources/MCNMEKOANOEGQ4X4K4MVS3HUYY-QLSVIDRQUCZLSAGEUVKWYJIPQA</EditMediaLink>
 <MediaResource>
 <Hash>guVUDjCgsrkAxKVVbCUPgA==</Hash>
 <Id>d73533c0-271b-4879-b5c8-021b94e874e2</Id>
 <IsUploaded>true</IsUploaded>
 <LastUpdatedTime>2008-10-28T23:04:13.4950863Z</LastUpdatedTime>
 <Length>4990823</Length>
 <MediaType>audio/x-ms-wma</MediaType>
 <Name>Amanda.wma</Name>
 <PublishDate>2008-10-28T23:04:13.4950863Z</PublishDate>
 </MediaResource>
 <ParentId>urn:uuid:00000000-0000-0000-0000-000000000000</ParentId>
 <Type>File</Type>
 </DataEntry>

More information on various properties of a data entry is available here. Media related to the data entry is linked via the “EditMediaLink” property and is stored under Media Resources. Sync Entries and Media Staging Area provide information that allows for synchronization of data entries. We will discuss more about synchronization in a separate post.

Let us assume that the data entry in this context represents a photo. A collection of all such photos can be represented as a Data Feed. A data feed is a collection of data entries. In most cases a data feed will be a logical collection of similar / related data entries, however, the content and type of data entries present as part of a data feed is whatever you want it to be. Here is an example of a data feed with single data entry –

{
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Entries" : [
        {
            "AuthorProfileLink" : "email-brian.perry@live.com/Profiles",
            "Authors" : [
                {
                    "Name" : "Brian Perry",
                    "Uri" : "email-brian.perry@live.com/Profiles",
                    "Email" : "brian.perry@live.com"
                }
            ],
            "BaseUri" : "https://user-ctp.windows.net/V0.1/",
            "Categories" : [
                {
                    "Label" : "DataEntry",
                    "Name" : "DataEntry",
                    "Scheme" : "http://user.windows.net/Resource"
                }
            ],
            "Id" : "urn:uuid:29c29a60-6bc0-6888-72fc-5719596cf4c6",
            "LastUpdatedTime" : "/Date(1225235053000)/",
            "PublishDate" : "/Date(1225235053000)/",
            "SelfLink" : "Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/Entries/MCNMEKOANOEGQ4X4K4MVS3HUYY",
            "Summary" : " ",
            "Title" : "Amanda.wma",
            "EditMediaLink" : "Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/MediaResources/MCNMEKOANOEGQ4X4K4MVS3HUYY-QLSVIDRQUCZLSAGEUVKWYJIPQA",
            "MediaResource" : {
                "Hash" : "guVUDjCgsrkAxKVVbCUPgA==",
                "Id" : "d73533c0-271b-4879-b5c8-021b94e874e2",
                "IsUploaded" : true,
                "LastUpdatedTime" : "/Date(1225235053495)/",
                "Length" : 4990823,
                "MediaType" : "audio/x-ms-wma",
                "Name" : "Amanda.wma",
                "PublishDate" : "/Date(1225235053495)/"
            },
            "ParentId" : "urn:uuid:00000000-0000-0000-0000-000000000000",
            "Type" : "File"
        }
    ],
    "Links" : [
        {
            "RelationshipType" : "LiveFX/MediaResources",
            "Title" : "LiveFX/MediaResources",
            "Uri" : "Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/MediaResources"
        }
    ],
    "SelfLink" : "Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/Entries",
    "SubscriptionLink" : "Mesh/MeshObjects/4YMLEZWFU7QUFFAJTATIX5DYE4/DataFeeds/V5EGUCYSYL7ULE6IEYZR4P2IOY/Entries/Subscriptions",
    "Title" : "DataEntries"
}

More information on the various properties of data feeds can be found here.

Similarly, a collection of data feeds can be represented by a container which we call as a Mesh Object. Again, in most cases, the data feeds that are clubbed together under a single container (Mesh Object) will be logically related to each other but there is no such binding. Mesh objects are the basic unit of extensibility, data synchronization and sharing in the Live Framework Resource Model. Information on various properties of mesh objects is available here. All of a user’s data is represented by a collection of such mesh objects and they can be referenced via the user’s Mesh. Each mesh object not only exposes the collection of data feeds which contains user data but also some other important collections –

1. Mappings – Every mesh object can be synchronized to multiple devices in a user’s mesh. Information on devices on which a given mesh object is synchronized is available via the mappings feed where each entry provides information on a single device where this mesh object is present. More information on various properties is available here. JSON representation of Mappings feed with a single entry is as follows –

{
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Entries" : [
        {
            "AuthorProfileLink" : "email-brian.perry@live.com/Profiles",
            "Authors" : [
                {
                    "Name" : "Brian Perry",
                    "Uri" : "email-brian.perry@live.com/Profiles",
                    "Email" : "brian.perry@live.com"
                }
            ],
            "BaseUri" : "https://user-ctp.windows.net/V0.1/",
            "Categories" : [
                {
                    "Label" : "Mapping",
                    "Name" : "Mapping",
                    "Scheme" : "http://user.windows.net/Resource"
                }
            ],
            "Id" : "urn:uuid:00000000-0000-0000-0000-000000000000",
            "LastUpdatedTime" : "/Date(1228413012000)/",
            "PublishDate" : "/Date(1228413012000)/",
            "SelfLink" : "Mesh/MeshObjects/WA6OMIZL7IGEFNJCCBFQG47V3U/Mappings/AAAAAAAAAAAAAAAAAAAAAAAAAA",
            "Title" : "",
            "GhostingPolicy" : 0,
            "MappingType" : 1,
            "MeshObjectLink" : "Mesh/MeshObjects/WA6OMIZL7IGEFNJCCBFQG47V3U"
        }
    ],
    "SelfLink" : "Mesh/MeshObjects/WA6OMIZL7IGEFNJCCBFQG47V3U/Mappings",
    "SubscriptionLink" : "Mesh/MeshObjects/WA6OMIZL7IGEFNJCCBFQG47V3U/Mappings/Subscriptions",
    "Title" : "Mappings"
}

2. Members – Every mesh object can be shared with multiple people in various capacities. E.g., I can share a mesh object that contains all my photos with my spouse (another Windows Live ID user) such that she can edit / delete / add more photos in that mesh object and with my friends such that they can only read them. Every entry in the members feed provide information on every user who has access to the given mesh object and the type of access they have (e.g. RO or RW). More information on various properties is available here. JSON representation of Members feed with a single entry is as follows –

{
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Entries" : [
        {
            "AuthorProfileLink" : "email-brian.perry@live.com/Profiles",
            "Authors" : [
                {
                    "Name" : "Brian Perry",
                    "Uri" : "email-brian.perry@live.com/Profiles",
                    "Email" : "brian.perry@live.com"
                }
            ],
            "BaseUri" : "https://user-ctp.windows.net/V0.1/",
            "Categories" : [
                {
                    "Label" : "Member",
                    "Name" : "Member",
                    "Scheme" : "http://user.windows.net/Resource"
                }
            ],
            "Id" : "urn:uuid:00eb8df1-16ff-4c95-93a7-9ea3199b05b1",
            "LastUpdatedTime" : "/Date(1227561909000)/",
            "PublishDate" : "/Date(1227561909000)/",
            "SelfLink" : "Mesh/MeshObjects/U5CVWTZDBTRE7GKU623MLYZCOA/Members/6GG6WAH7C2KUZE5HT2RRTGYFWE",
            "Title" : "Brian Perry",
            "Email" : "brian.perry@live.com",
            "IsOwner" : true,
            "ProfilesLink" : "cid--4392929366419723837/Profiles",
            "Role" : 1
        }
    ],
    "SelfLink" : "Mesh/MeshObjects/U5CVWTZDBTRE7GKU623MLYZCOA/Members",
    "SubscriptionLink" : "Mesh/MeshObjects/U5CVWTZDBTRE7GKU623MLYZCOA/Members/Subscriptions",
    "Title" : "Members"
}

3. News – Whenever a data entry is added, updated or deleted under a given mesh object, the system automatically generates news events. These are also generated whenever there is an addition / deletion to the members feed or mappings feed for the mesh object. Each such news event forms an entry in the news feed for the given mesh object. More information on various properties is available here. JSON representation of a news feed with a single entry is as follows –

{
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Entries" : [
        {
            "AuthorProfileLink" : "email-brian.perry@live.com/Profiles",
            "Authors" : [
                {
                    "Name" : "Brian Perry",
                    "Uri" : "email-brian.perry@live.com/Profiles",
                    "Email" : "brian.perry@live.com"
                }
            ],
            "BaseUri" : "https://user-ctp.windows.net/V0.1/",
            "Categories" : [
                {
                    "Label" : "NewsItem",
                    "Name" : "NewsItem",
                    "Scheme" : "http://user.windows.net/Resource"
                }
            ],
            "Id" : "urn:uuid:96777b22-65d2-0782-e4ec-2f85d7831f26",
            "LastUpdatedTime" : "/Date(1225297814000)/",
            "PublishDate" : "/Date(1225297814000)/",
            "SelfLink" : "Mesh/MeshObjects/S35IOSATGIMU3L5K2Y5HBLSW3M/News/ULXR63FDIIHU3LNMZZNYGW6RRI-EJ5XPFWSMWBAPZHMF6C5PAY7EY",
            "Title" : "LiveMesh.MemberAdd",
            "CoalesceCount" : 1,
            "Contexts" : [
                {
                    "Kind" : "Scope",
                    "Relationship" : "LiveFX/MeshObject",
                    "TargetLink" : "Mesh/MeshObjects/S35IOSATGIMU3L5K2Y5HBLSW3M",
                    "Text" : "Documents",
                    "Type" : "LiveFX/MeshObject"
                }
            ]
        }
    ],
    "SelfLink" : "Mesh/MeshObjects/S35IOSATGIMU3L5K2Y5HBLSW3M/News",
    "SubscriptionLink" : "Mesh/MeshObjects/S35IOSATGIMU3L5K2Y5HBLSW3M/News/Subscriptions",
    "Title" : "NewsFeed"
}

4. Subscription – Users can subscribe to changes to mesh objects such that they can be notified and can potentially take appropriate actions. We will discuss more about this when we talk about notifications and subscriptions in another post.

Other important resources exposed via Mesh in addition to Mesh Objects are

1. Devices – Information on all the devices on which all or some of the mesh objects are synchronized is available via the devices feed where each entry in the feed provides information on a single device. More information on the various properties exposed via devices entry is available here. JSON representation of Devices feed is as follows –

{
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Entries" : [
        {
            "BaseUri" : "https://user-ctp.windows.net/V0.1/",
            "Categories" : [
                {
                    "Label" : "Device",
                    "Name" : "Device",
                    "Scheme" : "http://user.windows.net/Resource"
                }
            ],
            "Id" : "d61585ef-1d67-4d48-9b44-e0047ab93adf",
            "LastUpdatedTime" : "/Date(1226685229000)/",
            "PublishDate" : "/Date(1226685229000)/",
            "SelfLink" : "Mesh/Devices/7O5BXLSH2O7UDDAM7VG5SNBJSM-56CRLVTHDVEE3G2E4ACHVOJ234",
            "Title" : "MESHDEMO1",
            "SubscriptionLink" : "Mesh/Devices/7O5BXLSH2O7UDDAM7VG5SNBJSM-56CRLVTHDVEE3G2E4ACHVOJ234/Subscriptions",
            "Type" : "Computer"
        }
    ],
    "SelfLink" : "Mesh/Devices",
    "SubscriptionLink" : "Mesh/Devices/Subscriptions",
    "Title" : "Devices"
}

2. News – Collective information on all the news entries for all the mesh objects and global news related to the user is available via the news feed where every entry represents a single news event.

Mesh and all the resources underneath it can be accessed via the service endpoint. The service endpoint in the cloud is https://user.window-ctp.net and on the client is http://localhost:2048. In addition to Mesh, you can also access Windows Live Profiles and Windows Live Contacts via the cloud service endpoint. They are represented as Profile and Contact resource. More information on Contact resource is available here. JSON representation of a contact is as follows –

{
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Categories" : [
        {
            "Label" : "Contact",
            "Name" : "Contact",
            "Scheme" : "http://user.windows.net/Resource"
        }
    ],
    "Id" : "8129b749-ebe2-4257-854e-bd2c4eb0094c",
    "LastUpdatedTime" : "/Date(1225296671853)/",
    "SelfLink" : "cid--4392929366419723837/Contacts/8129b749-ebe2-4257-854e-bd2c4eb0094c",
    "Title" : "Brian Perry",
    "Birthday" : "/Date(-62135568000000)/",
    "Cid" : -1415099226309944575,
    "ContactId" : "8129b749-ebe2-4257-854e-bd2c4eb0094c",
    "DisplayName" : "Brian Perry",
    "Emails" : [
        {
            "Primary" : true,
            "Type" : 1,
            "Value" : "brian.perry@live.com"
        }
    ],
    "FamilyName" : "Perry",
    "FormattedName" : "Brian Perry",
    "GivenName" : "Brian",
    "NickName" : "Brian",
    "PreferredUserName" : "brianperry",
    "Profession" : "Photographer",
    "ProfilesLink" : "cid--1415099226309944575/Profiles",
    "WindowsLiveId" : "brian.perry@live.com"
}

There are 5 profiles that are available for every user – About You Profile, Contact Profile, Work Profile, General Profile and Interests Profile. You can get more information on these profiles here. JSON representation of About You Profile is as follows –

{
    "BaseUri" : "https://user-ctp.windows.net/V0.1/",
    "Categories" : [
        {
            "Label" : "Profile",
            "Name" : "Profile",
            "Scheme" : "http://user.windows.net/Resource"
        },
        {
            "Label" : "AboutYouProfile",
            "Name" : "Profile",
            "Scheme" : "http://user.windows.net/Resource"
        }
    ],
    "Id" : "480u7Y0U",
    "SelfLink" : "cid--4392929366419723837/Profiles/480u7Y0U",
    "Title" : "AboutYouProfile",
    "ProfileBase" : {
        "__type" : "AboutYouProfile:http://user.windows.net",
        "Age" : 31,
        "Gender" : 2,
        "Interests" : "Coding\u000aReading books\u000aHiking\u000aXBOX!",
        "Location" : "Redmond, WA",
        "MoreAboutMe" : "I like to write code!",
        "Occupation" : "Engineer"
    },
    "ProfileType" : 2
}

To learn how to do basic operations on these resources, see the SDK documentation topics:

In upcoming posts we'll talk about Applications, Subscriptions and Notifications, and Synchronization of resources.

 

--The Live Framework Team