Re: [basex-talk] Call for assistance : BaseX as a preprocessor ?

2020-02-27 Thread thufir
you write: "I would like to preprocess the xml before entering postgres, and stream it with the copy command." but why? I'm inferring that you want to dynamically generate XML as its queried by postgres? Just curious, Thufir On 2020-02-23 7:31 a.m., maxzor wrote: Hello,

Re: [basex-talk] how to store a result in a database?

2020-02-20 Thread thufir
urn $x } On 2020-02-19 6:08 a.m., Martin Honnen wrote: Am 19.02.2020 um 14:36 schrieb thufir: While I can certainly output the result to a file, and then add to a database, how would I actually send the result directly to a database? xquery version "3.0"; { for $line

[basex-talk] empty tags when grouping with tumbling window?

2020-02-20 Thread thufir
ully understand how the tumbling window works as of yet, so reviewing that section of a text book. see also: https://stackoverflow.com/q/60237739/262852 thanks, Thufir

Re: [basex-talk] was: increment a variable only when a conditional is true?

2020-02-19 Thread thufir
Yes, that's pretty much it: https://stackoverflow.com/q/60237739/262852 I'm a bit curious what happened to the "people" group, but I'll test and adapt. Did "people" get dropped because it has no following siblings to group with? thanks, Thufir On 2020-02-19 6:55 p.

Re: [basex-talk] was: increment a variable only when a conditional is true?

2020-02-19 Thread thufir
Hi Steve, yes, it certainly does. At this point, I'd settle for adding an attribute like "recordID", but that's exactly it. I'll take a closer look at "group by" a bit later, thanks for the pointer. See also: https://stackoverflow.com/q/60237739/262852 thanks, Thu

Re: [basex-talk] increment a variable only when a conditional is true?

2020-02-19 Thread thufir
, Thufi On 2020-02-19 7:57 a.m., Bridger Dyson-Smith wrote: Hi Thufir - Maybe something like this will help? ``` xquery version "3.1"; let $y := 99 for $x in (1 to 9) count $iterator let $decrease := $y - $iterator return(   comment { "iterator = " ||  $iterator },  

Re: [basex-talk] increment a variable only when a conditional is true?

2020-02-19 Thread thufir
How do I decrement y? Pardon, output for a simpler example: the FLWOR: xquery version "3.0"; let $y := 99 for $x in (1 to 9) let $y := $y - 1 return is it not possible to decrement $y without using some external scripting function? That seems odd. thanks, Thufir

[basex-talk] increment a variable only when a conditional is true?

2020-02-19 Thread thufir
re I'm trying to use attributes because I'm not sure how to conditionally nest tags. But, this is interesting. Not quite sure on syntax to set and then conditionally increment $x, however. thanks, Thufir

Re: [basex-talk] how to nest tags using a conditional

2020-02-19 Thread thufir
On 2020-02-19 6:10 a.m., Martin Honnen wrote: Am 19.02.2020 um 15:08 schrieb thufir: How can I start a new "record" and then nest tags in that record? but I'm getting output like:     if (matches($line, "[0-9]"))   then people   else people       if

[basex-talk] how to nest tags using a conditional

2020-02-19 Thread thufir
. Pardon, yes, I'm literally reading a book on this, still trying to understand the syntax. thanks, Thufir

[basex-talk] how to store a result in a database?

2020-02-19 Thread thufir
then {$line} else {$line} } Currently I'm running it like so: thufir@dur:~/flwor/people.json$ thufir@dur:~/flwor/people.json$ basex all.xq > all.xml thufir@dur:~/flwor/people.json$ thufir@dur:~/flwor/people.json$ basex BaseX 9.0.1 [Standalone] Try 'help' to get more information. > &

Re: [basex-talk] How to export or query JSON as an array?

2020-02-17 Thread thufir
", "1":"cell4", "name":"sue" }, { "0":"phone3", "1":"phone2", "2":"phone1", "name":"joe" }, { "name":"people" } ] which

[basex-talk] How to export or query JSON as an array?

2020-02-17 Thread thufir
Using Java, I can add JSON easily enough. But how can I get that data back as a JSONArray, or even just a List of JSONObject? https://stackoverflow.com/q/60268157/262852 which is the same question, of course. thanks, Thufir

[basex-talk] How to programatically add JSON?

2020-02-16 Thread thufir
:"cell4","name":"sue"},{"0":"phone3","1":"phone2","2":"phone1","name":"joe"},{"name":"people"}] So, I guess a two-fold question: how to import a JSONArray with Java, and how to even know what resource isn't found. Doesn't seem likely to be the JSONObject as I've inspected it just prior to invoking Add. thanks, Thufir

[basex-talk] POJO for import?

2020-02-16 Thread thufir
I'm looking at the Java examples, but how would I add a POJO, or collection of POJO's, to BaseX? Jaxb looks to certainly be an option to serialize to XML, but what would be some alternate approaches? thanks, Thufir

Re: [basex-talk] how to export to CSV?

2020-02-15 Thread thufir
I'll read your response more carefully, but key takeaway is to maybe use something else? I'm futzing with powershell, seems reasonable for the task (if a bit odd). On 2020-02-15 11:47 a.m., Graydon wrote: On Sat, Feb 15, 2020 at 11:12:36AM -0800, thufir scripsit: What I'm trying to export

[basex-talk] how to export to CSV?

2020-02-15 Thread thufir
how to get there. thanks, Thufir

Re: [basex-talk] Flat XML fods database

2020-02-14 Thread thufir
Hi Bridger, thanks, and yes, I have her book -- still reading it. But I'll skip ahead to that section :) -Thufir On 2020-02-14 5:05 a.m., Bridger Dyson-Smith wrote: Hi Thufir, You might find Priscilla Walmsley's Functx library[1] section on namespaces helpful (or something else

Re: [basex-talk] Flat XML fods database

2020-02-14 Thread thufir
I think I mainly need to add a namespace for fods: thufir@dur:~/fods/flwor$ thufir@dur:~/fods/flwor$ basex text.xq Stopped at /home/thufir/fods/flwor/text.xq, 3/14: [XPST0081] No namespace declared for 'text:p'. thufir@dur:~/fods/flwor$ thufir@dur:~/fods/flwor$ cat text.xq for $foo in db:open

[basex-talk] Flat XML fods database

2020-02-13 Thread thufir
Hi all, I've loaded a .fods file from Libre Office into BaseX and am looking to identify bold cells. This is totally off-topic to BaseX itself, but does anyone have experience in working with .fods files? thanks, Thufir

Re: [basex-talk] how to count and remove "entities"

2020-02-04 Thread thufir
I'd have to experiment more, but I believe that if I kept the filename static each iteration of Replace would simply write over the previous tweet so that only one tweet was ever being stored to the db. Only by changing the name was I able to add multiple tweets with Replace. (I think.)

Re: [basex-talk] how to count and remove "entities"

2020-02-04 Thread thufir
tand there is that when creating the Replace command the "primary key" would seem to be the id_str from the tweet -- which is fine. But that relates to a filename xxx.xml? thanks, Thufir On 2020-02-03 11:05 p.m., Christian Grün wrote: You could use REPLACE instead of ADD (or db:replace i

Re: [basex-talk] how to count and remove "entities"

2020-02-03 Thread thufir
re-inventing the wheel here? On 2020-02-03 10:41 p.m., thufir wrote: Not sure of the correct lingo, but I'm building a database of tweets. As I run it, duplicate tweets are added to the database.  I can see the duplicates with: for $tweets  in db:open("twitter") return {$tweets

[basex-talk] how to count and remove "entities"

2020-02-03 Thread thufir
ate entity. But, before even selecting that node, recursively look to see if there's more than one result for that id__str value. How would I even generate a count of each occurrence for the data of a specific id__str? thanks, Thufir

Re: [basex-talk] Add command: name of the input will be set as path?

2020-02-03 Thread thufir
ing the fileName -- certainly I can just pass stringXml by itself somehow? see also: https://stackoverflow.com/a/60047738/262852 thanks, Thufir On 2020-02-03 1:42 p.m., Christian Grün wrote: In this case there's no path argument, but there is an input argument of stringXml. Is that how to p

Re: [basex-talk] Add command: name of the input will be set as path?

2020-02-03 Thread thufir
e console but rather: new Add(null, stringXml).execute(context); In this case there's no path argument, but there is an input argument of stringXml. Is that how to pass a String to Add()? thanks, Thufir

Re: [basex-talk] convert JSON to XML to add to database

2020-02-03 Thread thufir
is this what you're referring to? Command: SET PARSER json Command: CREATE DB tweet /home/thufir/json/tweet.json Result: Database 'tweet' created in 166.11 ms. Which, yes, is exactly the sequence which I'm looking to capture or replicate -- but not from a file as above. It's more the usage

[basex-talk] Add command: name of the input will be set as path?

2020-02-03 Thread thufir
f the input" will be "set as path"? Where is the "name of the input"? What is "path" in relation to a String which exists only in memory? Just pass a string like: new Add(null, stringXml).execute(context); and that should add to the currently open database? thanks, Thufir

[basex-talk] convert JSON to XML to add to database

2020-02-02 Thread thufir
://stackoverflow.com/q/60034291/262852 thanks, Thufir

[basex-talk] JSON to XML conversion

2020-02-01 Thread thufir
? } Unclear on how to use the different parsers (really, just need this one parser). See also: https://stackoverflow.com/q/60022419/262852 thanks, Thufir

Re: [basex-talk] simplest possible FLOWR specifying a database

2019-10-12 Thread thufir
that's interesting. what's item in this example, and how can it be referenced? thanks, Thufir On 2019-10-12 2:29 a.m., Christian Grün wrote: On top of the query (in the query prolog), you can bind your database to the context. After that, there’ll be no need to bind it to a variable

Re: [basex-talk] simplest possible FLOWR specifying a database

2019-10-12 Thread thufir
nevermind, it's: let $db := db:open("com.w3schools.books") return $db/bookstore I thought it was unusual because of db:open. -Thufir On 2019-10-12 12:50 a.m., thufir wrote: these FLWOR .xq files work as is: let $db := db:open("com.w3schools.books") for $x in $db

[basex-talk] simplest possible FLOWR specifying a database

2019-10-12 Thread thufir
first query, using $x can I not somehow specify just "/"? thanks, Thufir

[basex-talk] what do with treasury data?

2019-10-11 Thread thufir
and auctions. thanks, Thufir

Re: [basex-talk] how to specify a database in a.xq FLOWR query?

2019-10-07 Thread thufir
From SO (and the fine manual), the solution is to use: basex -i w3school_data titles.xq Very interesting. I'm sure this can be piped or simply written to a file, but is there a particularly "basex" method? Not to just return a result but write that result back to basex. thank

Re: [basex-talk] // versus /*/

2019-10-07 Thread thufir
Thanks, Liam. No, not homework, just me futzing about. I'll experiment a bit more -- and thanks for the suggestion. -Thufir On 2019-10-07 12:25 a.m., Liam R. E. Quin wrote: On Sun, 2019-10-06 at 21:28 -0700, thufir wrote: Do these have the same meaning? Might there be a subtle distinction

[basex-talk] how to specify a database in a.xq FLOWR query?

2019-10-07 Thread thufir
how do I specify a database for a .xq file to use? a simple FLOWR: thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ basex titles.xq [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java Learning XML XQuery Kick Startthufir@dur:~/basex/w3$ thufir@dur:~/basex/w3

[basex-talk] // versus /*/

2019-10-06 Thread thufir
1.52 ms. > > xquery /*/book[@id="bk112"]/title Visual Studio 7: A Comprehensive Guide Query executed in 1.67 ms. > They're equally efficient, at least as used above? thanks, Thufir

Re: [basex-talk] get list of databases

2019-10-06 Thread thufir
thanks, worked perfectly. On 2019-10-06 3:42 p.m., Christian Grün wrote: Try new List().execute(ctx); See [1] for details. Cheers, Christian [1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/core/cmd/List.java#L28

[basex-talk] get list of databases

2019-10-06 Thread thufir
ath -- books 0 4570 1 database(s). > but using: http://docs.basex.org/javadoc/org/basex/core/cmd/List.html thanks, Thufir

Re: [basex-talk] console versus gui

2019-01-03 Thread thufir
I thought I was losing my mind -- thanks for at least confirming your understanding. I'll be futzing with it, bit burnt out at the moment. thanks, Thufir On 2019-01-03 12:41 p.m., Bridger Dyson-Smith wrote: Hi Thufir, AFAIK, the GUI and console (client or stand-alone mode

Re: [basex-talk] console versus gui

2019-01-03 Thread thufir
I'll take a look at the database directory: http://docs.basex.org/wiki/Configuration#Database_Directory On 2019-01-03 11:03 a.m., thufir wrote: I'd like it consistent across access through the Java hooks, GUI and console.

[basex-talk] console versus gui

2019-01-03 Thread thufir
thanks, Thufir

Re: [basex-talk] Java XQuery

2019-01-03 Thread thufir
The project is: https://github.com/THUFIR/helloWorldBaseX While I've been through many of the Java examples it's also entirely possible that I overlooked something. Learning XQuery and Xpath syntax and capabilities. -thufir

Re: [basex-talk] Java XQuery

2019-01-03 Thread thufir
. Not so with "raw" xml from w3schools. With that xml I can drill down to varying degrees as expected. --- Either tagsoup is mashing the html too extremely, or it's my lack of knowledge. Hey, I appreciate the input. Hope I made sense. -Thufir

[basex-talk] XQuery from Java

2019-01-02 Thread thufir
ng similar? see also: https://stackoverflow.com/q/53996575/262852 thanks, Thufir

[basex-talk] upper limits on storage; database admin

2019-01-02 Thread thufir
tle I know of RDBMS is that master/slave can alleviate some bottlenecks. To put this another way: I'm so enthusiastic about basex that I'm having trouble finding a place it doesn't fit. As you approach terabytes and beyond what dbadmin approaches are employed? -Thufir

[basex-talk] Java XQuery

2019-01-02 Thread thufir
ld I query it? The query: db:open("note")//note thanks, Thufir

Re: [basex-talk] console usage

2019-01-02 Thread thufir
On 2019-01-02 8:07 a.m., Christian Grün wrote: > RUN fetch.note.text.xq Resource "/home/thufir/fetch.note.text.xq" not found. Is the script located at this path? If not, you will have to change to this directory and start BaseX from there, or you will need to specify

Re: [basex-talk] console usage

2019-01-02 Thread thufir
On 2019-01-02 8:01 a.m., thufir wrote: Resource "/home/thufir/fetch.note.text.xq" not found. O My pwd is /home/thufir/basex which is where the script is..

Re: [basex-talk] console usage

2019-01-02 Thread thufir
On 2019-01-02 8:07 a.m., Christian Grün wrote: > RUN fetch.note.text.xq Resource "/home/thufir/fetch.note.text.xq" not found. Is the script located at this path? If not, you will have to change to this directory and start BaseX from there, or you will need to specify the full

[basex-talk] console usage

2019-01-02 Thread thufir
How can I run this script? thufir@dur:~/basex$ thufir@dur:~/basex$ basex [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java BaseX 9.0.1 [Standalone] Try 'help' to get more information. > > RUN fetch.note.text.xq Resource "/home/thufir/fetch.n

[basex-talk] basic xquery

2019-01-01 Thread thufir
How can I run this xquery: fetch:xml("http://books.toscrape.com/;, map { 'parser': 'html', 'htmlparser': map { 'html': false(), 'nodefaults': true() } }) from basex using Java? I can run that xquery from the GUI. thanks, Thufir