From ihe.onwuka at gmail.com Wed Apr 2 08:13:52 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Wed, 2 Apr 2014 17:13:52 +0100 Subject: [xquery-talk] Compared to what? Message-ID: Excerpt from the 3.13 of the XQuery 3.0 specification. "In a switch expression, the switch keyword is followed by an expression enclosed in parentheses, called the switch operand expression. This is the expression whose value is being compared." The issue is the last word - compared. XPath has general and value based comparisons and the spec doesn't say what type of comparison is operative for comparisons on the switch operand expression. From mike at saxonica.com Wed Apr 2 08:39:29 2014 From: mike at saxonica.com (Michael Kay) Date: Wed, 2 Apr 2014 17:39:29 +0100 Subject: [xquery-talk] Compared to what? In-Reply-To: References: Message-ID: On 2 Apr 2014, at 17:13, Ihe Onwuka wrote: > Excerpt from the 3.13 of the XQuery 3.0 specification. > > "In a switch expression, the switch keyword is followed by an > expression enclosed in parentheses, called the switch operand > expression. This is the expression whose value is being compared." > > The issue is the last word - compared. > > XPath has general and value based comparisons and the spec doesn't say > what type of comparison is operative for comparisons on the switch > operand expression. > _______________________________________________ Not sure how you missed this, but it says this in great detail: The resulting value is matched against each SwitchCaseOperand in turn until a match is found or the list is exhausted. The matching is performed as follows: ? The SwitchCaseOperand is evaluated. ? The resulting value is atomized. ? If the atomized sequence has length greater than one, a type error is raised [err:XPTY0004]. ? The atomized value of the switch operand expression is compared with the atomized value of the SwitchCaseOperand using the fn:deep-equal function, with the default collation from the static context. Using fn:deep-equal() on two atomic values is almost the same as using "eq", except that you get false rather than an error if the values are of incomparable types, and you get true if you compare NaN to NaN. Michael Kay Saxonica From ihe.onwuka at gmail.com Wed Apr 2 08:51:10 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Wed, 2 Apr 2014 17:51:10 +0100 Subject: [xquery-talk] Compared to what? In-Reply-To: References: Message-ID: indeed.... how did I miss that..I'll tell you.. once I saw that a comparison was involved I was expecting to be declaratively told what type of comparison. Thats what I looked for and didn't see it. I didn't expect to see an algorithm and didn't recognise what it was. On Wed, Apr 2, 2014 at 5:39 PM, Michael Kay wrote: > > On 2 Apr 2014, at 17:13, Ihe Onwuka wrote: > >> Excerpt from the 3.13 of the XQuery 3.0 specification. >> >> "In a switch expression, the switch keyword is followed by an >> expression enclosed in parentheses, called the switch operand >> expression. This is the expression whose value is being compared." >> >> The issue is the last word - compared. >> >> XPath has general and value based comparisons and the spec doesn't say >> what type of comparison is operative for comparisons on the switch >> operand expression. >> _______________________________________________ > > Not sure how you missed this, but it says this in great detail: > > The resulting value is matched against each SwitchCaseOperand in turn until a match is found or the list is exhausted. The matching is performed as follows: > > * The SwitchCaseOperand is evaluated. > * The resulting value is atomized. > * If the atomized sequence has length greater than one, a type error is raised [err:XPTY0004]. > * The atomized value of the switch operand expression is compared with the atomized value of the SwitchCaseOperand using the fn:deep-equal function, with the default collation from the static context. > > Using fn:deep-equal() on two atomic values is almost the same as using "eq", except that you get false rather than an error if the values are of incomparable types, and you get true if you compare NaN to NaN. > > Michael Kay > Saxonica > From dlee at calldei.com Wed Apr 2 09:02:23 2014 From: dlee at calldei.com (David Lee) Date: Wed, 2 Apr 2014 17:02:23 +0000 Subject: [xquery-talk] Compared to what? In-Reply-To: References: Message-ID: <1e655ef1c6344a5583aecd289c502c83@BY2PR08MB014.namprd08.prod.outlook.com> Had to jump in here with a catcall ... "Miss something in a W3C spec ? Why ... the horror !!! or as George Takei (tm) says 'ohh myy' " Tssk tssk ... The effort put into these specs is unequaled except for perhaps the effort to comprehend them in less time then they took to write :) -----Original Message----- From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of Ihe Onwuka Sent: Wednesday, April 02, 2014 12:51 PM To: Michael Kay Cc: talk at x-query.com Subject: Re: [xquery-talk] Compared to what? indeed.... how did I miss that..I'll tell you.. once I saw that a comparison was involved I was expecting to be declaratively told what type of comparison. Thats what I looked for and didn't see it. I didn't expect to see an algorithm and didn't recognise what it was. On Wed, Apr 2, 2014 at 5:39 PM, Michael Kay wrote: > > On 2 Apr 2014, at 17:13, Ihe Onwuka wrote: > >> Excerpt from the 3.13 of the XQuery 3.0 specification. >> >> "In a switch expression, the switch keyword is followed by an >> expression enclosed in parentheses, called the switch operand >> expression. This is the expression whose value is being compared." >> >> The issue is the last word - compared. >> >> XPath has general and value based comparisons and the spec doesn't >> say what type of comparison is operative for comparisons on the >> switch operand expression. >> _______________________________________________ > > Not sure how you missed this, but it says this in great detail: > > The resulting value is matched against each SwitchCaseOperand in turn until a match is found or the list is exhausted. The matching is performed as follows: > > * The SwitchCaseOperand is evaluated. > * The resulting value is atomized. > * If the atomized sequence has length greater than one, a type error is raised [err:XPTY0004]. > * The atomized value of the switch operand expression is compared with the atomized value of the SwitchCaseOperand using the fn:deep-equal function, with the default collation from the static context. > > Using fn:deep-equal() on two atomic values is almost the same as using "eq", except that you get false rather than an error if the values are of incomparable types, and you get true if you compare NaN to NaN. > > Michael Kay > Saxonica > _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Wed Apr 2 09:08:52 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Wed, 2 Apr 2014 18:08:52 +0100 Subject: [xquery-talk] Compared to what? In-Reply-To: <1e655ef1c6344a5583aecd289c502c83@BY2PR08MB014.namprd08.prod.outlook.com> References: <1e655ef1c6344a5583aecd289c502c83@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On Wed, Apr 2, 2014 at 6:02 PM, David Lee wrote: > > The effort put into these specs is unequaled except for perhaps the effort to comprehend them in less time then they took to write :) > ......especially when it is quicker to try out the thing you are trying to verify. From ihe.onwuka at gmail.com Wed Apr 2 09:11:41 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Wed, 2 Apr 2014 18:11:41 +0100 Subject: [xquery-talk] Compared to what? In-Reply-To: <1e655ef1c6344a5583aecd289c502c83@BY2PR08MB014.namprd08.prod.outlook.com> References: <1e655ef1c6344a5583aecd289c502c83@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On Wed, Apr 2, 2014 at 6:02 PM, David Lee wrote: > Had to jump in here with a catcall ... > Does that mean I am now in the dog house? From dlee at calldei.com Wed Apr 2 09:12:09 2014 From: dlee at calldei.com (David Lee) Date: Wed, 2 Apr 2014 17:12:09 +0000 Subject: [xquery-talk] Compared to what? In-Reply-To: References: <1e655ef1c6344a5583aecd289c502c83@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <1de8ee3ca6fa4e5aae584618e611f302@BY2PR08MB014.namprd08.prod.outlook.com> > ......especially when it is quicker to try out the thing you are trying to verify. Thanks to Michael, the unofficial reference implementation (yea I know W3C doesn't do those), is generally much easier to debug then the specs :) ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org From liam at w3.org Wed Apr 2 09:53:21 2014 From: liam at w3.org (Liam R E Quin) Date: Wed, 02 Apr 2014 13:53:21 -0400 Subject: [xquery-talk] Compared to what? In-Reply-To: References: Message-ID: <1396461201.3724.81.camel@localhost.localdomain> On Wed, 2014-04-02 at 17:13 +0100, Ihe Onwuka wrote: > Excerpt from the 3.13 of the XQuery 3.0 specification. > [...] > XPath has general and value based comparisons and the spec doesn't say > what type of comparison is operative for comparisons on the switch > operand expression. A little further down you'll see, 4. The atomized value of the switch operand expression is compared with the atomized value of the SwitchCaseOperand using the fn:deep-equal function, with the default collation from the static context. 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 From ihe.onwuka at gmail.com Mon Apr 7 09:07:21 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 7 Apr 2014 17:07:21 +0100 Subject: [xquery-talk] backticks in regex - tales of the unexpected part II Message-ID: backticks match the \w regex class which does seem at odds with the definition of that class. From ihe.onwuka at gmail.com Mon Apr 7 09:09:57 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 7 Apr 2014 17:09:57 +0100 Subject: [xquery-talk] backticks in regex - tales of the unexpected part II In-Reply-To: References: Message-ID: to put that another way why is a backtick (matches \w) deemed more wordy than a quote which doesn't match \w. On Mon, Apr 7, 2014 at 5:07 PM, Ihe Onwuka wrote: > backticks match the \w regex class which does seem at odds with the > definition of that class. From davidc at nag.co.uk Mon Apr 7 09:21:31 2014 From: davidc at nag.co.uk (David Carlisle) Date: Mon, 07 Apr 2014 17:21:31 +0100 Subject: [xquery-talk] [xsl] Re: backticks in regex - tales of the unexpected part II In-Reply-To: References: Message-ID: <5342D08B.4030502@nag.co.uk> On 07/04/2014 17:09, Ihe Onwuka wrote: > to put that another way why is a backtick (matches \w) deemed more > wordy than a quote which doesn't match \w. You cross posted to the wrong lists really, regex syntax is as defined by schema, not by xsl or xquery, and that defines \w as [#x0000-#x10FFFF]-[\p{P}\p{Z}\p{C}] (all characters except the set of "punctuation", "separator" and "other" characters) By backtick I assume you mean U+0060 [`] which isn't a quotation mark, it's a grave accent and has unicode class Sk so isn't punctuation, separator or other. (Sk is "symbols") David From ihe.onwuka at gmail.com Mon Apr 7 09:36:29 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 7 Apr 2014 17:36:29 +0100 Subject: [xquery-talk] [xsl] Re: backticks in regex - tales of the unexpected part II In-Reply-To: <5342D08B.4030502@nag.co.uk> References: <5342D08B.4030502@nag.co.uk> Message-ID: Just going by the definition of the \w class in MK's XPath 2.0 reference - \w -> a character considered to form part of a word So it's TS if backtick isn't a word character in your vocabulary. Probably neither the first or the last to get caught by that one. On Mon, Apr 7, 2014 at 5:21 PM, David Carlisle wrote: > On 07/04/2014 17:09, Ihe Onwuka wrote: >> >> to put that another way why is a backtick (matches \w) deemed more >> wordy than a quote which doesn't match \w. > > > > You cross posted to the wrong lists really, regex syntax is as defined > by schema, not by xsl or xquery, and that defines \w as > > [#x0000-#x10FFFF]-[\p{P}\p{Z}\p{C}] (all characters except the set of > "punctuation", "separator" and "other" characters) > > > By backtick I assume you mean U+0060 [`] which isn't a quotation mark, > it's a grave accent and has unicode class Sk so isn't punctuation, > separator or other. (Sk is "symbols") > > David > > > --~------------------------------------------------------------------ > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > or e-mail: > --~-- > From davidc at nag.co.uk Mon Apr 7 09:49:52 2014 From: davidc at nag.co.uk (David Carlisle) Date: Mon, 07 Apr 2014 17:49:52 +0100 Subject: [xquery-talk] [xsl] Re: backticks in regex - tales of the unexpected part II In-Reply-To: References: <5342D08B.4030502@nag.co.uk> Message-ID: <5342D730.2030705@nag.co.uk> On 07/04/2014 17:35, Ihe Onwuka wrote: > Just going by the definition of the \w class in MK's XPath 2.0 > reference - \w -> a character considered to form part of a word It isn't (and can't) mean a character that _you_ consider a word, since it's not a user (or even locale) dependent expression. So it has to mean what someone considered (very loosely) to be a "word". Including spacing accents in that list doesn't seem unreasonable. > So it's TS if backtick isn't a word character in your vocabulary. No just that if you are writing vocabulary specific regex you need to use vocabulary specific regex terms. If I'm looking for words in English I tend to use [a-z] even if some people try to sneak accents into cafe or naive :-) David From ihe.onwuka at gmail.com Mon Apr 7 10:04:11 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Mon, 7 Apr 2014 18:04:11 +0100 Subject: [xquery-talk] [xsl] Re: backticks in regex - tales of the unexpected part II In-Reply-To: <5342D730.2030705@nag.co.uk> References: <5342D08B.4030502@nag.co.uk> <5342D730.2030705@nag.co.uk> Message-ID: On Mon, Apr 7, 2014 at 5:49 PM, David Carlisle wrote: > > No just that if you are writing vocabulary specific regex you need to > use vocabulary specific regex terms. If I'm looking for words in English > I tend to use [a-z] even if some people try to sneak accents into cafe > or naive :-) > Well mine is not a regional vocabulary scenario. The backtick appears in a title which is used to create a url which (I believe) will not tolerate such characters. From davidc at nag.co.uk Mon Apr 7 11:32:33 2014 From: davidc at nag.co.uk (David Carlisle) Date: Mon, 07 Apr 2014 19:32:33 +0100 Subject: [xquery-talk] [xsl] Re: backticks in regex - tales of the unexpected part II In-Reply-To: References: <5342D08B.4030502@nag.co.uk> <5342D730.2030705@nag.co.uk> Message-ID: <5342EF41.7060302@nag.co.uk> On 07/04/2014 18:04, Ihe Onwuka wrote: > On Mon, Apr 7, 2014 at 5:49 PM, David Carlisle > wrote: >> >> No just that if you are writing vocabulary specific regex you need >> to use vocabulary specific regex terms. If I'm looking for words >> in English I tend to use [a-z] even if some people try to sneak >> accents into cafe or naive :-) >> > > Well mine is not a regional vocabulary scenario. The backtick > appears in a title which is used to create a url which (I believe) > will not tolerate such characters. well then grave accent is the least of your concerns with \w URI letters are defined as ALPHA (%41-%5A and %61-%7A) ie [a-zA-Z] so doesn't allow accented letters, or Greek or Cyrillic or 10s of thousands of other characters included in \w https://tools.ietf.org/html/rfc3986 Of course most user-facing systems such as html or XML allow a much wider set of characters in href attributes and SYSTEM identifiers and leave it to the system to %-encode according to the somewhat arcane URI rules, cf IRI or LEIRI syntax. David From ihe.onwuka at gmail.com Tue Apr 8 08:23:27 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 16:23:27 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons Message-ID: count(colllection('myColl')//elem tells me how many elems there are in myColl. Fine So now I want to be told how many elems are in myColl and myColl2. Put them in a sequence like so (collection('myColl')//elem,collection('myColl2')//elem) and then apply the count method to each element of the sequence n'est pas? (collection('myColl')//elem,collection('myColl2')//elem)/count(.) 2 collections to give me 2 numbers .C'est domage, Mais non. That only gives me one number - the count of elems in MyColl. C'est fait rien methinks (or perhaps doesn't think). 3.0 map operator to the rescue - let's substitute the / for a !. Sacre bleu I now have a stream of N 1's where N is the number of elems in MyColl............ I have gone back to the more prosaic method of counting each collection with a comma separator to transform the answer to a sequence. From andrew.j.welch at gmail.com Tue Apr 8 08:43:33 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 8 Apr 2014 16:43:33 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: > (collection('myColl')//elem,collection('myColl2')//elem)/count(.) ^^^ that constructs a sequence of s, and then supplies each one to the count() function... so it will just a return a load of 1s. Bonney dee doosh, ala quet de mer, rodders. -- Andrew Welch http://andrewjwelch.com From msokolov at safaribooksonline.com Tue Apr 8 08:46:46 2014 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Tue, 08 Apr 2014 11:46:46 -0400 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: <534419E6.2050601@safaribooksonline.com> On 04/08/2014 11:23 AM, Ihe Onwuka wrote: > count(colllection('myColl')//elem tells me how many elems there are in > myColl. Fine > > So now I want to be told how many elems are in myColl and myColl2. > > Put them in a sequence like so > > (collection('myColl')//elem,collection('myColl2')//elem) and then > apply the count method to each element of the sequence n'est pas? > > (collection('myColl')//elem,collection('myColl2')//elem)/count(.) > > 2 collections to give me 2 numbers .C'est domage, Mais non. That only > gives me one number - the count of elems in MyColl. That should give you the total count of both. You are thinking that you have a sequence of sequences, but you don't since there is no such thing in XPath -- only sequences of items (nodes and atomic values). > > C'est fait rien methinks (or perhaps doesn't think). 3.0 map operator > to the rescue - let's substitute the / for a !. > > Sacre bleu > > I now have a stream of N 1's where N is the number of elems in > MyColl............ > > I have gone back to the more prosaic method of counting each > collection with a comma separator to transform the answer to a > sequence. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From ihe.onwuka at gmail.com Tue Apr 8 08:50:04 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 16:50:04 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: ....but that my dear plonker..... does not return a stream of ones......Oops! On Tue, Apr 8, 2014 at 4:43 PM, Andrew Welch wrote: >> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) > > ^^^ that constructs a sequence of s, and then supplies each one > to the count() function... so it will just a return a load of 1s. > > Bonney dee doosh, ala quet de mer, rodders. > > -- > Andrew Welch > http://andrewjwelch.com From ihe.onwuka at gmail.com Tue Apr 8 08:52:34 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 16:52:34 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: <534419E6.2050601@safaribooksonline.com> References: <534419E6.2050601@safaribooksonline.com> Message-ID: On Tue, Apr 8, 2014 at 4:46 PM, Michael Sokolov wrote: > > On 04/08/2014 11:23 AM, Ihe Onwuka wrote: >> >> count(colllection('myColl')//elem tells me how many elems there are in >> myColl. Fine >> >> So now I want to be told how many elems are in myColl and myColl2. >> >> Put them in a sequence like so >> >> (collection('myColl')//elem,collection('myColl2')//elem) and then >> apply the count method to each element of the sequence n'est pas? >> >> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) >> >> 2 collections to give me 2 numbers .C'est domage, Mais non. That only >> gives me one number - the count of elems in MyColl. > > That should give you the total count of both. You are thinking that you > have a sequence of sequences, but you don't since there is no such thing in > XPath -- only sequences of items (nodes and atomic values). > Indeed.... that tallies with what I got and was why I reached for the map operator. Try first and ask later. That's ok for a a non critical query. From davidc at nag.co.uk Tue Apr 8 08:54:37 2014 From: davidc at nag.co.uk (David Carlisle) Date: Tue, 08 Apr 2014 16:54:37 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: <53441BBD.5090603@nag.co.uk> On 08/04/2014 16:23, Ihe Onwuka wrote: > count(colllection('myColl')//elem tells me how many elems there are in > myColl. Fine > > So now I want to be told how many elems are in myColl and myColl2. > > Put them in a sequence like so > > (collection('myColl')//elem,collection('myColl2')//elem) and then > apply the count method to each element of the sequence n'est pas? > > (collection('myColl')//elem,collection('myColl2')//elem)/count(.) > XPath sequences don't nest ((1,2,3),(4,5,6)) is (1,2,3,4,5,6) so your issue is nothing to do with count() but rather with the sequence you are constructing. for $c in ('myColl','myColl2') return count(collection($c)//elem) From davidc at nag.co.uk Tue Apr 8 08:59:15 2014 From: davidc at nag.co.uk (David Carlisle) Date: Tue, 08 Apr 2014 16:59:15 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: <53441CD3.5000508@nag.co.uk> On 08/04/2014 16:50, Ihe Onwuka wrote: >> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) > ....but that my dear plonker..... does not return a stream of ones......Oops! It should, unless there is a bug somewhere, count() applied to an element node is only ever going to return 1. David From ihe.onwuka at gmail.com Tue Apr 8 09:00:51 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 17:00:51 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: <53441CD3.5000508@nag.co.uk> References: <53441CD3.5000508@nag.co.uk> Message-ID: On Tue, Apr 8, 2014 at 4:59 PM, David Carlisle wrote: > On 08/04/2014 16:50, Ihe Onwuka wrote: > >>> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) > >> ....but that my dear plonker..... does not return a stream of >> ones......Oops! > > > It should, unless there is a bug somewhere, count() applied to an element > node is only ever going to return 1. > The answer I got tallies with what Mike Sokolov said I would get. From ihe.onwuka at gmail.com Tue Apr 8 09:04:32 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 17:04:32 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: <53441BBD.5090603@nag.co.uk> References: <53441BBD.5090603@nag.co.uk> Message-ID: yes, for some reason I strenuously avoid using the for version of Flowr syntax so abandoned my attempt without considering it. So although I like the minimalistic way you formulated the query (sequencing over only the collection string) my curiosity is centred on the challenge of doing it with the just / operator. On Tue, Apr 8, 2014 at 4:54 PM, David Carlisle wrote: > On 08/04/2014 16:23, Ihe Onwuka wrote: >> >> count(colllection('myColl')//elem tells me how many elems there are in >> myColl. Fine >> >> So now I want to be told how many elems are in myColl and myColl2. >> >> Put them in a sequence like so >> >> (collection('myColl')//elem,collection('myColl2')//elem) and then >> apply the count method to each element of the sequence n'est pas? >> >> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) >> > > > > XPath sequences don't nest ((1,2,3),(4,5,6)) is (1,2,3,4,5,6) so your issue > is nothing to do with count() but rather with the sequence you are > constructing. > > for $c in ('myColl','myColl2') return count(collection($c)//elem) > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From andrew.j.welch at gmail.com Tue Apr 8 09:05:45 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 8 Apr 2014 17:05:45 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: Happy to be the plonker if I'm wrong but: ($seq)/count(.) will only ever produce a sequence of 1s (or 0 when $seq is empty)... If you are saying otherwise please provide small complete runnable sample so I recreate it. (and please really do provide an actual sample of runnable code that really does show it) On 8 April 2014 16:50, Ihe Onwuka wrote: > ....but that my dear plonker..... does not return a stream of ones......Oops! > > On Tue, Apr 8, 2014 at 4:43 PM, Andrew Welch wrote: >>> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) >> >> ^^^ that constructs a sequence of s, and then supplies each one >> to the count() function... so it will just a return a load of 1s. >> >> Bonney dee doosh, ala quet de mer, rodders. >> >> -- >> Andrew Welch >> http://andrewjwelch.com -- Andrew Welch http://andrewjwelch.com From davidc at nag.co.uk Tue Apr 8 09:05:59 2014 From: davidc at nag.co.uk (David Carlisle) Date: Tue, 08 Apr 2014 17:05:59 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: <53441CD3.5000508@nag.co.uk> Message-ID: <53441E67.5080304@nag.co.uk> On 08/04/2014 17:00, Ihe Onwuka wrote: > The answer I got tallies with what Mike Sokolov said I would get. which system did you use? count((collection('myColl')//elem,collection('myColl2')//elem)) should be the total (collection('myColl')//elem,collection('myColl2')//elem))/count(.) is a sequence of 1's. as you have a sequence of elem elements (however constructed) followed by /count(.) and count(.) on an element is 1. David From davidc at nag.co.uk Tue Apr 8 09:08:16 2014 From: davidc at nag.co.uk (David Carlisle) Date: Tue, 08 Apr 2014 17:08:16 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: <53441BBD.5090603@nag.co.uk> Message-ID: <53441EF0.7030105@nag.co.uk> On 08/04/2014 17:04, Ihe Onwuka wrote: > yes, for some reason I strenuously avoid using the for version of > Flowr syntax so abandoned my attempt without considering it. well you could use ! instead, I don't have a version 3 to hand but I think it would be ('myColl','myColl2')!count(collection(.)//elem) From ihe.onwuka at gmail.com Tue Apr 8 09:17:50 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 17:17:50 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: I'm not creating a collection as I've already exceeded my allocated time for talking about this. However I can oblige with a slightly edited screen print of query and result. The answer is at the bottom. The eXist people read the list, it was run on their XQuery processor so perhaps they may want to comment. I am finito here. NewNew XQueryOpenSaveCloseRunCheck countM.xq* new-document 1* new-document 2 1 2 3 xquery version "3.0"; (collection('/db/apps/spark/data/rtUnmatched')//thing,collection('/db/apps/spark/data/rtID')//thing)/count(.) /db/apps/spark/programs/countMovies.xq Outline Live Preview Showing results 1 to 1 of 1 87567 On Tue, Apr 8, 2014 at 5:05 PM, Andrew Welch wrote: > Happy to be the plonker if I'm wrong but: > > ($seq)/count(.) > > will only ever produce a sequence of 1s (or 0 when $seq is empty)... > > If you are saying otherwise please provide small complete runnable > sample so I recreate it. (and please really do provide an actual > sample of runnable code that really does show it) > > > > On 8 April 2014 16:50, Ihe Onwuka wrote: >> ....but that my dear plonker..... does not return a stream of ones......Oops! >> >> On Tue, Apr 8, 2014 at 4:43 PM, Andrew Welch wrote: >>>> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) >>> >>> ^^^ that constructs a sequence of s, and then supplies each one >>> to the count() function... so it will just a return a load of 1s. >>> >>> Bonney dee doosh, ala quet de mer, rodders. >>> >>> -- >>> Andrew Welch >>> http://andrewjwelch.com > > > > -- > Andrew Welch > http://andrewjwelch.com From andrew.j.welch at gmail.com Tue Apr 8 09:29:14 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 8 Apr 2014 17:29:14 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: <53441EF0.7030105@nag.co.uk> References: <53441BBD.5090603@nag.co.uk> <53441EF0.7030105@nag.co.uk> Message-ID: On 8 April 2014 17:08, David Carlisle wrote: > On 08/04/2014 17:04, Ihe Onwuka wrote: >> >> yes, for some reason I strenuously avoid using the for version of >> Flowr syntax so abandoned my attempt without considering it. > > > > well you could use ! instead, I don't have a version 3 to hand but I think > it would be > > > ('myColl','myColl2')!count(collection(.)//elem) It's been a while but I think eXist's collection() implementation can take a sequence: count( collection(('myColl', 'myColl2'))//elem ) MarkLogic, Saxon etc all take sequences -- Andrew Welch http://andrewjwelch.com From andrew.j.welch at gmail.com Tue Apr 8 09:32:40 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 8 Apr 2014 17:32:40 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: On 8 April 2014 17:17, Ihe Onwuka wrote: > I'm not creating a collection as I've already exceeded my allocated > time for talking about this. funny that... > I am finito here. A small complete runnable example is something like this: (, (, ))/count(.) If you think about it, the slash operator passes each node on the LHS to the function on the RHS... so it can only ever produce 1 1 1 etc This time next year, Rodders... -- Andrew Welch http://andrewjwelch.com From msokolov at safaribooksonline.com Tue Apr 8 09:38:14 2014 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Tue, 08 Apr 2014 12:38:14 -0400 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: <534425F6.6000900@safaribooksonline.com> Yes, that's true - I stand corrected On 04/08/2014 12:05 PM, Andrew Welch wrote: > Happy to be the plonker if I'm wrong but: > > ($seq)/count(.) > > will only ever produce a sequence of 1s (or 0 when $seq is empty)... > > If you are saying otherwise please provide small complete runnable > sample so I recreate it. (and please really do provide an actual > sample of runnable code that really does show it) > > > > On 8 April 2014 16:50, Ihe Onwuka wrote: >> ....but that my dear plonker..... does not return a stream of ones......Oops! >> >> On Tue, Apr 8, 2014 at 4:43 PM, Andrew Welch wrote: >>>> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) >>> ^^^ that constructs a sequence of s, and then supplies each one >>> to the count() function... so it will just a return a load of 1s. >>> >>> Bonney dee doosh, ala quet de mer, rodders. >>> >>> -- >>> Andrew Welch >>> http://andrewjwelch.com > > From ihe.onwuka at gmail.com Tue Apr 8 09:41:26 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 17:41:26 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: On Tue, Apr 8, 2014 at 5:32 PM, Andrew Welch wrote: > On 8 April 2014 17:17, Ihe Onwuka wrote: >> I'm not creating a collection as I've already exceeded my allocated >> time for talking about this. > > funny that... > It's a non critical query that from the example posted you can see only involved 2 collections, but perhaps you have nothing better to do. > >> I am finito here. > > A small complete runnable example is something like this: > > (, (, ))/count(.) > Sorry you seem to have a deluded sense of self-importance. Since when did I have to comply with your requests? From andrew.j.welch at gmail.com Tue Apr 8 09:43:53 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 8 Apr 2014 17:43:53 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: <53441BBD.5090603@nag.co.uk> <53441EF0.7030105@nag.co.uk> Message-ID: On 8 April 2014 17:29, Andrew Welch wrote: > On 8 April 2014 17:08, David Carlisle wrote: >> On 08/04/2014 17:04, Ihe Onwuka wrote: >>> >>> yes, for some reason I strenuously avoid using the for version of >>> Flowr syntax so abandoned my attempt without considering it. >> >> >> >> well you could use ! instead, I don't have a version 3 to hand but I think >> it would be >> >> >> ('myColl','myColl2')!count(collection(.)//elem) > > It's been a while but I think eXist's collection() implementation can > take a sequence: > > count( collection(('myColl', 'myColl2'))//elem ) > > MarkLogic, Saxon etc all take sequences ^^^ which is of course different to what DC posted... his provides a count of per collection, but the latter does the count across collections. -- Andrew Welch http://andrewjwelch.com From andrew.j.welch at gmail.com Tue Apr 8 10:05:26 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 8 Apr 2014 18:05:26 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: > Sorry you seem to have a deluded sense of self-importance. Since when > did I have to comply with your requests? People will question the "seem to" in that sentence. Is it really necessary to have ask for small complete runnable samples... isn't that common mailing list etiquette these days? -- Andrew Welch http://andrewjwelch.com From mike at saxonica.com Tue Apr 8 10:20:26 2014 From: mike at saxonica.com (Michael Kay) Date: Tue, 8 Apr 2014 18:20:26 +0100 Subject: [xquery-talk] backticks in regex - tales of the unexpected part II In-Reply-To: References: Message-ID: <99D75BEB-C3C5-4A40-9BB5-4FB7DF3F9D4E@saxonica.com> On 7 Apr 2014, at 17:07, Ihe Onwuka wrote: > backticks match the \w regex class which does seem at odds with the > definition of that class. You might call it a backtick, and misuse it as a kind of quotation mark, but its proper Unicode name and intended semantics is "grave accent", and the \w category includes all non-spacing diacriticals. Michael Kay Saxonica From ihe.onwuka at gmail.com Tue Apr 8 10:28:48 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 18:28:48 +0100 Subject: [xquery-talk] backticks in regex - tales of the unexpected part II In-Reply-To: <99D75BEB-C3C5-4A40-9BB5-4FB7DF3F9D4E@saxonica.com> References: <99D75BEB-C3C5-4A40-9BB5-4FB7DF3F9D4E@saxonica.com> Message-ID: it and every other backtick in the dataset I am dealing with is a mistyped quotation mark. Exhibit 1 Aisha`s Song but is supposed to be referring to http://www.imdb.com/title/tt1950067/ On Tue, Apr 8, 2014 at 6:20 PM, Michael Kay wrote: > > On 7 Apr 2014, at 17:07, Ihe Onwuka wrote: > >> backticks match the \w regex class which does seem at odds with the >> definition of that class. > > > You might call it a backtick, and misuse it as a kind of quotation mark, but its proper Unicode name and intended semantics is "grave accent", and the \w category includes all non-spacing diacriticals. > > Michael Kay > Saxonica > From ihe.onwuka at gmail.com Tue Apr 8 10:38:14 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 18:38:14 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: On Tue, Apr 8, 2014 at 6:05 PM, Andrew Welch wrote: >> Sorry you seem to have a deluded sense of self-importance. Since when >> did I have to comply with your requests? > > People will question the "seem to" in that sentence. > > Is it really necessary to have ask for small complete runnable > samples... isn't that common mailing list etiquette these days? > Mailing list etiquette eh. The pasted screen print of the query and the result it gave - was not enough? You want me to do more work to satisfy a curiosity that I no longer have because you still harbour it? DC gave an illuminating answer and I have clarified that my curiosity is in seeing a formulation that used the / or ! operators. Did that part of the conversation pass you by? OTOH your answer and every thing you have contributed since did nothing to point towards the correct formulation of the query for the problem stated. Thats ok, but somehow you find it funny that I don't wish to waste my time talking about that. Funny perhaps but you should not find it strange that I don't wish to carry on engaging. This may sound patronising (where've I heard that before) but you can generally be relied upon to proffer a spectacularly insular perspective to a discussion, so invariably I don't want to stick around responding to everything you want to say. Why do you keep doing it (that's rhetorical hence no question mark). Do you see a mailing list as a venue for venting your machismo? Look there are better ways of getting rid of the excess testosterone. Trust me on that one. From andrew.j.welch at gmail.com Tue Apr 8 11:35:40 2014 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 8 Apr 2014 19:35:40 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: >> Is it really necessary to have ask for small complete runnable >> samples... isn't that common mailing list etiquette these days? >> > > Mailing list etiquette eh. > > The pasted screen print of the query and the result it gave - was not > enough? You want me to do more work to satisfy a curiosity that I no > longer have because you still harbour it? No it's not enough: it's not a small complete runnable sample so people can recreate what you are asserting. You make a statement, people question it, then you never back it up. You try and close the thread down. I've lost count of the threads you've started that have ended like this... > DC gave an illuminating answer and I have clarified that my curiosity > is in seeing a formulation that used the / or ! operators. Did that > part of the conversation pass you by? No - I was talking about how $seq/count(.) will always produce a sequence of 1s (or () as was noted to me offlist) Remember you called me a plonker for saying that? > OTOH your answer and every thing you have contributed since did > nothing to point towards the correct formulation of the query for the > problem stated. Thats ok, but somehow you find it funny that I don't > wish to waste my time talking about that. I find all this nonsense funny. > Funny perhaps but you should not find it strange that I don't wish to > carry on engaging. Stop engaging then. > This may sound patronising (where've I heard that > before) but you can generally be relied upon to proffer a > spectacularly insular perspective to a discussion, so invariably I > don't want to stick around responding to everything you want to say. Don't respond then. > Why do you keep doing it (that's rhetorical hence no question mark). > Do you see a mailing list as a venue for venting your machismo? Look > there are better ways of getting rid of the excess testosterone. Trust > me on that one. Er I'm not sure how to read that one... "getting rid of excess testosterone" sounds like something teenage boys do. That mark twain quote springs to mind, so I really should stop arguing now. -- Andrew Welch http://andrewjwelch.com From ihe.onwuka at gmail.com Tue Apr 8 12:16:31 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 20:16:31 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: On Tue, Apr 8, 2014 at 7:35 PM, Andrew Welch wrote: > >> Why do you keep doing it (that's rhetorical hence no question mark). >> Do you see a mailing list as a venue for venting your machismo? Look >> there are better ways of getting rid of the excess testosterone. Trust >> me on that one. > > Er I'm not sure how to read that one... "getting rid of excess > testosterone" sounds like something teenage boys do. > You obviously didn't learn any other way so you keep trying to spend it here. But you know what. People like you are good. They make a fellow study hard while they at school so that when they finish and enter the workforce they know exactly the type of person not to take s**t from. From ihe.onwuka at gmail.com Tue Apr 8 13:29:24 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 21:29:24 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: On Tue, Apr 8, 2014 at 7:35 PM, Andrew Welch wrote: >>> Is it really necessary to have ask for small complete runnable >>> samples... isn't that common mailing list etiquette these days? >>> >> >> Mailing list etiquette eh. >> >> The pasted screen print of the query and the result it gave - was not >> enough? You want me to do more work to satisfy a curiosity that I no >> longer have because you still harbour it? > > No it's not enough: Nah let's deal with you once and for all. After all you are on repeatedly record as enjoying this sort of stuff. > it's not a small complete runnable sample so > people can recreate what you are asserting. You make a statement, > people question it, then you never back it up. You try and close the > thread down. I've lost count of the threads you've started that have > ended like this... > Thats because you're like one of those kids in the playground that think that everybody has to play the game you want to play by the rules you want to play by and talk about what you want to talk about in the way you want to talk about it (code not words right! because Andrew said so). >> DC gave an illuminating answer and I have clarified that my curiosity >> is in seeing a formulation that used the / or ! operators. Did that >> part of the conversation pass you by? > > No - I was talking about how $seq/count(.) will always produce a > sequence of 1s (or () as was noted to me offlist) Remember you > called me a plonker for saying that? > I returned the compliment. Everybody on our side of the Atlantic knows what rodders is a euphemism for. Mike S and the eXist developers seem to have made the same mistake (which I'll come back to later) - are they plonkers too? > >> This may sound patronising (where've I heard that >> before) but you can generally be relied upon to proffer a >> spectacularly insular perspective to a discussion, so invariably I >> don't want to stick around responding to everything you want to say. > > Don't respond then. > And when you don't get a response you complain that people make statements they don't back up. I almost said it was amazing how you can simultaneously hold both positions in the course of one reply but actually it's not. Look if your primary objective was a professional one then the observation to have made in this thread (which someone else already did) is that there seems to be a buggy XQuery implementation at play here. Because if a stream of ones is the correct response and thats what is returned then what happened to cause that is immediately apparent. You on the other hand harbour the pathetically juvenile viewpoint that the scenario offered an opportunity to come on here and josh d**ks. Why? Maybe you were the puny kid at school who used smarts at other peoples expense instead of fists to build self esteem. That stops working when l you come across a kid who is both bigger and smarter. While we are on the subject of childhoods, you know all those kids who say "My mother told me that if you can't say something nice about someone you shouldn't say anything at all". Well my mother never told me that. Keep bringing it fool. From ihe.onwuka at gmail.com Tue Apr 8 14:18:18 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 22:18:18 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: http://exist.2174344.n4.nabble.com/counting-bug-td4664056.html On Tue, Apr 8, 2014 at 5:17 PM, Ihe Onwuka wrote: > I'm not creating a collection as I've already exceeded my allocated > time for talking about this. However I can oblige with a slightly > edited screen print of query and result. The answer is at the bottom. > The eXist people read the list, it was run on their XQuery processor > so perhaps they may want to comment. > > I am finito here. > > NewNew XQueryOpenSaveCloseRunCheck > > countM.xq* > new-document 1* > new-document 2 > > 1 > 2 > 3 > xquery version "3.0"; > (collection('/db/apps/spark/data/rtUnmatched')//thing,collection('/db/apps/spark/data/rtID')//thing)/count(.) > /db/apps/spark/programs/countMovies.xq > > Outline > > Live Preview > Showing results 1 to 1 of 1 > 87567 > > On Tue, Apr 8, 2014 at 5:05 PM, Andrew Welch wrote: >> Happy to be the plonker if I'm wrong but: >> >> ($seq)/count(.) >> >> will only ever produce a sequence of 1s (or 0 when $seq is empty)... >> >> If you are saying otherwise please provide small complete runnable >> sample so I recreate it. (and please really do provide an actual >> sample of runnable code that really does show it) >> >> >> >> On 8 April 2014 16:50, Ihe Onwuka wrote: >>> ....but that my dear plonker..... does not return a stream of ones......Oops! >>> >>> On Tue, Apr 8, 2014 at 4:43 PM, Andrew Welch wrote: >>>>> (collection('myColl')//elem,collection('myColl2')//elem)/count(.) >>>> >>>> ^^^ that constructs a sequence of s, and then supplies each one >>>> to the count() function... so it will just a return a load of 1s. >>>> >>>> Bonney dee doosh, ala quet de mer, rodders. >>>> >>>> -- >>>> Andrew Welch >>>> http://andrewjwelch.com >> >> >> >> -- >> Andrew Welch >> http://andrewjwelch.com From rpbourret at rpbourret.com Tue Apr 8 15:15:44 2014 From: rpbourret at rpbourret.com (Ronald Bourret) Date: Tue, 08 Apr 2014 15:15:44 -0700 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: <53447510.9080606@rpbourret.com> Ihe, Up until now, your repeated rudeness and demanding attitude on this list has been modestly amusing. This post moves well past amusing and into the patently offensive. Personally, I would suggest that the moderator (if there is one) either remove you from the list or that other members simply not answer your questions. -- Ron On 4/8/2014 1:29 PM, Ihe Onwuka wrote: > You on the other hand harbour the pathetically juvenile viewpoint that > the scenario offered an opportunity to come on here and josh d**ks. > Why? Maybe you were the puny kid at school who used smarts at other > peoples expense instead of fists to build self esteem. That stops > working when l you come across a kid who is both bigger and smarter. > > While we are on the subject of childhoods, you know all those kids who > say "My mother told me that if you can't say something nice about > someone you shouldn't say anything at all". > > Well my mother never told me that. > > Keep bringing it fool. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > > --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com From ihe.onwuka at gmail.com Tue Apr 8 15:24:52 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 8 Apr 2014 23:24:52 +0100 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: <53447510.9080606@rpbourret.com> References: <53447510.9080606@rpbourret.com> Message-ID: Go ahead. I don't give a toss. On Tue, Apr 8, 2014 at 11:15 PM, Ronald Bourret wrote: > Ihe, > > Up until now, your repeated rudeness and demanding attitude on this list has > been modestly amusing. This post moves well past amusing and into the > patently offensive. Personally, I would suggest that the moderator (if there > is one) either remove you from the list or that other members simply not > answer your questions. > > -- Ron > > > On 4/8/2014 1:29 PM, Ihe Onwuka wrote: > >> You on the other hand harbour the pathetically juvenile viewpoint that >> the scenario offered an opportunity to come on here and josh d**ks. >> Why? Maybe you were the puny kid at school who used smarts at other >> peoples expense instead of fists to build self esteem. That stops >> working when l you come across a kid who is both bigger and smarter. >> >> While we are on the subject of childhoods, you know all those kids who >> say "My mother told me that if you can't say something nice about >> someone you shouldn't say anything at all". >> >> Well my mother never told me that. >> >> Keep bringing it fool. >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> >> > > --- > This email is free from viruses and malware because avast! Antivirus > protection is active. > http://www.avast.com > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From liam at w3.org Tue Apr 8 18:06:54 2014 From: liam at w3.org (Liam R E Quin) Date: Tue, 08 Apr 2014 21:06:54 -0400 Subject: [xquery-talk] A walk down Sesame St - counting for simpletons In-Reply-To: References: Message-ID: <1397005614.27973.225.camel@slave.barefootcomputing.com> On Tue, 2014-04-08 at 22:18 +0100, Ihe Onwuka wrote: > http://exist.2174344.n4.nabble.com/counting-bug-td4664056.html I've found it incredibly useful in the past to set things up so I can run tests against more than one implementation - I use Saxon and BaseX the most often. I tried MarkLogic once but I wasn't smart enough to work it :) although years ago I also used Galax and, until a year or so, qizx. Actually I still use qizx/open for some things on www.fromoldbooks.org because it's so fast and I haven't found time to move those queries to basex. 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 Another barefoot programmer. From james.fuller.2007 at gmail.com Thu Apr 10 10:43:46 2014 From: james.fuller.2007 at gmail.com (James Fuller) Date: Thu, 10 Apr 2014 19:43:46 +0200 Subject: [xquery-talk] speaking at MUGL in London, April 29th on REST XQ (RXQ) Message-ID: speaking at MUGL in London, April 29th, I'll be going through RXQ an implementation of REST XQ https://github.com/xquery/rxq I intend to demonstrate a series of applications as well as touching upon the vagaries of implementing enterprise REST api's. Be great to see folks there (details and reserve at the link below). http://www.meetup.com/muglondon/events/176441552/ Jim Fuller -------------- next part -------------- An HTML attachment was scrubbed... URL: From kennorth at sbcglobal.net Thu Apr 10 18:13:46 2014 From: kennorth at sbcglobal.net (Ken North) Date: Thu, 10 Apr 2014 18:13:46 -0700 (PDT) Subject: [xquery-talk] speaking at MUGL in London, April 29th on REST XQ (RXQ) In-Reply-To: References: Message-ID: <1397178826.93151.YahooMailNeo@web181302.mail.ne1.yahoo.com> Will this be recorded on video for playback over the Internet? Ken North ________________ Twitter: @knorth2 kncomputing.com >________________________________ > From: James Fuller >To: xquery-discuss >Sent: Thursday, April 10, 2014 10:43 AM >Subject: [xquery-talk] speaking at MUGL in London,????April 29th on REST XQ (RXQ) > > > >speaking at MUGL in London, April 29th, > > >I'll be going through RXQ an implementation of REST XQ? > > > >? ? ?https://github.com/xquery/rxq > > > >I intend to demonstrate a series of applications as well as touching upon the vagaries of implementing enterprise REST api's. > > >Be great to see folks there (details and reserve at the link below). > > >? ? ?http://www.meetup.com/muglondon/events/176441552/ > > > >Jim Fuller >_______________________________________________ >talk at x-query.com >http://x-query.com/mailman/listinfo/talk > >? From james.fuller.2007 at gmail.com Thu Apr 10 20:50:28 2014 From: james.fuller.2007 at gmail.com (James Fuller) Date: Fri, 11 Apr 2014 05:50:28 +0200 Subject: [xquery-talk] speaking at MUGL in London, April 29th on REST XQ (RXQ) In-Reply-To: <1397178826.93151.YahooMailNeo@web181302.mail.ne1.yahoo.com> References: <1397178826.93151.YahooMailNeo@web181302.mail.ne1.yahoo.com> Message-ID: Hello Ken, We can try to do some video recording. Will see what I can get arranged. thx, J On Fri, Apr 11, 2014 at 3:13 AM, Ken North wrote: > > Will this be recorded on video for playback over the Internet? > > > > > Ken North > ________________ > > > Twitter: @knorth2 > kncomputing.com > > > >________________________________ > > From: James Fuller > >To: xquery-discuss > >Sent: Thursday, April 10, 2014 10:43 AM > >Subject: [xquery-talk] speaking at MUGL in London, April 29th on REST > XQ (RXQ) > > > > > > > >speaking at MUGL in London, April 29th, > > > > > >I'll be going through RXQ an implementation of REST XQ > > > > > > > > https://github.com/xquery/rxq > > > > > > > >I intend to demonstrate a series of applications as well as touching upon > the vagaries of implementing enterprise REST api's. > > > > > >Be great to see folks there (details and reserve at the link below). > > > > > > http://www.meetup.com/muglondon/events/176441552/ > > > > > > > >Jim Fuller > >_______________________________________________ > >talk at x-query.com > >http://x-query.com/mailman/listinfo/talk > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From liam at w3.org Fri Apr 11 12:58:47 2014 From: liam at w3.org (Liam R E Quin) Date: Fri, 11 Apr 2014 15:58:47 -0400 Subject: [xquery-talk] [ANN] Published: XPath 3.0, XQuery 3.0, XQueryX 3.0, XDM 3.0, Serialization 3.0, F&O 3.0, and XQuery 3.0 use Cases, Requirements Message-ID: <1397246327.30419.118.camel@slave.barefootcomputing.com> The XSLT and XQuery Working Groups today published XPath 3.0, XQuery 3.0, XQueryX 3.0, XDM 3.0, Serialization 3.0, F&O 3.0 as W3C Recommendations, and XQuery 3.0 use Cases, Requirements as notes. News items on http://www.w3.org/ and http://www.w3.org/blog/news/archives/3773/ (and I'll be updating the XQuery and XSLT home pages today). Liam -- Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ Pictures from old books: http://fromoldbooks.org/ http://www.holoweb.net/~liam/ The barefoot typographer From sahoo.byomokesh at gmail.com Sat Apr 12 01:55:37 2014 From: sahoo.byomokesh at gmail.com (Byomokesh sahoo) Date: Sat, 12 Apr 2014 08:55:37 +0000 (UTC) Subject: [xquery-talk] Invitation to connect on LinkedIn Message-ID: <1698191416.9611554.1397292937191.JavaMail.app@ela4-app1327.prod> LinkedIn ------------ I'd like to add you to my professional network on LinkedIn. - Byomokesh Byomokesh sahoo engineer India Confirm that you know Byomokesh sahoo: https://www.linkedin.com/e/xnupbm-htwo4yjl-1q/isd/5860671342885486592/o8-tYDD6/?hs=false&tok=3g83VymT-nmmc1 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/xnupbm-htwo4yjl-1q/kDd-YG5BG4ZUACXjkyk-G9jZp24/goo/talk%40x-query%2Ecom/20061/I6876647750_1/?hs=false&tok=0-2qlksiKnmmc1 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bunce.andy at gmail.com Sat Apr 12 14:59:42 2014 From: bunce.andy at gmail.com (Andy Bunce) Date: Sat, 12 Apr 2014 22:59:42 +0100 Subject: [xquery-talk] create a sequence of dates In-Reply-To: References: Message-ID: How about: let $d1 := xs:date("2014-03-02") let $d2 := xs:date("2014-04-21") let $days:=0 to days-from-duration($d2 - $d1) return $days!($d1+ . *xs:dayTimeDuration('P1D')) Cheers /Andy On Sat, Apr 12, 2014 at 9:58 PM, Jakob Fix wrote: > Hi, > > I have a "sparse sequence" of dates that I'd like to pad with the missing > ones. > > So I thought I'd find the min and the max dates, create a sequence from > min to max and then create a union with the existing sequence and get the > distinct values. > > unfortunately, creating a sequence of dates doesn't seem that simple. This: > > let $d1 := xs:date("2014-03-01") > let $d2 := xs:date("2014-03-31") > return ($d1 to $d2) > > doesn't work. There is probably a way to create a recursive function using > durations, but maybe it's just me not seeing the forest because of all the > tress... > > cheers, > Jakob. > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ihe.onwuka at gmail.com Sat Apr 12 22:53:43 2014 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Sun, 13 Apr 2014 06:53:43 +0100 Subject: [xquery-talk] [Exist-open] Getting more out of Freebase with XQuery In-Reply-To: References: Message-ID: The wiki has been updated. The sample code now closes the HTTP connection following a PUT (thanks to Joe Wiz for pointing this out) but it does not stop the crashes - this may be an issue specific to eXist. Thanks to Dan M for organising the layout of the update. He had final editorial say so so if there are any mistakes please blame him. http://en.wikibooks.org/w/index.php?title=XQuery/Freebase&stable=0#Using_Cursors_to_Get_Additional_Data On Tue, Apr 1, 2014 at 10:14 AM, W.S. Hager wrote: > The purpose of PUT is to update a resource. You may not expect GET to have > side effects, if it does it's irrelevant to the client. If the server state > varies, use POST. > > Like how you say REST purists... :-) > > Op 1 apr. 2014 08:46 schreef "Ihe Onwuka" : >> >> On Mon, Mar 31, 2014 at 9:26 PM, Joe Wicentowski wrote: >> > Hi Ihe, >> > >> >> http:send-request() >> > ... >> >> One last thing. I experienced repeated eXist crashes when running >> >> this. >> > >> > Check to make sure you're closing your HTTP connection. See >> > http://markmail.org/message/3opzcgyzv6auevkt for the solution; the >> > whole thread is edifying though. >> > >> >> Will investigate - thanks. >> >> A couple of dilemmas both related. >> >> The return type of the function freebaseCall is string..... would it >> be helpful to specify that given that it has a side-effect (HTTP Put) >> >> One for the RESTFUL purists that might object to a GET that has >> side-effects. What HTTP method should be used to invoke this XQuery? >> >> On reflection the function could probably use a better name. >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Exist-open mailing list >> Exist-open at lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/exist-open