[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPath related query

Subject: Re: XPath related query
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sun, 23 Jan 2011 18:38:04 +0000
Re:  XPath related query
On 23/01/2011 14:14, Florent Georges wrote:
Vineet Chaoji wrote:

Hi,

So the query that I am trying to represent is: Is there a Book
"Book1" that has a chapter 'c1' that cites some article 'a' and
does this article 'a' have a chapter 'c2' which has a section
's' which has a figure 'f' which is called "Example semi-joins".
This is a binary yes/no type of query.
   Given that $dblp is bound to the element DBLP, the following
expression should return what you are looking for, and is I think
self-explanatory:

     exists(
       $dblp
         /Book[@rdf:about eq 'Book1']
         /chapter
         /Chapter[@rdf:about eq 'c1']

I think c1 was intended as a range variable rather than an actual chapter name - though I can't be sure. Certainly it looks to me as if "a" is intended as a range variable, since the join (books cites article) seems to be the essence of this query. Florent's query doesn't seem to include this join condition. I don't think I can correct it, however, without a better formulation of the requirement.


Michael Kay
Saxonica
         /section
         /Section
         /cites[@rdf:resource eq 'a']
         /../../../../../..
         /Article[@rdf:about eq 'a']
         /chapter
         /Chapter[@rdf:about eq 'c2']
         /section
         /Section[@rdf:about eq 's']
         /figure[. eq '"Example Semi-join"']
     )

Regards,

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.