W3C home > Mailing lists > Public > public-rww@w3.org > August 2012

Re: MyProfile REST API.

From: Melvin Carvalho <melvincarvalho@gmail.com>
Date: Sat, 11 Aug 2012 19:59:55 +0200
Message-ID: <CAKaEYhK9BzeoR7wy=X2dLECqVUX5OuxgTmBRnRgGS2bkbZ9zWg@mail.gmail.com>
To: Andrei Sambra <andrei@fcns.eu>
Cc: public-webid <public-webid@w3.org>, Read-Write-Web <public-rww@w3.org>
On 10 August 2012 23:15, Andrei Sambra <andrei@fcns.eu> wrote:

> Greetings,
>
> Today marks the first release of MyProfile REST API [1], which is supposed
> to be an interface between standard social web applications (i.e. MyProfile
> included), and linked data storage, especially SPARQL endpoints (i.e.
> Virtuoso).
>
> The API offers WebID authentication as well as WebID delegated
> authorization[2]. It will offer access control at the triple level very
> soon (a few weeks maximum). For now I'm just testing that I'm doing it
> right.
>
> A very important feature of the API is that it serves data based on the
> desired Content-Type. This means if you specify in your request that you
> Accept: text/rdf+n3, then you will get the data back in that format.
>
> The API currently supports viewing of user profiles (i.e. GET methods), as
> well as removing cached profiles (i.e. DELETE methods). Once I switch the
> Wall posts and Messages to full RDF storage (probably based on SIOC), I
> will also enable those resources.
>
>
>
> Anyway, here is a quick example for viewing a user's profile:
>
> The request:
>
> HTTP/1.1 GET https://auth.my-profile.eu/**profile/?webid=<https://auth.my-profile.eu/profile/?webid=><urlencoded
> WebID>
>
> With these extra header options:
>
> Accept: text/rdf+n3
> On-Behalf-Of: https://my-profile.eu/people/**deiu/card#me<https://my-profile.eu/people/deiu/card#me>
>
> Returns*:
>
> <https://my-profile.eu/people/**deiu/card#me<https://my-profile.eu/people/deiu/card#me>
> >
>     a foaf:Person ;
>     foaf:name "Andrei Vlad Sambra" ;
>     foaf:givenName "Andrei Vlad" ;
>     . . .
>
> *the returned profile matches the access control policies specific to the
> user on whose behalf the request is being made, and optionally the agent
> doing the request.
>
>
> Another example for deleting the cached copy of a profile:
>
> The request:
> HTTP/1.1 DELETE https://auth.my-profile.eu/**profile/cache/?webid=<https://auth.my-profile.eu/profile/cache/?webid=>
> <**urlencoded WebID>
>
> Returns*:
> Successfully deleted profile https://my-profile.eu/people/**deiu/card#me<https://my-profile.eu/people/deiu/card#me>
> .
>
> *for now, the operation will be performed only if the request is made by
> profile owner, or on his/her behalf (!)
>

Awesome!

Have you had much thoughts on wall posting yet?

JSON seems to be the popular format as of today ...

In web 3.0 we have some microblogging standards based on

- SMOB

Web 2.0 the dominant I think is facebook

http://developers.facebook.com/docs/reference/api/post/

