From dflorescu at mac.com Mon May 7 11:45:38 2012 From: dflorescu at mac.com (daniela florescu) Date: Mon, 07 May 2012 11:45:38 -0700 Subject: [xquery-talk] 5 summer interns for the FLWOR Foundation Message-ID: <07AE4B1A-11B5-4094-9B4E-5F4A4B564430@mac.com> Dear all, The XML community has spend oozes of time building languages, technology and platform software, that are at this time sufficiently mature. It's time now to build more killer apps in order to make people aware of what could be achieved using this technology. The FLOWR foundation is looking for 5 summer interns with XML, XQuery, database and application development knowledge, with creativity and initiative, to build a series of XML-only information intensive web applications. The position offers between 3 and 6 month of competitive salary (length depending of the complexity of the application to be developed), and it is located in Palo Alto, CA, the heart of Sillicon Valley (part of the internship can be done remotely, but not entirely). In addition to the XML technologies, the internship will provide in depth knowledge in database cloud computing, NOSQL, full text search, complex optimization of large information processing platforms. Please contact me for more information. Finally, if anybody on this mailing list has an interesting idea about such an application, we are more then happy to investigate financing the development (in open source only ! ). Best regards Dana From gkholman at CraneSoftwrights.com Sun May 13 07:19:47 2012 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Sun, 13 May 2012 10:19:47 -0400 Subject: [xquery-talk] Setting the document URI on constructed nodes. In-Reply-To: <220256FDE771B74FB662165BC562CF5937540C03@CH1PRD0802MB107.n amprd08.prod.outlook.com> References: <220256FDE771B74FB662165BC562CF5937540C03@CH1PRD0802MB107.namprd08.prod.outlook.com> Message-ID: <7.0.1.0.2.20120513100650.025080a8@wheresmymailserver.com> I cannot think of any way in the spec to specify the document URI of a temporary in-memory tree, because I don't think that is meaningful in the general case. However, when I've chained transformations in the past, I've sometimes needed to preserve the input document URI along all of the steps (because there have been relative URI addresses in the data) and so I've very simply used xml:base= on the document element of the temporary tree (unless the document element already has an xml:base= attribute). Remember that from a syntax perspective, the root document file entity of an XML document must contain the document element, so base-uri(/*) is always the same as document-uri(root()) when there is no xml:base= already there on the document element. So, when I create a temporary tree I use: ... and when I ask for base-uri(/*) I get "...whatever...". In my work I would do something along the lines of: let $d := doc("input.xml") return element {$d/name(.)} { attribute xml:base { "...whatever..." }, $d/@xml:base, (:in case there already exists one:) "rest of the processing" } I hope this helps. . . . . . . . . . . . Ken At 2012-05-13 13:58 +0000, David Lee wrote: >I noticed somewhat of a hole in XQuery ... hoping I am wrong. >I can find no way to set the base URI of a constructed document e.g > >document { } > >such that fn:document-uri() would return it. > >It seem this is one of those properties that must come from the >outside environment. >I know if I were to store the document to a file then re-read it, >likely the XML processor would pick it up ... I also know how to do >this programmatically in API's like say Saxon. >But it seems missing from XQuery itself. My guess is that since >XQuery doesnt support storing documents it was thought unimportant >to set the document URI. > >Why I ask ? >I'm still looking at Streaming XDM formats, including pure in-memory >streaming. >But it seems like I cannot directly encode and pass on a document >(or base) URI through XQuery by itself to the output. So any >constructed documents would have none or undefined URI's to the >receiver. this leads me to think I need a meta encoding for XDM >much like proposed at Balisage (XDML). basically passing the URI >information as seperate XDM values and a convention for interpreting >them. This seems like it could not be done in pure XQuery however >because the target even if it got say a sequence ( "uri" , document >) has no way to apply the uri to the document using XQuery so it >must be done by external code. > >Thanks for any commentary. >-David > -- Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012 Contact us for world-wide XML consulting and instructor-led training Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ G. Ken Holman mailto:gkholman at CraneSoftwrights.com Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal From gkholman at CraneSoftwrights.com Sun May 13 09:26:34 2012 From: gkholman at CraneSoftwrights.com (G. Ken Holman) Date: Sun, 13 May 2012 12:26:34 -0400 Subject: [xquery-talk] Setting the document URI on constructed nodes. In-Reply-To: <7.0.1.0.2.20120513100650.025080a8@wheresmymailserver.com> References: <220256FDE771B74FB662165BC562CF5937540C03@CH1PRD0802MB107.namprd08.prod.outlook.com> <7.0.1.0.2.20120513100650.025080a8@wheresmymailserver.com> Message-ID: <7.0.1.0.2.20120513122125.0239a808@wheresmymailserver.com> At 2012-05-13 10:19 -0400, I wrote: >I cannot think of any way in the spec to specify the document URI of >a temporary in-memory tree, because I don't think that is meaningful >in the general case. > >However, when I've chained transformations in the past, I've >sometimes needed to preserve the input document URI along all of the >steps (because there have been relative URI addresses in the data) >and so I've very simply used xml:base= on the document element of >the temporary tree (unless the document element already has an >xml:base= attribute). > >Remember that from a syntax perspective, the root document file >entity of an XML document must contain the document element, so >base-uri(/*) is always the same as document-uri(root()) when there >is no xml:base= already there on the document element. > >So, when I create a temporary tree I use: > > > >... and when I ask for base-uri(/*) I get "...whatever...". > >In my work I would do something along the lines of: > >let $d := doc("input.xml") return >element {$d/name(.)} > { > attribute xml:base { "...whatever..." }, > $d/@xml:base, (:in case there already exists one:) > "rest of the processing" > } Actually, two mistakes in throwing together that example. I was asking for the name of the root node (not the document element) and I wouldn't hard-code the xml:base value. Rather I'd use the document-uri() function to preserve the URI of the input file, or even shorten it further by using base-uri() on the document element so as to accommodate any existing xml:base= attribute: let $d := doc("input.xml") return element {$d/*/name(.)} { attribute xml:base { base-uri($d/*) }, "rest of the processing" } >I hope this helps. > >. . . . . . . . . . . Ken > >At 2012-05-13 13:58 +0000, David Lee wrote: >>I noticed somewhat of a hole in XQuery ... hoping I am wrong. >>I can find no way to set the base URI of a constructed document e.g >> >>document { } >> >>such that fn:document-uri() would return it. >> >>It seem this is one of those properties that must come from the >>outside environment. >>I know if I were to store the document to a file then re-read it, >>likely the XML processor would pick it up ... I also know how to do >>this programmatically in API's like say Saxon. >>But it seems missing from XQuery itself. My guess is that since >>XQuery doesnt support storing documents it was thought unimportant >>to set the document URI. >> >>Why I ask ? >>I'm still looking at Streaming XDM formats, including pure >>in-memory streaming. >>But it seems like I cannot directly encode and pass on a document >>(or base) URI through XQuery by itself to the output. So any >>constructed documents would have none or undefined URI's to the >>receiver. this leads me to think I need a meta encoding for XDM >>much like proposed at Balisage (XDML). basically passing the URI >>information as seperate XDM values and a convention for >>interpreting them. This seems like it could not be done in pure >>XQuery however because the target even if it got say a sequence ( >>"uri" , document ) has no way to apply the uri to the document >>using XQuery so it must be done by external code. >> >>Thanks for any commentary. >>-David -- Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012 Contact us for world-wide XML consulting and instructor-led training Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm Crane Softwrights Ltd. http://www.CraneSoftwrights.com/q/ G. Ken Holman mailto:gkholman at CraneSoftwrights.com Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal From davidc at nag.co.uk Tue May 15 09:12:40 2012 From: davidc at nag.co.uk (David Carlisle) Date: Tue, 15 May 2012 17:12:40 +0100 Subject: [xquery-talk] Help with an XQuery function In-Reply-To: <3E9A20764CADCB45BEA06374E52DBC4B30ADA16E3D@SI-MSEV01.US.SINET.SI.EDU> References: <3E9A20764CADCB45BEA06374E52DBC4B30ADA16E3C@SI-MSEV01.US.SINET.SI.EDU> <220256FDE771B74FB662165BC562CF59375413F2@CH1PRD0802MB107.namprd08.prod.outlook.com> <3E9A20764CADCB45BEA06374E52DBC4B30ADA16E3D@SI-MSEV01.US.SINET.SI.EDU> Message-ID: <4FB28078.3050603@nag.co.uk> On 15/05/2012 17:02, Custer, Mark wrote: > Thanks for pointing out the XQuery 3.0 functions, Matthias! > > fn:path is indeed supported, but I want a function that will do the same > as fn:path, minus any of the values of ?[1]?. Plus, since my current > crop of documents don?t have any associated namespaces, the processor > that I?m using prepends ?Q{}? before each path. So, with the previous > a/b/c example, I get the following: > > /Q{}a[1]/Q{}b[1]/Q{}c[3] > > But all I want is: > > /a/b/c[3] > > I?ll try working on it again later. Thanks again, > > Mark sounds like replace(path(),'\[1\]|Q{}','') will do what you want. David -- google plus: https:/profiles.google.com/d.p.carlisle ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________ From liam at w3.org Tue May 15 09:48:14 2012 From: liam at w3.org (Liam R E Quin) Date: Tue, 15 May 2012 18:48:14 +0200 Subject: [xquery-talk] Help with an XQuery function In-Reply-To: <3E9A20764CADCB45BEA06374E52DBC4B30ADA16E3C@SI-MSEV01.US.SINET.SI.EDU> References: <3E9A20764CADCB45BEA06374E52DBC4B30ADA16E3C@SI-MSEV01.US.SINET.SI.EDU> Message-ID: <1337100494.21908.12.camel@localhost.localdomain> On Tue, 2012-05-15 at 11:29 -0400, Custer, Mark wrote: [..] > This works, but I was wondering if it could be written better (and I > imagine that someone already has written a concise XQuery function to > do this). It might be easier to write it recursively, but clear is better than concise. > Also, I'm not entirely sure why, but when I run the above function, > I get the following result: > > /a /b /c[3] This is because you construct a sequence of strings. Use string-join( your-function(), "") to fix that. Or it might be, string-join("", your-function()), I never remember, which suggests it's the opposite of the other languages I use :-) 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 CusterM at si.edu Tue May 15 10:28:44 2012 From: CusterM at si.edu (Custer, Mark) Date: Tue, 15 May 2012 13:28:44 -0400 Subject: [xquery-talk] Help with an XQuery function In-Reply-To: <1337100494.21908.12.camel@localhost.localdomain> References: <3E9A20764CADCB45BEA06374E52DBC4B30ADA16E3C@SI-MSEV01.US.SINET.SI.EDU> <1337100494.21908.12.camel@localhost.localdomain> Message-ID: <3E9A20764CADCB45BEA06374E52DBC4B30ADA16E3E@SI-MSEV01.US.SINET.SI.EDU> Perfect. Thank you everyone. I was a bit confused about using the string-join function, but I just looked it up and it makes sense now. So, I can call the following with my function, as Liam mentioned: string-join(local:xpath($someNode), '') Or I can use the new built-in function, as David mentioned, replacing any unwanted strings, like so: replace(fn:path($name),'\[1\]|Q\{\}','') It seems like I have a lot more to get used to with XQuery, but I think that I understand things a little bit better now. Thanks again, Mark -----Original Message----- From: Liam R E Quin [mailto:liam at w3.org] Sent: Tuesday, May 15, 2012 12:48 PM To: Custer, Mark Cc: xquery-discuss Subject: Re: [xquery-talk] Help with an XQuery function On Tue, 2012-05-15 at 11:29 -0400, Custer, Mark wrote: [..] > This works, but I was wondering if it could be written better (and I > imagine that someone already has written a concise XQuery function to > do this). It might be easier to write it recursively, but clear is better than concise. > Also, I'm not entirely sure why, but when I run the above function, > I get the following result: > > /a /b /c[3] This is because you construct a sequence of strings. Use string-join( your-function(), "") to fix that. Or it might be, string-join("", your-function()), I never remember, which suggests it's the opposite of the other languages I use :-) 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