Cooperative XML Co XML Query Answering Motivation n

  • Slides: 53
Download presentation
Cooperative XML (Co. XML) Query Answering

Cooperative XML (Co. XML) Query Answering

Motivation n XML has become the standard format for information n representation and data

Motivation n XML has become the standard format for information n representation and data exchange An explosive increase in the amount of XML data available on the web, e. g. , n n n Bills at the Library of Congress IEEE Computer Society’s publication Swiss. Prot – protein sequence databases XMark – online auction data …. Effective XML search methods are needed! 2

Challenges n XML schema is usually very complex n n n E. g. ,

Challenges n XML schema is usually very complex n n n E. g. , the schema for the IEEE Computer Society publication dataset contains about 170 distinct tags and more than 1000 distinct paths It is often unrealistic for users to fully understand a schema before asking queries Exact query answering is inadequate and approximate query answering is more appropriate! 3

Approach: Co. XML Derive approximate answers by relaxing query conditions, i. e. , query

Approach: Co. XML Derive approximate answers by relaxing query conditions, i. e. , query relaxation Query Cooperative XML Approximate Query Answering Answers XML Database Engine XML Documents 4

Roadmap n n n Introduction Background Co. XML Related Work Conclusion 5

Roadmap n n n Introduction Background Co. XML Related Work Conclusion 5

XML Data Model n XML data is often modeled as an ordered labeled tree

XML Data Model n XML data is often modeled as an ordered labeled tree n n Tree nodes: elements Tree edges: element-nesting relationships 1 article Element 2 title Search engine spam detection Content 3 author 4 XYZ name 5 IEEE Fellow 6 title 2003 year 7 body 8 section . . a spam detection technique by content analysis… 6

XML Query Model n XML queries are often modeled as trees n Structure conditions:

