xpath evaluation in linear time
play

XPath Evaluation in Linear Time Mikoaj Bojaczyk, Pawe Parys Warsaw - PowerPoint PPT Presentation

XPath Evaluation in Linear Time Mikoaj Bojaczyk, Pawe Parys Warsaw University find the nodes in an XML document d Goal: that satisfy an XPath unary query q. We consider a fragment of XPath called FOXPath. Previous algorithms:


  1. XPath Evaluation in Linear Time Mikołaj Bojańczyk, Paweł Parys Warsaw University

  2. find the nodes in an XML document d Goal: that satisfy an XPath unary query q. We consider a fragment of XPath called FOXPath. Previous algorithms: – exponential in the document size – quadratic in the document size (Benedikt, Koch) We give two algorithms: – linear in the document size: O ( 2 |q| ·| d| ) – good combined complexity: O ( |q| · |d| · log (|d|))

  3. XML Document < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> </document>

  4. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag

  5. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag

  6. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  7. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  8. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  9. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  10. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  11. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  12. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  13. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag XPath query: “select teams that share a player with another team”

  14. XML Document attribute name attribute name < document > < team name=”Borussia”> < player name=”Kuba”></player> < player name=”Frei”></player> </team> < team name=”Schalke”> < player name=”Kuranyi”> </team> < team name=”Poland”> < player name=”Kuba” >< /player> < player name=”Boruc”></player> </team> document node, </document> i.e. opening tag child[player]@name = sibling[team]/child[player]@name XPath query: “select teams that share a player with another team”

  15. FOXPath Programs - select node pairs. - child , parent , next-sibling , prev-sibling , descendant , etc. - any regular expression on programs is a program, e.g. child * - if t is a test, then [t] is a program that selects (x,x) if node x satisfies t Tests - select single nodes. - any tag name a is a test that selects nodes with this tag. - boolean operations: or, and, not - if p,q are programs, and a , b attribute names, then p@ a =q@ b and p@ a ≠ p@ b are tests.

  16. FOXPath Programs - select node pairs. - child , parent , next-sibling , prev-sibling , descendant , etc. - any regular expression on programs is a program, e.g. child * - if t is a test, then [t] is a program that selects (x,x) if node x satisfies t Tests - select single nodes. - any tag name a is a test that selects nodes with this tag. - boolean operations: or, and, not - if p,q are programs, and a , b attribute names, then p@ a =q@ b and p@ a ≠ p@ b are tests. A node x is selected by p @a= q @b if x

  17. FOXPath Programs - select node pairs. - child , parent , next-sibling , prev-sibling , descendant , etc. - any regular expression on programs is a program, e.g. child * - if t is a test, then [t] is a program that selects (x,x) if node x satisfies t Tests - select single nodes. - any tag name a is a test that selects nodes with this tag. - boolean operations: or, and, not - if p,q are programs, and a , b attribute names, then p@ a =q@ b and p@ a ≠ p@ b are tests. A node x is selected by p @a= q @b if there are some nodes y and z such that x

  18. FOXPath Programs - select node pairs. - child , parent , next-sibling , prev-sibling , descendant , etc. - any regular expression on programs is a program, e.g. child * - if t is a test, then [t] is a program that selects (x,x) if node x satisfies t Tests - select single nodes. - any tag name a is a test that selects nodes with this tag. - boolean operations: or, and, not - if p,q are programs, and a , b attribute names, then p@ a =q@ b and p@ a ≠ p@ b are tests. A node x is selected by p @a= q @b if there are some nodes y and z such that y the pair ( x,y ) is selected by p. p x

  19. FOXPath Programs - select node pairs. - child , parent , next-sibling , prev-sibling , descendant , etc. - any regular expression on programs is a program, e.g. child * - if t is a test, then [t] is a program that selects (x,x) if node x satisfies t Tests - select single nodes. - any tag name a is a test that selects nodes with this tag. - boolean operations: or, and, not - if p,q are programs, and a , b attribute names, then p@ a =q@ b and p@ a ≠ p@ b are tests. A node x is selected by p @a= q @b if there are some nodes y and z such that y the pair ( x,y ) is selected by p. p x q the pair ( x,z ) is selected by q. z

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend