rel="File-List" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"> rel="themeData" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"> rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5CADMINI%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml">
Social Graph可以看作一个简单的推理机,可以进行更深入的处理。
某个叫Brad的人,在某个网站注册后,可能有如下链接:
l http://brad.social-network.example.com
l http://brad.social-network.example.com/
l http://BRAD.SOCIAL-NETWORK.EXAMPLE.COM/
l http://social-network.example.com/viewBlog?user=brad
l http://social-network.example.com/viewProfile?user=brad
l http://social-network.example.com:80/viewBlog?user=brad
l http://social-network.example.com/users/brad/data/foaf
需要将URL标准化为这样的形式:sgn://social-network.example.com/?ident=brad
有开源工具sgnodemapper project可以做到这点。
返回的节点对象包含一系列属性:
属性名称 | 描述 |
url | The main URL for this node. Note that this may differ from the node's key in the |
profile | Profile URL. Typically about the person, rather than their main content.个人资料的URL。 |
rss | RSS URL |
atom | Atom URL |
foaf | FOAF URL |
photo | Photo/avatar URL. |
fn | Name. (formatted name) |
你的应用不应该局限于上面几种属性,以后可能增加更多的属性。
All edge types from all supported formats are mapped onto their closest XFN equivalent. Consult the XFN 1.1 documentation for details.
In summary, the XFN relation types are:
l Identity:
me: a claim that the referenced URL is yours
l Those that indicate a relation to another person 与他人有关联的声明:
contact
acquaintance 熟人,熟知,认识
friend
met
co-worker 同事,合作者
colleague 同事,同行
co-resident 同居
neighbor
child
parent
sibling
spouse 配偶
kin 亲戚
muse
crush
date
sweetheart 情人,爱人
Other source of me links 除XFN之外的其它链接源
l Fields in FOAF, such as:
weblog
homepage
openid
mbox_sha1sum, with the resulting internal target node of the format:
sgn://mboxsha1/?pk=4caa1d6f6203d21705a00a7aca86203e82a9cf7a
· OpenID delegation <link> tags, both openid.delegate and openid2.local_id.
· FOAF declaration <link> tags. (i.e. if http://example.com/ has a <link> to http://example.com/my-foaf.rdf, then a me edge is created from http://example.com/ to http://example.com/my-foaf.rdf)
· mailto: queries. When querying on an email address, a directed edge of type me from mailto:foo@bar.com to sgn://mboxsha1/?pk=xxxxx... is temporarily assumed, but not stored.
Mapping FOAF’s knows field 映射到FOAF的knows域
By default, any knows relation in a FOAF file is mapped to the XFN value of contact. However, in cases where a site publishes both XFN and FOAF, with a single XFN edge type, the FOAF knows mapping will be the site's XFN edge type used.
4、APIs:http://code.google.com/intl/zh-CN/apis/socialgraph/docs/api.html
下面几个方法是可用的:
lookup: low-level access to the graph. It lets you list all the edges out of or into a given node.
otherme: given one or more of a person's identifiers (e.g. URLs), return other identifiers for that person. 给定某个人的若干URL,返回其此人它的URL。
我给出了我的3个帐号:blog.sohu,blog.优快云和fanfou。最后返回了我在jiwai的链接,不过只指出了我在jiwai链接向优快云的博客。
testparse: test your site's XFN or FOAF to see what the Social Graph API's parsers find in it。测试你的站点的XFN或FOAF,看看Social Graph API的解析器能从中找到什么。
5、使用的前提;对站点的要求:
To use XFN to connect sites, add
rel="friend"
to your link like this:<a href="http://bradfitz.com" rel="friend" >Brad</a>
To use FOAF, create a FOAF file and link to it from your web page. More details on FOAF.