Annotea [1]是W3C 所規範制定的一個標準。Annotea是一個RDF architecture,被設計成為一個annotation sharing system, Annotea可以讓使用者針對well-formed之HTML或XML文件的任何部分來建置annotations,而且也可以針對 annotations來回應或另作annotations。
在Annotea的規劃中分為client和server兩部分:有RDF server管理metadata layer,有client端介面讓使用者進入這架構。client是類似browser的工作平台, 提供使用者瀏覽網頁及對其內容加上註解;server則是提供資料庫儲存使用者 的註解資訊。使用者透過Web介面來檢視一般的HTML網頁,然後可以為檢視的網頁建置annotations, 建置的annotations會被包裝成XML的格式存到Annotea server中。
一份完整的annotation資料除了使用者的annotation文件外,也包含了描述annotation狀態的一群 metadata。為了能讓其他應用系統便於重用與擴充這些metadata的用途,Annotea用RDF的結構來描述 annotations的properties
一份annotation,其夾帶的properties有:本文("postit.html")、標題("dc:title")、建置者("dc:creator")以及最後更新時間("dc:date")等,並紀錄所annotate之文件("XDoc.html")及針對文件中的哪部分內文("context")。圖右則為對此annotation回覆的reply文件,其結構類似的基本的一份annotation文件。底下是一個實際annotation的資料內容:
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:a="http://www.w3.org/2000/10/annotation-ns#"
xmlns:d="http://purl.org/dc/elements/1.1/"
xmlns:h="http://www.w3.org/1999/xx/http#">
http://annotea.example.org/Annotation/3ACF6D754">
http://www.w3.org/2000/10/annotation-ns#Annotation"/>
http://www.w3.org/2000/10/annotationType#Example"/>
http://serv1.example.com/some/page.html"/>
http://serv1.example.com/some/page.html#xpointer(id("Main")/p[2])
Ralph Swick
1999-10-14T12:10Z
1999-10-14T13:14Z
text/html
250
http://www.w3.org/1999/xhtml">
資料儲存架構: Annotea在server方面需要有資料庫來儲存使用者的資料,在這部分annotea使用了多層架構的RDF Database:
RdfDB - in memory triple store
ObjectDB - persistent triple store over SQL
SqlDB - interface to SQL DB with arbitrary structure
Algae則是一套針對RDF的資料模組專用的查詢語法,其語法如下:
query :: "(ask '(" contstraints+ ") :collect '(" variable+ "))"
contstraint :: urlvar ' ' urlvar ' ' urlvarstr
urlvar :: URL | variable
urlvarstr :: URL | variable | string
variable :: '?' name
string :: '"' text '"'
Annotea Protocol
在Annotea規劃中,將client-server間的互動資訊分為五類:
(1) Posting 一份新的annotation:使用者發表新的annotation。
(2) 向annotation server作Querying:使用者向 server 傳送 query資訊,然後取回符合之 annotations。
(3) Downloading 一份annotation:取得所欲觀看或下載的整份 annotation 文件。
(4) Updating 一份annotation:使用者修改 annotation 並將結果送回 annotation server。
(5) Deleting annotation:使用者將 annotation 從 server 刪除。
底下為posting request的範例:
POST /Annotation HTTP/1.1
Host: annotea.example.org
Content-Type: application/xml
Content-Length: 786
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:a="http://www.w3.org/2000/10/annotation-ns#"
xmlns:d="http://purl.org/dc/elements/1.1/">
http://www.w3.org/2000/10/annotation-ns#Annotation"/>
http://www.w3.org/2000/10/annotationType#Comment"/>
http://serv1.example.com/some/page.html"/>
http://serv1.example.com/some/page.html#xpointer(id("Main")/p[2])
Ralph Swick
1999-10-14T12:10Z
1999-10-14T12:10Z
http://serv2.example.com/mycomment.html"/>
底下則為從server回覆的posting reply的範例:
HTTP/1.1 201 Created
Location: http://annotea.example.org/Annotation/3ACF6D754
Content-Type: application/xml
Content-Length: 432
http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:a="http://www.w3.org/2000/10/annotation-ns#"
xmlns:d="http://purl.org/dc/elements/1.1/">
http://annotea.example.org/Annotation/3ACF6D754">
http://serv1.example.com/some/page.html"/>
http://serv2.example.com/mycomment.html"/>
利用與實作Annotea client & server端程式來進一步認識Semantic Web architecture是一個很好的方式,步驟大致如下:
-
尋找現成的Annotea server或自行架設。
由W3C所提供之test server - http://annotest.w3.org/annotations
Open source - Zope Annotation Server -
安裝client介面,連上Annotea server。
Amaya - 由W3C所開發。
Annozilla - 利用Mozilla發展,仍未有成果
Snufkin - 利用IE發展 -
選定網頁、加註解、存入Annotea server。
-
執行metadata管理的工作。
[1]. Annotea, http://www.w3.org/2001/Annotea/
This is an important concept; see
other">http://serv1.example.com/other/page.html">other page.
請先 登入 以發表留言。