Discussion:
[xquery-talk] set as datatype in xquery
Rob Stapper
2015-07-19 09:27:04 UTC
Permalink
Hello,



Is it an option to add a "dataSet" as datatype in xquery, like for example
the "array"?

My case is that I'm having this high-order function that iterates through a
sequence and start a given function on each item until it receives back an
'nothing', than it breaks off.

This works great except with sequences which I ( have to) use for
"dataSets": there are occasions that I need to return an empty set without
breaking of the iteration.

In xquery there are empty arrays, empty maps and empty elements but no empty
"dataset", like - set {} -



Thanx,



Rob Stapper



PS.

- definition for "dataset" could be something like: - a datatype
representing a dynamic collection of data-items -.



- Since the "dataSet" is an datatype, "dataSets" could hold other dataSets.

- Function "for-each" ( no particular sequence) could take a "dataset" but
"fold-left" and "fold-right" ( particular sequence) could not.

- I don't know if a "fold"-function ( no particular sequence) would make
sense, haven't thought about it enough.





---
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
https://www.avast.com/antivirus
Adam Retter
2015-07-19 10:01:50 UTC
Permalink
Can you tell me how you see a dataSet being different to an array?
Post by Rob Stapper
Hello,
Is it an option to add a “dataSet” as datatype in xquery, like for example
the “array”?
My case is that I’m having this high-order function that iterates through
a sequence and start a given function on each item until it receives back
an ‘nothing’, than it breaks off.
This works great except with sequences which I ( have to) use for
“dataSets”: there are occasions that I need to return an empty set without
breaking of the iteration.
In xquery there are empty arrays, empty maps and empty elements but no
empty “dataset”, like - set {} -
Thanx,
Rob Stapper
PS.
- definition for “dataset” could be something like: - a datatype
representing a dynamic collection of data-items –.
- Since the “dataSet” is an datatype, “dataSets” could hold other dataSets.
- Function “for-each” ( no particular sequence) could take a “dataset”
but “fold-left” and “fold-right” ( particular sequence) could not.
- I don’t know if a “fold”-function ( no particular sequence) would make
sense, haven’t thought about it enough.
------------------------------
[image: Avast logo] <https://www.avast.com/antivirus>
Dit e-mailbericht is gecontroleerd op virussen met Avast
antivirussoftware.
www.avast.com <https://www.avast.com/antivirus>
_______________________________________________
http://x-query.com/mailman/listinfo/talk
--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
Adam Retter
2015-07-19 11:53:56 UTC
Permalink
Okay I see what you are getting at but in light of the fact that there is
not a set type, but there is an array type, could you not just use the
array type with the XPath 3.1 function arrays:for-each?

Regards polluting your code, you would only have that if you chose to
access the array by index, instead you could just stick to for-each.

Well, I see an array as a specialized dataSet.
I see an array is an indexed, c.q. subscripted, dataset.
Or I see a dataset is an array without the indexing-mechanism.
Or you could also see a dataset as an map without the mapping-mechanism.
What remains is a dynamic set with data-items where the items can
individually be processed, e.g. by a for-each function, but not
individually be addressed.
Using arrays as datasets pollutes my code with its addressing mechanism.
Especially for a function language expressiveness of the language should
be one of the highest goods.
Rob
*Verzonden:* zondag 19 juli 2015 12:02
*Aan:* Rob Stapper
*Onderwerp:* Re: [xquery-talk] set as datatype in xquery
Can you tell me how you see a dataSet being different to an array?
Hello,
Is it an option to add a “dataSet” as datatype in xquery, like for example
the “array”?
My case is that I’m having this high-order function that iterates through
a sequence and start a given function on each item until it receives back
an ‘nothing’, than it breaks off.
This works great except with sequences which I ( have to) use for
“dataSets”: there are occasions that I need to return an empty set without
breaking of the iteration.
In xquery there are empty arrays, empty maps and empty elements but no
empty “dataset”, like - set {} -
Thanx,
Rob Stapper
PS.
- definition for “dataset” could be something like: - a datatype
representing a dynamic collection of data-items –.
- Since the “dataSet” is an datatype, “dataSets” could hold other dataSets.
- Function “for-each” ( no particular sequence) could take a “dataset”
but “fold-left” and “fold-right” ( particular sequence) could not.
- I don’t know if a “fold”-function ( no particular sequence) would make
sense, haven’t thought about it enough.
------------------------------
[image: Afbeelding verwijderd door afzender. Avast logo]
<https://www.avast.com/antivirus>
Dit e-mailbericht is gecontroleerd op virussen met Avast
antivirussoftware.
www.avast.com <https://www.avast.com/antivirus>
_______________________________________________
http://x-query.com/mailman/listinfo/talk
--
Adam Retter
skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
------------------------------
[image: Avast logo] <https://www.avast.com/antivirus>
Dit e-mailbericht is gecontroleerd op virussen met Avast
antivirussoftware.
www.avast.com <https://www.avast.com/antivirus>
--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
Rob Stapper
2015-07-19 13:11:00 UTC
Permalink
Van: Rob Stapper [mailto:***@lijbrandt.nl]
Verzonden: zondag 19 juli 2015 15:10
Aan: 'Adam Retter'
Onderwerp: RE: [xquery-talk] set as datatype in xquery



Sure I can do that because after all an array is a glorified dataset. But I won’t J.

Question is: does the W3C as a standardization-organization, want its product to settle for a workaround like that?



Van: talk-***@x-query.com [mailto:talk-***@x-query.com] Namens Adam Retter
Verzonden: zondag 19 juli 2015 13:54
Aan: Rob Stapper
CC: ***@x-query.com
Onderwerp: Re: [xquery-talk] set as datatype in xquery



