From mike at saxonica.com Wed Aug 1 01:22:17 2012 From: mike at saxonica.com (Michael Kay) Date: Wed, 01 Aug 2012 09:22:17 +0100 Subject: [xquery-talk] FLOWR vs Xpath axis syntax - Performance In-Reply-To: References: Message-ID: <5018E739.3000908@saxonica.com> On 31/07/2012 17:25, Ihe Onwuka wrote: > I vaguely remember reading somewhere that a preference for what I > would call axis notation has performance advantages over the > equivalent FLOWR code. > > I certainly recall reading that XPath predicates perform better than > where clauses in FLOWR. > > I would appreciate clarification, confirmation or correction and > general enllightenment. As others have said, this is likely to vary between implementations. I know that some implementations attempt to rewrite FLWOR expressions as path expressions, while other implementations try to do the opposite. Presumably in such implementations, if the rewrite succeeds, then it doesn't matter which way you write the query. Do some measurements, and share the results with the list, then we can all be enlightened. Michael Kay Saxonica From ihe.onwuka at googlemail.com Wed Aug 1 18:09:29 2012 From: ihe.onwuka at googlemail.com (Ihe Onwuka) Date: Thu, 2 Aug 2012 02:09:29 +0100 Subject: [xquery-talk] FLOWR vs Xpath axis syntax - Performance In-Reply-To: References: Message-ID: On Tue, Jul 31, 2012 at 5:25 PM, Ihe Onwuka wrote: > I vaguely remember reading somewhere that a preference for what I > would call axis notation has performance advantages over the > equivalent FLOWR code. > > I certainly recall reading that XPath predicates perform better than > where clauses in FLOWR. > > I would appreciate clarification, confirmation or correction and > general enllightenment. I have stumbled across my original source (I think) at least for the 2nd paragraph. http://demo.exist-db.org:8098/exist/tuning.xml#d32089e550 From liam at w3.org Wed Aug 1 18:39:41 2012 From: liam at w3.org (Liam R E Quin) Date: Wed, 01 Aug 2012 21:39:41 -0400 Subject: [xquery-talk] FLOWR vs Xpath axis syntax - Performance In-Reply-To: References: Message-ID: <1343871581.3078.42.camel@localhost.localdomain> On Thu, 2012-08-02 at 02:09 +0100, Ihe Onwuka wrote: > I have stumbled across my original source (I think) at least for the > 2nd paragraph. > > http://demo.exist-db.org:8098/exist/tuning.xml#d32089e550 If you're using the eXist implementation it may well be true. But you didn't include that in your question :-) Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ Ankh: irc.sorcery.net irc.gnome.org freenode/#xml Co-author: 5th edition "Beginning XML", Wrox, 2012, Hot Weather Edition From Robby.Pelssers at nxp.com Fri Aug 10 07:32:00 2012 From: Robby.Pelssers at nxp.com (Robby Pelssers) Date: Fri, 10 Aug 2012 16:32:00 +0200 Subject: [xquery-talk] how to optimaly denormalize 1-to-many relationships with XQuery Message-ID: <927C66C0775CCA43B88EB1E3006614B318147F3E@eu1rdcrdc1wx032.exi.nxp.com> Hi all, Suppose I have a collection of XML documents looking like this: Basictype has 1 to many Product types. Producttype has 1 to many Sales items. Example snippet: --------------------------------- End of life ... Deprecated ... abcde Now I want to generate some data looking like this: End of life ... Deprecated ... abcde ... ------------- I have written a query which returns just this but it iterates - three times over the basictypes - 2 times over the producttypes - 1 time over the salesitems Is there a better way to get this accomplished in 1 iteration? Pseudo-code: let $basictypes := collection("basictypes") return { for $basictype in $basictypes ...do some stuff } { for $basictype in $basictypes for $producttype in $basictype/ProductTypes/ProductType ...do some stuff } { for $basictype in $basictypes for $producttype in $basictype/ProductTypes/ProductType for $salesitem in $producttype/SalesItems/SalesItem ...do some stuff } Robby Pelssers From adam.retter at googlemail.com Sun Aug 12 04:01:23 2012 From: adam.retter at googlemail.com (Adam Retter) Date: Sun, 12 Aug 2012 12:01:23 +0100 Subject: [xquery-talk] how to optimaly denormalize 1-to-many relationships with XQuery In-Reply-To: <927C66C0775CCA43B88EB1E3006614B318147F3E@eu1rdcrdc1wx032.exi.nxp.com> References: <927C66C0775CCA43B88EB1E3006614B318147F3E@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: I dont think you can do this in one pass. However, depending on the implementation its impossible to know how many passed the processor will actually make over the source to fulfil the query. However, if we were to assume each FLWOR expression is a pass over the source data, then I think the following implementation could be more efficient. It really depends on how the implementation handles descendant-or-self and ancestor selection. let $basicTypes := /BasicType { $basicTypes } { for $productType in $basicTypes//ProductType return { $productType/*, } } { for $salesItem $basicTypes//SalesItem return { $salesItem/*, } } On 10 August 2012 15:32, Robby Pelssers wrote: > Hi all, > > Suppose I have a collection of XML documents looking like this: > > Basictype has 1 to many Product types. > Producttype has 1 to many Sales items. > > Example snippet: > --------------------------------- > > End of life > ... > > > Deprecated > ... > > > abcde > > > > > > > Now I want to generate some data looking like this: > > > > > End of life > > ... > > > > Deprecated > > > ... > > > > abcde > > > ... > > > > ------------- > I have written a query which returns just this but it iterates > - three times over the basictypes > - 2 times over the producttypes > - 1 time over the salesitems > > Is there a better way to get this accomplished in 1 iteration? > > > Pseudo-code: > > let $basictypes := collection("basictypes") > return > > > { > for $basictype in $basictypes > ...do some stuff > > } > > > { > for $basictype in $basictypes > for $producttype in $basictype/ProductTypes/ProductType > ...do some stuff > } > > > { > for $basictype in $basictypes > for $producttype in $basictype/ProductTypes/ProductType > for $salesitem in $producttype/SalesItems/SalesItem > ...do some stuff > } > > > > Robby Pelssers > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk -- Adam Retter skype: adam.retter tweet: adamretter http://www.adamretter.org.uk From dlee at calldei.com Sun Aug 12 12:22:38 2012 From: dlee at calldei.com (David Lee) Date: Sun, 12 Aug 2012 19:22:38 +0000 Subject: [xquery-talk] how to optimaly denormalize 1-to-many relationships with XQuery In-Reply-To: References: <927C66C0775CCA43B88EB1E3006614B318147F3E@eu1rdcrdc1wx032.exi.nxp.com>, Message-ID: <3D449B01-B2B4-4BCC-A4C6-30576ADD0478@calldei.com> I wouldn't necessarily be worried about iteration efficiency until you try it. Often iteration Is cheep compared to element creation. It all depends on the processor , data, and other issues. Remember "iteration" doesn't necessarily imply temporal literation, unlike in procedural languages. Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com On Aug 12, 2012, at 7:02 AM, "Adam Retter" wrote: > I dont think you can do this in one pass. However, depending on the > implementation its impossible to know how many passed the processor > will actually make over the source to fulfil the query. > > However, if we were to assume each FLWOR expression is a pass over the > source data, then I think the following implementation could be more > efficient. It really depends on how the implementation handles > descendant-or-self and ancestor selection. > > > let $basicTypes := /BasicType > > > { > $basicTypes > } > > > { > for $productType in $basicTypes//ProductType return > > { > $productType/*, > > } > > } > > > { > for $salesItem $basicTypes//SalesItem return > > { > $salesItem/*, > > } > > } > > > > > > On 10 August 2012 15:32, Robby Pelssers wrote: >> Hi all, >> >> Suppose I have a collection of XML documents looking like this: >> >> Basictype has 1 to many Product types. >> Producttype has 1 to many Sales items. >> >> Example snippet: >> --------------------------------- >> >> End of life >> ... >> >> >> Deprecated >> ... >> >> >> abcde >> >> >> >> >> >> >> Now I want to generate some data looking like this: >> >> >> >> >> End of life >> >> ... >> >> >> >> Deprecated >> >> >> ... >> >> >> >> abcde >> >> >> ... >> >> >> >> ------------- >> I have written a query which returns just this but it iterates >> - three times over the basictypes >> - 2 times over the producttypes >> - 1 time over the salesitems >> >> Is there a better way to get this accomplished in 1 iteration? >> >> >> Pseudo-code: >> >> let $basictypes := collection("basictypes") >> return >> >> >> { >> for $basictype in $basictypes >> ...do some stuff >> >> } >> >> >> { >> for $basictype in $basictypes >> for $producttype in $basictype/ProductTypes/ProductType >> ...do some stuff >> } >> >> >> { >> for $basictype in $basictypes >> for $producttype in $basictype/ProductTypes/ProductType >> for $salesitem in $producttype/SalesItems/SalesItem >> ...do some stuff >> } >> >> >> >> Robby Pelssers >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > > > -- > Adam Retter > > skype: adam.retter > tweet: adamretter > http://www.adamretter.org.uk > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From Robby.Pelssers at nxp.com Mon Aug 13 01:42:44 2012 From: Robby.Pelssers at nxp.com (Robby Pelssers) Date: Mon, 13 Aug 2012 10:42:44 +0200 Subject: [xquery-talk] how to optimaly denormalize 1-to-many relationships with XQuery In-Reply-To: <3D449B01-B2B4-4BCC-A4C6-30576ADD0478@calldei.com> References: <927C66C0775CCA43B88EB1E3006614B318147F3E@eu1rdcrdc1wx032.exi.nxp.com>, <3D449B01-B2B4-4BCC-A4C6-30576ADD0478@calldei.com> Message-ID: <927C66C0775CCA43B88EB1E3006614B3181482E7@eu1rdcrdc1wx032.exi.nxp.com> In fact that query returns results under 1 second over a collection of 20k documents. The documents can be 50k - 100k in size but the data I need to extract is not deeply nested in the document hierarchy. So performance is not (yet) a real focus point but it was more of a 'Can I improve on this or learn a new trick' question ;-) But as a side note: Do you have any insight in how expensive child, parent, ancestor and descendant operations are? Should one avoid those if possible? Robby -----Original Message----- From: David Lee [mailto:dlee at calldei.com] Sent: Sunday, August 12, 2012 9:23 PM To: Adam Retter Cc: Robby Pelssers; talk at x-query.com Subject: Re: [xquery-talk] how to optimaly denormalize 1-to-many relationships with XQuery I wouldn't necessarily be worried about iteration efficiency until you try it. Often iteration Is cheep compared to element creation. It all depends on the processor , data, and other issues. Remember "iteration" doesn't necessarily imply temporal literation, unlike in procedural languages. Sent from my iPad (excuse the terseness) David A Lee dlee at calldei.com On Aug 12, 2012, at 7:02 AM, "Adam Retter" wrote: > I dont think you can do this in one pass. However, depending on the > implementation its impossible to know how many passed the processor > will actually make over the source to fulfil the query. > > However, if we were to assume each FLWOR expression is a pass over the > source data, then I think the following implementation could be more > efficient. It really depends on how the implementation handles > descendant-or-self and ancestor selection. > > > let $basicTypes := /BasicType > > > { > $basicTypes > } > > > { > for $productType in $basicTypes//ProductType return > > { > $productType/*, > > } > > } > > > { > for $salesItem $basicTypes//SalesItem return > > { > $salesItem/*, > > } > > } > > > > > > On 10 August 2012 15:32, Robby Pelssers wrote: >> Hi all, >> >> Suppose I have a collection of XML documents looking like this: >> >> Basictype has 1 to many Product types. >> Producttype has 1 to many Sales items. >> >> Example snippet: >> --------------------------------- >> >> End of life >> ... >> >> >> Deprecated >> ... >> >> >> abcde >> >> >> >> >> >> >> Now I want to generate some data looking like this: >> >> >> >> >> End of life >> >> ... >> >> >> >> Deprecated >> >> >> ... >> >> >> >> abcde >> >> >> ... >> >> >> >> ------------- >> I have written a query which returns just this but it iterates >> - three times over the basictypes >> - 2 times over the producttypes >> - 1 time over the salesitems >> >> Is there a better way to get this accomplished in 1 iteration? >> >> >> Pseudo-code: >> >> let $basictypes := collection("basictypes") >> return >> >> >> { >> for $basictype in $basictypes >> ...do some stuff >> >> } >> >> >> { >> for $basictype in $basictypes >> for $producttype in $basictype/ProductTypes/ProductType >> ...do some stuff >> } >> >> >> { >> for $basictype in $basictypes >> for $producttype in $basictype/ProductTypes/ProductType >> for $salesitem in $producttype/SalesItems/SalesItem >> ...do some stuff >> } >> >> >> >> Robby Pelssers >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > > > > -- > Adam Retter > > skype: adam.retter > tweet: adamretter > http://www.adamretter.org.uk > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From mike at saxonica.com Mon Aug 13 02:04:48 2012 From: mike at saxonica.com (Michael Kay) Date: Mon, 13 Aug 2012 10:04:48 +0100 Subject: [xquery-talk] how to optimaly denormalize 1-to-many relationships with XQuery In-Reply-To: <927C66C0775CCA43B88EB1E3006614B3181482E7@eu1rdcrdc1wx032.exi.nxp.com> References: <927C66C0775CCA43B88EB1E3006614B318147F3E@eu1rdcrdc1wx032.exi.nxp.com>, <3D449B01-B2B4-4BCC-A4C6-30576ADD0478@calldei.com> <927C66C0775CCA43B88EB1E3006614B3181482E7@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: <5028C330.70907@saxonica.com> >But as a side note: Do you have any insight in how expensive child, parent, ancestor and descendant operations are? Should one avoid those if possible? This kind of thing is going to vary enormously depending on the implementation (not just the product you are using, but perhaps also on variables such as whether the input is provided in DOM form or in some other form). Michael Kay Saxonica From andrew.j.welch at gmail.com Mon Aug 13 04:47:44 2012 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Mon, 13 Aug 2012 12:47:44 +0100 Subject: [xquery-talk] strange results sequence operators In-Reply-To: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: > I might be misunderstanding how the is-same-node() works but executing below > xquery gives me results which I find hard to reason about. ... > Returns following output (at least on Sedna): It must be a Sedna issue... check it with Saxon. -- Andrew Welch http://andrewjwelch.com From Robby.Pelssers at nxp.com Mon Aug 13 04:55:26 2012 From: Robby.Pelssers at nxp.com (Robby Pelssers) Date: Mon, 13 Aug 2012 13:55:26 +0200 Subject: [xquery-talk] strange results sequence operators In-Reply-To: References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: <927C66C0775CCA43B88EB1E3006614B3181C5EEB@eu1rdcrdc1wx032.exi.nxp.com> I already did but thx for confirming my suspicion! http://sourceforge.net/mailarchive/message.php?msg_id=29669334 Robby -----Original Message----- From: Andrew Welch [mailto:andrew.j.welch at gmail.com] Sent: Monday, August 13, 2012 1:48 PM To: Robby Pelssers Cc: talk at x-query.com Subject: Re: [xquery-talk] strange results sequence operators > I might be misunderstanding how the is-same-node() works but executing below > xquery gives me results which I find hard to reason about. ... > Returns following output (at least on Sedna): It must be a Sedna issue... check it with Saxon. -- Andrew Welch http://andrewjwelch.com From dlee at calldei.com Mon Aug 13 06:04:51 2012 From: dlee at calldei.com (David Lee) Date: Mon, 13 Aug 2012 13:04:51 +0000 Subject: [xquery-talk] how to optimaly denormalize 1-to-many relationships with XQuery In-Reply-To: <927C66C0775CCA43B88EB1E3006614B3181482E7@eu1rdcrdc1wx032.exi.nxp.com> References: <927C66C0775CCA43B88EB1E3006614B318147F3E@eu1rdcrdc1wx032.exi.nxp.com>, <3D449B01-B2B4-4BCC-A4C6-30576ADD0478@calldei.com> <927C66C0775CCA43B88EB1E3006614B3181482E7@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: <220256FDE771B74FB662165BC562CF5941183FBA@CH1PRD0811MB418.namprd08.prod.outlook.com> > But as a side note: Do you have any insight in how expensive child, parent, > ancestor and descendant operations are? Should one avoid those if possible? What you ask is really entirely processor and system configuration dependent. I suggest asking on a mailing list specific to that processor/vendor. (who knows I might see you on that list too !) ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org > -----Original Message----- > From: Robby Pelssers [mailto:Robby.Pelssers at nxp.com] > Sent: Monday, August 13, 2012 4:43 AM > To: David Lee; Adam Retter > Cc: talk at x-query.com > Subject: RE: [xquery-talk] how to optimaly denormalize 1-to-many > relationships with XQuery > > In fact that query returns results under 1 second over a collection of 20k > documents. The documents can be 50k - 100k in size but the data I need to > extract is not deeply nested in the document hierarchy. > > So performance is not (yet) a real focus point but it was more of a 'Can I > improve on this or learn a new trick' question ;-) > > But as a side note: Do you have any insight in how expensive child, parent, > ancestor and descendant operations are? Should one avoid those if possible? > > Robby > > -----Original Message----- > From: David Lee [mailto:dlee at calldei.com] > Sent: Sunday, August 12, 2012 9:23 PM > To: Adam Retter > Cc: Robby Pelssers; talk at x-query.com > Subject: Re: [xquery-talk] how to optimaly denormalize 1-to-many > relationships with XQuery > > I wouldn't necessarily be worried about iteration efficiency until you try it. > Often iteration Is cheep compared to element creation. It all depends on the > processor , data, and other issues. > Remember "iteration" doesn't necessarily imply temporal literation, unlike in > procedural languages. > > > Sent from my iPad (excuse the terseness) > David A Lee > dlee at calldei.com > > > On Aug 12, 2012, at 7:02 AM, "Adam Retter" > wrote: > > > I dont think you can do this in one pass. However, depending on the > > implementation its impossible to know how many passed the processor > > will actually make over the source to fulfil the query. > > > > However, if we were to assume each FLWOR expression is a pass over the > > source data, then I think the following implementation could be more > > efficient. It really depends on how the implementation handles > > descendant-or-self and ancestor selection. > > > > > > let $basicTypes := /BasicType > > > > > > { > > $basicTypes > > } > > > > > > { > > for $productType in $basicTypes//ProductType return > > > > { > > $productType/*, > > > > } > > > > } > > > > > > { > > for $salesItem $basicTypes//SalesItem return > > > > { > > $salesItem/*, > > > > } > > > > } > > > > > > > > > > > > On 10 August 2012 15:32, Robby Pelssers wrote: > >> Hi all, > >> > >> Suppose I have a collection of XML documents looking like this: > >> > >> Basictype has 1 to many Product types. > >> Producttype has 1 to many Sales items. > >> > >> Example snippet: > >> --------------------------------- > >> > >> End of life > >> ... > >> > >> > >> Deprecated > >> ... > >> > >> > >> abcde > >> > >> > >> > >> > >> > >> > >> Now I want to generate some data looking like this: > >> > >> > >> > >> > >> End of life > >> > >> ... > >> > >> > >> > >> Deprecated > >> > >> > >> ... > >> > >> > >> > >> abcde > >> > >> > >> ... > >> > >> > >> > >> ------------- > >> I have written a query which returns just this but it iterates > >> - three times over the basictypes > >> - 2 times over the producttypes > >> - 1 time over the salesitems > >> > >> Is there a better way to get this accomplished in 1 iteration? > >> > >> > >> Pseudo-code: > >> > >> let $basictypes := collection("basictypes") > >> return > >> > >> > >> { > >> for $basictype in $basictypes > >> ...do some stuff > >> > >> } > >> > >> > >> { > >> for $basictype in $basictypes > >> for $producttype in $basictype/ProductTypes/ProductType > >> ...do some stuff > >> } > >> > >> > >> { > >> for $basictype in $basictypes > >> for $producttype in $basictype/ProductTypes/ProductType > >> for $salesitem in $producttype/SalesItems/SalesItem > >> ...do some stuff > >> } > >> > >> > >> > >> Robby Pelssers > >> > >> > >> _______________________________________________ > >> talk at x-query.com > >> http://x-query.com/mailman/listinfo/talk > > > > > > > > -- > > Adam Retter > > > > skype: adam.retter > > tweet: adamretter > > http://www.adamretter.org.uk > > _______________________________________________ > > talk at x-query.com > > http://x-query.com/mailman/listinfo/talk > > > From lists at fgeorges.org Mon Aug 13 06:08:31 2012 From: lists at fgeorges.org (Florent Georges) Date: Mon, 13 Aug 2012 14:08:31 +0100 (BST) Subject: [xquery-talk] strange results sequence operators In-Reply-To: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> Robby Pelssers wrote: ? Hi, >??? let $number1 := 1 >??? let $number2 := 2 >??? let $number3 := 3 >??? let $seq1 :=? ($number1, $number2) >??? let $seq2 := ($number2, $number3) >??? return >????? >??????? {$seq1 union $seq2} >??????? {$seq1 intersect $seq2} >??????? {$seq1 except $seq2} >????? ? Those operators return results in document order, and they come from different documents, so it's undefined.? You should rather try something like the following (not tested): ??? let $doc := ????????? ???????????? 1 ???????????? 2 ???????????? 3 ????????? ??? let $number1 := $doc/number[1] ??? let $number2 := $doc/number[2] ??? let $number3 := $doc/number[3] ??? let $seq1 :=? ($number1, $number2) ??? let $seq2 := ($number2, $number3) ??? return ????? ??????? {$seq1 union $seq2} ??????? {$seq1 intersect $seq2} ??????? {$seq1 except $seq2} ????? ? Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ From andrew.j.welch at gmail.com Mon Aug 13 06:43:27 2012 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Mon, 13 Aug 2012 14:43:27 +0100 Subject: [xquery-talk] strange results sequence operators In-Reply-To: <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> Message-ID: > Those operators return results in document order, and they come > from different documents, so it's undefined. Good point (the elements without a common parent arent siblings gotcha), but I'm not sure that applies here... for example: let $number1 := 1 let $number2 := 2 let $number3 := 3 let $seq1 := ($number1, $number2) let $seq2 := ($number2, $number3) return $seq1 except $seq2 That always has to return 1... both sequences refer to same $number2 even it exists in different documents to 1 and 3. What am I missing? -- Andrew Welch http://andrewjwelch.com From dlee at calldei.com Mon Aug 13 06:55:37 2012 From: dlee at calldei.com (David Lee) Date: Mon, 13 Aug 2012 13:55:37 +0000 Subject: [xquery-talk] strange results sequence operators In-Reply-To: References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> Message-ID: <220256FDE771B74FB662165BC562CF594118409C@CH1PRD0811MB418.namprd08.prod.outlook.com> I have lost track here of what is "wrong". Your example below should always return 1 (to my understanding of XQuery). The identity of constructed elements is maintained so equality is guaranteed, but not ordering. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org > -----Original Message----- > From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On > Behalf Of Andrew Welch > Sent: Monday, August 13, 2012 9:43 AM > To: Florent Georges > Cc: talk at x-query.com; Robby Pelssers > Subject: Re: [xquery-talk] strange results sequence operators > > > Those operators return results in document order, and they come > > from different documents, so it's undefined. > > Good point (the elements without a common parent arent siblings > gotcha), but I'm not sure that applies here... for example: > > let $number1 := 1 > let $number2 := 2 > let $number3 := 3 > let $seq1 := ($number1, $number2) > let $seq2 := ($number2, $number3) > > return $seq1 except $seq2 > > That always has to return 1... both sequences refer > to same $number2 even it exists in different documents to 1 and 3. > What am I missing? > > > -- > Andrew Welch > http://andrewjwelch.com > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From mike at saxonica.com Mon Aug 13 07:01:20 2012 From: mike at saxonica.com (Michael Kay) Date: Mon, 13 Aug 2012 15:01:20 +0100 Subject: [xquery-talk] strange results sequence operators In-Reply-To: <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> Message-ID: <502908B0.8000206@saxonica.com> On 13/08/2012 14:08, Florent Georges wrote: > Robby Pelssers wrote: > > Hi, > >> let $number1 := 1 >> let $number2 := 2 >> let $number3 := 3 >> let $seq1 := ($number1, $number2) >> let $seq2 := ($number2, $number3) >> return >> >> {$seq1 union $seq2} >> {$seq1 intersect $seq2} >> {$seq1 except $seq2} >> > Those operators return results in document order, and they come > from different documents, so it's undefined. I think the ordering of the items in the result is undefined for this reason, but apart from that the results are well defined by the spec and should be the "expected results" given. Michael Kay Saxonica From lists at fgeorges.org Mon Aug 13 07:22:37 2012 From: lists at fgeorges.org (Florent Georges) Date: Mon, 13 Aug 2012 15:22:37 +0100 (BST) Subject: [xquery-talk] strange results sequence operators In-Reply-To: <502908B0.8000206@saxonica.com> References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> <502908B0.8000206@saxonica.com> Message-ID: <1344867757.42555.YahooMailNeo@web28906.mail.ir2.yahoo.com> Michael Kay wrote: > I think the ordering of the items in the result is undefined for > this reason, but apart from that the results are well defined by > the spec and should be the "expected results" given. ? Oops, I thought the OP talked about the difference in ordering between the actual and expected result, but it seems I did not look close enough at the problem. ? My bad, sorry for the noise.? Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ From Robby.Pelssers at nxp.com Mon Aug 13 07:31:02 2012 From: Robby.Pelssers at nxp.com (Robby Pelssers) Date: Mon, 13 Aug 2012 16:31:02 +0200 Subject: [xquery-talk] strange results sequence operators In-Reply-To: <1344867757.42555.YahooMailNeo@web28906.mail.ir2.yahoo.com> References: <927C66C0775CCA43B88EB1E3006614B3181C5EA3@eu1rdcrdc1wx032.exi.nxp.com> <1344863311.50781.YahooMailNeo@web28904.mail.ir2.yahoo.com> <502908B0.8000206@saxonica.com> <1344867757.42555.YahooMailNeo@web28906.mail.ir2.yahoo.com> Message-ID: <927C66C0775CCA43B88EB1E3006614B3181C614D@eu1rdcrdc1wx032.exi.nxp.com> @Michael: sorry.. I'm used to hitting the reply button. So I may conclude that it should return the expected tags as output, ignoring the order. I have to agree that my example was not a really accurate use case anyway but I just wanted to write a little blog about usage of these sequence operators and the output I got was not really helpful ;-) I was using it a bit more exotic (even Sedna specific) and that function does give expected output. Still the issue has been addressed on Sedna mailing list. declare function basictypes:filterBySet($basictypes as element(Product)*, $set as xs:string*) as element(Product)* { $basictypes intersect (for $id in $set return index-scan('basictype_id', $id, 'EQ')) }; Robby -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Florent Georges Sent: Monday, August 13, 2012 4:23 PM To: Michael Kay; talk at x-query.com Subject: Re: [xquery-talk] strange results sequence operators Michael Kay wrote: > I think the ordering of the items in the result is undefined for > this reason, but apart from that the results are well defined by > the spec and should be the "expected results" given. ? Oops, I thought the OP talked about the difference in ordering between the actual and expected result, but it seems I did not look close enough at the problem. ? My bad, sorry for the noise.? Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From stadler at weber-gesamtausgabe.de Wed Aug 15 03:07:34 2012 From: stadler at weber-gesamtausgabe.de (Peter Stadler) Date: Wed, 15 Aug 2012 12:07:34 +0200 Subject: [xquery-talk] UML diagrams from XQuery Message-ID: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> Dear all, does anybody know of any piece of software that produces UML diagrams from XQuery (or something similar)? I'm loosing track of all my XQuery functions in various modules and would like to view the inter-dependencies. Many thanks for your help Peter -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de From wcandillon at gmail.com Wed Aug 15 13:37:30 2012 From: wcandillon at gmail.com (William Candillon) Date: Wed, 15 Aug 2012 13:37:30 -0700 Subject: [xquery-talk] UML diagrams from XQuery In-Reply-To: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> References: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> Message-ID: Hello, Zorba provides an xqdoc module that would help you to keep track of such information. The module documentation is available at http://www.zorba-xquery.com/html/modules/zorba/xqdoc/xqdoc You can try it live at http://www.zorba-xquery.com/html/demo#xPrUoyGhuz1Ut57qOvuBCrcV1f0= If your xquery modules are available via HTTP you can directly perform analysis of your modules from the sandbox, without installing zorba. Best, William On Wed, Aug 15, 2012 at 3:07 AM, Peter Stadler wrote: > Dear all, > > does anybody know of any piece of software that produces UML diagrams from XQuery (or something similar)? > I'm loosing track of all my XQuery functions in various modules and would like to view the inter-dependencies. > > Many thanks for your help > Peter > > -- > Peter Stadler > Carl-Maria-von-Weber-Gesamtausgabe > Arbeitsstelle Detmold > Gartenstr. 20 > D-32756 Detmold > Tel. +49 5231 975-665 > Fax: +49 5231 975-668 > stadler at weber-gesamtausgabe.de > www.weber-gesamtausgabe.de > > > > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From kennorth at sbcglobal.net Wed Aug 15 22:21:01 2012 From: kennorth at sbcglobal.net (Ken North) Date: Wed, 15 Aug 2012 22:21:01 -0700 (PDT) Subject: [xquery-talk] UML diagrams from XQuery In-Reply-To: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> References: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> Message-ID: <1345094461.62806.YahooMailRC@web181305.mail.ne1.yahoo.com> Dave Carlson of XMLmodeling.com has a hyperModel tool that can generate XML schema from UML, import schemas into UML and so on. Contact him directly for an update about support for XQuery. dcarlson at xmlmodeling.com Ken North ________________ Twitter: @knorth2 ----- Original Message ---- > From: Peter Stadler > To: talk at x-query.com > Sent: Wed, August 15, 2012 3:43:01 AM > Subject: [xquery-talk] UML diagrams from XQuery > > Dear all, > > does anybody know of any piece of software that produces UML diagrams from >XQuery (or something similar)? > I'm loosing track of all my XQuery functions in various modules and would like >to view the inter-dependencies. > > Many thanks for your help > Peter > > -- > Peter Stadler > Carl-Maria-von-Weber-Gesamtausgabe > Arbeitsstelle Detmold > Gartenstr. 20 > D-32756 Detmold > Tel. +49 5231 975-665 > Fax: +49 5231 975-668 > stadler at weber-gesamtausgabe.de > www.weber-gesamtausgabe.de > > > > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > From stadler at weber-gesamtausgabe.de Thu Aug 16 06:36:39 2012 From: stadler at weber-gesamtausgabe.de (Peter Stadler) Date: Thu, 16 Aug 2012 15:36:39 +0200 Subject: [xquery-talk] UML diagrams from XQuery In-Reply-To: References: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> Message-ID: Many thanks for your answers. Meanwhile I had a look at xqdoc and it seems to contain all the necessary data (derived from the corresponding xquery modules) -- but still no visualization?! Best Peter Am 15.08.2012 um 22:37 schrieb William Candillon: > Hello, > > Zorba provides an xqdoc module that would help you to keep track of > such information. > The module documentation is available at > http://www.zorba-xquery.com/html/modules/zorba/xqdoc/xqdoc > > You can try it live at > http://www.zorba-xquery.com/html/demo#xPrUoyGhuz1Ut57qOvuBCrcV1f0= > If your xquery modules are available via HTTP you can directly perform > analysis of your modules from the sandbox, without installing zorba. > > Best, > > William > > On Wed, Aug 15, 2012 at 3:07 AM, Peter Stadler > wrote: >> Dear all, >> >> does anybody know of any piece of software that produces UML diagrams from XQuery (or something similar)? >> I'm loosing track of all my XQuery functions in various modules and would like to view the inter-dependencies. >> >> Many thanks for your help >> Peter >> -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de From joewiz at gmail.com Thu Aug 16 06:42:11 2012 From: joewiz at gmail.com (Joe Wicentowski) Date: Thu, 16 Aug 2012 09:42:11 -0400 Subject: [xquery-talk] UML diagrams from XQuery In-Reply-To: References: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> Message-ID: Hi Peter, Chris Wallace has worked on a module to generate graphviz-based visualizations of dependencies in XQuery modules. He hasn't published the code anywhere, but I have seen it, and it's quite impressive. I forwarded your note to him, and suggested that he get in touch with you if he's interested in sharing the code more broadly. Cheers, Joe On Thu, Aug 16, 2012 at 9:36 AM, Peter Stadler wrote: > Many thanks for your answers. > Meanwhile I had a look at xqdoc and it seems to contain all the necessary data (derived from the corresponding xquery modules) -- but still no visualization?! > > Best > Peter > > Am 15.08.2012 um 22:37 schrieb William Candillon: > >> Hello, >> >> Zorba provides an xqdoc module that would help you to keep track of >> such information. >> The module documentation is available at >> http://www.zorba-xquery.com/html/modules/zorba/xqdoc/xqdoc >> >> You can try it live at >> http://www.zorba-xquery.com/html/demo#xPrUoyGhuz1Ut57qOvuBCrcV1f0= >> If your xquery modules are available via HTTP you can directly perform >> analysis of your modules from the sandbox, without installing zorba. >> >> Best, >> >> William >> >> On Wed, Aug 15, 2012 at 3:07 AM, Peter Stadler >> wrote: >>> Dear all, >>> >>> does anybody know of any piece of software that produces UML diagrams from XQuery (or something similar)? >>> I'm loosing track of all my XQuery functions in various modules and would like to view the inter-dependencies. >>> >>> Many thanks for your help >>> Peter >>> > > -- > Peter Stadler > Carl-Maria-von-Weber-Gesamtausgabe > Arbeitsstelle Detmold > Gartenstr. 20 > D-32756 Detmold > Tel. +49 5231 975-665 > Fax: +49 5231 975-668 > stadler at weber-gesamtausgabe.de > www.weber-gesamtausgabe.de > > > > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From dlee at calldei.com Thu Aug 16 06:43:39 2012 From: dlee at calldei.com (David Lee) Date: Thu, 16 Aug 2012 13:43:39 +0000 Subject: [xquery-talk] UML diagrams from XQuery In-Reply-To: References: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> Message-ID: <220256FDE771B74FB662165BC562CF5941186976@CH1PRD0811MB418.namprd08.prod.outlook.com> I would love to take a look at that tool also ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Joe Wicentowski Sent: Thursday, August 16, 2012 9:42 AM To: Peter Stadler Cc: talk at x-query.com; William Candillon Subject: Re: [xquery-talk] UML diagrams from XQuery Hi Peter, Chris Wallace has worked on a module to generate graphviz-based visualizations of dependencies in XQuery modules. He hasn't published the code anywhere, but I have seen it, and it's quite impressive. I forwarded your note to him, and suggested that he get in touch with you if he's interested in sharing the code more broadly. Cheers, Joe On Thu, Aug 16, 2012 at 9:36 AM, Peter Stadler wrote: > Many thanks for your answers. > Meanwhile I had a look at xqdoc and it seems to contain all the necessary data (derived from the corresponding xquery modules) -- but still no visualization?! > > Best > Peter > > Am 15.08.2012 um 22:37 schrieb William Candillon: > >> Hello, >> >> Zorba provides an xqdoc module that would help you to keep track of >> such information. >> The module documentation is available at >> http://www.zorba-xquery.com/html/modules/zorba/xqdoc/xqdoc >> >> You can try it live at >> http://www.zorba-xquery.com/html/demo#xPrUoyGhuz1Ut57qOvuBCrcV1f0= >> If your xquery modules are available via HTTP you can directly perform >> analysis of your modules from the sandbox, without installing zorba. >> >> Best, >> >> William >> >> On Wed, Aug 15, 2012 at 3:07 AM, Peter Stadler >> wrote: >>> Dear all, >>> >>> does anybody know of any piece of software that produces UML diagrams from XQuery (or something similar)? >>> I'm loosing track of all my XQuery functions in various modules and would like to view the inter-dependencies. >>> >>> Many thanks for your help >>> Peter >>> > > -- > Peter Stadler > Carl-Maria-von-Weber-Gesamtausgabe > Arbeitsstelle Detmold > Gartenstr. 20 > D-32756 Detmold > Tel. +49 5231 975-665 > Fax: +49 5231 975-668 > stadler at weber-gesamtausgabe.de > www.weber-gesamtausgabe.de > > > > > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From matthias.brantner at 28msec.com Thu Aug 16 07:50:19 2012 From: matthias.brantner at 28msec.com (Matthias Brantner) Date: Thu, 16 Aug 2012 07:50:19 -0700 Subject: [xquery-talk] UML diagrams from XQuery In-Reply-To: References: <5058D077-8E4D-4602-BD38-292ECDB73A36@weber-gesamtausgabe.de> Message-ID: <3C447DAD-2B09-4288-9EC1-73EBE207F6E0@28msec.com> FYI: Zorba also provides a graphviz-based module to render SVG graphs from a DOT or GXL description. You can find more information about it at http://www.zorba-xquery.com/html/modules/zorba/image/graphviz. Matthias On Aug 16, 2012, at 6:42 AM, Joe Wicentowski wrote: > Hi Peter, > > Chris Wallace has worked on a module to generate graphviz-based > visualizations of dependencies in XQuery modules. He hasn't published > the code anywhere, but I have seen it, and it's quite impressive. I > forwarded your note to him, and suggested that he get in touch with > you if he's interested in sharing the code more broadly. > > Cheers, > Joe > > > On Thu, Aug 16, 2012 at 9:36 AM, Peter Stadler > wrote: >> Many thanks for your answers. >> Meanwhile I had a look at xqdoc and it seems to contain all the necessary data (derived from the corresponding xquery modules) -- but still no visualization?! >> >> Best >> Peter >> >> Am 15.08.2012 um 22:37 schrieb William Candillon: >> >>> Hello, >>> >>> Zorba provides an xqdoc module that would help you to keep track of >>> such information. >>> The module documentation is available at >>> http://www.zorba-xquery.com/html/modules/zorba/xqdoc/xqdoc >>> >>> You can try it live at >>> http://www.zorba-xquery.com/html/demo#xPrUoyGhuz1Ut57qOvuBCrcV1f0= >>> If your xquery modules are available via HTTP you can directly perform >>> analysis of your modules from the sandbox, without installing zorba. >>> >>> Best, >>> >>> William >>> >>> On Wed, Aug 15, 2012 at 3:07 AM, Peter Stadler >>> wrote: >>>> Dear all, >>>> >>>> does anybody know of any piece of software that produces UML diagrams from XQuery (or something similar)? >>>> I'm loosing track of all my XQuery functions in various modules and would like to view the inter-dependencies. >>>> >>>> Many thanks for your help >>>> Peter >>>> >> >> -- >> Peter Stadler >> Carl-Maria-von-Weber-Gesamtausgabe >> Arbeitsstelle Detmold >> Gartenstr. 20 >> D-32756 Detmold >> Tel. +49 5231 975-665 >> Fax: +49 5231 975-668 >> stadler at weber-gesamtausgabe.de >> www.weber-gesamtausgabe.de >> >> >> >> >> >> >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From wcandillon at gmail.com Mon Aug 20 13:15:10 2012 From: wcandillon at gmail.com (William Candillon) Date: Mon, 20 Aug 2012 13:15:10 -0700 Subject: [xquery-talk] [ANN] Zorba "Eros" 2.6: The JSONiq Release Message-ID: Hello Gang, The Zorba development team is pleased to announce the release of Zorba 2.6, codename Eros. For a couple of months, we have been working on a project named JSONiq, which extends the XQuery data model with JSON objects and arrays. The JSONiq specification has now reached a mature state and Zorba 2.6 is shipped with a JSONiq implementation. In other words, Zorba now supports JSON natively. The full announcement is available at http://www.zorba-xquery.com/html/entry/2012/08/20/Eros Best regards, William From wcandillon at gmail.com Tue Aug 21 02:11:02 2012 From: wcandillon at gmail.com (William Candillon) Date: Tue, 21 Aug 2012 02:11:02 -0700 Subject: [xquery-talk] [ANN] XQuery for MongoDB Message-ID: Hello Gang, We just released a MongoDB driver for XQuery. This module leverages the JSONiq extension [1]. We have two goal with this module: - To provide a seamless connector to a scalable storage for XML developers. - To enable MongoDB developers to work with the robustness of productivity of JSONiq for their projects. You can try it live at http://28.io/mongodb The full announcement is available at http://28.io/html/entry/2012/08/17/JSON Kind regards, William [1] http://jsoniq.org/ From Robby.Pelssers at nxp.com Thu Aug 23 04:44:10 2012 From: Robby.Pelssers at nxp.com (Robby Pelssers) Date: Thu, 23 Aug 2012 13:44:10 +0200 Subject: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) Message-ID: <927C66C0775CCA43B88EB1E3006614B3184AC450@eu1rdcrdc1wx032.exi.nxp.com> Hi all, I've setup a small test case and was trying to see the effect of the copy-namespaces instruction. What I am trying to achieve is to have the root tag (in this case rdf:RDF) declare all used namespaces so that the result of the XQuery becomes much smaller for big result sets. Any pointers on how to achieve this? Thx in advance, Robby ******************************************************************* declare namespace convert2rdf = "http://www.nxp.com/convert2rdf"; declare copy-namespaces preserve, inherit; declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; declare namespace skos="http://www.w3.org/2004/02/skos/core#"; declare namespace foaf="http://xmlns.com/foaf/0.1/"; declare namespace nxp="http://purl.org/nxp/schema/v1/"; declare function convert2rdf:basicType($product as element(product)) { {convert2rdf:basicTypeRaw($product)} }; declare function convert2rdf:basicTypeRaw($product as element(product)) { let $btn := data($product/name) return {data($product/description)} {$btn} }; let $product := PH3330L N-channel TrenchMOS logic level FET (: return convert2rdf:basicType($product) :) (: return convert2rdf:basicTypeRaw($product) :) ********************** output from convert2rdf:basicType($product) ************************* N-channel TrenchMOS logic level FET PH3330L ********************** output from convert2rdf:basicTypeRaw($product) ************************* N-channel TrenchMOS logic level FET PH3330L From dlee at calldei.com Thu Aug 23 04:48:59 2012 From: dlee at calldei.com (David Lee) Date: Thu, 23 Aug 2012 11:48:59 +0000 Subject: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) In-Reply-To: <927C66C0775CCA43B88EB1E3006614B3184AC450@eu1rdcrdc1wx032.exi.nxp.com> References: <927C66C0775CCA43B88EB1E3006614B3184AC450@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: <220256FDE771B74FB662165BC562CF5941190B32@CH1PRD0811MB418.namprd08.prod.outlook.com> I suggest a simpler approach is to simply predecease all namespaces on your root node. The serializer then will (should) omit redundant namespace declarations on child nodes. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Robby Pelssers Sent: Thursday, August 23, 2012 7:44 AM To: talk at x-query.com Subject: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) Hi all, I've setup a small test case and was trying to see the effect of the copy-namespaces instruction. What I am trying to achieve is to have the root tag (in this case rdf:RDF) declare all used namespaces so that the result of the XQuery becomes much smaller for big result sets. Any pointers on how to achieve this? Thx in advance, Robby ******************************************************************* declare namespace convert2rdf = "http://www.nxp.com/convert2rdf"; declare copy-namespaces preserve, inherit; declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; declare namespace skos="http://www.w3.org/2004/02/skos/core#"; declare namespace foaf="http://xmlns.com/foaf/0.1/"; declare namespace nxp="http://purl.org/nxp/schema/v1/"; declare function convert2rdf:basicType($product as element(product)) { {convert2rdf:basicTypeRaw($product)} }; declare function convert2rdf:basicTypeRaw($product as element(product)) { let $btn := data($product/name) return {data($product/description)} {$btn} }; let $product := PH3330L N-channel TrenchMOS logic level FET (: return convert2rdf:basicType($product) :) (: return convert2rdf:basicTypeRaw($product) :) ********************** output from convert2rdf:basicType($product) ************************* N-channel TrenchMOS logic level FET PH3330L ********************** output from convert2rdf:basicTypeRaw($product) ************************* N-channel TrenchMOS logic level FET PH3330L _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From Robby.Pelssers at nxp.com Thu Aug 23 05:14:18 2012 From: Robby.Pelssers at nxp.com (Robby Pelssers) Date: Thu, 23 Aug 2012 14:14:18 +0200 Subject: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) In-Reply-To: <220256FDE771B74FB662165BC562CF5941190B32@CH1PRD0811MB418.namprd08.prod.outlook.com> References: <927C66C0775CCA43B88EB1E3006614B3184AC450@eu1rdcrdc1wx032.exi.nxp.com> <220256FDE771B74FB662165BC562CF5941190B32@CH1PRD0811MB418.namprd08.prod.outlook.com> Message-ID: <927C66C0775CCA43B88EB1E3006614B3184AC4B5@eu1rdcrdc1wx032.exi.nxp.com> Yeah.. that's a simple approach that will work (was my first approach actually) but it will give me much more maintenance (and typing). To be honest... this really sounds like a hot feature and it's hard to believe this is not supported. Robby -----Original Message----- From: David Lee [mailto:dlee at calldei.com] Sent: Thursday, August 23, 2012 1:49 PM To: Robby Pelssers; talk at x-query.com Subject: RE: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) I suggest a simpler approach is to simply predecease all namespaces on your root node. The serializer then will (should) omit redundant namespace declarations on child nodes. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Robby Pelssers Sent: Thursday, August 23, 2012 7:44 AM To: talk at x-query.com Subject: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) Hi all, I've setup a small test case and was trying to see the effect of the copy-namespaces instruction. What I am trying to achieve is to have the root tag (in this case rdf:RDF) declare all used namespaces so that the result of the XQuery becomes much smaller for big result sets. Any pointers on how to achieve this? Thx in advance, Robby ******************************************************************* declare namespace convert2rdf = "http://www.nxp.com/convert2rdf"; declare copy-namespaces preserve, inherit; declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; declare namespace skos="http://www.w3.org/2004/02/skos/core#"; declare namespace foaf="http://xmlns.com/foaf/0.1/"; declare namespace nxp="http://purl.org/nxp/schema/v1/"; declare function convert2rdf:basicType($product as element(product)) { {convert2rdf:basicTypeRaw($product)} }; declare function convert2rdf:basicTypeRaw($product as element(product)) { let $btn := data($product/name) return {data($product/description)} {$btn} }; let $product := PH3330L N-channel TrenchMOS logic level FET (: return convert2rdf:basicType($product) :) (: return convert2rdf:basicTypeRaw($product) :) ********************** output from convert2rdf:basicType($product) ************************* N-channel TrenchMOS logic level FET PH3330L ********************** output from convert2rdf:basicTypeRaw($product) ************************* N-channel TrenchMOS logic level FET PH3330L _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From Robby.Pelssers at nxp.com Thu Aug 23 05:39:20 2012 From: Robby.Pelssers at nxp.com (Robby Pelssers) Date: Thu, 23 Aug 2012 14:39:20 +0200 Subject: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) In-Reply-To: <927C66C0775CCA43B88EB1E3006614B3184AC4B5@eu1rdcrdc1wx032.exi.nxp.com> References: <927C66C0775CCA43B88EB1E3006614B3184AC450@eu1rdcrdc1wx032.exi.nxp.com> <220256FDE771B74FB662165BC562CF5941190B32@CH1PRD0811MB418.namprd08.prod.outlook.com> <927C66C0775CCA43B88EB1E3006614B3184AC4B5@eu1rdcrdc1wx032.exi.nxp.com> Message-ID: <927C66C0775CCA43B88EB1E3006614B3184AC508@eu1rdcrdc1wx032.exi.nxp.com> Ok... I found a workable workaround. I created a wrapper function that takes care of the namespaces. Benefit is now that I can change it in one spot. declare namespace basictypes2rdf = "http://www.nxp.com/basictypes2rdf"; declare copy-namespaces preserve, inherit; declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; declare namespace skos="http://www.w3.org/2004/02/skos/core#"; declare namespace foaf="http://xmlns.com/foaf/0.1/"; declare namespace nxp="http://purl.org/nxp/schema/v1/"; declare function basictypes2rdf:basicType($product as element(product)) { basictypes2rdf:wrapRDF(basictypes2rdf:basicTypeRaw($product)) }; declare function basictypes2rdf:wrapRDF($element as element()) as element(rdf:RDF) { {$element} }; declare function basictypes2rdf:basicTypeRaw($product as element(product)) { let $btn := data($product/name) return {data($product/description)} {$btn} }; let $product := PH3330L N-channel TrenchMOS logic level FET return basictypes2rdf:basicType($product) Result: -------- N-channel TrenchMOS logic level FET PH3330L -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Robby Pelssers Sent: Thursday, August 23, 2012 2:14 PM To: talk at x-query.com Subject: Re: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) Yeah.. that's a simple approach that will work (was my first approach actually) but it will give me much more maintenance (and typing). To be honest... this really sounds like a hot feature and it's hard to believe this is not supported. Robby -----Original Message----- From: David Lee [mailto:dlee at calldei.com] Sent: Thursday, August 23, 2012 1:49 PM To: Robby Pelssers; talk at x-query.com Subject: RE: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) I suggest a simpler approach is to simply predecease all namespaces on your root node. The serializer then will (should) omit redundant namespace declarations on child nodes. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Robby Pelssers Sent: Thursday, August 23, 2012 7:44 AM To: talk at x-query.com Subject: [xquery-talk] how to copy namespaces to root tag (to avoid repetition) Hi all, I've setup a small test case and was trying to see the effect of the copy-namespaces instruction. What I am trying to achieve is to have the root tag (in this case rdf:RDF) declare all used namespaces so that the result of the XQuery becomes much smaller for big result sets. Any pointers on how to achieve this? Thx in advance, Robby ******************************************************************* declare namespace convert2rdf = "http://www.nxp.com/convert2rdf"; declare copy-namespaces preserve, inherit; declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; declare namespace skos="http://www.w3.org/2004/02/skos/core#"; declare namespace foaf="http://xmlns.com/foaf/0.1/"; declare namespace nxp="http://purl.org/nxp/schema/v1/"; declare function convert2rdf:basicType($product as element(product)) { {convert2rdf:basicTypeRaw($product)} }; declare function convert2rdf:basicTypeRaw($product as element(product)) { let $btn := data($product/name) return {data($product/description)} {$btn} }; let $product := PH3330L N-channel TrenchMOS logic level FET (: return convert2rdf:basicType($product) :) (: return convert2rdf:basicTypeRaw($product) :) ********************** output from convert2rdf:basicType($product) ************************* N-channel TrenchMOS logic level FET PH3330L ********************** output from convert2rdf:basicTypeRaw($product) ************************* N-channel TrenchMOS logic level FET PH3330L _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk