From mike at saxonica.com Wed May 1 01:02:07 2013 From: mike at saxonica.com (Michael Kay) Date: Wed, 1 May 2013 09:02:07 +0100 Subject: [xquery-talk] Fuctions and variables in replacement string of fn:replace() In-Reply-To: <1367378067.27683.19.camel@slave.barefootcomputing.com> References: <1367378067.27683.19.camel@slave.barefootcomputing.com> Message-ID: On 1 May 2013, at 04:14, Liam R E Quin wrote: > On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote: >> When using fn:replace(), is it kosher or illegal to construct the >> replacement string dynamically using a function? Yes. XQuery is an orthogonal language, any expression can be replaced by a different expression that returns the same value. >> In some cases this >> seems to work (tested in Saxon and MarkLogic): >> >> xquery version "1.0"; >> let $string := "Now, let's SEND OUT for QUICHE!!" >> let $match := "[A-Z][A-Z]+" >> return replace($string, $match, concat("$0","$0")) >> ==> Now, let's SENDSEND OUTOUT for QUICHEQUICHE!! >> >> but in other cases it doesn't. For example, lower-case("$0") has no >> effect. It should have no effect. It's the same as replace($string, $match, '$0') which replaces every string that matches $match with itself. >> And substring("$0", 1, 1) throws an error. Because '$' is not a valid replacement string. OK, I think I've understood what you wanted (maybe!). You didn't want to construct the replacement string using a function, you wanted to apply a function to the matching substrings found by the matching operation: you want a higher-order replace(). Saxon has such a thing in the form of saxon:analyze-string (see http://www.saxonica.com/documentation/#!functions/saxon/analyze-string) but in 3.0 the WG took a different direction in its definition of fn:analyze-string(), which is probably easier for ordinary mortals to cope with: http://www.w3.org/TR/xpath-functions-30/#func-analyze-string > Michael Kay Saxonica From geert.josten at dayon.nl Wed May 1 01:32:38 2013 From: geert.josten at dayon.nl (Geert Josten) Date: Wed, 1 May 2013 10:32:38 +0200 Subject: [xquery-talk] Fuctions and variables in replacement string of fn:replace() In-Reply-To: References: <1367378067.27683.19.camel@slave.barefootcomputing.com> Message-ID: Or switch to xsl:analyze-string.. ;-) > -----Oorspronkelijk bericht----- > Van: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] > Namens Michael Kay > Verzonden: woensdag 1 mei 2013 10:02 > Aan: liam at w3.org > CC: XQuery Talk; David Sewell > Onderwerp: Re: [xquery-talk] Fuctions and variables in replacement string > of fn:replace() > > > On 1 May 2013, at 04:14, Liam R E Quin wrote: > > > On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote: > >> When using fn:replace(), is it kosher or illegal to construct the > >> replacement string dynamically using a function? > > Yes. XQuery is an orthogonal language, any expression can be replaced by a > different expression that returns the same value. > > >> In some cases this > >> seems to work (tested in Saxon and MarkLogic): > >> > >> xquery version "1.0"; > >> let $string := "Now, let's SEND OUT for QUICHE!!" > >> let $match := "[A-Z][A-Z]+" > >> return replace($string, $match, concat("$0","$0")) > >> ==> Now, let's SENDSEND OUTOUT for QUICHEQUICHE!! > >> > >> but in other cases it doesn't. For example, lower-case("$0") has no > >> effect. > > It should have no effect. It's the same as replace($string, $match, '$0') > which replaces every string that matches $match with itself. > > >> And substring("$0", 1, 1) throws an error. > > Because '$' is not a valid replacement string. > > OK, I think I've understood what you wanted (maybe!). You didn't want to > construct the replacement string using a function, you wanted to apply a > function to the matching substrings found by the matching operation: you > want a higher-order replace(). Saxon has such a thing in the form of > saxon:analyze-string (see > http://www.saxonica.com/documentation/#!functions/saxon/analyze- > string) but in 3.0 the WG took a different direction in its definition of > fn:analyze-string(), which is probably easier for ordinary mortals to cope > with: http://www.w3.org/TR/xpath-functions-30/#func-analyze-string > > > Michael Kay > Saxonica > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From dsewell at virginia.edu Wed May 1 06:43:00 2013 From: dsewell at virginia.edu (David Sewell) Date: Wed, 1 May 2013 09:43:00 -0400 (EDT) Subject: [xquery-talk] Fuctions and variables in replacement string of fn:replace() In-Reply-To: References: <1367378067.27683.19.camel@slave.barefootcomputing.com> Message-ID: Thanks, Michael, for the clarification. I'm aware that fn:analyze-string is (with XPath 3.0) the right tool for this kind of job, I was just confused about the extent to which fn:replace() was capable of being a poor-man's equivalent. The answer then is "not much". David On Wed, 1 May 2013, Michael Kay wrote: > > On 1 May 2013, at 04:14, Liam R E Quin wrote: > >> On Tue, 2013-04-30 at 23:01 -0400, David Sewell wrote: >>> When using fn:replace(), is it kosher or illegal to construct the >>> replacement string dynamically using a function? > > Yes. XQuery is an orthogonal language, any expression can be replaced by a different expression that returns the same value. > >>> In some cases this >>> seems to work (tested in Saxon and MarkLogic): >>> >>> xquery version "1.0"; >>> let $string := "Now, let's SEND OUT for QUICHE!!" >>> let $match := "[A-Z][A-Z]+" >>> return replace($string, $match, concat("$0","$0")) >>> ==> Now, let's SENDSEND OUTOUT for QUICHEQUICHE!! >>> >>> but in other cases it doesn't. For example, lower-case("$0") has no >>> effect. > > It should have no effect. It's the same as replace($string, $match, '$0') which replaces every string that matches $match with itself. > >>> And substring("$0", 1, 1) throws an error. > > Because '$' is not a valid replacement string. > > OK, I think I've understood what you wanted (maybe!). You didn't want to construct the replacement string using a function, you wanted to apply a function to the matching substrings found by the matching operation: you want a higher-order replace(). Saxon has such a thing in the form of saxon:analyze-string (see http://www.saxonica.com/documentation/#!functions/saxon/analyze-string) but in 3.0 the WG took a different direction in its definition of fn:analyze-string(), which is probably easier for ordinary mortals to cope with: http://www.w3.org/TR/xpath-functions-30/#func-analyze-string >> > Michael Kay > Saxonica > > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA Email: dsewell at virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From dflorescu at me.com Wed May 15 11:23:42 2013 From: dflorescu at me.com (daniela florescu) Date: Wed, 15 May 2013 11:23:42 -0700 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <9FAD06A2-EAD0-4C98-B005-D445CABB5285@saxonica.com> References: <9FAD06A2-EAD0-4C98-B005-D445CABB5285@saxonica.com> Message-ID: <2D843498-89AE-4064-9541-FD259D5BAEF4@me.com> > > No, if you are horrified by the inefficiency of this code then switch to an XQuery processor with a decent optimizer. You know, Michael, I would mellow down a little bit if I were you. Or at least try some benchmarks before hand (I did, and the results might surprise you ). If you can strongly say such a statement, it either that you never understood how complicate of a problem optimization is (how many different cases, how to do a compromise between complexity of program vs. size of the data, how to make sure that the optimization time stays reasonable, etc, etc,), or you are totally dishonest. So, I don't know, a more mellow approach would be probably better. ===== As a matter of fact, I wasn't even talking about runtime when I wrote that email. (even though it applies to execution time, too). I was horrified about HOW UGLY that code looked. As a programmer, I would't like to write that. Cheers Dana From msokolov at safaribooksonline.com Wed May 15 12:26:22 2013 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Wed, 15 May 2013 15:26:22 -0400 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: References: Message-ID: <5193E15E.3080600@safaribooksonline.com> On 5/15/2013 10:47 AM, Kunal Chauhan wrote: > Hi, > > I want to maintain a list of value. > > for eg: > initially I have blank list and through some process I add values in > to the list. > > like (Apple,Banana,Cherry) > > now, when get Apple as an output 2nd time it will check into the list. > If present than don't add value into the list otherwise add it. > At last I will return the list. > > I don't know whether it's possible or not. > But this there any work around. You might want to look into maps, a new feature in XQuery 3.0, which provide a natural and (probably) efficient way to do this, but whether that is available to you will depend on which processor you are using. -Mike From dlee at calldei.com Wed May 15 12:36:40 2013 From: dlee at calldei.com (David Lee) Date: Wed, 15 May 2013 19:36:40 +0000 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <5193E15E.3080600@safaribooksonline.com> References: , <5193E15E.3080600@safaribooksonline.com> Message-ID: <8C6C704E-74EC-448F-8DF4-CE9EA2318B38@calldei.com> Has maps actually made it into xquery 3? I thought they were xslt only so far Sent from my iPhone On May 15, 2013, at 3:27 PM, "Michael Sokolov" wrote: > On 5/15/2013 10:47 AM, Kunal Chauhan wrote: >> Hi, >> >> I want to maintain a list of value. >> >> for eg: >> initially I have blank list and through some process I add values in to the list. >> >> like (Apple,Banana,Cherry) >> >> now, when get Apple as an output 2nd time it will check into the list. >> If present than don't add value into the list otherwise add it. >> At last I will return the list. >> >> I don't know whether it's possible or not. >> But this there any work around. > You might want to look into maps, a new feature in XQuery 3.0, which provide a natural and (probably) efficient way to do this, but whether that is available to you will depend on which processor you are using. > > -Mike > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From adam.retter at googlemail.com Wed May 15 12:42:20 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 15 May 2013 20:42:20 +0100 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <8C6C704E-74EC-448F-8DF4-CE9EA2318B38@calldei.com> References: <5193E15E.3080600@safaribooksonline.com> <8C6C704E-74EC-448F-8DF4-CE9EA2318B38@calldei.com> Message-ID: Sure they will be in XQuery 3.0 On 15 May 2013 20:38, "David Lee" wrote: > Has maps actually made it into xquery 3? I thought they were xslt only so > far > > Sent from my iPhone > > On May 15, 2013, at 3:27 PM, "Michael Sokolov" < > msokolov at safaribooksonline.com> wrote: > > > On 5/15/2013 10:47 AM, Kunal Chauhan wrote: > >> Hi, > >> > >> I want to maintain a list of value. > >> > >> for eg: > >> initially I have blank list and through some process I add values in to > the list. > >> > >> like (Apple,Banana,Cherry) > >> > >> now, when get Apple as an output 2nd time it will check into the list. > >> If present than don't add value into the list otherwise add it. > >> At last I will return the list. > >> > >> I don't know whether it's possible or not. > >> But this there any work around. > > You might want to look into maps, a new feature in XQuery 3.0, which > provide a natural and (probably) efficient way to do this, but whether that > is available to you will depend on which processor you are using. > > > > -Mike > > _______________________________________________ > > talk at x-query.com > > http://x-query.com/mailman/listinfo/talk > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dlee at calldei.com Wed May 15 13:05:53 2013 From: dlee at calldei.com (David Lee) Date: Wed, 15 May 2013 20:05:53 +0000 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <2D843498-89AE-4064-9541-FD259D5BAEF4@me.com> References: <9FAD06A2-EAD0-4C98-B005-D445CABB5285@saxonica.com> <2D843498-89AE-4064-9541-FD259D5BAEF4@me.com> Message-ID: <7bd0d91011d9424bb69bdcce6e11de87@BY2PR08MB014.namprd08.prod.outlook.com> Wow ... I really hoped our ivory tower was immune from personal attacks.... what's up with today a full moon crossing mars? If *anyone* on this list, or the entire world for that matter, knows about program optimization I would put Mike at the top of the list, higher than anyone I know personally and likely higher than anyone I know via Nth relation. So could we stop that and get back to decency ? XQuery itself is efficient or not based in the implementation, not the language. And yes some optimizations are hard, possibly so hard they never get done or only done by As for the ugliness of XQuery code ... point taken. XQuery is not always pretty ... but then it has many flavors. I personally find it beautiful. I am sure one could come up with prettier code. Although I myself don't see any ugliness in the code I wrote, and don't see how it would be prettier in a procedural fashion ... or why it matters to the poster ... Was subjective beauty part of the prerequisite ? And the question was asked about XQuery, not XQuery + (Add feature X We are proud of but isn't XQuery) Might as well jump to C or Java or Haskell or BUT ... if you want an answer to "Could I use another language instead of XQuery but is close enough to get on this list" I of course recommend xmlsh ... it solves ALL problems and is prettier than any other language. www.xmlsh.org ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: daniela florescu [mailto:dflorescu at me.com] Sent: Wednesday, May 15, 2013 2:24 PM To: Michael Kay Cc: talk at x-query.com; David Lee; Kunal Chauhan Subject: Re: [xquery-talk] Is it possible to maintain a list of value in XQuery > > No, if you are horrified by the inefficiency of this code then switch to an XQuery processor with a decent optimizer. You know, Michael, I would mellow down a little bit if I were you. Or at least try some benchmarks before hand (I did, and the results might surprise you ). If you can strongly say such a statement, it either that you never understood how complicate of a problem optimization is (how many different cases, how to do a compromise between complexity of program vs. size of the data, how to make sure that the optimization time stays reasonable, etc, etc,), or you are totally dishonest. So, I don't know, a more mellow approach would be probably better. ===== As a matter of fact, I wasn't even talking about runtime when I wrote that email. (even though it applies to execution time, too). I was horrified about HOW UGLY that code looked. As a programmer, I would't like to write that. Cheers Dana From christian.gruen at gmail.com Wed May 15 13:12:08 2013 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Wed, 15 May 2013 22:12:08 +0200 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: References: <5193E15E.3080600@safaribooksonline.com> <8C6C704E-74EC-448F-8DF4-CE9EA2318B38@calldei.com> Message-ID: Maps will most probably be added to XQuery 3.1, but there are already some implementations available (e.g. check out Saxon [1] BaseX [2], or eXist-db [3]). Note that the exact map syntax is still subject to change. [1] http://www.saxonica.com/documentation/index.html#!expressions/xpath30maps [2] http://docs.basex.org/wiki/Map_Module [3] http://atomic.exist-db.org/blogs/eXist/XQueryMap ___________________________ On Wed, May 15, 2013 at 9:42 PM, Adam Retter wrote: > Sure they will be in XQuery 3.0 > > On 15 May 2013 20:38, "David Lee" wrote: >> >> Has maps actually made it into xquery 3? I thought they were xslt only so >> far >> >> Sent from my iPhone >> >> On May 15, 2013, at 3:27 PM, "Michael Sokolov" >> wrote: >> >> > On 5/15/2013 10:47 AM, Kunal Chauhan wrote: >> >> Hi, >> >> >> >> I want to maintain a list of value. >> >> >> >> for eg: >> >> initially I have blank list and through some process I add values in to >> >> the list. >> >> >> >> like (Apple,Banana,Cherry) >> >> >> >> now, when get Apple as an output 2nd time it will check into the list. >> >> If present than don't add value into the list otherwise add it. >> >> At last I will return the list. >> >> >> >> I don't know whether it's possible or not. >> >> But this there any work around. >> > You might want to look into maps, a new feature in XQuery 3.0, which >> > provide a natural and (probably) efficient way to do this, but whether that >> > is available to you will depend on which processor you are using. >> > >> > -Mike >> > _______________________________________________ >> > talk at x-query.com >> > http://x-query.com/mailman/listinfo/talk >> >> _______________________________________________ >> 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 dflorescu at me.com Wed May 15 13:32:04 2013 From: dflorescu at me.com (daniela florescu) Date: Wed, 15 May 2013 13:32:04 -0700 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <7bd0d91011d9424bb69bdcce6e11de87@BY2PR08MB014.namprd08.prod.outlook.com> References: <9FAD06A2-EAD0-4C98-B005-D445CABB5285@saxonica.com> <2D843498-89AE-4064-9541-FD259D5BAEF4@me.com> <7bd0d91011d9424bb69bdcce6e11de87@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <05201194-6A73-4BC5-AAF4-3732667906D4@me.com> On May 15, 2013, at 1:05 PM, David Lee wrote: > Wow ... I really hoped our ivory tower was immune from personal attacks.... what's up with today a full moon crossing mars? I just said the code is ugly and potentially slow. I am attacking the coding style, not the author. (and BTW, given the design of XQuery, there is no way to write it other way, so it's definitely not the fault of the author. And by the way, a lot of the design of XQuery is my fault... so why would I complain?) > If *anyone* on this list, or the entire world for that matter, knows about program optimization I would put Mike at the top of the list, higher than anyone I know personally and likely higher than anyone I know via Nth relation. I can tell you the world is full of query optimizer experts, that probably know XQuery in and out, and SQL optimization in and out, and compiler technology in and out, and functional language compilation, and that you probably never met. Not everybody who knows something writes a lot of emails on public mailing lists, that's all. There is a 30 years old history of optimizing SQL, or compiling functional languages, and lots of people did lots of things, even if you do not know about it. ( But I agree that nobody knows XML as well as Mike. I would defer all questions about the details of XML to him....) > So could we stop that and get back to decency ? XQuery itself is efficient or not based in the implementation, not the language. > And yes some optimizations are hard, possibly so hard they never get done or only done by > No, I am afraid you do not understand what I am trying to say. Not that certain optimizations are HARD. Hard you can deal with. You just sit down and do it. In optimization in general it is IMPOSSIBLE to get it PERFECT (and I have some 25 years of experience with compilers and query optimization, so I think I know something about it). An optimization is extremely rarely something that you apply and BOOM, your programs (all of them) are faster. Almost NONE are like this. There is always a compromise to be made. For some programs that you make faster there are ALWAYS others that you make slower. This is why optimization is the delicate art of choosing wisely a compromise that would work well IN AVERAGE (whatever that means..). This is why you need heuristics, for the SPECIAL cases when the user knows better then the compiler -- and there are always cases like this-- and then he/she should have the possibility to say: "Here, I would like my program to be executed THIS way". Most of the time you will trust a smart optimizer, but not always. That's what an assignment is. A heuristic. > As for the ugliness of XQuery code ... point taken. XQuery is not always pretty ... but then it has many flavors. > I personally find it beautiful. > > I am sure one could come up with prettier code. Although I myself don't see any ugliness in the code I wrote, > and don't see how it would be prettier in a procedural fashion ... or why it matters to the poster ... > Was subjective beauty part of the prerequisite ? > > And the question was asked about XQuery, not XQuery + (Add feature X We are proud of but isn't XQuery) > Might as well jump to C or Java or Haskell or Thanks for liking XQuery ! Given that it looks 90% as the language that bears my design (Quilt, with Jonathan Robie and Don Chamberlin) and that it is a functional language because of me (probably), I am certainly taking it as a compliment :-))) So don't get me wrong, I like it too :-) It's just that, like any other programming language, is not 100% perfect. Best Dana From liam at w3.org Wed May 15 16:25:25 2013 From: liam at w3.org (Liam R E Quin) Date: Wed, 15 May 2013 19:25:25 -0400 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <1368660325.19492.265.camel@slave.barefootcomputing.com> On Wed, 2013-05-15 at 23:10 +0000, David Lee wrote: [...] > I boldly propose that perhaps as a group we step back and get off our > high horse and admit that some procedural aspects to XML processing > be embraced instead of hidden in the dark corners of "vendor > implementations" that every single vendor has had to provide because > pure functional programming has simply not lived up to its promise. I don't think it's about a high horse. The XQuery WG spent multiple years trying to wrestle with adding procedural hooks to XQuery. Part of the difficulty was that it was a group of people who did not share a common goal. For example, some people thought it would be nice to offer a sort of bait-and-switch language where the easy stuff was procedural but anything hard was functional, a sort of gentle slope learning curve followed by a cliff, instead of a very steep hill at the start. Others needed synchronization and orchestration. My own feeling is still that the scripting extensions would work better as a framework rather like XProc, orchestrating functional chunks of XQuery (and/or XSLT) at a higher level, with clearly-defined boundaries for optimization & transactions. One problem with them as written today is that it's easy to put a semicolon instead of a comma in places where it's still legal, but has a different meaning, one which has the side-effect (!) of effectively disabling a lot of optimization. At any rate we ended up delaying XQuery 3 for a year or more while working on the scripting extensions, without really coming to a good consensus. Maybe the long term answer is XQuery extensions to JavaScript. 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 Eric.Bloch at marklogic.com Wed May 15 16:53:46 2013 From: Eric.Bloch at marklogic.com (Eric Bloch) Date: Wed, 15 May 2013 23:53:46 +0000 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <1368660325.19492.265.camel@slave.barefootcomputing.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> Message-ID: <93ACEBC222C637479703ACA6268E6716249B17@EXCHG10-BE01.marklogic.com> > > Maybe the long term answer is XQuery extensions to JavaScript. > Are you suggesting a resurrection of E4X? From liam at w3.org Wed May 15 17:21:14 2013 From: liam at w3.org (Liam R E Quin) Date: Wed, 15 May 2013 20:21:14 -0400 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <93ACEBC222C637479703ACA6268E6716249B17@EXCHG10-BE01.marklogic.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> <93ACEBC222C637479703ACA6268E6716249B17@EXCHG10-BE01.marklogic.com> Message-ID: <1368663674.19492.267.camel@slave.barefootcomputing.com> On Wed, 2013-05-15 at 23:53 +0000, Eric Bloch wrote: > > > > > Maybe the long term answer is XQuery extensions to JavaScript. > > > > Are you suggesting a resurrection of E4X? I wasn't, at least not directly, although E4X isn't as dead as you might think (e.g. it's in Flash and Acrobat). 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 dlee at calldei.com Wed May 15 17:22:57 2013 From: dlee at calldei.com (David Lee) Date: Thu, 16 May 2013 00:22:57 +0000 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <1368660325.19492.265.camel@slave.barefootcomputing.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> Message-ID: I still am unconvinced that the theory that a purely functional language would enable vastly better optimizations has yet to be realized in the real world and may never be. It sounds good, and looks good on paper ... And maybe someday a genius will make it so ... and teach us peons how to do it Gods Way. But in practice using non-functional semantics can produce vastly faster or simplier code sometimes (or both ).... Or why would every XQuery vendor put them in ? They got tired of telling customers they were wrong. And keeping a straight face .... Of course this was the same argument for "register" and _asm in C ... and later had the back door "volatile" snuck in where the assumptions of nothing sneaky happening in the back door were violated .... who knows what "volatile" really means nowadays in a multi-core multi layered cache line system ... The Compiler Knows :) And yes adding scripting frameworks on top of XQuery is very powerful ... And Good. (why I wrote xmlsh ... ) ... combining them is a very good mix. But when your "stuck" with pure XQuery ... or XSLT for that matter no matter how many times the gurus tell you that its for your own good ... it seems more religion then fact ... Thats my opinion and I'm sticking with it no matter how many facts you want to throw at me :) ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -----Original Message----- From: Liam R E Quin [mailto:liam at w3.org] Sent: Wednesday, May 15, 2013 7:25 PM To: David Lee Cc: talk at x-query.com Subject: Re: [xquery-talk] Is it possible to maintain a list of value in XQuery On Wed, 2013-05-15 at 23:10 +0000, David Lee wrote: [...] > I boldly propose that perhaps as a group we step back and get off our > high horse and admit that some procedural aspects to XML processing > be embraced instead of hidden in the dark corners of "vendor > implementations" that every single vendor has had to provide because > pure functional programming has simply not lived up to its promise. I don't think it's about a high horse. The XQuery WG spent multiple years trying to wrestle with adding procedural hooks to XQuery. Part of the difficulty was that it was a group of people who did not share a common goal. For example, some people thought it would be nice to offer a sort of bait-and-switch language where the easy stuff was procedural but anything hard was functional, a sort of gentle slope learning curve followed by a cliff, instead of a very steep hill at the start. Others needed synchronization and orchestration. My own feeling is still that the scripting extensions would work better as a framework rather like XProc, orchestrating functional chunks of XQuery (and/or XSLT) at a higher level, with clearly-defined boundaries for optimization & transactions. One problem with them as written today is that it's easy to put a semicolon instead of a comma in places where it's still legal, but has a different meaning, one which has the side-effect (!) of effectively disabling a lot of optimization. At any rate we ended up delaying XQuery 3 for a year or more while working on the scripting extensions, without really coming to a good consensus. Maybe the long term answer is XQuery extensions to JavaScript. 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 liam at w3.org Wed May 15 21:39:42 2013 From: liam at w3.org (Liam R E Quin) Date: Thu, 16 May 2013 00:39:42 -0400 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> Message-ID: <1368679182.19492.313.camel@slave.barefootcomputing.com> On Thu, 2013-05-16 at 00:22 +0000, David Lee wrote: > I still am unconvinced that the theory that a purely functional > language would enable vastly better optimizations > has yet to be realized in the real world and may never be. I'm not sure I'm failing to follow you incorrectly here. Yes, declarative languages, especially with referential transparency, are often massively easier to optimize than procedural ones. Or rather, the computer science and mathematics might be harder in some cases, but the optimizations can be more far-reaching. The down side is that they tend to start out slower, so it doesn't always balance out. *BUT* they are also often more maintainable. I started to write an essay on optimization of procedural languages and realised it was crazy and stopped. One minor note though, that applies to a great many languages where the same code is run many times - logging the result of each conditional and then rewriting the generated code to make the faster branch the more common is a useful trick that only works in some environments. The speed difference in a language like C or assembly is because one branch has to do a jump (goto) to get to the else part, and jumps tend to stall the CPU pipeline. But even in a language like XQuery you'll tend to get L2 cache performance benefits in such cases. I don't know how significant they would be, and would be interested in hearing from implementors. Maybe we should have a public XQuery optimization wiki, although I don't know how many vendors would be able to share their deep and wonderful secrets :) 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 dflorescu at me.com Wed May 15 22:39:09 2013 From: dflorescu at me.com (daniela florescu) Date: Wed, 15 May 2013 22:39:09 -0700 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <1368679182.19492.313.camel@slave.barefootcomputing.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> <1368679182.19492.313.camel@slave.barefootcomputing.com> Message-ID: <3F4A58F3-8FEA-4403-86DE-650FC01ECA19@me.com> On May 15, 2013, at 9:39 PM, Liam R E Quin wrote: > On Thu, 2013-05-16 at 00:22 +0000, David Lee wrote: >> I still am unconvinced that the theory that a purely functional >> language would enable vastly better optimizations >> has yet to be realized in the real world and may never be. > > I'm not sure I'm failing to follow you incorrectly here. > > Yes, declarative languages, especially with referential transparency, > are often massively easier to optimize than procedural ones. Or rather, > the computer science and mathematics might be harder in some cases, but > the optimizations can be more far-reaching. The down side is that they > tend to start out slower, so it doesn't always balance out. *BUT* they > are also often more maintainable. Really !? 100 lines of code are more maintainable then 20 (because this 1:5 is how it looks like when you need to maintain a structure vs. when you have to FAKE like you don't need to update and life is good and you are "just copying" the data) Really !?? Well, there is experimental evidence that says that bugs are linearly proportional with # lines of code. (Let alone the nightmare that you put your optimizer through, trying to re-invent stuff that you already know, and you spent hours and days trying to hide.) Great. > > I started to write an essay on optimization of procedural languages and > realised it was crazy and stopped. Liam, out of curiosity, other then writing an essay, when is the last time you wrote a serious compiler/optimizer for either one !? (Functional and/or procedural language !? And/or any combination of the above !?) There are plenty of lessons that anyone can learn doing the "dirty" work. Dirty work is anything that is NOT pdf and slideshare. Other then number of lines of code there is something else that counts. It's called experience. > Maybe we should have a public XQuery optimization wiki, although I don't > know how many vendors would be able to share their deep and wonderful > secrets :) Yes, such thing would be called a standard benchmark, and historically it triggers people to work on performance and/or publish (or at least patent :-) their secret sauce. I asked you for years to trigger W3C to work on this. Never heard back from it. Thanks Dana From andrew.j.welch at gmail.com Thu May 16 02:21:34 2013 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Thu, 16 May 2013 10:21:34 +0100 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <4b456027e53820597d1fb3590c415741@mail.gmail.com> References: <4b456027e53820597d1fb3590c415741@mail.gmail.com> Message-ID: > Could you elaborate on the bigger picture? Are you running through a pile of > data, trying to accumulate information along the way, and want to use that > afterwards? Or is it something entirely different that you are trying to > achieve? It sounds like they want the equivalent of a TreeSet.... and there are various ways to achieve that - such as appending to a sequence and then using distinct-values() on the getter. -- Andrew Welch http://andrewjwelch.com From dlee at calldei.com Thu May 16 05:20:26 2013 From: dlee at calldei.com (David Lee) Date: Thu, 16 May 2013 12:20:26 +0000 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <1368679182.19492.313.camel@slave.barefootcomputing.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> <1368679182.19492.313.camel@slave.barefootcomputing.com> Message-ID: <80eef3976aa24ed2976ecacba6ec1249@BY2PR08MB014.namprd08.prod.outlook.com> >>> Liam I'm not sure I'm failing to follow you incorrectly here. ------ Someone is failing somethign :)_ Yes, declarative languages, especially with referential transparency, are often massively easier to optimize than procedural ones. Or rather, the computer science and mathematics might be harder in some cases, but the optimizations can be more far-reaching. The down side is that they tend to start out slower, so it doesn't always balance out. *BUT* they are also often more maintainable. ----------- This is the "Promised Land of Milk and Honey" that I have been told about ... And I can believe it in some cases. What I boldly propose out of ignorance is that in reality its somewhat (mostly?) BS. Like the class I took in collage about proving computer programs ... it only worked if your program was about 3 lines or less beyond that it was *effectively* impossible. I know many kinds of optimizations are possible (and yea have been achieved) with purely functional languages. Query Optimization of SQL has some very deep proof of this and I suspect that may have been the rational behind XQuery and XSLT. But in reality ... at least the reality I have absorbed by attending conferences, reading papers, talking with implementers, and delving deeply into the guts of real world XQuery and XSLT processors .... that reality has come up short from the promise. There are a huge range of *possible* optimizations that simply never get achieved. Its *HARD* ... I am not blaming the implementers. There is Theory and then there is Engineering. (and lets not forget time and money). One example is parallelism. A purely functional language should be able to be highly paralyzed automatically. But what we have seen, is that few vendors do this at all, or very little. I know from Mr Kay's papers he has had some success, but largely by introducing vendor (and now some standard) specific "hints" into the language to allow for points where parallism can be recognized and he himself has stated that reality has not lived up to the ideal. The comment about XQuery and cache hits I propose is theory not practice ... unless one implements XQuery in machine language *directly* (the implementations I have seen are interpretive or late compiled to bytecode ... ), then the illusion that xquery statements will actually fit snugly in cachelines is an illusion. Now if someone does write a direct XQuery to machine code compiler that might be valid ... maybe there is one, would love to see the paper at Balisage. So what are the languages people write XQuery compilers in *really* ? What I have seen is C, C++ and Java. I am sure there are more. And *those* implementations are highly optimized using non-functional techniques. So in summary I just dont buy the "functional languages inherantly optimize better" angle. Maybe in theory ... and maybe in some select cases, but not globally in practice. Global *mutable* variables are another example. To avoid them 100% can be very difficult and results in code that in theory should be optimized but in practice is often not. And can be very "ugly" by some standards. Adding the ability to "open a crack" from the functional to procedural allows users to achieve optimizations simply not practical by the optimizer. Or atleast be able to write code that they can understand. This is why I am seriously suggesting that XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms. Maybe not the whole floodgate, but bits. The bits that vendors have found necessary to introduce ... Yes in theory this lets the cat out of the bag, and the camels nose in the tent and cats will sleep with dogs and the world will end .... But on the other hand maybe just a few carefully chosen idioms that "brake the shackles of pure functional programming" could be a good thing. For one maybe it would encourage vendors to switch over from their vendor specific holes and instead use the standard ones thus making XQuery and XSLT more portable do agree with a layered approach. You dont have to sink the entire ship with this, you can *document* where use of such a bastard might unduly affect the optimizer and let the user decide. For Layered Approaches, XQuery scripting is one, xproc another, xmlsh another. But I suggest the layer is too high. I suggest XQuery has grown in use to more complexity then possibly imagined at the beginning. Whole apps are being written in XQuery alone. So maybe the layer should be a little deeper *into* the language instead of above of. ( This is why I am shy of suggesting xpath itself break the mold of purely functional, it might actually be the layer where pure functional ideology works). I know from a standards committee perspective this is a nearly impossible task ... so instead I just rant on a mailing list. Maybe someone will see the view ... or intelligently disagree, or just think about it for a second before abandoning it as the ramblings of an insane apostate ... or maybe I will just be beat to a pulp. All in all a good day :) -David From loren.cahlander at gmail.com Thu May 16 05:37:10 2013 From: loren.cahlander at gmail.com (Loren Cahlander) Date: Thu, 16 May 2013 07:37:10 -0500 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <80eef3976aa24ed2976ecacba6ec1249@BY2PR08MB014.namprd08.prod.outlook.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> <1368679182.19492.313.camel@slave.barefootcomputing.com> <80eef3976aa24ed2976ecacba6ec1249@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: Stop thinking like you only have one tool in your toolbox! Would you use a pliers to drive in a screw? I use many languages and XQuery is one of them. Each language has its strengths and weaknesses. Sent from my iPhone On May 16, 2013, at 7:20 AM, David Lee wrote: >>> Liam I'm not sure I'm failing to follow you incorrectly here. ------ Someone is failing somethign :)_ Yes, declarative languages, especially with referential transparency, are often massively easier to optimize than procedural ones. Or rather, the computer science and mathematics might be harder in some cases, but the optimizations can be more far-reaching. The down side is that they tend to start out slower, so it doesn't always balance out. *BUT* they are also often more maintainable. ----------- This is the "Promised Land of Milk and Honey" that I have been told about ... And I can believe it in some cases. What I boldly propose out of ignorance is that in reality its somewhat (mostly?) BS. Like the class I took in collage about proving computer programs ... it only worked if your program was about 3 lines or less beyond that it was *effectively* impossible. I know many kinds of optimizations are possible (and yea have been achieved) with purely functional languages. Query Optimization of SQL has some very deep proof of this and I suspect that may have been the rational behind XQuery and XSLT. But in reality ... at least the reality I have absorbed by attending conferences, reading papers, talking with implementers, and delving deeply into the guts of real world XQuery and XSLT processors .... that reality has come up short from the promise. There are a huge range of *possible* optimizations that simply never get achieved. Its *HARD* ... I am not blaming the implementers. There is Theory and then there is Engineering. (and lets not forget time and money). One example is parallelism. A purely functional language should be able to be highly paralyzed automatically. But what we have seen, is that few vendors do this at all, or very little. I know from Mr Kay's papers he has had some success, but largely by introducing vendor (and now some standard) specific "hints" into the language to allow for points where parallism can be recognized and he himself has stated that reality has not lived up to the ideal. The comment about XQuery and cache hits I propose is theory not practice ... unless one implements XQuery in machine language *directly* (the implementations I have seen are interpretive or late compiled to bytecode ... ), then the illusion that xquery statements will actually fit snugly in cachelines is an illusion. Now if someone does write a direct XQuery to machine code compiler that might be valid ... maybe there is one, would love to see the paper at Balisage. So what are the languages people write XQuery compilers in *really* ? What I have seen is C, C++ and Java. I am sure there are more. And *those* implementations are highly optimized using non-functional techniques. So in summary I just dont buy the "functional languages inherantly optimize better" angle. Maybe in theory ... and maybe in some select cases, but not globally in practice. Global *mutable* variables are another example. To avoid them 100% can be very difficult and results in code that in theory should be optimized but in practice is often not. And can be very "ugly" by some standards. Adding the ability to "open a crack" from the functional to procedural allows users to achieve optimizations simply not practical by the optimizer. Or atleast be able to write code that they can understand. This is why I am seriously suggesting that XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms. Maybe not the whole floodgate, but bits. The bits that vendors have found necessary to introduce ... Yes in theory this lets the cat out of the bag, and the camels nose in the tent and cats will sleep with dogs and the world will end .... But on the other hand maybe just a few carefully chosen idioms that "brake the shackles of pure functional programming" could be a good thing. For one maybe it would encourage vendors to switch over from their vendor specific holes and instead use the standard ones thus making XQuery and XSLT more portable do agree with a layered approach. You dont have to sink the entire ship with this, you can *document* where use of such a bastard might unduly affect the optimizer and let the user decide. For Layered Approaches, XQuery scripting is one, xproc another, xmlsh another. But I suggest the layer is too high. I suggest XQuery has grown in use to more complexity then possibly imagined at the beginning. Whole apps are being written in XQuery alone. So maybe the layer should be a little deeper *into* the language instead of above of. ( This is why I am shy of suggesting xpath itself break the mold of purely functional, it might actually be the layer where pure functional ideology works). I know from a standards committee perspective this is a nearly impossible task ... so instead I just rant on a mailing list. Maybe someone will see the view ... or intelligently disagree, or just think about it for a second before abandoning it as the ramblings of an insane apostate ... or maybe I will just be beat to a pulp. All in all a good day :) -David _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From msokolov at safaribooksonline.com Thu May 16 05:56:41 2013 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Thu, 16 May 2013 08:56:41 -0400 Subject: [xquery-talk] Is it possible to maintain a list of value in XQuery In-Reply-To: <80eef3976aa24ed2976ecacba6ec1249@BY2PR08MB014.namprd08.prod.outlook.com> References: <5330adfb459c4eb3932f7bbfec92e1bb@BY2PR08MB014.namprd08.prod.outlook.com> <1368660325.19492.265.camel@slave.barefootcomputing.com> <1368679182.19492.313.camel@slave.barefootcomputing.com> <80eef3976aa24ed2976ecacba6ec1249@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <5194D789.8050101@safaribooksonline.com> On 05/16/2013 08:20 AM, David Lee wrote: > ----------- > > This is the "Promised Land of Milk and Honey" that I have been told about ... > > Look at what has been achieved with Java byte compilation, or -- Javascript to ASM ! -- who would have expected that in 1995? Well, not me anyway. I tend to think this has to do with adoption ... the interest in Javascript now is overwhelming, and it is embedded in every web application in the world, in possibly the most performance-sensitive part of it, so more attention gets paid to improving it. Also it started with a low bar, so the improvement has been impressive. I suspect that with a similar amount of incentive, XQuery would get optimized to take advantage of processor optimizations. > Adding the ability to "open a crack" from the functional to procedural > allows users to achieve optimizations simply not practical by the optimizer. Or atleast be able to write code that they can understand. This is why I am seriously suggesting that XQuery and XSLT (and MAYBE XPath ... but not so convinced on xpath) be opened up *philosophically* to non-functional paradigms. Maybe not the whole floodgate, but bits. > > Part of the reason XQuery hasn't achieved wider acceptance, in my view, is the whole functional mindset. Forget for a moment about performance. People program in what they like to read and write (if they have a choice), preferably in a language that makes it easy to conceptualize a solution to a problem. People who take the trouble to learn how to program functionally generally come to appreciate it, but it doesn't seem to be the most natural idiom, and for the many programmers, it presents real difficulties. One might suppose this is due to what is learned in school, but Scheme was the teaching language in vogue when I was learning, and still we bred a generation of C programmers. Even XSLT I think presents a barrier of this sort, although somehow adoption is greater - perhaps because the pattern-matching rules engine fits another conceptual model? Just stating the semi-obvious: not sure what that means for "the future of XQuery" or whatever. -Mike From james.fuller.2007 at gmail.com Fri May 17 23:42:10 2013 From: james.fuller.2007 at gmail.com (James Fuller) Date: Sat, 18 May 2013 08:42:10 +0200 Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: On Sat, May 18, 2013 at 2:32 AM, daniela florescu wrote: > I have to apologize on this mailing list first for completely scaring one of > potential XQuery's customers a couple of days back. > (he never answered back... oups... I will always wonder if he solved his > problem...) reach out to him by email and ask ? > This is not how science works. XQuery is a unique, cool, interesting and great programming language, it combines a query language with the power of a stored proc language in one = GSD, it plays well with my other favorite tool xslt, XQuery 3.0 'fpness' gives me joy when I program (akin to when I spelunked deeply in Perl) and joy in programming is a rare and wondrous thing. Practically speaking, xquery generates career paths and with the market now recognizing that data led decision making is better then punditry, things look good for xquery (we should be positive about that). We are living in a time where all the 'oxygen of choice' is consumed by javascript ... it means we have to expend more energy to get the word out about this incredibly productive little language. With the data revolution going, we have a very good chance to establish a grass roots foundation, which I think is where our efforts are best focused versus the 'rocket science' end which I think you are espousing ... we need materials for training (for students and teachers), we need to tell students about the potential for a career programming in xquery. Uche Ogbuji reminded us at last XML Prague to reach out to the digital humanities folks ... and I think this is an especially relevant group of people we should be trying to engage; librarians love this little language. Daniela you've probably done more to try and make xquery used and known within the academic community (number of papers, advocation, etc) then anyone; its a real achievement and I hear what you are saying but I don't fully grok what you are proposing. From one angle, I think your call for 'more science' could be construed as yet another variation of the desire for 'wide spread adoption'; the book you read taught you to ignore other people and yet you want more of these people to use your favorite tool ? Confused as to what you are concretely proposing, but interested and will help 'pull the oar' once I understand. Jim Fuller From dsewell at virginia.edu Mon May 20 06:46:57 2013 From: dsewell at virginia.edu (David Sewell) Date: Mon, 20 May 2013 09:46:57 -0400 (EDT) Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: On Sat, 18 May 2013, James Fuller wrote: > Uche Ogbuji reminded us at last XML Prague to reach out to the digital > humanities folks ... and I think this is an especially relevant group > of people we should be trying to engage; librarians love this little > language. Speaking as someone in the digital humanities community, I am extremely grateful for the work that has been done on XQuery and on the entire suite of XML-related W3C technologies (XPath, XSLT, etc.) within the W3C working groups and by independent developers. As a self-taught programmer without a computer science background, I can't evaluate the theoretical arguments pro or against different styles of programming languages; all I know is that in the practical world, it is almost inconceivable that the projects I have worked on for the last decade could have been achieved as well as they have without XQuery and the tools built upon it (notably Saxon, MarkLogic, and the oXygen editor/IDE). Even if the community of users is small by comparison with Javascript or Perl or whatever, the impact of projects that rely on XQuery is, I suspect, much greater than people realize. David -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA Email: dsewell at virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From james.fuller.2007 at gmail.com Mon May 20 06:58:37 2013 From: james.fuller.2007 at gmail.com (James Fuller) Date: Mon, 20 May 2013 15:58:37 +0200 Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: Hello David, On Mon, May 20, 2013 at 3:46 PM, David Sewell wrote: ... > the oXygen editor/IDE). Even if the community of users is small by > comparison with Javascript or Perl or whatever, the impact of projects that > rely on XQuery is, I suspect, much greater than people realize. Great to confirm Uche's reliable instincts. Wondering what are the top venues (conferences, training, etc) where digital humanities folk 'live' ? I would also be interested in hearing what kind of problems these folks are trying to solve. thx, Jim From dsewell at virginia.edu Mon May 20 07:08:04 2013 From: dsewell at virginia.edu (David Sewell) Date: Mon, 20 May 2013 10:08:04 -0400 (EDT) Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: Jim, The best two websites for general information on DH organizations/events are probably: http://adho.org/ http://dh2013.unl.edu/ Also, the people within the DH community who are most interested in XML from a theoretical perspective can usually be found at the Balisage meetings: http://www.balisage.net/. David On Mon, 20 May 2013, James Fuller wrote: > Hello David, > > On Mon, May 20, 2013 at 3:46 PM, David Sewell wrote: > ... >> the oXygen editor/IDE). Even if the community of users is small by >> comparison with Javascript or Perl or whatever, the impact of projects that >> rely on XQuery is, I suspect, much greater than people realize. > > Great to confirm Uche's reliable instincts. > > Wondering what are the top venues (conferences, training, etc) where > digital humanities folk 'live' ? > > I would also be interested in hearing what kind of problems these > folks are trying to solve. > > thx, Jim > -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA Email: dsewell at virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From dsewell at virginia.edu Mon May 20 07:09:35 2013 From: dsewell at virginia.edu (David Sewell) Date: Mon, 20 May 2013 10:09:35 -0400 (EDT) Subject: [xquery-talk] why do you care what other people think ? (fwd) Message-ID: Jim, The best two websites for general information on DH organizations/events are probably: http://adho.org/ http://dh2013.unl.edu/ Also, the people within the DH community who are most interested in XML from a theoretical perspective can usually be found at the Balisage meetings: http://www.balisage.net/. David On Mon, 20 May 2013, James Fuller wrote: > Hello David, > > On Mon, May 20, 2013 at 3:46 PM, David Sewell wrote: > ... >> the oXygen editor/IDE). Even if the community of users is small by >> comparison with Javascript or Perl or whatever, the impact of projects that >> rely on XQuery is, I suspect, much greater than people realize. > > Great to confirm Uche's reliable instincts. > > Wondering what are the top venues (conferences, training, etc) where > digital humanities folk 'live' ? > > I would also be interested in hearing what kind of problems these > folks are trying to solve. > > thx, Jim > -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA Email: dsewell at virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ From liam at w3.org Mon May 20 07:49:25 2013 From: liam at w3.org (Liam R E Quin) Date: Mon, 20 May 2013 10:49:25 -0400 Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: <1369061365.9022.264.camel@slave.barefootcomputing.com> On Mon, 2013-05-20 at 09:46 -0400, David Sewell wrote: > [...] > it > is almost inconceivable that the projects I have worked on for the last decade > could have been achieved as well as they have without XQuery and the tools built > upon it (notably Saxon, MarkLogic, and the oXygen editor/IDE). XML is about who owns your data - you, or an application. This tends to mean that programmers (who want to own all the data) tend to hate it. But it also means that XML and the related technologies are often bridges that people who do not consider themselves programmers can cross. Or perhaps they are fords where you might get your feet wet just a little, but you don't have to swim. We often forget this when we are working on the specs. Maybe we should try and have WG meetings co-hosted at the adh or mls conference (or even with the tei member meeting). I have always been in love with the digital humanities work, from early TEI days and before. The humanities projects are not well-funded, generally, but the work they do will live on when the rest of us are forgotten. 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 joewiz at gmail.com Mon May 20 07:55:01 2013 From: joewiz at gmail.com (Joe Wicentowski) Date: Mon, 20 May 2013 10:55:01 -0400 Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: > Speaking as someone in the digital humanities community, I am extremely > grateful for the work that has been done on XQuery and on the entire suite > of XML-related W3C technologies (XPath, XSLT, etc.) within the W3C working > groups and by independent developers. As a self-taught programmer without a > computer science background, I can't evaluate the theoretical arguments pro > or against different styles of programming languages; all I know is that in > the practical world, it is almost inconceivable that the projects I have > worked on for the last decade could have been achieved as well as they have > without XQuery and the tools built upon it (notably Saxon, MarkLogic, and > the oXygen editor/IDE). Even if the community of users is small by > comparison with Javascript or Perl or whatever, the impact of projects that > rely on XQuery is, I suspect, much greater than people realize. Let me second David's sentiments wholeheartedly. I am also a self-taught programmer without a CS background - a historian. I'm convinced that I could not have taken on and accomplished what I have were it not for the high level concerns that XQuery allows me to focus on. I started this work in June 2007, months after XQuery's graduation to recommendation status and 1.0 and the publication of Priscilla Walmsley's book. I daily rely on and thank my lucky stars for tools like eXist-db and oXygen, and the vibrant, generous communities behind XQuery and all the XML-related W3C technologies. In seminars I've given to colleagues and new and seasoned digital humanists about XQuery, one of the most salient arguments that gives students the confidence that they *can* do this is that XQuery lets you focus on your data, and lets you get in and out without being bogged down with all the usual concerns of programming. I think XQuery is a tremendously empowering (dare I say transformational) technology. Joe From markus.flatscher at virginia.edu Mon May 20 09:51:20 2013 From: markus.flatscher at virginia.edu (Markus Flatscher) Date: Mon, 20 May 2013 12:51:20 -0400 Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: <519A5488.8080006@virginia.edu> Jim, the yearly Digital Humanities Summer School in Oxford has a technical and hands-on focus on matters of XML-based text encoding and -transformation. They also have a dedicated Linked Data workshop this year (July)?although nothing specifically targeted at xQuery, so apologies if off-topic: http://digital.humanities.ox.ac.uk/dhoxss/2013/workshops.html#humdata Markus On 5/20/13 10:08 AM, David Sewell wrote: > Jim, > > The best two websites for general information on DH > organizations/events are probably: > > http://adho.org/ > http://dh2013.unl.edu/ > > Also, the people within the DH community who are most interested in > XML from a theoretical perspective can usually be found at the > Balisage meetings: http://www.balisage.net/. > > David > > On Mon, 20 May 2013, James Fuller wrote: > >> Hello David, >> >> On Mon, May 20, 2013 at 3:46 PM, David Sewell >> wrote: >> ... >>> the oXygen editor/IDE). Even if the community of users is small by >>> comparison with Javascript or Perl or whatever, the impact of >>> projects that >>> rely on XQuery is, I suspect, much greater than people realize. >> >> Great to confirm Uche's reliable instincts. >> >> Wondering what are the top venues (conferences, training, etc) where >> digital humanities folk 'live' ? >> >> I would also be interested in hearing what kind of problems these >> folks are trying to solve. >> >> thx, Jim >> > -- Markus Flatscher, Editorial and Technical Specialist ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville VA 22904, USA Courier: 211 Emmet Street South, Charlottesville VA 22903, USA Email: markus.flatscher at virginia.edu Web: http://rotunda.upress.virginia.edu/ From dflorescu at me.com Mon May 20 17:13:48 2013 From: dflorescu at me.com (daniela florescu) Date: Mon, 20 May 2013 17:13:48 -0700 Subject: [xquery-talk] letter to a young scientist, and what this community is all about Message-ID: <1F6EAB28-5126-4566-A67C-87FAE3D34C23@me.com> Dear James and David, you both told me that you do not understand what I am trying to say about turning this community into a more scientifically driven one. At first I didn't know what to answer, because honestly, I have no particular agenda, and no clear goal in mind when I said that. But in the meantime, your request made me think about the lessons I received when I was a young researcher, lessons that I tried to inculcate to my PhD students and my team. Maybe they are useful in this discussion. Here is what I teach them. 1. Make sure you understand what is the problem you try to solve. That's self-evident. Spend MORE time clarifying the problem then trying to find a solution. Often after that the solution will show up naturally. 2. Make sure the problem you try to solve is worthwhile. Are you helping someone in a big way ? If no, move on to a different problem. 3. Be open minded and don't have fixed ideas and preconceptions. "It HAS to be this way". "This has ALWAYS worked like this.' Well, if we would want to keep thinks to keep working the way they did, we wouldn't do research.... 4. Do not be afraid to talk when you think you have something to say. Do not be afraid to be taken for stupid. Most people are quiet because they are afraid to look stupid. What a terrible mistake !! And how many interesting things we don't hear because the people thinking them are afraid to speak up ! Do not do that!! 5. Use your own mind, and do not take anybody else's opinion for granted. Hence, the "what do you care what other people think?".... There is no reason age, or social status will make you smarter, or more creative. In fact, I think it's likely the opposite. 6. When you open your mouth, though, be SURE that you did your research, and redid it 100 times. Don't be flamboyant if you don't know what you are talking about. 7. Don't be afraid to tackle "big" problem, or propose visionary solutions. Most people avoid those being afraid to be taken for paranoid. I will solve the cancer problem. Or I will solve the hunger in the world. Or I will make peace in the world. Well, yeah, you sound a tad lunatic when you say it. But geez, SOMEONE will do it one day. Why not you !? And even if you solve the problem entirely, maybe you put a serious dent into it. 8. Don't be afraid to say: "this is not true". Many people try to be nice, and don't say "you are wrong" when they think it. Again. that's another mistake. That's the wrong moment to be nice. In fact, that's NOT being nice, because sometimes the consequences (for other people) or your knowing that something and wrong and shutting up, can be nasty. That's a wrong interpretation of "being nice". But then again, check and recheck your facts before you do that. 9. Don't say things just to be popular. Many young scientists are afraid to open their mouths for fear that'll be taken for nutcases. Science is not a popularity contest. (that's why uncool kids from highschool become better scientists, they are already used to NOT being popular..:-) Well, yeah. This is because you ARE a nutcase. Live with this. Most good scientists are nutcases. A good scientists changes the status quo, and this rarely happens while being popular. Usually there is some form of inertia that pushes back on you. 10. Don't accept to change your scientific opinion because of pressure induced by people with more power then you. Unless you live in Iran or Korea, or some other strange places, or people threaten you to break your legs, don't do that. If you have no other choice, exploit the fact that we live in a free world, and move somewhere else... (that would explain my so many job employments :-) 11. Don't expect that once you said something once, BOUM, the world suddenly understands you perfectly and suddenly the world changes. The secret to happiness is to manage expectations. Get a grip, the likelihood of this happening is VERY low. 12. Get a good hobby and have a bunch of good friends. This helps with problem 11 above. Seriously, usually in my job interviews I ask people about they hobbies and friends. Someone who doesn't have any is less likely to be resilient to stress. (and stress there will be if you try to change the world..) 13. Develop a good taste for science. Good taste in science is very similar with good taste in fashion. Certain things are aesthetic and elegant, others not. I don't know how to explain this better. A mathematician friend of mine told me once " If a proof of a theorem is ugly, it is certainly flawed." 14. Have fun while doing research. If you are not having fun, and you are not entthusiastic, something is off, either with you, your interest in the problem, or the problem itself. Then go do something else. 15. Don't support a cause for commercial gain only. When you do so, science is gone. Of course, commercial gain is always part of the equation, someone has to pay for your/your team/your company's bills, and we didn't invent yet a world without money. But there is a matter of balance and proportions. 16. Associate yourself with other people you think are good scientists. There is someone who said: "be friend with smart people and suddenly you will become one of them". but also goes along the lines: associate yourself with people that are not creepy and only motivated by commercial gain, or control. 17. Do not belong to "scientific" groups that have members above the law, aka, whose opinion is taken as the gospel, or groups who have "principles" that are above being discussed. The groups who need Gods and given books are called religious groups, not scientific communities. To cite from another classic favorite of mine (Goya): The sleep of reason produces monsters. http://en.wikipedia.org/wiki/The_Sleep_of_Reason_Produces_Monsters 18. Even if you have something interesting to say, be brief and do not open your mouth EVERY DAY. To paraphrase freely from Larry Page: "If I have to read your emails every day, or I need to scroll to read it, I won't read it at all". 19. Do not feel bad because you want your solution to be accepted. Of course you do. That's a sign that you care about the problem. Otherwise, tell me again, why do you do research at all !? That's not a sign that you are mentally disturbed and an ego fanatic (well, unless you are :-). That's in general a sign that you care. 20. On the other hand, if proven that you are wrong, accept it and move on. Nothing wrong with that. Everybody has been wrong (Jim Gray, another legend once famously explained publicly to the Wikipedia founder why wikipedia will never work..) (well, the stupidest moment of my life is when I did the same with founder of twitter, when he was a young and totally unknown person...Oups.) 20. Learn to laugh. Laughing increases creativity. http://www.fastcompany.com/3009489/leadership-now/why-humor-makes-you-more-creative?sf12872537=1 Good research is sometimes like a good prankster. ======== Now, after scrolling up to here, you might ask me why do you had to read all this. Well, it's because James and David asked me :-) Seriously now. I think this community is faulty first and foremost with the FIRST bullet on this list. We don't know what is the problem we solve. If (re)formatting documents is what we want, XSLT does it magnificently, and we should all go home. If it's information management, data science, or whatever name this thing has, then XQuery is just the first drop in the ocean and we need to go back to the drawing board. Best Dana From dflorescu at me.com Mon May 20 17:33:53 2013 From: dflorescu at me.com (daniela florescu) Date: Mon, 20 May 2013 17:33:53 -0700 Subject: [xquery-talk] and what I think we should tackle right now Message-ID: 1. I think this community should take JSON very seriously, because it's here to stay. The way that maps are designed in XQuery is a failed attempt to solve that problem, that kind of solves the JSON problem, but not really. It's more likely to annoy the JSON people then attract them to what we have. On xml-dev there was a long discussion about this and someone said this very intelligent thing: "the Web ignored XML because XML ignored the Web". I don't remember who, but this was brilliant. The world will AGAIN ignore XML if XML CONTINUES to ignore the realities of the web. 2. I think XQuery is a great beginning, not a great end. >From XQuery to a general solution for information management, there is stuff to do. Rules, workflow, side-effects, tools, integration with machine learning and NLP, etc, etc, etc. If we are so content with XQuery as it is and we see it as an end result in itself, then we are about to miss a big bunch. My 5 cents. Dana From dflorescu at me.com Mon May 20 23:07:52 2013 From: dflorescu at me.com (daniela florescu) Date: Mon, 20 May 2013 23:07:52 -0700 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: <73C67E72-5181-43CB-A1D0-C32466313B9E@me.com> > > On xml-dev there was a long discussion about this and someone said this very intelligent thing: > "the Web ignored XML because XML ignored the Web". > > I don't remember who, but this was brilliant. > The world will AGAIN ignore XML if XML CONTINUES to ignore the realities of the web. Sorry to come back to this.... The fact that the Web will ignore XML does not bother me so much (well, that's a well deserved reaction, sorry!). What bothers me is the fact that they will throw the baby with the baby water, and they will ignore XQuery. And XQuery (the functional, declarative aspect of information processing..) is not guilty for the silliness of the good old core XML mentality (they still have SGML revenge on their flags, documents are the only thing that matters, and semi-structured data never happened...:-). I wish XQuery would be bound to that good old XML mentality, because it has nothing to do with it. Dana From andrew.j.welch at gmail.com Tue May 21 04:30:05 2013 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 21 May 2013 12:30:05 +0100 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: > On xml-dev there was a long discussion about this and someone said this very intelligent thing: > "the Web ignored XML because XML ignored the Web". I don't get it - the language of the browser is javascript, and its easy to process json in javascript.... The back end could well be xml, but the server -> client communication is always going to be json while the processing language is javascript - what's the problem with that? -- Andrew Welch http://andrewjwelch.com From andrew.j.welch at gmail.com Tue May 21 04:49:06 2013 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 21 May 2013 12:49:06 +0100 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: > Same story on the backend, when it comes to query flexible documents, XQuery > has answered a lot of questions that the NoSQL community is only starting to > discover and yet it seems that there is a cultural gap between the two > communities. Interesting - what are problems the NoSQL community is discovering that XQuery solves? (I've got zero nosql knowledge) -- Andrew Welch http://andrewjwelch.com From ihe.onwuka at gmail.com Tue May 21 05:05:58 2013 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 21 May 2013 13:05:58 +0100 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: > > Same story on the backend, when it comes to query flexible documents, XQuery > has answered a lot of questions that the NoSQL community is only starting to > discover and yet it seems that there is a cultural gap between the two > communities. > Re NoSQL and a bit of a digression. but could same the same about IMS/DB, IDMS or any of the old network/hierarchical databases. Perhaps the issue with NoSQL is that they like to believe (or at least behave as if ) they are doing something new and unique. From msokolov at safaribooksonline.com Tue May 21 05:56:18 2013 From: msokolov at safaribooksonline.com (Michael Sokolov) Date: Tue, 21 May 2013 08:56:18 -0400 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: <519B6EF2.1080609@safaribooksonline.com> On 05/21/2013 08:05 AM, Ihe Onwuka wrote: >> Same story on the backend, when it comes to query flexible documents, XQuery >> has answered a lot of questions that the NoSQL community is only starting to >> discover and yet it seems that there is a cultural gap between the two >> communities. >> >> > Re NoSQL and a bit of a digression. but could same the same about > IMS/DB, IDMS or any of the old network/hierarchical databases. Perhaps > the issue with NoSQL is that they like to believe (or at least behave > as if ) they are doing something new and unique. > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk > The difference is the ready availability of huge computing resources and datasets to a large number of entry-level programmers and data users, for want of a better word. I think the XQuery model is great for what it provides to those willing to scale the mountain, but it also seems as if there is a big "niche" for a system that provides easy query/processing/storage etc capabilities at enormous scale for low intellectual investment. Look at Google - one box, type anything, get something not totally wrong usually. It's a low barrier in terms of query capability, but an enormous amount of data and usability for (almost) *everyone*. NoSQL databases are a few steps up from that in terms of data modeling and query language, but what they are really trying to offer is easy scaling. -Mike From adam.retter at googlemail.com Tue May 21 06:14:29 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Tue, 21 May 2013 14:14:29 +0100 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: Personally I think that XQuery can have support for consuming and producing JSON, but do I want to work with JSON inside XQuery - not really. I do a LOT of work with both JSON and XML, for JSON work I tend to use JavaScript and for XML I tend to use XQuery/XSLT. Should there be one language to do both, perhaps. Is it XQuery, I dont think so. However, it could be a new language which is a superset of XQuery and takes many of the concepts from XQuery (maybe that is JSONiq and maybe it is not). My point though is that the X in XQuery stands for XML, I like XQuery and I do not think we need to reinvent it, it does what it was designed for. I am not opposed to creating a new language though, and if it allows me to do what I already do in XQuery and also do a bunch of stuff which I normally do with JavaScript *and* it is standardised and widely adopted then sure I will move to it. I guess I am saying, XQuery does not have to last for ever or even reinvent itself, but whilst it is the right tool for the right job (that I am doing) then I will continue to use it. So, perhaps Daniela we should stop trying to change XQuery and instead invent DQuery? Where the D is for Document (in the abstract sense). On 21 May 2013 12:55, William Candillon wrote: > > > > On Tue, May 21, 2013 at 1:49 PM, Andrew Welch > wrote: >> >> > Same story on the backend, when it comes to query flexible documents, >> > XQuery >> > has answered a lot of questions that the NoSQL community is only >> > starting to >> > discover and yet it seems that there is a cultural gap between the two >> > communities. >> >> Interesting - what are problems the NoSQL community is discovering >> that XQuery solves? >> >> (I've got zero nosql knowledge) > > As far as I know, things like how do you joining documents efficiently or > windowing queries. Navigating into deeply nested data. > String collations, math functions, the whole date time data model. > > JSON document stores have been designed for scaling out and the processing > capabilities are extremely poor. They try to catch up (at least that's what > I'm seeing in some products). I feel that the XQuery expertise should be > reused in this space. This is one of the goals of the JSONiq project. > > William > > >> >> >> >> -- >> Andrew Welch >> http://andrewjwelch.com > > > > _______________________________________________ > 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 loren.cahlander at gmail.com Tue May 21 06:48:11 2013 From: loren.cahlander at gmail.com (Loren Cahlander) Date: Tue, 21 May 2013 09:48:11 -0400 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: <8B45F03A-2548-4A90-97D1-F66D7EE5AD9C@gmail.com> Comment inline. Sent from my iPad On May 21, 2013, at 9:14 AM, Adam Retter wrote: > Personally I think that XQuery can have support for consuming and > producing JSON, but do I want to work with JSON inside XQuery - not > really. I do a LOT of work with both JSON and XML, for JSON work I > tend to use JavaScript and for XML I tend to use XQuery/XSLT. > > Should there be one language to do both, perhaps. Is it XQuery, I dont > think so. However, it could be a new language which is a superset of > XQuery and takes many of the concepts from XQuery (maybe that is > JSONiq and maybe it is not). My point though is that the X in XQuery > stands for XML, I like XQuery and I do not think we need to reinvent > it, it does what it was designed for. I am not opposed to creating a > new language though, and if it allows me to do what I already do in > XQuery and also do a bunch of stuff which I normally do with > JavaScript *and* it is standardised and widely adopted then sure I > will move to it. > > I guess I am saying, XQuery does not have to last for ever or even > reinvent itself, but whilst it is the right tool for the right job > (that I am doing) then I will continue to use it. > > So, perhaps Daniela we should stop trying to change XQuery and instead > invent DQuery? Where the D is for Document (in the abstract sense). I fully agree with this statement! Different languages have their strengths and weaknesses. Do not try to make a pliers into a screwdriver. Find a screwdriver to drive in screws. If XQuery does not meet your needs, then either propose changes that do not change to focus of XQuery or find/invent a language that meets your needs. > > > On 21 May 2013 12:55, William Candillon wrote: >> >> >> >> On Tue, May 21, 2013 at 1:49 PM, Andrew Welch >> wrote: >>> >>>> Same story on the backend, when it comes to query flexible documents, >>>> XQuery >>>> has answered a lot of questions that the NoSQL community is only >>>> starting to >>>> discover and yet it seems that there is a cultural gap between the two >>>> communities. >>> >>> Interesting - what are problems the NoSQL community is discovering >>> that XQuery solves? >>> >>> (I've got zero nosql knowledge) >> >> As far as I know, things like how do you joining documents efficiently or >> windowing queries. Navigating into deeply nested data. >> String collations, math functions, the whole date time data model. >> >> JSON document stores have been designed for scaling out and the processing >> capabilities are extremely poor. They try to catch up (at least that's what >> I'm seeing in some products). I feel that the XQuery expertise should be >> reused in this space. This is one of the goals of the JSONiq project. >> >> William >> >> >>> >>> >>> >>> -- >>> Andrew Welch >>> http://andrewjwelch.com >> >> >> >> _______________________________________________ >> 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 dlee at calldei.com Tue May 21 07:09:31 2013 From: dlee at calldei.com (David Lee) Date: Tue, 21 May 2013 14:09:31 +0000 Subject: [xquery-talk] HRE: and what I think we should tackle right now Message-ID: <048ec015e0834d048268bec4b2e27d1d@BY2PR08MB014.namprd08.prod.outlook.com> >> Andrew I don't get it - the language of the browser is javascript, and its easy to process json in javascript.... The back end could well be xml, but the server -> client communication is always going to be json while the processing language is javascript - what's the problem with that? <<< I wouldn't hold my breath for "always". I will make a prediction and bet a 1 beer delivered in person if you come to me personally in 5 years. I predict that in 5 years that the majority of Web Applications Running In Browsers will *not* be authored in JavaScript directly, but rather in a language that compiles to JavaScript. I see a trend continuing as it has for 50+ years as languages and machines evolve - the pattern seems the same to me. As machines get faster and people get more creative with languages they go through a phase A) This language is great, its fast, its close to the machine its obvious we will use it forever B) Well it would nice if it had a preprocessor or maybe some libraries C) I'm using the preprocessor and libraries so much I am not writing very *much* of the native language D) Someone just invented a *compiler* to let me write code in a language I prefer ... but ... its slow and buggy and there's that 10% it never gets right so no Real Coders will ever use it E) The compiler gets better and better so that no longer is the layer below it needed for anything but the most obscure tasks. F) The compiler gets *faster* then hand written code for the layer below it because it can optimize better than humans for a majority of expressions especially for large systems where you simply cannot optimize everything by hand. G) What happened to all those people who would never use this new language ? Nearly everyone is using it(s). H) Language "A" is used only by people writing the compilers for language D and isn't taught in school ...in fact most people don't even know it exists. Examples of this trend Machine Language -> Macro Assembler -> C -> C + libraries -> C++ Macro Assembler -> Fortran / Basic / Pascal ... C/C++ -> Java Java -> (really Java Bytecode) -> jRuby / Scala etc. C++ -> JavaScript C -> Objective C JavaScript -> JavaScript + Libraries (jQuery etc.) -> Dart/GWT/CoffeeScript etc. HTML -> GUI's that produce HTML -> JavaScript that produces HTML ... And even now were seeing new and old languages based on GWT ! Turtles all the way down. Right now I see very little "Pure JavaScript" written in any bulk ... for people who write JavaScript Applications they do so with Libraries (like jQuery, YUI etc.). This is Phase #B from above. There are a few starting the trend of bucking the JS+Libraries and going for the new language directly. I personally have become a fan of GWT ... and my JavaScript writing friends think I'm nuts. But I have not stumbled into the brick wall they claim is in front of me every step. I understand their scorn because they know JavaScript inside-out so writing in some other language that *produces impossible to read JavaScript* is nonsensical. Exactly the same discussions I had with C programmers in the 80s, and C++ programmers in the late 80's and Java programmers in the 90s ... So I make a prediction . In 5 years (give or take a decade) the shift will be complete as it has nearly universally done for the past 50 and Web Applications will be written in a language that compiles to JavaScript instead of JavaScript manually. And when that happens. The major reason for JSON will vanish. (that being it converts to JavaScript by simply looking at it). I am not saying that JSON will vanish, it has other reasons to exist and by then will likely be as entrenched as ASCII, and possibly as hard to get rid of ... but ... No longer will it be The Inherently Obvious format to send data to browsers. I will not predict what will replace it, but I do predict that the biggest leg holding it up will simply vanish. -David ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -- Andrew Welch http://andrewjwelch.com _______________________________________________ talk at x-query.com http://x-query.com/mailman/listinfo/talk From andrew.j.welch at gmail.com Tue May 21 07:17:09 2013 From: andrew.j.welch at gmail.com (Andrew Welch) Date: Tue, 21 May 2013 15:17:09 +0100 Subject: [xquery-talk] HRE: and what I think we should tackle right now In-Reply-To: <048ec015e0834d048268bec4b2e27d1d@BY2PR08MB014.namprd08.prod.outlook.com> References: <048ec015e0834d048268bec4b2e27d1d@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: On 21 May 2013 15:09, David Lee wrote: >>> Andrew > I don't get it - the language of the browser is javascript, and its > easy to process json in javascript.... The back end could well be xml, > but the server -> client communication is always going to be json > while the processing language is javascript - what's the problem with > that? > <<< > > I wouldn't hold my breath for "always". > I will make a prediction and bet a 1 beer delivered in person if you come to me personally in 5 years. > I predict that in 5 years that the majority of Web Applications Running In Browsers will *not* be authored in JavaScript directly, but rather in a language that compiles to JavaScript. > The folly of prediction :) (plus im not Scottish so I won't hold you to that beer) Whilst the client application might be written in a language that compiles to javascript, what will the format be of the client/server communication? -- Andrew Welch http://andrewjwelch.com From mike at saxonica.com Tue May 21 07:25:46 2013 From: mike at saxonica.com (Michael Kay) Date: Tue, 21 May 2013 15:25:46 +0100 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: <0A3B63A4-45FE-4B2E-BD5B-B412F1864F51@saxonica.com> On 21 May 2013, at 14:14, Adam Retter wrote: > Personally I think that XQuery can have support for consuming and > producing JSON, but do I want to work with JSON inside XQuery - not > really. I do a LOT of work with both JSON and XML, for JSON work I > tend to use JavaScript and for XML I tend to use XQuery/XSLT. > > Should there be one language to do both, perhaps. Is it XQuery, I dont > think so. I think the essential point is that when you've got a language that fits its data model, you're happy, and when you're using a language that doesn't fit it's data model, you're forever cutting against the grain. The famous impedance mismatch. XSLT and XQuery are very closely designed around the XML data model with all its peculiar quirks; that makes them very good at doing XML, and a bit of a peculiar choice for doing anything else. Designing a data model that can embrace XML and JSON with a high level of fidelity is not easy, as we are finding - it's easy to find you've designed a camel (or a chimera in Jeni's memorable terms). No-one in my view has ever really succeeded in designing a data model that works well for integrating heterogeneous data sources. They've been trying for at least 40 years. My own preferred candidate is the functional data model, because it so minimalist, but it's not exactly a fashionable candidate right now. Michael Kay Saxonica From dlee at calldei.com Tue May 21 07:33:58 2013 From: dlee at calldei.com (David Lee) Date: Tue, 21 May 2013 14:33:58 +0000 Subject: [xquery-talk] HRE: and what I think we should tackle right now In-Reply-To: References: <048ec015e0834d048268bec4b2e27d1d@BY2PR08MB014.namprd08.prod.outlook.com> Message-ID: <89233f1c7dae4f25923f4d382ad79f4a@BY2PR08MB014.namprd08.prod.outlook.com> >>>> The folly of prediction :) (plus im not Scottish so I won't hold you to that beer) Whilst the client application might be written in a language that compiles to javascript, what will the format be of the client/server communication? <<<<<< As I said, I am not THAT good at prediction :) I don't know what the format will be. We may cycle through the phase where many formats are preferable to one, a format for each language and its corresponding server. Or a format that suits the data ... Then discover that One Ring that Rules Them All is better ! Then discover it was created by an evil daemon ... Then discover that My New Awesome Format is Better than Anything. ( hmmm NAF !!! ) What I do predict is that the format(s) will be chosen for characteristics more important (or more convenient or more inbred) than the ability of JavaScript to do an eval() on it. That still might be JSON ... Although I really doubt it. As clients get thicker the size and complexity of the data they want goes UP not down. With HTML5 I am seeing people sending things like raw dumps of sqlite database ... so they can run their apps entirely disconnected. ---------------------------------------- David A. Lee dlee at calldei.com http://www.xmlsh.org -- Andrew Welch http://andrewjwelch.com From dflorescu at me.com Tue May 21 12:57:24 2013 From: dflorescu at me.com (daniela florescu) Date: Tue, 21 May 2013 12:57:24 -0700 Subject: [xquery-talk] why do you care what other people think ? In-Reply-To: References: <4C30B3EF-51DB-44F8-8250-551EF6DEA16E@me.com> Message-ID: <9E3101F0-8CCF-478E-872A-D05B0342BECA@me.com> On May 20, 2013, at 7:55 AM, Joe Wicentowski wrote: >> I am extremely grateful for the work that has been done on XQuery > I'm > convinced that I could not have taken on and accomplished what I have > were it not for the high level concerns that XQuery allows me to focus > on. David, Joe, thanks a LOT for those messages. It means that our (hard) work was not spent in vain ! It's very rewarding for all of us. But I would like you to clearly understand what I am saying, as I think there is a disconnect. It's not that I think XQuery is no good. It's that it can do SO MUCH MORE. It's just a BEGINNING of what you can have in terms of information processing, not an END, hopefully. Does it make it more clear ? Best regards Dana From dflorescu at me.com Tue May 21 15:45:15 2013 From: dflorescu at me.com (daniela florescu) Date: Tue, 21 May 2013 15:45:15 -0700 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: References: Message-ID: > > > So, perhaps Daniela we should stop trying to change XQuery and instead > invent DQuery? Where the D is for Document (in the abstract sense). Adam, honestly, I have no desire to put more time in XQuery as a standard, simply because I do not believe in any future (successful) versions after 3.0. That's exactly what I am doing, and it is called www.jsoniq.org . (the fact that it extends XQuery is no surprise, given that most of the features we use from XQuery are coming from me anyway. So I don't need to invent anything new, I already did it.) Best Dana From daktapaal at gmail.com Thu May 23 01:34:56 2013 From: daktapaal at gmail.com (Mailing Lists Mail) Date: Thu, 23 May 2013 09:34:56 +0100 Subject: [xquery-talk] Query the attributes Message-ID: Dear All, I was trying to query the atribute value using Xquery in MarkLogic and no matter what, I dont seem to be printing the value... So this is what I do... for $college at $position in $doc//college return
{$college/name}
{$college/@id}
This is interesting as the first div is prints the name of the college... the second is empty.. if I change the xpath to:
{$college/@*[1]/name()}
this does print the text "id" , which is correct. so I tried
{$college/@*[1] }
I thought that this should print the value in the attribute id, which is also the first attribute... There is probably something very basic, I am missing... So please help! Thanks --Dak From mike at saxonica.com Thu May 23 01:48:09 2013 From: mike at saxonica.com (Michael Kay) Date: Thu, 23 May 2013 09:48:09 +0100 Subject: [xquery-talk] Query the attributes In-Reply-To: References: Message-ID: <7F89ECFB-5536-4246-8108-440D68E5A011@saxonica.com> I can't see anything wrong with your code. Sorry if that's not a helpful answer but at least you know someone is listening! Giving a complete query and source document might help, then at least we can see if it works on other processors, or we might spot something strange in the XML. The only XML I can think of that's consistent with your observations is where the id attribute is present with a value of "" (empty string). Michael Kay Saxonica On 23 May 2013, at 09:34, Mailing Lists Mail wrote: > Dear All, > I was trying to query the atribute value using Xquery in MarkLogic and > no matter what, I dont seem to be printing the value... > So this is what I do... > > for $college at $position in $doc//college > return >
> {$college/name} >
>
> {$college/@id} >
> > This is interesting as the first div is prints the name of the > college... the second is empty.. if I change the xpath to: >
> {$college/@*[1]/name()} >
> this does print the text "id" , which is correct. > > so I tried > >
> {$college/@*[1] } >
> > I thought that this should print the value in the attribute id, which > is also the first attribute... > > There is probably something very basic, I am missing... So please help! > > Thanks > --Dak > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From john.snelson at marklogic.com Thu May 23 01:53:47 2013 From: john.snelson at marklogic.com (John Snelson) Date: Thu, 23 May 2013 09:53:47 +0100 Subject: [xquery-talk] Query the attributes In-Reply-To: References: Message-ID: <519DD91B.8040306@marklogic.com> On 23/05/13 09:34, Mailing Lists Mail wrote: > I was trying to query the atribute value using Xquery in MarkLogic and > no matter what, I dont seem to be printing the value... > So this is what I do... > > for $college at $position in $doc//college > return >
> {$college/name} >
>
> {$college/@id} >
In both those cases you're selecting nodes, and the nodes are being added to the result tree. I suspect the browser is displaying the name, as it is an element with text content, but the "id" attribute is added as an attribute, which browsers don't display. In both cases what you really want is probably the string value of those nodes, which you can get be calling the string() function on them. John -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From daktapaal at gmail.com Thu May 23 02:01:11 2013 From: daktapaal at gmail.com (Mailing Lists Mail) Date: Thu, 23 May 2013 10:01:11 +0100 Subject: [xquery-talk] Query the attributes In-Reply-To: <519DD91B.8040306@marklogic.com> References: <519DD91B.8040306@marklogic.com> Message-ID: Hi Mike/ JOhn/ As far as my knowledge went, i did not think anything was wrong as calling a child element should be the same as calling attribute for practical purposes. I will try to reproduce the issue with something smaller. In the meantime, I shall try John's suggestion.., Thanks both for your replies. Dak On Thu, May 23, 2013 at 9:53 AM, John Snelson wrote: > On 23/05/13 09:34, Mailing Lists Mail wrote: >> >> I was trying to query the atribute value using Xquery in MarkLogic and >> no matter what, I dont seem to be printing the value... >> So this is what I do... >> >> for $college at $position in $doc//college >> return >>
>> {$college/name} >>
>>
>> {$college/@id} >>
> > > In both those cases you're selecting nodes, and the nodes are being added to > the result tree. I suspect the browser is displaying the name, as it is an > element with text content, but the "id" attribute is added as an attribute, > which browsers don't display. > > In both cases what you really want is probably the string value of those > nodes, which you can get be calling the string() function on them. > > John > > -- > John Snelson, Lead Engineer http://twitter.com/jpcs > MarkLogic Corporation http://www.marklogic.com > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From daktapaal at gmail.com Thu May 23 02:19:41 2013 From: daktapaal at gmail.com (Mailing Lists Mail) Date: Thu, 23 May 2013 10:19:41 +0100 Subject: [xquery-talk] Query the attributes In-Reply-To: References: <519DD91B.8040306@marklogic.com> Message-ID: Just updating... I tried : { string($college/@id) } and { $college/@id/string() } Both worked! You were right John, I checked the source of HTML .. the name was getting on to the div element as an attribute. so it is more like copy-of select as opposed to value-of select So i tried { $college/name/text() } this copied the text node of the name.. So the
rerr
now is more
rerr
which is what i want... I guess we couldnt do the same for the attribute nodes as {$college/@id/text()} Thanks.... On Thu, May 23, 2013 at 10:01 AM, Mailing Lists Mail wrote: > Hi Mike/ JOhn/ > > As far as my knowledge went, i did not think anything was wrong as > calling a child element should be the same as calling attribute for > practical purposes. > I will try to reproduce the issue with something smaller. In the > meantime, I shall try John's suggestion.., > > Thanks both for your replies. > Dak > > On Thu, May 23, 2013 at 9:53 AM, John Snelson > wrote: >> On 23/05/13 09:34, Mailing Lists Mail wrote: >>> >>> I was trying to query the atribute value using Xquery in MarkLogic and >>> no matter what, I dont seem to be printing the value... >>> So this is what I do... >>> >>> for $college at $position in $doc//college >>> return >>>
>>> {$college/name} >>>
>>>
>>> {$college/@id} >>>
>> >> >> In both those cases you're selecting nodes, and the nodes are being added to >> the result tree. I suspect the browser is displaying the name, as it is an >> element with text content, but the "id" attribute is added as an attribute, >> which browsers don't display. >> >> In both cases what you really want is probably the string value of those >> nodes, which you can get be calling the string() function on them. >> >> John >> >> -- >> John Snelson, Lead Engineer http://twitter.com/jpcs >> MarkLogic Corporation http://www.marklogic.com >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk From adam.retter at googlemail.com Thu May 23 02:21:15 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Thu, 23 May 2013 10:21:15 +0100 Subject: [xquery-talk] Query the attributes In-Reply-To: References: Message-ID: Instead use this - for $college at $position in $doc//college return
{$college/name}
{text{ $college/@id }}
See John Snelson's response for the 'why' of the matter. On 23 May 2013 09:34, Mailing Lists Mail wrote: > Dear All, > I was trying to query the atribute value using Xquery in MarkLogic and > no matter what, I dont seem to be printing the value... > So this is what I do... > > for $college at $position in $doc//college > return >
> {$college/name} >
>
> {$college/@id} >
> > This is interesting as the first div is prints the name of the > college... the second is empty.. if I change the xpath to: >
> {$college/@*[1]/name()} >
> this does print the text "id" , which is correct. > > so I tried > >
> {$college/@*[1] } >
> > I thought that this should print the value in the attribute id, which > is also the first attribute... > > There is probably something very basic, I am missing... So please help! > > Thanks > --Dak > _______________________________________________ > 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 daktapaal at gmail.com Thu May 23 02:35:36 2013 From: daktapaal at gmail.com (Mailing Lists Mail) Date: Thu, 23 May 2013 10:35:36 +0100 Subject: [xquery-talk] Query the attributes In-Reply-To: References: Message-ID: Thanks all... Great help indeed... On Thu, May 23, 2013 at 10:21 AM, Adam Retter wrote: > Instead use this - > > for $college at $position in $doc//college > return >
> {$college/name} >
>
> {text{ $college/@id }} >
> > See John Snelson's response for the 'why' of the matter. > > On 23 May 2013 09:34, Mailing Lists Mail wrote: >> Dear All, >> I was trying to query the atribute value using Xquery in MarkLogic and >> no matter what, I dont seem to be printing the value... >> So this is what I do... >> >> for $college at $position in $doc//college >> return >>
>> {$college/name} >>
>>
>> {$college/@id} >>
>> >> This is interesting as the first div is prints the name of the >> college... the second is empty.. if I change the xpath to: >>
>> {$college/@*[1]/name()} >>
>> this does print the text "id" , which is correct. >> >> so I tried >> >>
>> {$college/@*[1] } >>
>> >> I thought that this should print the value in the attribute id, which >> is also the first attribute... >> >> There is probably something very basic, I am missing... So please help! >> >> Thanks >> --Dak >> _______________________________________________ >> 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 mike at saxonica.com Thu May 23 02:49:27 2013 From: mike at saxonica.com (Michael Kay) Date: Thu, 23 May 2013 10:49:27 +0100 Subject: [xquery-talk] Query the attributes In-Reply-To: References: <519DD91B.8040306@marklogic.com> Message-ID: A well-known gotcha in XQuery, sorry for not spotting it! Michael Kay Saxonica On 23 May 2013, at 10:19, Mailing Lists Mail wrote: > Just updating... > I tried : > { > string($college/@id) > } > > and > > { > $college/@id/string() > } > > Both worked! > > You were right John, I checked the source of HTML .. the name was > getting on to the div element as an attribute. > > so it is more like copy-of select as opposed to value-of select > > So i tried > > { > $college/name/text() > } > > this copied the text node of the name.. So the
rerr >
now is more
rerr
which is what i want... > > I guess we couldnt do the same for the attribute nodes as {$college/@id/text()} > > > Thanks.... > > On Thu, May 23, 2013 at 10:01 AM, Mailing Lists Mail > wrote: >> Hi Mike/ JOhn/ >> >> As far as my knowledge went, i did not think anything was wrong as >> calling a child element should be the same as calling attribute for >> practical purposes. >> I will try to reproduce the issue with something smaller. In the >> meantime, I shall try John's suggestion.., >> >> Thanks both for your replies. >> Dak >> >> On Thu, May 23, 2013 at 9:53 AM, John Snelson >> wrote: >>> On 23/05/13 09:34, Mailing Lists Mail wrote: >>>> >>>> I was trying to query the atribute value using Xquery in MarkLogic and >>>> no matter what, I dont seem to be printing the value... >>>> So this is what I do... >>>> >>>> for $college at $position in $doc//college >>>> return >>>>
>>>> {$college/name} >>>>
>>>>
>>>> {$college/@id} >>>>
>>> >>> >>> In both those cases you're selecting nodes, and the nodes are being added to >>> the result tree. I suspect the browser is displaying the name, as it is an >>> element with text content, but the "id" attribute is added as an attribute, >>> which browsers don't display. >>> >>> In both cases what you really want is probably the string value of those >>> nodes, which you can get be calling the string() function on them. >>> >>> John >>> >>> -- >>> John Snelson, Lead Engineer http://twitter.com/jpcs >>> MarkLogic Corporation http://www.marklogic.com >>> _______________________________________________ >>> 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 ihe.onwuka at gmail.com Tue May 28 08:32:59 2013 From: ihe.onwuka at gmail.com (Ihe Onwuka) Date: Tue, 28 May 2013 16:32:59 +0100 Subject: [xquery-talk] and what I think we should tackle right now In-Reply-To: <519B6EF2.1080609@safaribooksonline.com> References: <519B6EF2.1080609@safaribooksonline.com> Message-ID: On Tue, May 21, 2013 at 1:56 PM, Michael Sokolov wrote: > On 05/21/2013 08:05 AM, Ihe Onwuka wrote: >>> >>> Same story on the backend, when it comes to query flexible documents, >>> XQuery >>> has answered a lot of questions that the NoSQL community is only starting >>> to >>> discover and yet it seems that there is a cultural gap between the two >>> communities. >>> >>> >> >> Re NoSQL and a bit of a digression. but could same the same about >> IMS/DB, IDMS or any of the old network/hierarchical databases. Perhaps >> the issue with NoSQL is that they like to believe (or at least behave >> as if ) they are doing something new and unique. >> _______________________________________________ >> talk at x-query.com >> http://x-query.com/mailman/listinfo/talk >> > > The difference is the ready availability of huge computing resources and > datasets to a large number of entry-level programmers and data users, for > want of a better word. Some people are using SQL for solving non database problems just to take advantage of the built in query optimisation and performance features of relational databases. I guess if the query engine offers fast enough performance people will be willing to convert their data to whatever form is necessary to take advantage of it. From liam at w3.org Tue May 28 23:09:39 2013 From: liam at w3.org (Liam R E Quin) Date: Wed, 29 May 2013 02:09:39 -0400 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: References: Message-ID: <1369807779.9042.439.camel@slave.barefootcomputing.com> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: > Hi, > > I am looking for some tools/plugins which provides xquery coding style > check and suggest the xquery coding standards if not followed properly. We don't have coding standards for XQuery. In XQuery 3 there's a way to say you don't want any optional features, so that you can get an idea about how portable your query might be, but there are still no rules for layout, for example. 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 liam at w3.org Tue May 28 23:10:52 2013 From: liam at w3.org (Liam R E Quin) Date: Wed, 29 May 2013 02:10:52 -0400 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: References: Message-ID: <1369807852.9042.440.camel@slave.barefootcomputing.com> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: > Hi, > > I am looking for some tools/plugins which provides xquery coding style > check and suggest the xquery coding standards if not followed properly. > > Just like Eclipse has plugins like ?CheckStyle? which gives warning if > Java coding standards are not followed. Sorry to post a 2nd time - there are eclipse plugins for XQuery, and some editors have support for syntax checking in XQuery (e.g. OxygenXML, and the GUI part of BaseX, to name a couple), in case that's what you meant. 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 adam.retter at googlemail.com Wed May 29 02:35:30 2013 From: adam.retter at googlemail.com (Adam Retter) Date: Wed, 29 May 2013 10:35:30 +0100 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: <1369807852.9042.440.camel@slave.barefootcomputing.com> References: <1369807852.9042.440.camel@slave.barefootcomputing.com> Message-ID: I think it could be valuable for us (W3C WG?) to come up with a coding standards for XQuery, so that when we look at XQuery code its all formatted the same. i.e. Where should braces go? declare local:function($a, $b) { () }; or declare local:function($a, $b) { () }; i.e. Where should return statements go? let $x = $y return $x or let $x = $y return $x I think you get the idea... On 29 May 2013 07:10, Liam R E Quin wrote: > On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: >> Hi, >> >> I am looking for some tools/plugins which provides xquery coding style >> check and suggest the xquery coding standards if not followed properly. >> >> Just like Eclipse has plugins like ?CheckStyle? which gives warning if >> Java coding standards are not followed. > > Sorry to post a 2nd time - there are eclipse plugins for XQuery, and > some editors have support for syntax checking in XQuery (e.g. OxygenXML, > and the GUI part of BaseX, to name a couple), in case that's what you > meant. > > 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 > > _______________________________________________ > 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 wcandillon at gmail.com Wed May 29 02:35:03 2013 From: wcandillon at gmail.com (William Candillon) Date: Wed, 29 May 2013 11:35:03 +0200 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: <1369807852.9042.440.camel@slave.barefootcomputing.com> References: <1369807852.9042.440.camel@slave.barefootcomputing.com> Message-ID: Hi, We have written a plugin to Cloud9 that static checking (unused variables, namespaces) and also does code formatting. If you are using Cloud9 (locally or on an hosted version), simply add the following extension: https://github.com/wcandillon/cloud9-xquery/raw/master/plugins-client/ext.xquery/xquery.js This plugin is done by using XQLint, a static checker for XQuery: https://github.com/wcandillon/xqlint This toolkit can easily be embedded into different type of IDE. This slidedeck contains a couple of useful informations about this project: https://speakerdeck.com/wcandillon/xquery-development-in-cloud9 On Wed, May 29, 2013 at 8:10 AM, Liam R E Quin wrote: > On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: >> Hi, >> >> I am looking for some tools/plugins which provides xquery coding style >> check and suggest the xquery coding standards if not followed properly. >> >> Just like Eclipse has plugins like ?CheckStyle? which gives warning if >> Java coding standards are not followed. > > Sorry to post a 2nd time - there are eclipse plugins for XQuery, and > some editors have support for syntax checking in XQuery (e.g. OxygenXML, > and the GUI part of BaseX, to name a couple), in case that's what you > meant. > > 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 > > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From wcandillon at gmail.com Wed May 29 02:41:19 2013 From: wcandillon at gmail.com (William Candillon) Date: Wed, 29 May 2013 11:41:19 +0200 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: References: <1369807852.9042.440.camel@slave.barefootcomputing.com> Message-ID: Darin has started this effort: http://xqdoc.org/xquery-style.html In fact, we started from these conventions in the XQLint/Cloud9 code formatter. On Wed, May 29, 2013 at 11:35 AM, Adam Retter wrote: > I think it could be valuable for us (W3C WG?) to come up with a coding > standards for XQuery, so that when we look at XQuery code its all > formatted the same. > > i.e. Where should braces go? > > declare local:function($a, $b) { > () > }; > > or > > declare local:function($a, $b) > { > () > }; > > i.e. Where should return statements go? > > let $x = $y return > $x > > or > > let $x = $y > return > $x > > > I think you get the idea... > > On 29 May 2013 07:10, Liam R E Quin wrote: >> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: >>> Hi, >>> >>> I am looking for some tools/plugins which provides xquery coding style >>> check and suggest the xquery coding standards if not followed properly. >>> >>> Just like Eclipse has plugins like ?CheckStyle? which gives warning if >>> Java coding standards are not followed. >> >> Sorry to post a 2nd time - there are eclipse plugins for XQuery, and >> some editors have support for syntax checking in XQuery (e.g. OxygenXML, >> and the GUI part of BaseX, to name a couple), in case that's what you >> meant. >> >> 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 >> >> _______________________________________________ >> 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 john.snelson at marklogic.com Wed May 29 03:56:44 2013 From: john.snelson at marklogic.com (John Snelson) Date: Wed, 29 May 2013 11:56:44 +0100 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: References: <1369807852.9042.440.camel@slave.barefootcomputing.com> Message-ID: <51A5DEEC.9010401@marklogic.com> I'm extremely dubious - coding style is a religion, and you won't get general agreement. I've found if you write good code it's readable, whatever the style. And if you write useful (bug free) code, no-one will comment on the style. If you really want a single style, here's my solution: Write more code than anyone else, and become the de-facto standard ;-). John On 29/05/13 10:35, Adam Retter wrote: > I think it could be valuable for us (W3C WG?) to come up with a coding > standards for XQuery, so that when we look at XQuery code its all > formatted the same. > > i.e. Where should braces go? > > declare local:function($a, $b) { > () > }; > > or > > declare local:function($a, $b) > { > () > }; > > i.e. Where should return statements go? > > let $x = $y return > $x > > or > > let $x = $y > return > $x > > > I think you get the idea... > > On 29 May 2013 07:10, Liam R E Quin wrote: >> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: >>> Hi, >>> >>> I am looking for some tools/plugins which provides xquery coding style >>> check and suggest the xquery coding standards if not followed properly. >>> >>> Just like Eclipse has plugins like ?CheckStyle? which gives warning if >>> Java coding standards are not followed. >> >> Sorry to post a 2nd time - there are eclipse plugins for XQuery, and >> some editors have support for syntax checking in XQuery (e.g. OxygenXML, >> and the GUI part of BaseX, to name a couple), in case that's what you >> meant. >> >> Liam -- John Snelson, Lead Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com From christian.gruen at gmail.com Wed May 29 04:42:33 2013 From: christian.gruen at gmail.com (=?ISO-8859-1?Q?Christian_Gr=FCn?=) Date: Wed, 29 May 2013 13:42:33 +0200 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: <51A5DEEC.9010401@marklogic.com> References: <1369807852.9042.440.camel@slave.barefootcomputing.com> <51A5DEEC.9010401@marklogic.com> Message-ID: Personally, I am more than happy to have some coding style conventions for languages such as Java. I would love to also have them in XQuery, but I fear that the flexibility of that language makes it difficult to find solutions which are strict, consistent and nice to read at the same time: we have strings that may extend over multiple lines, XML snippets with whitespaces that can?t be simply reindented... I frequently catch myself reinventing my own conventions, and I haven?t found a style yet that I?d like to fix for all the time coming. After all, the best thing would probably be to have some formatting and checkstyle-like templates in Eclipse, Cloud9 etc., which can then be adapted by everyone. > If you really want a single style, here's my solution: Write more code than > anyone else, and become the de-facto standard ;-). I like this one.. Christian ___________________________ On Wed, May 29, 2013 at 12:56 PM, John Snelson wrote: > I'm extremely dubious - coding style is a religion, and you won't get > general agreement. I've found if you write good code it's readable, whatever > the style. And if you write useful (bug free) code, no-one will comment on > the style. > > If you really want a single style, here's my solution: Write more code than > anyone else, and become the de-facto standard ;-). > > John > > > On 29/05/13 10:35, Adam Retter wrote: >> >> I think it could be valuable for us (W3C WG?) to come up with a coding >> standards for XQuery, so that when we look at XQuery code its all >> formatted the same. >> >> i.e. Where should braces go? >> >> declare local:function($a, $b) { >> () >> }; >> >> or >> >> declare local:function($a, $b) >> { >> () >> }; >> >> i.e. Where should return statements go? >> >> let $x = $y return >> $x >> >> or >> >> let $x = $y >> return >> $x >> >> >> I think you get the idea... >> >> On 29 May 2013 07:10, Liam R E Quin wrote: >>> >>> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: >>>> >>>> Hi, >>>> >>>> I am looking for some tools/plugins which provides xquery coding style >>>> check and suggest the xquery coding standards if not followed properly. >>>> >>>> Just like Eclipse has plugins like ?CheckStyle? which gives warning if >>>> Java coding standards are not followed. >>> >>> >>> Sorry to post a 2nd time - there are eclipse plugins for XQuery, and >>> some editors have support for syntax checking in XQuery (e.g. OxygenXML, >>> and the GUI part of BaseX, to name a couple), in case that's what you >>> meant. >>> >>> Liam > > > -- > John Snelson, Lead Engineer http://twitter.com/jpcs > MarkLogic Corporation http://www.marklogic.com > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From loren.cahlander at gmail.com Wed May 29 05:12:21 2013 From: loren.cahlander at gmail.com (Loren Cahlander) Date: Wed, 29 May 2013 08:12:21 -0400 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: <51A5DEEC.9010401@marklogic.com> References: <1369807852.9042.440.camel@slave.barefootcomputing.com> <51A5DEEC.9010401@marklogic.com> Message-ID: I could not agree more. Those who write good code will make it readable by definition. Those who do not write good code will not make it readable even if the code adheres to a coding style. Having a recommendation of a coding style is a good idea. It give the good software engineers somewhere to start from. On May 29, 2013, at 6:56 AM, John Snelson wrote: > I'm extremely dubious - coding style is a religion, and you won't get general agreement. I've found if you write good code it's readable, whatever the style. And if you write useful (bug free) code, no-one will comment on the style. > > If you really want a single style, here's my solution: Write more code than anyone else, and become the de-facto standard ;-). > > John > > On 29/05/13 10:35, Adam Retter wrote: >> I think it could be valuable for us (W3C WG?) to come up with a coding >> standards for XQuery, so that when we look at XQuery code its all >> formatted the same. >> >> i.e. Where should braces go? >> >> declare local:function($a, $b) { >> () >> }; >> >> or >> >> declare local:function($a, $b) >> { >> () >> }; >> >> i.e. Where should return statements go? >> >> let $x = $y return >> $x >> >> or >> >> let $x = $y >> return >> $x >> >> >> I think you get the idea... >> >> On 29 May 2013 07:10, Liam R E Quin wrote: >>> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: >>>> Hi, >>>> >>>> I am looking for some tools/plugins which provides xquery coding style >>>> check and suggest the xquery coding standards if not followed properly. >>>> >>>> Just like Eclipse has plugins like ?CheckStyle? which gives warning if >>>> Java coding standards are not followed. >>> >>> Sorry to post a 2nd time - there are eclipse plugins for XQuery, and >>> some editors have support for syntax checking in XQuery (e.g. OxygenXML, >>> and the GUI part of BaseX, to name a couple), in case that's what you >>> meant. >>> >>> Liam > > -- > John Snelson, Lead Engineer http://twitter.com/jpcs > MarkLogic Corporation http://www.marklogic.com > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk From geert.josten at dayon.nl Wed May 29 05:32:28 2013 From: geert.josten at dayon.nl (Geert Josten) Date: Wed, 29 May 2013 14:32:28 +0200 Subject: [xquery-talk] Is there any tool/plugin to verify the xquery coding standards? In-Reply-To: <51A5DEEC.9010401@marklogic.com> References: <1369807852.9042.440.camel@slave.barefootcomputing.com> <51A5DEEC.9010401@marklogic.com> Message-ID: <46439d630d2ea5cb8b1c6613bec7e40f@mail.gmail.com> There is a point to what John says. Though I personally found the xqdoc suggestions helpful to start with. My personal style deviates in some points, but there are good suggestions there and I am sure that I am using a fair percentage of the xqdoc style.. Grtz > -----Oorspronkelijk bericht----- > Van: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] > Namens John Snelson > Verzonden: woensdag 29 mei 2013 12:57 > Aan: talk at x-query.com > Onderwerp: Re: [xquery-talk] Is there any tool/plugin to verify the xquery > coding standards? > > I'm extremely dubious - coding style is a religion, and you won't get > general agreement. I've found if you write good code it's readable, > whatever the style. And if you write useful (bug free) code, no-one will > comment on the style. > > If you really want a single style, here's my solution: Write more code > than anyone else, and become the de-facto standard ;-). > > John > > On 29/05/13 10:35, Adam Retter wrote: > > I think it could be valuable for us (W3C WG?) to come up with a coding > > standards for XQuery, so that when we look at XQuery code its all > > formatted the same. > > > > i.e. Where should braces go? > > > > declare local:function($a, $b) { > > () > > }; > > > > or > > > > declare local:function($a, $b) > > { > > () > > }; > > > > i.e. Where should return statements go? > > > > let $x = $y return > > $x > > > > or > > > > let $x = $y > > return > > $x > > > > > > I think you get the idea... > > > > On 29 May 2013 07:10, Liam R E Quin wrote: > >> On Wed, 2013-05-29 at 11:36 +0530, abhinav mishra wrote: > >>> Hi, > >>> > >>> I am looking for some tools/plugins which provides xquery coding style > >>> check and suggest the xquery coding standards if not followed > properly. > >>> > >>> Just like Eclipse has plugins like ?CheckStyle? which gives warning if > >>> Java coding standards are not followed. > >> > >> Sorry to post a 2nd time - there are eclipse plugins for XQuery, and > >> some editors have support for syntax checking in XQuery (e.g. > OxygenXML, > >> and the GUI part of BaseX, to name a couple), in case that's what you > >> meant. > >> > >> Liam > > -- > John Snelson, Lead Engineer http://twitter.com/jpcs > MarkLogic Corporation http://www.marklogic.com > _______________________________________________ > talk at x-query.com > http://x-query.com/mailman/listinfo/talk