XML Query Model n XML queries are often modeled as trees n Structure conditions: a set of query nodes connected by n n n Content conditions: n n Parent-to-child (‘/’): directly connected Ancestor-to-descendant (‘// ’): connected (either directly or indirectly) Either value predicates or keyword constraints on query nodes Example article title year section search engine 2003 spam detection 7

XML Query Answer n n An answer for a query is a set of

XML Query Answer n n An answer for a query is a set of nodes in a data tree that satisfies both structure and content conditions Example 1 article 2 title Search engine spam detection 3 author 4 name 5 title 6 year 2003 article 7 8 body section title year section search 2003 spam engine detection Query Tree XYZ IEEE Fellow . . a spam detection technique by content analysis… Data Tree 8

XML Query Relaxation Types n Value relaxation: enlarging a value condition’s search scope article

XML Query Relaxation Types n Value relaxation: enlarging a value condition’s search scope article n title year section title search engine 2003 spam detection search engine year section 2000 spam 2005 detection Node relabel: changing the label a node to a similar or a more general label by domain knowledge document article title year section search engine 2003 spam detection [1] Tree Pattern Relaxation (S. Amer-Yahia, et al. , 2000) 9

XML Query Relaxation Types n Edge generalization: relaxing a ‘/’ edge to a ‘//’

XML Query Relaxation Types n Edge generalization: relaxing a ‘/’ edge to a ‘//’ edge article n article title year section search engine 2003 spam detection Node deletion: dropping a node from a query tree article title year section search engine 2003 spam detection search engine year section 2003 spam detection 10

XML Relaxation Properties n Definition n n Relaxation operation: an application of a relaxation

XML Relaxation Properties n Definition n n Relaxation operation: an application of a relaxation type to a specific query node or edge Lemma n Given a query tree with n applicable relaxation operations, there are potentially up to 2 n relaxed trees n Possible combinations: 11

Roadmap n n n Introduction Background Co. XML Related Work Conclusion 12

Roadmap n n n Introduction Background Co. XML Related Work Conclusion 12

Challenges n Query relaxation is often user-specific n n n A query with n

Challenges n Query relaxation is often user-specific n n n A query with n relaxation operations has potentially up to 2 n relaxed queries n n Different users may have different approximate matching specifications for a given query tree How to provide user-specific approximate query answering? How to systematically relax a query? Query relaxation generates a set of approximate answers n How to effectively rank the returned approximate answers? 13

Co. XML System Overview relaxation language RLXQuery similarity metrics ranked results Ranking Module query

Co. XML System Overview relaxation language RLXQuery similarity metrics ranked results Ranking Module query Relaxation results relaxed query Engine query exact answers relaxation indexes XTAH Relaxation Index Builder Co. XML Database Engine XML Documents 14

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Language

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Language Relaxation Indexes Ranking Evaluation Testbed Related Work Conclusion 15

Relaxation Language n Motivation n n Enabling users to specify approximate conditions in queries

Relaxation Language n Motivation n n Enabling users to specify approximate conditions in queries and to control the approximate matching process RLXQuery - relaxation-enabled XQuery n Extends the standard XML query language (XQuery) with relaxation constructs & controls, such as n n n ~ : approximate conditions ! : non-relaxable conditions REJECT : unacceptable relaxations AT-LEAST : minimum # of answers to be returned RELAX-ORDER : relaxation orders among multiple conditions USE: allowable relaxation types 16

RLXQuery Example FOR $a in doc (“bib. xml”)//article WHERE $a/year = ~2003 V-COND-LABEL t

RLXQuery Example FOR $a in doc (“bib. xml”)//article WHERE $a/year = ~2003 V-COND-LABEL t 1 and ~($a[about(. /!title, “search engine”)]/body/section)[about(. , “spam detection”)] S-COND-LABEL t 2 RETURN $a RELAX-ORDER (t 1, t 2) USE (edge generalization, node deletion) AT-LEAST 20 article t 1 year ! title body 2003 search engine section spam detection t 2 17

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Language

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Language Relaxation Indexes Ranking Evaluation Testbed Related Work Conclusion 18

Relaxation Index n Naïve approach n n n Observation n n Generate all possible

Relaxation Index n Naïve approach n n n Observation n n Generate all possible relaxed queries & iteratively select the best relaxed query to derive approximate answers Exhaustive, but not scalable Many queries share the same (or similar) tree structures Our approach: relaxation index n n n Consider the structure of a query tree T as a template Build indexes on the relaxed trees of T Use the index to guide the relaxations of any query with the same (or similar) tree structure as that of T 19

Relaxation Index - XTAH n n A hierarchical multi-level labeled cluster of relaxed trees

Relaxation Index - XTAH n n A hierarchical multi-level labeled cluster of relaxed trees Building an XTAH n n n Given a query structure template T, generate all possible relaxed trees Each relaxed trees uses an unique set of relaxation operations Cluster relaxed trees into groups based on relaxation operations and distances similar to “suffix-tree” clustering 20

XTAH Example relax edge_generalization {gen(e$1, $2)} T 1 article … … {gen(e$1, $2), gen(e$3,

XTAH Example relax edge_generalization {gen(e$1, $2)} T 1 article … … {gen(e$1, $2), gen(e$3, $4)} title body node_relabel section {gen(e$3, $4)} T 2 article title body section T 3 article title body section … … node_deletion . . . {gen(e$3, $4), gen(e$1, $3)} {del($2)} T 6 article body … … {del($2), del($3)} section T 4 article … title body T 7 article … section A sample XTAH for the template structure T article $1 title $2 body $3 section $4 Template structure T gen(e$u, $v) – relaxing the edge between $u and $v del($u) – deleting the node $u 21

XTAH Properties n Each group consists of a set of relaxed trees obtained by

XTAH Properties n Each group consists of a set of relaxed trees obtained by using similar relaxation operations n n Efficient location of relaxed trees based on relaxation operations The higher level a group, the less relaxed the trees in the group n Relaxing queries at different granularities by traversing up and down the XTAH 22

XTAH-Guided Query Relaxation n Problem n n Given a query with relaxation specifications (constructs

XTAH-Guided Query Relaxation n Problem n n Given a query with relaxation specifications (constructs and controls), how to search an XTAH for relaxed queries that satisfy the specification? Approach n First, prune XTAH groups containing trees that use unacceptable relaxations as specified in the query n n This step can be efficiently achieved by utilizing internal node labels Then, iteratively search the XTAH for the best relaxed query 23

Query Relaxation Process Example article year ! title body 2003 search engine section title

Query Relaxation Process Example article year ! title body 2003 search engine section title $2 body $3 section $4 The template structure, T spam t 2 detection t 1 article $1 Relaxation Control USE (edge generalization, node deletion) AT-LEAST 20 Sample RLXQuery relax edge_generalization {gen(e$1, $2)} T 1 article title body … node_relabel … {gen(e$1, $2), gen(e$3, $4)} section {gen(e$3, $4)} T 2 article title body section T 3 article title body section … … node_deletion . . . {gen(e$3, $4), gen(e$1, $3)} {del($2)} T 6 article body … … {del($2), del($3)} section T 4 article … title body section A sample XTAH for the template structure T T 7 article … section 24

XTAH-Guided Query Relaxation n Problem n Given a query and an XTAH, how to

XTAH-Guided Query Relaxation n Problem n Given a query and an XTAH, how to efficiently locate the best relaxation candidate at the leaf level? R 0 R 1 R 2 R 5 R 8 R 3 R 11 relaxed tree j n Approach: M-tree n n n Assign representatives to internal groups Representatives summarize distance properties of the trees within groups Use representatives to guide the search path to the best relaxation candidate [2] M-tree: An efficient access method for similarity search in metric space (P. Ciaccia et. al. , VLDB 97)25

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Language

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Language Relaxation Indexes Ranking Evaluation Testbed Related Work Conclusion 26

Ranking n Ranking criteria n n Based on both content and structure similarities between

Ranking n Ranking criteria n n Based on both content and structure similarities between a query and an answer, i. e. , a set of data nodes Approach n n n Content similarity – extended vector space model Structure similarity – tree editing distance with a model for assigning operation cost Overall relevancy – a ranking model combing both content and structure similarities 27

Content Similarity Traditional IR ranking Vector Space Model content similarity between a query and

Content Similarity Traditional IR ranking Vector Space Model content similarity between a query and a document Term Frequency Inverse Document Frequency Weighted Term Frequency Inverse Element Frequency XML content ranking Extended Vector Space Model content similarity between a query and an answer (i. e. , a set of data nodes) 28

Weighted Term Frequency n n Terms under different paths of a node weight differently

Weighted Term Frequency n n Terms under different paths of a node weight differently 5 section Data Query Example paragraph 12 reference 6 title 8 Spam Detection By Content Analysis n …an approach to detect spam by … Spam detection taxonomy spam detection The weighted term frequency for a term t in a node v is: pi: a path under the node v to a term t; m: # of different paths under the node v that contain the term t 29

Inverse Element Frequency n n n The more number of XML elements containing a

Inverse Element Frequency n n n The more number of XML elements containing a term, the less disambiguating power the term has E. g. , the term “spam” is less disambiguating than the term “detection” The inverse element frequency for a query term t is $u: a query node whose content condition contains the term t N 1: # of data nodes that match the structure condition related to $u N 2: # of data nodes that match the structure condition related to $u and contain t 30

Extended Vector Space Model n The content similarity between an answer A and a

Extended Vector Space Model n The content similarity between an answer A and a query Q is n: # of nodes in Q {$u 1, …, $un}: the set of query nodes in Q {v 1, …, vn}: the set of data nodes in A, where vi matches $ui (1 ≤ i ≤ n) |$ui. cont|: the number of terms in the content conditions on the node $ui tij: a term in the content condition on the query $ui 31

Structure Distance Function n n Both XML data and queries are modeled as trees

Structure Distance Function n n Both XML data and queries are modeled as trees Similarities between trees are often computed by editing distances, n n i. e. , the cost of the cheapest sequence of editing operations that transform one tree into the other tree The structure distance between an answer A and a query Q can be measured as the total cost of relaxation operations used to derive A {r 1, …, rk}: the set of relaxation operations used to derive A cost(ri): the cost for ri (0 ≤ cost(ri) ≤ 1 ) 32

Relaxation Operation Cost n Naïve approach n n n Assign uniform cost to all

Relaxation Operation Cost n Naïve approach n n n Assign uniform cost to all relaxation operations Simple but ineffective Our approach n n Assign an operation cost based on the similarity between the two nodes being approximated by the operation The closer the two nodes, the less the operation costs ri: a relaxation operation $u, $v: the two nodes that are being approximated by ri 33

Nodes Approximated By Relaxation Operations Relaxation Operation Nodes being approximated by the operation: ($u,

Nodes Approximated By Relaxation Operations Relaxation Operation Nodes being approximated by the operation: ($u, $v) Example Node relabel (a node with the old label, a node with the new label) (article, document) Node deletion (a child node, the parent node) (section, body) Edge generalization (a child node, a descendant node) (article/title, article//title) T 1 article title body section Query tree T 2 document title body T 3 article title body section Node Relabel T 4 article title body section Node deletion Edge generalization 34

content similarity structure distance overall relevancy 35

content similarity structure distance overall relevancy 35

Overall Relevancy Function n The overall relevancy of an answer A to a query

Overall Relevancy Function n The overall relevancy of an answer A to a query Q, sim(A, Q), is a function of cont_sim(A, Q) and struct_dist(A, Q) Properties n sim(A, Q) = cont_sim(A, Q) if struct_dist(A, Q) = 0 n sim(A, Q) as cont_sim(A, Q ) n sim(A, Q) as struct_dist(A, Q ) Implementation is a small constant between 0 and 1 36

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Indexes

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Indexes Relaxation Language Ranking Evaluation Testbed Related Work Conclusion 37

Evaluation Studies n INEX (Initiative for the evaluation of XML) n n Document collections

Evaluation Studies n INEX (Initiative for the evaluation of XML) n n Document collections n n Scientific articles from IEEE Computer Society 1995 – 2002 About 500 MByte Each article consists of 1500 XML nodes on average Queries n n n Similar to TREC for text retrieval Strict content and structure (SCAS) Vague content and structure (VCAS) Golden standard n Relevance assessment provided by INEX 38

Evaluation of Content Similarity n n Datasets: INEX 03 test collection Query sets: 30

Evaluation of Content Similarity n n Datasets: INEX 03 test collection Query sets: 30 SCAS queries Comparisons: 38 submissions in INEX 03 1 0. 8 Precision n Avg. Precision 0. 3309 0. 6 0. 4 0. 2 0 0. 5 Recall 1 39

Evaluation of the Cost Model n n n Dataset: INEX 05 test collection Query

Evaluation of the Cost Model n n n Dataset: INEX 05 test collection Query set: 22 simple VCAS queries Evaluation metric: normalized extended cumulative gain (nx. CG) n n the official evaluation metric used in INEX 05 Given a number i (i 1), nx. CG@i, similar to precision@i, measures the relative gain users accumulated up to the rank i E. g. , nx. CG@10, nx. CG@25, nx. CG@50, … Cost Models: n n UCost: uniform cost for each relaxation operation (Baseline) SCost: our proposed cost model 40

Retrieval performance improvements with semantic cost model nx. CG@10 ( , cost model) Cost

Retrieval performance improvements with semantic cost model nx. CG@10 ( , cost model) Cost Model n 0. 1 0. 3 0. 5 0. 7 0. 9 Uniform 0. 2584 0. 2616 0. 2828 0. 2894 0. 2916 Semantic 0. 3319 (+28. 44%) 0. 3190 (+21. 94%) 0. 3196 (+13. 04%) 0. 3068 (+6%) 0. 2957 (+4. 08%) Query set: all content-and-structure queries in INEX 05 Assigning relaxation operation with different cost based on the similarities of the nodes being operated improves retrieval performance! nx. CG@25 and nx. CG@50 yield similar results 41

Evaluation of the Cost Model 0. 1 0. 3 0. 5 0. 7 UCost

Evaluation of the Cost Model 0. 1 0. 3 0. 5 0. 7 UCost 0. 2584 0. 2616 0. 2828 SCost 0. 3319 (+28. 44%) 0. 3190 (+21. 94%) 0. 3196 0. 3068 (+13. 04%) (+6%) 0. 2894 0. 9 0. 2916 0. 2957 (+4. 08%) Each cell: nx. CG@10 for a given pair ( , cost model) n Result (% of improvement over the baseline) Utilizing node similarities to distinguish costs of different operations improves retrieval performance! Similar results are observed using nx. CG@25 and nx. CG@50 42

Expressiveness of the Relaxation Language n INEX 05 Topic 267 <inex_topic_id="267" query_type="CAS" > <castitle>

Expressiveness of the Relaxation Language n INEX 05 Topic 267 <inex_topic_id="267" query_type="CAS" > <castitle> //article//fm//atl[about(. , "digital libraries")] </castitle> <description> Articles containing "digital libraries" in their title. </description> <narrative> I'm interested in articles discussing Digital Libraries as their main subject. Therefore I require that the title of any relevant article mentions "digital library" explicitly. Documents that mention digital libraries only under the bibliography are not relevant, as well as documents that do not have the phrase "digital library" in their title. </narrative> </inex_topic> n Expressing Topic 267 using RLXQuery FOR $a in doc(“inex. xml”)//article LET $b = $a//fm//!atl REJECT(fm, bb) WHERE $b[about(. , “digital libraries”)] RETURN $b 43

Effectiveness of the Relaxation Control n Expressing Topic 267 with RLXQuery FOR $a in

Effectiveness of the Relaxation Control n Expressing Topic 267 with RLXQuery FOR $a in doc(“inex. xml”)//article LET $b = $a//fm//!atl REJECT(fm, bb) WHERE $b[about(. , “digital libraries”)] RETURN $b n Results Evaluation Metric nx. CG@10 nx. CG@25 No relaxation control 0. 1013 0. 2365 With relaxation control 1. 0 0. 8986 Method Perfect accuracy Relaxation control enables the system to provide answers with greater relevancy! 44

Evaluation of the Ranking Function n n Dataset: INEX 05 test collection Query set:

Evaluation of the Ranking Function n n Dataset: INEX 05 test collection Query set: 4 official VCAS queries with available relevance assessments Comparison: top-1 submission in INEX 05 Results Metric nx. CG@10 nx. CG@25 Topic Top-1 Co. XML 256 0. 4293 0. 4248 0. 4733 0. 5555 264 0. 0069 0. 0033 275 0. 7715 0. 638 0. 589 0. 5922 284 0. 0 0. 1259 0. 0 0. 1233 Average 0. 3002 (+0. 4%) 0. 2989 0. 2656 0. 3186 (+20%) The systematic relaxation approach enables our system to derive more approximate answers! Our ranking function, based on both content and structure relevancy, outperforms other ranking functions using content similarities only! 45

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Indexes

Roadmap n n n Introduction Background Co. XML n n n n Relaxation Indexes – XTAH Relaxation Language – RLXQuery Ranking Evaluation Testbed Related Work Conclusion 46

Co. XML Testbed RLXQuery Approximate Answers RLXQuery Parser RLXQuery Preprocessor Relaxation Controller Database Manager

Co. XML Testbed RLXQuery Approximate Answers RLXQuery Parser RLXQuery Preprocessor Relaxation Controller Database Manager Relaxation Manager XTAH XML Database Engine Ranking Module Relaxation Index Builder XML Document s Team Members: Prof. Chu, S. Liu, T. Lee, E. Sung, C. Cardenas, A. Putnam, J. Chen, R. Shahinian 47

Relaxation Examples using the Testbed 48

Relaxation Examples using the Testbed 48

Relaxation Examples using the Testbed 49

Relaxation Examples using the Testbed 49

Roadmap n n n Introduction Background Co. XML Related Work Conclusion 50

Roadmap n n n Introduction Background Co. XML Related Work Conclusion 50

Related Work: Query Relaxation n Relaxation based on schema conversions ([LC 01, LMC 01],

Related Work: Query Relaxation n Relaxation based on schema conversions ([LC 01, LMC 01], [LMC 03]) n n No structure relaxation Native XML relaxation n Propose structure relaxation types [e. g. , KS 01, ACS 02] n n We use the relaxation types introduced in [ACS 02] Investigate efficient algorithms for deriving top-K answers based on relaxation types supported [e. g, Sch 02, ACS 02, ALP 04, AKM 05] n No relaxation control 51

Related Work: XML Ranking n Content ranking n n n Most extend ranking models

Related Work: XML Ranking n Content ranking n n n Most extend ranking models for text retrieval to the XML scenario, e. g. , Hy. Rex, XXL, Juru. XML, XSearch We utilize structure to distinguish terms of different weights occurring in different parts of a document Structure ranking n n n Based on tree editing distance algorithms w/o considering operation cost [NJ 02] Based on the occurrence frequency of the query trees, paths, or predicates in data [MAK 05, AKM 05] Our structure ranking is similar to editing distance, but we consider operation cost 52

Conclusion n Cooperative XML (Co. XML) query answering n n RLXQuery enables users to

Conclusion n Cooperative XML (Co. XML) query answering n n RLXQuery enables users to effectively express approximate query conditions and to control the approximate matching process XTAH provides systematic query relaxation guidance Both content and structure similarity metrics for evaluating the relevancy of approximate answers Evaluation studies with the INEX test collections demonstrate the effectiveness of our methodology 53