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:[email protected] 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.CSDN和fanfou。最後返回了我在jiwai的鏈接,不過只指出了我在jiwai鏈接向CSDN的博客。
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.