Google.Social Graph学习笔记

完整版本: 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"> http://code.google.com/apis/socialgraph/docs/

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可以看作一个简单的推理机,可以进行更深入的处理。

1Node Canonicalization

某个叫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可以做到这点。

 

2Attributes

返回的节点对象包含一系列属性:

属性名称

描述

url

The main URL for this node. Note that this may differ from the node's key in the nodes dictionary, especially when using the sgn=1 parameter.

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)

你的应用不应该局限于上面几种属性,以后可能增加更多的属性。

 

3Edge Types

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 映射到FOAFknows

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.

 

4APIshttp://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.sohublog.CSDNfanfou。最后返回了我在jiwai的链接,不过只指出了我在jiwai链接向CSDN的博客。

*  testparse: test your site's XFN or FOAF to see what the Social Graph API's parsers find in it。测试你的站点的XFNFOAF,看看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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值