(cut and paste below as it's behind a login screen)

===============================================
Post
Core Concepts <http://developers.facebook.com/docs/coreconcepts/> › Graph
API <http://developers.facebook.com/docs/reference/api/> ›
Post<http://developers.facebook.com/docs/reference/api/post/>

An individual entry in a profile's feed as represented in the Graph
API<http://developers.facebook.com/docs/reference/api>
.

The User <http://developers.facebook.com/docs/reference/api/user>,
Page<http://developers.facebook.com/docs/reference/api/page>,
Application <http://developers.facebook.com/docs/reference/api/application>and
Group <http://developers.facebook.com/docs/reference/api/group> objects
have feed connections containing post objects that represent their walls.
In addition the User<http://developers.facebook.com/docs/reference/api/user>and
Page <http://developers.facebook.com/docs/reference/api/page> objects have
a connection named posts containing Posts made by the User and the Page
respectively.
Example

A post <http://www.facebook.com/platform/posts/10150189643478553> from
Facebook Platform:

https://graph.facebook.com/19292868552_10150189643478553<http://developers.facebook.com/tools/explorer/?method=GET&path=19292868552_10150189643478553>
------------------------------
Fields

A Post has the following fields.

Querying without the read_stream permission will return only the public
view of the data (i.e. data that can be see when the user is logged out).
*Name**Description**Permissions**Returns*id

The post ID

Requires access_token

string
from

Information about the user who posted the message

Requires access_token

object containing the name and Facebook id of the user who posted the
message
to

Profiles mentioned or targeted in this post

Requires access_token

Contains in data an array of objects, each with the name and Facebook id of
the user
message

The message

Requires access_token

string
message_tags

Objects tagged in the message (Users, Pages, etc)

Requires access_token

object containing fields whose names are the indexes to where objects are
mentioned in the message field; each field in turn is an array containing
an object with id, name, offset, and length fields, where length is the
length, within the message field, of the object mentioned
picture

If available, a link to the picture included with this post

Requires access_token

string containing the URL
link

The link attached to this post

Requires access_token

string containing the URL
name

The name of the link

Requires access_token

string
caption

The caption of the link (appears beneath the link name)

Requires access_token

string
description

A description of the link (appears beneath the link caption)

Requires access_token

string
source

A URL to a Flash movie or video file to be embedded within the post

Requires access_token

string containing the URL
properties

A list of properties for an uploaded video, for example, the length of the
video

Requires access_token

array of objects containing the name and text
icon

A link to an icon representing the type of this post

Requires access_token

string
actions

A list of available actions on the post (including commenting, liking, and
an optional app-specified action)

Requires access_token

array of objects containing the name and link
privacy

The privacy settings of the Post

read_stream

object containing the value field and optional friends, networks, allow,
deny and description fields.

The value field may specify one of the following strings: EVERYONE,
ALL_FRIENDS, NETWORKS_FRIENDS, FRIENDS_OF_FRIENDS, CUSTOM .

The friends field must be specified if value is set to CUSTOM and contain
one of the following strings: EVERYONE, NETWORKS_FRIENDS (when the object
can be seen by networks and friends), FRIENDS_OF_FRIENDS, ALL_FRIENDS,
SOME_FRIENDS, SELF, or NO_FRIENDS (when the object can be seen by a network
only).

The networks field may contain a comma-separated list of network IDs that
can see the object, or 1 for all of a user's network.

The allow field must be specified when the friends value is set to
SOME_FRIENDS and must specify a comma-separated list of user IDs and friend
list IDs that 'can' see the post.

The deny field may be specified if the friends field is set to SOME_FRIENDS
and must specify a comma-separated list of user IDs and friend list IDs
that 'cannot' see the post.

The description field may contain a comma-separated lists of valid country,
city and language if a *Page's post* targeting by location/language is
specified.

*Note:* This privacy setting only applies to posts to the current or
specified user's own Wall. Facebook ignores this setting for targeted Wall
posts (when the user is writing on the Wall of a friend, Page, event, group
connected to the user). Consistent with behavior on Facebook, all targeted
posts are viewable by anyone who can see the target's Wall.

*Privacy Policy:* any non-default privacy setting must be intentionally
chosen by the user. You may not set a custom privacy setting unless the
user has proactively specified that they want this non-default setting.
Note that the visibility of the post will be determined by the more
restrictive of the user's privacy setting as well as the post's privacy
field
type

A string indicating the type for this post (including link, photo, video)

Requires access_token

string
likes

Likes for this post

Requires access_token

Structure containing a data object and the count of total likes, with
datacontaining an
array of objects, each with the name and Facebook id of the user who liked
the post
place

Location associated with a Post, if any

read_stream

object containing id and name of Page associated with this location, and a
location field containing geographic information such as latitude, longitude,
country, and other fields (fields will vary based on geography and
availability of information)
story

Text of stories not intentionally generated by users, such as those
generated when two users become friends; you must have the "Include recent
activity stories" migration enabled in your app to retrieve these stories

read_stream

string
story_tags

Objects (Users, Pages, etc) tagged in a non-intentional story; you must
have the "Include recent activity stories" migration enabled in your app to
retrieve these tags

read_stream

object containing fields whose names are the indexes to where objects are
mentioned in the message field; each field in turn is an array containing
an object with id, name, offset, and length fields, where length is the
length, within the message field, of the object mentioned
with_tags

Objects (Users, Pages, etc) tagged as being with the publisher of the post
("Who are you with?" on Facebook)

read_stream

objects containing id and name fields, encapsulated in a data[] array
comments

Comments for this post

read_stream

Structure containing a data object containing an array of objects, each
with the id, from, message, and created_time for each comment
object_id

The Facebook object id for an uploaded photo or video

read_stream

number
application

Information about the application this post came from

read_stream

object containing the name and id of the application
created_time

The time the post was initially published

read_stream

string containing ISO-8601 date-time
updated_time

The time of the last comment on this post

read_stream

string containing ISO-8601 date-time
 Delete

You can delete a post as long as your application created the post. You
delete a post by issuing an HTTP DELETE request to the POST_ID object with
publish_stream permission.

If the delete is successful, you get the following return.
  Description  Type   If the delete succeeded  boolean
------------------------------
Connections

A Post has the following connections.
*Name**Description**Permissions**Returns*comments

All of the comments on this post.

Any valid access_token.

array of objects containing id, from, message and created_time fields.
likes

The likes on this post.

Any valid access_token.

array of objects containing the id and name fields.
insights

Insights information for this Post, If this Post is from a Facebook Page.

A valid access_token with read_insights permission for a user authorized to
view the Page's insights.

array of Insights objects. See the Insights
documentation<http://developers.facebook.com/docs/reference/api/insights/>for
more information.
 comments Create

You can write to the POST_ID/comments connection to post a
comment<http://developers.facebook.com/docs/reference/api/comment/>to
the post by issuing an HTTP POST request with the
publish_stream permission and following parameters.
  Parameter  Description  Type Required   message
Comment<http://developers.facebook.com/docs/reference/api/comment/>text
string  yes

If the write is successful, you get the following return.
  Name  Description  Type   id  The new comment ID  string  Delete

You can delete a
comment<http://developers.facebook.com/docs/reference/api/comment/>by
issuing an HTTP DELETE request to the COMMENT_ID object with the
publish_stream permission.

If the delete is successful, you get the following return.
  Description  Type   If the delete succeeded  boolean  likes Create

You can like a Post by issuing a HTTP POST request to the
POST_ID/likesconnection with the
publish_stream permission. No parameters necessary.

If the write is successful, you get the following return.
  Description  Type   If the like succeeded  boolean  Delete

You can unlike a post by issuing an HTTP DELETE request to the
POST_ID/likesconnection with the
publish_stream permission.

If the delete is successful, you get the following return.
 Description  Type   If the unlike succeeded  boolean
 ===============================================

Then there's

app.net
activity streams

Do you think it makes sense to make a list of existing methods then try and
align / standarize wall posting?



> Andrei
>
> [1] https://auth.my-profile.eu/
> [2] http://www.w3.org/wiki/WebID/**Authorization_Delegation<http://www.w3.org/wiki/WebID/Authorization_Delegation>
>
>
Received on Saturday, 11 August 2012 18:00:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 11 August 2012 18:00:25 GMT