Ӧ
Computer Applications
1999 198 Vol.19No.8 1999



WebѯĹϵݿģ
ܻ
ժҪһֶWebѯģͣһģͣƳݿSQLԵWebѯԣӶWebĽṹݼԲѯͬʱȽWebݲѯ׼ݿϵͳѯ
ؼʡάϵݿ⣬ѯURL
THE RATIONAL DATABASE MODEL
FOR WEB QUERIES
Li Shaohua
Computer Center of Guangdong Business College, GuangdongGuangzhou 510320
AbstractThis paper proposed a new model for Web query and computation. Web SQL-like query language can be designed based on this model. The differences between Web query and standard database query are also discussed.
KeywordsWorld wide web, Rational database, Query, URL
1Webѯ
άWWWһ޴ġֲʽ칹ĵϢ⣬Щĵͨıӣhypertext linkϵάпټϢĹ뼼չ죬άһͳݿ⣬ԱSQLDatalog֮ĲѯԣĿǷûĲѯȻWebһݿ⣬Ĳѯ׼ݿⱾǼ䲻ͬġWeb׼ݿ֮Ҫ¼1ݣ
ȱƣ
ݴȡޣ
߶Σ
칹ԣ
ȱṹԡ
WebƵǳҪĳһĵ޸Ĳʱ޸ڼӦܶĵԷֹʣ⼸޷ʵ֣ͬʱWebҲûƣԭʹúܶĲѯһ޵ʱڽм㡣磬ͨӲѯĳһĵʱĳڸĵĩβµݣٶȱȶȡٶȿ죬һ޷ˡҪʹWebвƻȡڸԶ̬޸ĵҳĲѯṩһϵľ̬ͼ
ĿǰWebĵĲѯϻǵʽġ֮һNavigationһʼURLһһؽ֮ǹؼʲѯQueryͨYahooAltavistaһûб֤ÿһĵҲûб֤һͨԣֻṩԤȼݽѰַһƶԲѯײӰܴҪѯǷĵdһ⣬ǲɼģΪ޷ĵһҪ֤ûжʧ⣬ֹΪõķ޷̽Webĵڽṹ˹ϵҾ¹ؼʵĵIBMpersonal computerpriceЧ˵ӦȽNavigationIBMҳwww.ibm.comȻӸ÷ϹؼٽQueryȻĿǰĹ߻ֲܽͳһԭNavigationڹģQueryǶѹõ
George A. MihailaUniversity of Toronto, CanadaһֻάSQLԣWebSQLWebSQLĵ˽ṹNavigationQueryֲһ壬߶ھ̬ĵͶ̬ĵǿɼġ
̽WebĹϵģ͡JavaԶһģͼʵ֣άϽƱ׼ݿSQLѯ
2WebĹϵģ
ȫֵĽǶȿWebģͻWebģͻWebվṹģͻWebҳڲṹģͻWebվݵȻҲһܼԵ⡣
2.1ıṹ
Webĵ֮ͨıӣ޴άϢԳΪһͼ3ݣͼ㣨nodeWeb󣬸öͳһԴʶURLHTMLĵ⣨titleݣcontentĵȣlengthͣtype޸ڣmodifԡˣǿԽһWebǡĵϵһԪ飺
Nid,title,content,type,length,modif,
УidURL˿ԶΪPKԿNullֵURLݸʽ£
<URL>:=<Protocol>://<Host>/<Path>/<Filename>#location>
HTMLĵ֮ͨê־Anchor tagӹϵʽ£
<A HREF="DestURL">AnchorText</A>
ǿԽÿΪêϵеһԪ飺
Lsource,destination,label,
УsourcedestinationǺOid͡
ṩһFormʽûӿڣûFormҪĲݲ֮ɵˣҲģͻΪСĽ㡣ͬԶΪһϵԪ飬ṹLƣҪһparamsetԣ
Pparamset,paramname,paramval
2.2ϵ
ȶֻ͡
͡DֵTΪ͵޼DӼһԪͼa1:t1,,an:tnݣaiԣڼtiϣi=1,,ntdom(t)D
͡A޼OidTΪʶһObjһԪ飺Obj=a1:t1,,an:tnݣaiA(i=1,n)͵ԡ
͵Դе
dom(Obj)={a1:v1,,an:vn|vidom(ti),i=1,n}
viԪaiԵֵ
ǿԶֶNodeLink:
Node=id:Oid,, ai:ti
Link=from:Oid,to:Oid,,bj:tj,
idfromtoԼaibjΪAԪأtitjTԪء
DocumentϵAnchorϵǰWebģУĵӳΪNode󣬳ıӳΪLinkУʶOidͳһԴʶURLNode󹹳һĵϵݿDocumentLink󹹳һêϵݿAnchor1ʾ
1Document

urlTitleTextlengthTypemodif
http://wwwTitle 1Text 11234Text1-1-96
http://wwwTitle 2Text 22345Text2-3-96
http://wwwTitle 3Text 33456Text3-4-96


Anchor

SourceLabeldestination
http://wwwLabel 1http://www
http://wwwLabel 2http://www
http://wwwLabel 3http://www


BaseϵͨWebʱһЩӵݣbookmarksļȣݳʼWebѯĳ㡣ΪˣǶһBaseϵЩϢȥBaseϵǰϵڣBaseϵһԵġ
2.3Webݿ
ԽWebݿⶨΪWebݿ޸BaseϵDB={R1,,Rn}ӹϵNLɣNΪnodeLΪlink󣬲ң
idǹϵNеPK
LеsourceԺNеidԾԼҪ
3Webѯľ廯
ϵWebݿģͣDocumentAnchorʵʴڵĹϵǱSQLǵĲѯҪ磬ҪҳWebĵоͬtitleЩURLдµĲѯ䣺
SELECT d1.url,d2.url
FROM Document d1,Document d2
WHERE d1.title=d2.title
AND NOT(d1.url=d2.url)
ǣDocumentAnchorϵ鹹ģϲѯ޷㣬Ҳ޷ĵؼжϡҪϲѯҪ󣬱뽫ϵ廯ǽѯΪ
SELECT d1.url,d2.url
FROM Document d1 SUCH THAT d1 MENTIONS "Something Interesting",
Document d2 SUCH THAT d2 MENTIONS "Something Interesting"
WHERE d1.title=d2.title
AND NOT(d1.url=d2.url)
ͨSUCH THATMENTION廯ѯݣǿɼˡ
4
Webģ͵о޵ǰṩһָЧȫWebѯΪˣصԲѯӦϵͳȵоͬҪġ
߼飺ܻ˶ʿʦҪо򣺼ͼѧݿ⼼
ߵλܻ㶫ѧԺġ㶫ݣ510320
ο
1ݡAlberto Mendelzon and Tova Milo,Formal Models of the Web,in Proceedings of the Sixteenth ACM Symposium on Principles of Databasse System,May 1997
2ݡAlberto Mendelzon,George Mihaila,Tova Milo,Querying the World Wide Web,Journal of Digital Libraries1(1),199768-88
3ݡDaniela Florescu,Alon Levy and Alberto Mendelzon, Database Techniques for the World Wide Web:A Survey,ACM SIGMOD Record 27:3,1998959-74
4ݡAlberto Mendelzon,The Web is not a database,slides from a presentation at the Workshop on internet Data Management,Washington,199811
ո:1999-02-11(޸ĸ)
