> Gaps? First, to avoid a misunderstanding: whereas map keys must not be the
> empty sequence, map values may.
Special data sources might contain challenges for further clarification of
the desired referential integrity.
Regards,
Markus
> although I do not quite understand your description
Which wording variant would you have found clearer for the mentioned use case?
> (why should I care for the representation of the map I construct?),
* Selection of a general data structure for the handling of key/value pairs
* I guess that
> Maps are a derivative of the function type and highly general.
I got informed that the data structure “map” got a clear meaning according to
XQuery programming interfaces.
> You're in effect asking for examples of using a function with no other
> information provided.
I came along another cl
Hello,
I would like to construct a map structure based on a dynamic selection by
the means of a FLWOR expression.
https://www.w3.org/TR/2017/REC-xquery-31-20170321/#id-maps
The keys and associated values should be presented as a CSV-like file by
a subsequent data processing step.
Can it become e
> Maybe I am missing the point, so it would be interesting to know more about
> your motivation 😊
Report generators are available which can handle selected formats as data
sources.
https://en.wikipedia.org/wiki/List_of_reporting_software
The chosen formats influence how challenging or convenie
> > Is any support available for data management by interfaces like the
> > following?
> >
> > * Open Database Connectivity
> > * Java Database Connectivity
>
> Are you just looking for https://docs.basex.org/wiki/SQL_Module?
No. (Not for related use cases at the moment.)
This module is useful f
Hello,
The software “BaseX” is providing direct support for document databases.
Is any support available for data management by interfaces like the following?
* Open Database Connectivity
* Java Database Connectivity
How are corresponding drivers evolving?
Regards,
Markus
> > Would you like to improve error reporting any more?
>
> Maybe. We’d be thankful for:
>
> a) a concrete query example;
My examples were questionable also because of some reasons.
> b) the error you got; and
> c) the error you’d have expected.
The user guidance can hopefully be adjusted.
R
> > I became curious if this development situation will be improved further.
> Who would you expect to improve that?
Various contributors.
The communication on this mailing list (for example) will provide helpful
information.
> Are you thinking of the developers of the official W3 recommendati
> The support for the invocation of dynamic functions is another feature
> that is only supported since version 3 of the specification. To be
> strict, the finalized version of the spec woud require the "updating"
> keyword to be prepended by an additional "invoke" keyword [4].
Thanks for your det
> There are a couple of syntax issues with your code shown below:
How often would you dare to pass a detailed FLWOR expression directly
as a function parameter instead of specifying an extra variable name
or function call?
db:add("Test_DB", Another document example:
{$X}, "my_test.xml")
Regar
> …, however the rules here can be hard to follow at first.
I became curious if this development situation will be improved further.
> The other XQuery rule that applies to your examples is that:
> if there is only one expression in main or a function body then the keyword
> "return" is omitted
> This aspect of XQuery syntax (when to use commas, when to construct explicit
> sequences with wrapping parens) can be a bit challenging to internalize.
Thanks for your constructive feedback.
I hope that further clarifications will adjust known construction challenges.
>This rework runs for me
> You can add documents to the database without first writing them to the file
> system[1]:
Thanks for such information.
> This needs to be done in an updating function or …
I am looking for further advices also according to XQuery script variants
like the following.
declare %updating func
Hello,
The software “BaseX” is providing direct support for file formats like
“XML” and “CSV”.
Corresponding data can be generated by customised XQuery scripts.
I got the impression that additional documents can be integrated into selected
databases so far by specifying file names.
Does this mean
Hello,
Some indexes are generally supported also by the software “BaseX”.
https://docs.basex.org/wiki/Indexes
Some data processing approaches would usually depend on indexes for primary
and foreign keys.
https://en.wikipedia.org/wiki/Primary_key
How much do run time characteristics influence dat
> To me that kind of array with a string literal followed by a an array of
> integers seemed kind of an odd data structure to start with
I am curious how such views will evolve further.
> so I would think about just adapting the original FLOWR expression
I am trying this for a while.
> to per
> declare function local:foo($item as array(*)){
> let $f:=$item(1)
> let $v:=$item(2)
> return array:for-each($v, function($q){ [$f,$q] }) ?*
> };
>
> (["f", [1, 2, 3]], ["g", [4, 5]]) ! local:foo(.)
> declare function local:foo($item as array(*)){
> let $f:=$item(1)
> let $v:=$item(
> Can you show us the input structure? A sequence of arrays with a string
> literal as the first array item but an element or document node as the
> second array item?
I stumbled on the design challenge if the sequence of nested arrays would be
constructed by another FLWOR expression (instead of t
> Your result asked for in the original question, if it also was meant to
> indicate some CSV representation, could be achieved using
>
>
> declare option output:method "csv";
> declare option output:csv "header=yes";
>
>
> {
> (["f", [1, 2, 3]], ["g", [4, 5]]) !
> (let $key := ?1, $values := ?2?*
> Possibly the below is helpful to you
Thanks for your suggestion.
Regards,
Markus
> That is not even syntactically close to a sequence of two nested arrays,
> I am afraid.
How do you think about to extend an XQuery sccript variant like the following
for the desired transformation?
declare option output:method "csv";
declare option output:csv "header=yes";
for $x in (["f", [1,
Hello,
It seems that I am still not familiar enough with the programming language
“XQuery”
for the quick specification of a bit of code for a general data processing task.
Thus I hope that the following use case can be clarified better.
A sequence like “(["f" [1 2 3]], ["g" [4, 5]])” might be a
Hello,
Various data models and corresponding applications can be constructed also with
the help of the software “BaseX”.
One popular data management tool is the address book (which can be supported by
customised hardware and software), isn't it?
Would you like to point any development repositori
Hello,
I would like to perform a sanity check for some input data which represent
numbers
that are using the comma as the decimal separator.
I stumbled on the message “[FORG0001] Cannot convert to xs:double: …” then
according to the evaluation of another XQuery script by the software “BaseX
9.7”
> Here's one thing you may be asking - do you want to know how to specify a
> join for n sources?
Yes. ‒ Your enquiry points into a direction for which I am looking also for
further solution ideas.
> for $e in $eng
> for $d in $deu
> for $u in $ukr
> for $h in $heb
> where $e/@n = $d/@n
>
Hello,
I constructed the following XML file for another test of the software “BaseX
9.7”.
12
Demo1
Demo2
23
Demo1
Demo2
34
Test1
Test2
Test3
45
Test1
Test2
Test3
56
Test1
Test2
Test3
67
Probe1
I tried the following XQuery script out accordingly.
declare option outp
> Have you read the XQuery specifications?
Yes.
> This section on joins, written by one of the inventors of SQL, may be a
> helpful starting point:
>
> https://www.w3.org/TR/xquery-31/#id-joins
It seems that I stumble on communication difficulties for this application area.
Regards,
Markus
> I was asking for your personal uses case or examples,
My use cases can be similar to the example application from the XQuery
specification.
> and I think this is what others have been asking you for as well.
I am trying to point further development possibilities out according to
varying and
> Could you please get specific and provide real use cases and examples?
An example application was published already with the XQuery 3.1 specification
for the combination of information from three documents.
https://www.w3.org/TR/2017/REC-xquery-31-20170321/#id-joins
Would you occasionally like
> > I propose once more to take another look at specification efforts for
> > join conditions (or constraints).
>
> What specific problem is it that you're trying to solve? What thing do
> you want to do that you do not believe you can do in XQuery?
I imagine that join parameters can be passed t
> To join something, you minimally need at least two expressions which find
> the things to be joined,
I am still trying to clarify corresponding development possibilities according
to
bigger numbers of entities together with for clauses.
(I hope that other meanings can be better distinguished fr
>
> Would you like to check the influence of numbers according to joinable
> items
> once more on data processing efforts?
>
>
> Are you asking about how well XQuery implementations perform compared to SQL
> databases?
Not directly.
> For a particular kind of query?
Yes.
I propo
> This makes "source of information" too complex to define a standard
> operation you can call a join; …
I find that this view will need further clarification.
>> I guess that you prefer to refer to them as “predicates within steps” so far
>> (according to path expressions).
>> https://www.w3.o
> We were looking at joining and combining diverse datasets as a key use case
> for XQuery.
This technical requirement is generally fine.
> It's possible that we missed something,
Do preferences matter if combinations of information sources are performed with
a key word
like “JOIN” (or
>> See also:
>> https://www.w3.org/TR/xquery-31/#id-joins
>>
> You can do join _operations_,
I would appreciate further clarification for the distinction
which you present here.
> but you aren't doing them on tables
> (unless you did extra work to represent the ta
> There are neither join conditions nor record sets in XQuery.
I suggest to compare this view to the situation before the key word “JOIN”
was added to the SQL standard.
https://en.wikipedia.org/wiki/Join_(SQL)
See also:
https://www.w3.org/TR/xquery-31/#id-joins
> I've beens upposing you're
> Get the "issn" attribute from every document in a sequence of arbitrary
> length:
>
> for $source in $sequence-of-URIs
> return
> $doc($source)/*/*:@issn
>
> So you can have an arbitrary number.
It seems that your imaginations are evolving in other directions than
the general data process
>> Did you stumble on bigger numbers of binding sequences
>> for which you would like to join some information?
> Generally the pattern for that is:
>
> 1 process each XPath expression into a sequence of maps; ideally there's
> a common function you pass a sequence of nodes, but …
Where did you
>> How do you think about to take another look at the development
>> challenges according to growing numbers of binding sequences and
>> corresponding join conditions?
> I think there's usually four steps:
Did you stumble on bigger numbers of binding sequences
for which you would like to join s
>> I imagine that the selection of for bindings can occasionally vary so
>> much and might become so big that it would be needed to construct
>> FLWOR expressions by more sophisticated data structures.
> A for clause will take any sequence as the binding sequence,
How do you think about to take a
Hello,
It is supported to specify a fixed number of information sources for a for
clause.
https://www.w3.org/TR/xquery-31/#id-xquery-for-clause
I imagine that the selection of for bindings can occasionally vary so much
and might become so big that it would be needed to construct FLWOR expression
>> How much do you care that the display for the item “Query” would be
>> equivalent to
>> the original XQuery script (including special characters like line breaks)?
> Not at all.
Interesting.
> U+000A LINE FEED is one of three control characters allowed in XML.
I would occasionally like to
>> Do you find the item “Query” still relevant for further displays?
> Sure!
>
> The teaching use is to compare the Query, …
How much do care that the display for the item “Query” would be equivalent to
the original XQuery script (including special characters like line breaks)?
> If the Query
> This would be the "simplify FLWOR expression:" returned just above the
> "Optimized Query" section of the info window?
I suggest to take another look at the items in the drop-down list of the info
view.
Do you find the item “Query” still relevant for further displays?
Regards,
Markus
> What do you mean with space character?
I suggest to take a closer look at the differences from a display like
“``["line 1 line 2 line 3"]``” in comparison to the mentioned test example.
Would you find any other representation more appropriate here?
Regards,
Markus
> I find the shown query display improvable.
>
>
> Feel free ;)
How challenging would it become to replace space characters by line breaks
at this place?
Regards,
Markus
> May I expect that original line breaks will be preserved in the shown
> query display?
>
>
> Yes, you can.
Thanks for your positive feedback.
Another XQuery example:
``["line 1
line 2
line 3"]``
Corresponding info view:
“…
Optimized Query:
"""line 1
line 2
line 3"""
Query:
``["line
Hello,
I tried the following XQuery script out with the software “BaseX 9.7”.
let $t1 := ``[line 1
line 2]``,
$t2 := ``[line 3
line 4]``
return ('"' || $t1 || '"', "---", '"' || $t2 || '"')
I observed the following display then in the info view.
“…
Optimized Query:
("""line 1
line 2""", "-
Dear Tamara,
Thanks for your detailed feedback.
> In the Microsoft documentation you linked, the name "text qualifier" is
> misleading.
Can this view trigger any further consequences?
> It doesn't mean the value will always be formatted as text by the program.
This aspect is interesting, is
> My opinion of these results is that they are correct - they meet my
> expectations.
I find this view interesting.
> Do you feel like these results are missing something?
Yes.
> If so, what specifically?
I am missing text quoting for the fields “ID”, “T1”, “T2” and “T4”.
> Is there somet
> > Test result:
> > T3|T4
> > "line 1
> > line 2?"|line 3\nline 4?
> >
> >
> > Will any more clarification help here?
>
> …, but if you're asking "Why are there double quotes around my `T3` field?",
Partly, yes.
(But not really.)
> then the answer appears to be in the CSV specification[1].
Whi
Hello,
I would like to create another database from a CSV file with the software
“BaseX 9.7”.
It seems that I can not choose the format option “XQuery” on the tab “Parsing”
of the dialogue “Create Database”.
https://docs.basex.org/wiki/CSV_Module#Conversion
Will any further configuration paramet
> No quotes will be added, as your delimiter does not occur in the text value.
How does this feedback fit to previously provided information?
A)
https://docs.basex.org/wiki/CSV_Module#Options
“…
Serialization: If the option is enabled, the value will be wrapped with quotes
if it contains charact
> > I did not observe text quotation during my software tests.
>
> See [1] for some instruction on how to create a reproducible example.
I created a BaseX database from a single XML file which contains the following
data
for another test approach.
01
X Y
Y, X
I tried the following XQuery s
> So when you attempt to print out {$incidence}, XQuery
> finds a sequence (1, 1, 1) instead of the value you want, 3.
Dear Tamara,
I found this test result surprising.
> To get the count of $incidence, you could return
> {count($incidence)} instead.
My understanding is still evolving also f
> As I said, consider to provide an input/output sample of what you have
> and want to achieve, …
I did that a moment ago.
https://mailman.uni-konstanz.de/pipermail/basex-talk/2022-April/017045.html
A simple query can provide the following data display.
id|contributor_count
123|1
45|1
67|1
89|2
> for $x in $results
>
> group by $count := $x(1)
I tried the code variant “for $r in $results let $count := $r(1)” also out.
But I wonder that the incidence “1” (only one) would be determined then
for all record set counters.
An other simple query is working as expected.
id|contributor_count
> That’s what already happens. The double quote is the text qualifier
> that’s used for serializing fields with spaces.
I did not observe text quotation during my software tests.
> There’s currently no feature to choose an alternative character
This can be fine.
> (such as the apostrophe),
A
> > for $x in $results
> > let $count := $x[1]
>
> Perhaps you want
>
> $x(1)
>
> here to access the first item in the array $x?
Yes. ‒ Thanks that you pointed a typo out.
Thus I adjusted the member access specification.
But I stumble on the message “[XPTY0004] Item expected, sequence found
> Double quotes are only required for parsing,
I would like to know a bit more about corresponding requirements.
> they are not used to judge if the input is a string or number.
I got other impressions (or expectations).
> A little example:
> 1;"1"
>
> If you save this one-liner as CSV file
> With XQuery 3.0, a group by clause was introduced [1, 2]. I can be
> applied to all data structures including arrays (“sequences” are the
> most basic data structure in XQuery, though).
I am looking for further hints in this software design area.
The following script got parsed.
declare option
> > Can any XQuery scripts be referenced by known file names at such places?
>
> Yes, you can e.g. use xquery:eval for that purpose [1]. The result can
> again be bound to a variable and further processed. It can also be
> written to a file, sent to any remote source, an SQL database,
> or whereve
> > https://docs.basex.org/wiki/CSV_Module#Options
…
> 2. What’s the name of the software applications that you use that
>requires double quotes?
Text qualifiers can accordingly be configured for data exports and imports.
Examples:
* LibreOffice Calc
* Microsoft Excel
> 3. What would be the
> > Further data type indications can eventually be omitted, can't they?
>
> A custom XQuery function may be the best option if you require a
> data-type specific output of CSV data.
I hope that such code can be avoided if the BaseX CSV module could be adjusted
accordingly.
https://docs.basex.org
> > I would prefer to avoid the creation of another BaseX database
> > for each query result.
>
> Just fine as well. If you use XQuery, you can bind your query results
> to variables for further processing.
I guess that it is expected that this kind of query result binding
would work only with XML
> > I came along software applications which would need the usage of double
> > quotes
> > for the distinction that provided data should be handled as text strings.
>
> So you would probably require all non-numeric values to be enclosed by
> quotes, no matter if it contains spaces?
The answer dep
> > But I would like to reuse query results for further queries directly.
>
> One common approach is to create volatile database instances from from
> query results (databases in BaseX are prety lightweight).
I would prefer to avoid the creation of another BaseX database
for each query result.
>
> Double quotes in CSV files do not give any information on the data
> type of a value.
I came along software applications which would need the usage of double quotes
for the distinction that provided data should be handled as text strings.
> Instead, they merely ensure that the data can be corr
Hello,
I constructed a small XQuery script which contains the following specifications.
declare option output:method "csv";
declare option output:csv "header=yes, separator=|, quotes=yes";
…
The query execution succeeded (in principle) with the software “BaseX 9.7”.
I observed data processing r
Hello,
XQuery scripts can be used also to compute values from selected XML data
structures.
Query results can be exported then into other file formats.
But I would like to reuse query results for further queries directly.
The SQL standard is providing named views for this purpose.
How will the
71 matches
Mail list logo