資料庫系統實驗室 指導教授:張玉盈 1
Relational Database Domains SNOOPYFAMILY Male Female Primary Key 利用 SQL 做查詢: ID NAME SEX 1 SNOOPY Male Select NAME 2 CHARLIE BROWN Male From SNOOPYFAMILY 3 SALLY BROWN Female Cardinality 4 LUCY VAN PELT Female Tuples Where SEX = ‘ Male ’ ; 5 LINUS VAN PELT Male 結果: 6 PEPPERMINT PATTY Female 7 MARCIE Female ID NAME SEX 8 SCHROEDER Male 1 SNOOPY Male 9 WOODSTOCK - 2 CHARLIE BROWN Male 5 LINUS VAN PELT Male Attributes 8 SCHROEDER Male Degree 2
Image Databases S M H T (a) An image picture (b) The corresponding symblic representation 2D String : x : M<H<T=S y : H=T<M<S 3
Image Database 應用層面:辦公室自動化、電腦輔助設計、醫學影像擷取 … 等等。 影像資料庫中的查詢 (Queries) : Spatial Reasoning( 空間推理 ) : 在一張影像中推論兩兩物件之間的空間 • 關係。 Pictorial Query( 圖像查詢 ) : 允許使用者給予特定的空間關係以查詢相 • 對應的影像。 Similarity Retrieval( 圖形相似擷取 ) : 藉由使用者所提供的資訊在影像 • 資料庫中找尋出最相似的圖形。 Pe Fr Lucy Marc Linu Char (a) An image picture (b) Symbolic Picture 4
Uids of 13 spatial operators 5
C B D (48) J (40) P (50) (16) (16) < < <* <* < | < | | ] | [ | / / /* /* / /* /* /* /* = ] [* [* = Another View of 169 relations | |* |* < <* <* <* <* <* <* | <* <* % | = | ] / / /* /* ] /* /* [ ] [* [* ]* ]* < | <* <* | |* |* < |* |* | / | /* /* | / ] /* /* ] / [ ] ] [* [* [* [* < |* |* <* <* |* |* |* |* <* <* |* |* |* |* / |* |* /* /* |* |* /* /* [ / = /* /* = % ] [* [* %* %* < / <* <* / ]* ]* < |* |* / ]* ]* | [* [* | /* /* % [ / % / = [ ]* ]* [* [* < /* /* <* <* /* /* ] <* <* |* |* /* /* %* %* | % |* |* / % [ /* /* % /* /* = % ]* ]* %* %* < ] <* ] <* = < |* |* ] ] |* |* = |* |* ]* ]* ] [* [* ] %* %* ] % % = ]* ]* < [ <* <* [ % < |* |* [ [ |* |* ]* ]* |* |* ]* ]* / [* [* / %* %* / = = = = < % <* % <* [* [* < |* |* % [* [* |* |* ]* ]* /* /* [* [* /* /* %* %* /* /* % = ]* ]* = < = <* = <* / < |* |* = %* %* |* |* [* [* [ %* %* [ ]* ]* [ ] = = [* [* < ]* ]* <* ]* <* ]* /* /* < |* |* ]* ]* | /* /* ] ]* ]* [ ]* ]* % ]* ]* [ = = %* %* < [* [* <* <* [* [* %* < %* |* |* [* [* | / ] [* [* [ [* [* % [* [* [ % ]* ]* ]* ]* < %* %* <* <* %* %* / <* <* |* |* %* %* | ] ] %* %* [ %* %* % %* %* ] % %* %* %* %* [* [* <* <* % <* <* /* /* <* <* | %* %* | = ]* ]* % /* /* ]* ]* = /* /* % [ %* %* [* [* = <* <* ]* ]* <* <* %* <* %* <* | [* [* | % / [* [* [* [* % /* /* [* [* = / [ [ %* %* ]* ]* 6 [ <* <* [ < ] < | ]* ]* | [ / %* %* %* %* % /* /* %* %* / ]* ]* ] [ %* %* =
5 Category Relationships(C AB ) Disjoin : Contain : A A B B Meet : A B Inside : B A Partly Overlap : A B 7
Decision tree of the CATEGORY function oid x , oid y > 4 T F oid x , oid y > 2 7 ≦ oid x , oid y ≦ 10 T F T F 10 ≦ oid x , oid y ≦ 13 Contain Join Disjoin T F Belong Part_Overlap 8
UID Matrix representation(cont.) a b d c f 1 a b c d a b c d a 0 /* * /* a 0 6 2 6 b 0 /* % b 1 0 6 9 c % * * 0 c 13 2 0 1 d % * 0 d 1 13 1 0 9
Similarity Retrieval based on the UID Matrix(1) Definition1 Picture f’ is a type- i unit picture of f , if (1) f’ is a picture containing the two objects A and B, represented as x : A r x ’ A,B B, y : A r y ’ A,B B. (2) A and B are also contained in f . (3) the relationships between A and B in f are represented as x : A r x A,B B, and y : A r y A,B B. Then, (Type-0): Category(r x ’ A,B , r y ’ A,B ) (Type-1): (Type-0) and (r x ’ A,B = r x A,B or r y ’ A,B = r y A,B ) (Type-2): r x ’ A,B = r x A,B and r y ’ A,B = r y A,B 10
3 type-i similarities A B B A f(A/B, A/*B) type-0(A/*B, A%*B) A B B A type-2 (A/B, A/*B) typ ype-1 (A/B, A[*B) 11
Image Mining: Finding Frequent Patterns in Image Databases Setting the minimum support to ½. 12 Charlie Brown often appears to the right of Snoopy .
Video : Image + Time …… Time Image 1 Image 2 Image 3 Image 4 Image N 範例: 一幕幕的 Snoopy 影像,編織成一部精彩的 Snoopy 影片 + + + + + 13
Multimedia Database - Pictures - Pictures with the depicted texts 你喜歡史奴比 嗎? Yes No 你可以加入我們實 到別的實驗室看看 驗室。 吧! - Voice - Video - Flow Chart 14
Spatial Database : Nearest Neighbor Query Where is the nearest restaurant to our location ? 15
Query Types 1. 精確比對查詢: 哪一個城市位在北緯 43 度與西經 88 度? 2. 部分比對查詢: 哪些城市的緯度屬於北緯 39 度 43 分? 3. 給定範圍查詢: 哪些城市的經緯度介於北緯 39 度 43 分 至 43 度與西經 53 度至 58 度之間? 4. 近似比對查詢: 最靠近東勢鎮的城市是? 16
Difficulty No total ordering of spatial data objects that preserves the spatial proximity. c c d d a a b b a b c d ? / a c b d ? 17
Space Decomposition and DZ expression 18
The Bucket-Numbering Scheme Bigger 5 7 13 15 4 6 12 14 1 3 9 11 Smaller 0 2 8 10 (c) (b) (a) the uptrend of the N-order Peano Curve bucket numbers of an object 19
Example O(l,u) = (12,26) The total number of buckets depends on the expected number of data objects. maximum bucket number: Max_bucket = 63 20
Example the data (b) the corresponding NA-tree structure (bucket_capacity = 2) 21
The basic structure of the revised version of the NA-tree 22
NN (Nearest Neighbor) NN problem is to find the nearest neighbor of q (query point). Nearest neighbor of q q Query point Managed by a Peer 23
Spatial Databases: KN KNN N Ke Keywor word d Qu Quer ery Where are the 2 nearest points with keywords B and C? 24
Road Network Databases: K K Ne Near arest est Ne Neighbor ghbor Qu Quer ery Where are the 3 nearest restaurants? 25
Spatial Databases: Top op- k Sp Spat atial al Key eywo word d Qu Quer ery Where are the top- 1 ‘Snoopy hotel’ near Kaohsiung? 26
RNN (Reversed NN) The q is the nearest neighbor of the blue points. RNN is a complement of NN problem. Reverse nearest neighbor of q Reverse nearest neighbor of q q Query point Reverse nearest neighbor of q Managed by a Peer 27
• Reverse Nearest Neighbor(RNN) Query means : to obtain the objects which treat the query as their nearest neighbor. • Application : Business strategy Location B Location A Five residents treat Location B as their NN. Three residents treat Location A as their NN. Location B is a better place to run the Query q store. Residents 28
• Reverse Nearest Neighbor(RNN) Query means : to obtain the objects which treat the query as their nearest neighbor. • Application : Traffic police B A Traffic smooth Traffic jam Five cars treat Location A as their NN. Query q Three cars treat Location B as their NN. A Query move Location A is a better place to the police for patrol. Cars 29
Spatial Database : Continuous Nearest Neighbor Query Find the nearest E gas stations from the starting point to the ending point. S 30
Spatio-temporal Database What is the traffic condition ahead of Where is the available me during the next gas station around 30 minutes? my location after 20 minutes? 31
P2P System I want to eat a pumpkin. I have it and Who has it? let’s share it. 32
Client-server vs . Peer-to-Peer network Example : How to find an object in the network • Client-server approach Use a big server store objects and provide a directory for look up. • Peer-to-Peer approach Data are fully distributed. Each peer acts as both a client and a server. By asking. 33
Data Grids I want I want File-A . File-X . 34
Protein Database Find the patterns from Sequence 1 KGGAKRHRKIL the protein Sequence 2 KVGAKRHSKRS Sequence 3 KVGAKRHSRKS database. Sequence 4 KGGAKRHRKVL 判斷蛋白質 判斷蛋白質 所屬家族 功能 35
Data Mining 收銀台 Peanuts Supermarket 大家排隊來結帳 PC 顧客通常在 買麵包時也 會買牛奶 利用資料挖礦的技術 對大家購買的紀錄作分析 36
Recommend
More recommend