Okay I see what you are getting at but in light of the fact that there is not a set type, but there is an array type, could you not just use the array type with the XPath 3.1 function arrays:for-each?

Regards polluting your code, you would only have that if you chose to access the array by index, instead you could just stick to for-each.



Well, I see an array as a specialized dataSet.

I see an array is an indexed, c.q. subscripted, dataset.

Or I see a dataset is an array without the indexing-mechanism.

Or you could also see a dataset as an map without the mapping-mechanism.

What remains is a dynamic set with data-items where the items can individually be processed, e.g. by a for-each function, but not individually be addressed.



Using arrays as datasets pollutes my code with its addressing mechanism.

Especially for a function language expressiveness of the language should be one of the highest goods.



Rob



Van: Adam Retter [mailto:***@googlemail.com]
Verzonden: zondag 19 juli 2015 12:02
Aan: Rob Stapper
CC: ***@x-query.com
Onderwerp: Re: [xquery-talk] set as datatype in xquery



Can you tell me how you see a dataSet being different to an array?



On 19 July 2015 at 10:27, Rob Stapper <***@lijbrandt.nl> wrote:

Hello,



Is it an option to add a “dataSet” as datatype in xquery, like for example the “array”?

My case is that I’m having this high-order function that iterates through a sequence and start a given function on each item until it receives back an ‘nothing’, than it breaks off.

This works great except with sequences which I ( have to) use for “dataSets”: there are occasions that I need to return an empty set without breaking of the iteration.

In xquery there are empty arrays, empty maps and empty elements but no empty “dataset”, like - set {} -



Thanx,



Rob Stapper



PS.

- definition for “dataset” could be something like: - a datatype representing a dynamic collection of data-items –.



- Since the “dataSet” is an datatype, “dataSets” could hold other dataSets.

- Function “for-each” ( no particular sequence) could take a “dataset” but “fold-left” and “fold-right” ( particular sequence) could not.

- I don’t know if a “fold”-function ( no particular sequence) would make sense, haven’t thought about it enough.





_____


<https://www.avast.com/antivirus> Afbeelding verwijderd door afzender. Avast logo

Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
www.avast.com <https://www.avast.com/antivirus>




_______________________________________________
***@x-query.com
http://x-query.com/mailman/listinfo/talk
--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk



_____


<https://www.avast.com/antivirus> Afbeelding verwijderd door afzender. Avast logo

Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
www.avast.com <https://www.avast.com/antivirus>
--
Adam Retter

skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk



---
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
https://www.avast.com/antivirus
Michael Kay
2015-07-19 13:35:38 UTC
Permalink
Post by Rob Stapper
Sure I can do that because after all an array is a glorified dataset. But I won’t J.
Question is: does the W3C as a standardization-organization, want its product to settle for a workaround like that?
The answer is yes.

If we still had 40 people taking an active part in the development process, we would probably be more ambitious. But it’s down to a handful, and you have to set your work programme so it can be achieved with the resources available. Remember the work is not done by W3C as some faceless entity, it is done by individuals whose work is in some cases funded by their companies and in some cases entirely voluntary. If you want to know why they aren’t doing this work, first ask why you aren’t doing it.

Adding arrays to the data model was in many ways a kludge. We would have much preferred to have done a generic collection capability where operations like FLWOR expressions applied to any kind of collection, rather than each kind of collection having its own functions and operators. But it was too hard and too disruptive, so we settled for doing it as a bolt-on. Without the underpinnings of a generic collections framework in the language, we certainly wouldn’t want to add more ad-hoc collection types.

Michael Kay
Saxonica
Rob Stapper
2015-07-19 17:47:22 UTC
Permalink
That’s clear.



I’m doing my work which is based on the results of the work done by W3C, also partly funded, partly voluntary. We can’t be all working on the same subject.



I hoped that since the specifications of the array is an extension of those of the dataset, the implementation would be a quick win and not so much of a kludge.

If the choose is between another ad-hoc implementation of a collection type, which in itself isn’t ad hoc, or the suggested workaround I also would offer the workaround.

Until the framework is ready for generic collection types and the dataset hopefully will be implemented, I’ll be using my own work-around.( no array anyway J)



One could perhaps make a start with the specifications of the dataset.



Rob Stapper



Van: talk-***@x-query.com [mailto:talk-***@x-query.com] Namens Michael Kay
Verzonden: zondag 19 juli 2015 15:36
Aan: Rob Stapper
CC: ***@x-query.com
Onderwerp: Re: [xquery-talk] set as datatype in xquery





Sure I can do that because after all an array is a glorified dataset. But I won’t J.

Question is: does the W3C as a standardization-organization, want its product to settle for a workaround like that?





The answer is yes.



If we still had 40 people taking an active part in the development process, we would probably be more ambitious. But it’s down to a handful, and you have to set your work programme so it can be achieved with the resources available. Remember the work is not done by W3C as some faceless entity, it is done by individuals whose work is in some cases funded by their companies and in some cases entirely voluntary. If you want to know why they aren’t doing this work, first ask why you aren’t doing it.



Adding arrays to the data model was in many ways a kludge. We would have much preferred to have done a generic collection capability where operations like FLWOR expressions applied to any kind of collection, rather than each kind of collection having its own functions and operators. But it was too hard and too disruptive, so we settled for doing it as a bolt-on. Without the underpinnings of a generic collections framework in the language, we certainly wouldn’t want to add more ad-hoc collection types.



Michael Kay

Saxonica





---
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
https://www.avast.com/antivirus

Loading...