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
4
votes
0 answers

How i got more performance in basex?

Actually i have a basex collection with 15000 registries, i'm implementing a jsf and basex aplication, but i got a issue with the performance of the queries, actually i'm using JAXB to convert the xml into objects in java, but is very slow, this is…
4
votes
1 answer

How to handle recursion in XQuery?

I'm trying to find all countries which are reachable by land by traversing from one country to another via land borders using the mondial.sql database. It must be done recursively and I found some functions online which I thought would be useful for…
4
votes
2 answers

XQuery distinct-nodes usage

So i want to insert the function distint-nodes in the for clause (see which for below). I'm using BaseX for this purpose. This is my code: { for $a in doc("libros.xml")//libro return { for $b in $a/autor …
JD0001
  • 131
  • 3
  • 11
4
votes
1 answer

Write directly to file from BaseX GUI

I wrote an XQuery expression that has a large result of about 50MB and takes a couple of hours to compute. I execute it in the BaseX GUI, but this is a little inconvenient: it crops the result to a result window, which I then have to save. At this…
wvdz
  • 16,251
  • 4
  • 53
  • 90
4
votes
2 answers

Optimizing a slow XQuery query in BaseX

I've got a BaseX XML database with only one small XML file. These file basically consists of two structures. One is PlatformCategory with 46 instances, the other one PlatformGenericType with 213 instances. PlatformGenericType has references to…
4
votes
1 answer

XQuery document node test with an element node test in BaseX 8.2 throws in the presence of comments before the root element. Why?

In BaseX 8.2, I'm trying to assign to an XQuery variable, a document node whose root element has a specific name. The source XML looks like this: To get the document node, I…
ARX
  • 1,040
  • 2
  • 14
  • 20
4
votes
2 answers

Scalability of open source XML Databases

We are looking to develop a reporting application that reports on data stored in a large number of XML files. ~3,000,000 files ranging in size from 7KB to 5MB (Each file conforms to the same schema). I’m guessing that there will be about around…
David Harris
  • 705
  • 1
  • 7
  • 16
4
votes
1 answer

Xpath/Xquery on BaseX bringing back no results

Trying to use XPath/Xquery for the first time, within BaseX and i have a collection/database of opendata.gov for carpark snippet below,
4
votes
1 answer

How to connect mysql with Basex?

I have a application with Mysql as Database which is using a lot XML/HTML. I would like to process mysql data in BaseX and update database through it. Is there any simple way to connect Database? I checked http://docs.basex.org/wiki/SQL but it is…
user2737980
  • 233
  • 5
  • 13
4
votes
1 answer

XML Searching - which is fast, text within nodes or text as attribute value

Don't know is it a right question or not, but of curiosity, I want to know that which will be searched fast. For Ex- John or I have stored millions of text as attribute value, though not enough…
John
  • 2,820
  • 3
  • 30
  • 50
4
votes
1 answer

Xquery group by on 2 tags

Below is the XML part of my data. FruitBanana FruitOrange FruitApple FruitLemon
user1388575
4
votes
2 answers

how to change the XML structure using XQuery

I have a XML file containing Employees Name and the Job done by them. The structure of the XML file is - AAA@A#B#C#D BBB@A#B#C#D CCC@A#B#C#D DDD@A#B#C#D There are…
user1388575
4
votes
2 answers

XML versus MongoDB

I have a problem... I need to store a daily barrage of about 3,000 mid-sized XML documents (100 to 200 data elements). The data is somewhat unstable in the sense that the schema changes from time to time and the changes are not announced with enough…
Alex R
  • 11,364
  • 15
  • 100
  • 180
4
votes
1 answer

XQuery Full Text search with Word1 and NOT Word2

Following is the XML Structure - Doc 1 This is a special note section. This B Tag is used for highlighting any text and is optional
John
  • 2,820
  • 3
  • 30
  • 50
4
votes
1 answer

where to declare xquery functions?

Let's take the most simple function I can think of written in xquery: declare function local:identityFunction($v as xs:integer) { return ($v) }; Where do I declare it? I am trying both exist-db and basex, but if I write it in the query…
Kami
  • 1,079
  • 2
  • 13
  • 28
1
2
3
32 33