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,
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
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
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.
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
,
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 },
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
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
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
. Pardon, yes,
I'm literally reading a book on this, still trying to understand the syntax.
thanks,
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.
>
&
",
"1":"cell4",
"name":"sue"
},
{
"0":"phone3",
"1":"phone2",
"2":"phone1",
"name":"joe"
},
{
"name":"people"
}
]
which
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
:"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
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
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
how to get there.
thanks,
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
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
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
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.)
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-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
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
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
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
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
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
://stackoverflow.com/q/60034291/262852
thanks,
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
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
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
first query,
using $x can I not somehow specify just "/"?
thanks,
Thufir
and auctions.
thanks,
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
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
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
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
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
ath
--
books 0 4570
1 database(s).
>
but using:
http://docs.basex.org/javadoc/org/basex/core/cmd/List.html
thanks,
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
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.
thanks,
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
. 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
ng similar?
see also:
https://stackoverflow.com/q/53996575/262852
thanks,
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
ld I query it? The query:
db:open("note")//note
thanks,
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
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..
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
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
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
53 matches
Mail list logo