Questions tagged [basex]

BaseX is a robust, high-performance XML database engine and a highly compliant XQuery 3.1 processor with full support of the W3C Update and Full Text extensions. It serves as excellent framework for building complex data-intensive web applications.

BaseX focuses on storing, querying, and visualizing large XML and JSON documents and collections. A visual frontend allows users to interactively explore data and evaluate queries in realtime (i.e., with each key click). BaseX is platform-independent and distributed under the free BSD License.

BaseX provides several methods of accessing a database and executing queries, among them:


Workflow (when using the native BaseX Java API)

More examples can be found in the BaseX Documentation

  • First of all, a BaseX database server must be running, which will process the client requests.
  • Each client provides a session class or script with methods to connect to and communicate with the database server. A socket connection will be established by the constructor, which expects a host, port, user name and password as arguments.
  • The execute() method is called to launch a database command. It returns the result or throws an exception with the received error message.
  • The query() method creates a query instance. Variables can be bound to that object, and the result can either be requested via execute(), or in an iterative manner with the more() and next() functions. If an error occurs, an exception will be thrown.
  • The create(), add(), replace() and store() method pass on input streams to the corresponding database commands.
  • To speed up execution, an output stream can be specified by some clients; this way, all results will be directed to that output stream.
  • Most clients are accompanied by some example files, which demonstrate how database commands can be executed or how queries can be evaluated.
486 questions
0
votes
1 answer

How can I get all the ids of xml nodes via xquery?

I would like to get all the ids of xml nodes via xquery I am trying this line but does not work(returns empty characters) xquery doc('MYdb/MY.xml')/ROOT/*/string(@ID) the xml is like…
vagelis
  • 326
  • 5
  • 18
0
votes
1 answer

Batch processing with BaseX

I am looking to query HL7 XML documents en masse. There could be thousands of XMLs with identical structure I would like to mine for particular values. I am currently evaluating BaseX XML database for this purpose, and I am having a bit struggle to…
Edmon
  • 4,752
  • 4
  • 32
  • 42
0
votes
1 answer

BaseX Updating issue or is it bad setup?

I've checked through docs and through SO for info regarding SET WRITEBACK TRUE in BaseX due to the nature in which it writes data updates (per documentation). Here's the issue I'm having: On one computer (Ubuntu 15.10) I installed BaseX and, using…
Adam T
  • 675
  • 8
  • 22
0
votes
0 answers

Create Subpath Indexes

I am storing a vast amount of mathematical formulas as Content MathML in BaseX databases. Since a lot of subpaths are similar and repeated it would be nice to have (self-defined) indexes which index not only one element node but subpaths in order to…
Waschbaer
  • 447
  • 6
  • 18
0
votes
1 answer

Access main table's values (DISTANCE and SIZE)

I am storing a vast amount of mathematical formulas as Content MathML in BaseX databases. To speed up lookup with different search algorithms implemented as XQuery expressions I want to access the main table's values especially PRE, DISTANCE and…
Waschbaer
  • 447
  • 6
  • 18
0
votes
0 answers

How can we improve the Update / Write operation on BaseX datastore?

I am using BaseX (XML based datastore) for its performance benchmarking. For testing it with , TestBeds I) 10,000 users, 10 friends, 10 resources II) 100,000 users , 10 friends, 10 resources I faced below issues: 1) Loading of data is too slow. Gets…
JustVirtually
  • 160
  • 1
  • 10
0
votes
1 answer

How to populate a map in XQuery?

I have an XML file in the following link I want to populate a map that with ids of movies and the average of their corresponding ratings. I am trying the following command from this site for $doc in db:open("movies","movies.xml")/movies/movie let…
user4542931
0
votes
1 answer

All nodes getting selected with deep-equal in xquery

I want to find all movies which don't have styles of anthology and art. To achieve this I am using the following query for $movie in db:open("movies","movies.xml")/movies/movie where not(deep-equal(($movie/styles/style),("anthology","art"))) return…
user4542931
0
votes
1 answer

replace node in basex xml using xquery

I am trying to replace a node in an xml using the following code String xquery_replace="xquery replace node CIDEM/ShopFloor/foo[/CIDEM/ShopFloor/ShopFloorID=1] with "+new_gbXML; session.execute(xquery_replace); So i want for example to change the…
vagelis
  • 326
  • 5
  • 18
0
votes
1 answer

Accessing my local baseX DB from another machine

I use BaseX on my machine to simplify how I interact with some XML data and I run it using the BaseX http service and access it via Rest and a localhost address. I don't really have any network experience, and I want to know how I would go about…
David K
  • 213
  • 1
  • 2
  • 12
0
votes
1 answer

BaseX list specific documents for database

When building a database in BaseX, can I provide a list of documents to be added? (Or a list of documents not to be added?) I'm working from a directory structure that contains both the documents of interest, as well as older versions that I want to…
johnbasil
  • 43
  • 1
  • 5
0
votes
1 answer

XQuery with basex-node Database gives other results with an external variable?

I am currently trying to get into properly using a BaseX Database in combination with the NodeJS package "basex-node". By writing .js Scripts that connect to the BaseX-Database-Server that I have running on my local-machine, I was already able to…
Doodu
  • 3
  • 2
0
votes
1 answer

How can I via xquery filtering get the whole xml file and not only the nodes that correspond to the filtering?

Is it possible to get the the aggregated xml file using filtering in xquery? I have the following xquery command xquery declare default element namespace \"http://www.satisfactory-project.eu/XMLSchema/v1.0/common\";…
vagelis
  • 326
  • 5
  • 18
0
votes
1 answer

Slow average function in BaseX

I'm totally new to XML and consequently XQuery. I have a large XML file (~30 GB) which I have loaded into a Basex Database. My problem is that the average function is taking a very long time to run. Sample XML file:
Jacob H
  • 4,317
  • 2
  • 32
  • 39