-i command line option

Tuesday, 13 May 2014 · 4 messages · last reply 19 May 2014
PH
Pascal Heus13 May 2014 13:24 #
Am trying to run BaseX form the command shell to execute a xquery on a specific database. I'm however a bit confused by the -i command line option. If I start BaseX as follows: java -Xmx512m -cp "/Users/pascal/git/dwb/lib/BaseX77.jar" -Dorg.basex.DBPATH=../BaseXdata org.basex.BaseX -*ifoo* which is expected to open the foo database, and from the prompt try to run:
Quoted text · 1 line
> xquery count(*)
This returns a count of 0
Quoted text · 2 lines
However, if I type > info database
I get the proper output about the current database (vs "No database opened" if none was selected).
Quoted text · 4 lines
If I then > open foo and > xquery count(*)
I get the proper count of documents Why do I have to count open again is the database is already 'opened' Likewise these return a count of 0 java -Xmx512m -cp "/Users/pascal/git/dwb/lib/BaseX77.jar" -Dorg.basex.DBPATH=../BaseXdata org.basex.BaseX -*ifoo*"count(*)" or java -Xmx512m -cp "/Users/pascal/git/dwb/lib/BaseX77.jar" -Dorg.basex.DBPATH=../BaseXdata org.basex.BaseX -*ifoo*countscript.bx though I would expect foo to be opened and ready for querying. Any suggestion would be appreciated. best *P
CG
Christian Grün16 May 2014 06:59 #
Hi Pascal, finally some feedback:
Quoted text · Pascal Heus · 5 lines
> java -Xmx512m -cp "/Users/pascal/git/dwb/lib/BaseX77.jar" > -Dorg.basex.DBPATH=../BaseXdata org.basex.BaseX -ifoo > which is expected to open the foo database, and from the prompt try to run: >> xquery count(*) > This returns a count of 0
I tried something similar, and I got "1" as result. Did you also try more recent versions of BaseX (7.8.2, 8.0 beta)? Christian
PH
Pascal Heus19 May 2014 11:38 #
Christian: Just tried with 7.8.2 and same issue. I can send you the DB if you like. Here is something interesting: If I run "info database" after starting from command line, I see Nodes: 0 / Documents: 0 / Binaries: 0 After I "open", I see Nodes: 1187661 / Documents: 27 / Binaries: 0 best *P _*DBINFO AFTER STARTING FROM COMMAND LINE*_ Database Properties Name: uk_ukda_teaching Size: 0 Bytes Nodes: 0 Documents: 0 Binaries: 0 Timestamp: 1970-01-01-01-00-00 Resource Properties Input Path: /Users/pascal/Work/DwB/BaseXData/uk_ukda_teaching Input Size: 37 MB Timestamp: 2014-01-10-11-56-38 Encoding: UTF-8 CHOP: true Indexes Up-to-date: true TEXTINDEX: true ATTRINDEX: true FTINDEX: false LANGUAGE: English STEMMING: false CASESENS: false DIACRITICS: false STOPWORDS: UPDINDEX: false MAXCATS: 100 MAXLEN: 96 _*DBINFO AFTER "OPEN uk-ukda_teaching"*_ Database Properties Name: uk_ukda_teaching Size: 37 MB Nodes: 1187661 Documents: 27 Binaries: 0 Timestamp: 2014-01-10-11-56-38 Resource Properties Timestamp: 2014-01-10-11-56-37 Encoding: UTF-8 CHOP: true Indexes Up-to-date: true TEXTINDEX: true ATTRINDEX: true FTINDEX: false LANGUAGE: English STEMMING: false CASESENS: false DIACRITICS: false STOPWORDS: UPDINDEX: false MAXCATS: 100 MAXLEN: 96
Quoted text · Christian Grün · 3 lines
On 5/16/14, 6:59 AM, Christian Grün wrote: > java -Xmx512m -cp "/Users/pascal/git/dwb/lib/BaseX77.jar" > > -Dorg.basex.DBPATH=../BaseXdata org.basex.BaseX -ifoo
CG
Christian Grün19 May 2014 11:48 #
Quoted text · Pascal Heus · 1 line
> Just tried with 7.8.2 and same issue. I can send you the DB if you like.
It might indeed have to do with the particular database. Did you experience the same with other dbs? This is what I get: $ basex -ifactbook BaseX 7.8.2 Try help to get more information.
Quoted text · Pascal Heus · 1 line
> info db
Database Properties Name: factbook Size: 2885 KB Nodes: 104627 Documents: 1 Binaries: 0 Timestamp: 2014-03-21-11-31-41 ...

⚡Generated with XQuery