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

Modification timestamp for documents in a BaseX database

I have a gnu make system, and would like to trigger rules based on updates to documents in a BaseX XML database. In other words, something like archive(member) can be used in gnu make to refer to a member of an archive, I would like to use…
user663031
0
votes
1 answer

XQuery in BaseX: return avg value from the output of the mapping

I am trying to manage the output of the map:get function in BaseX. The mapping file looks as follows: 161 82 323 319
v_e
  • 377
  • 1
  • 9
0
votes
1 answer

Querying data out of an XML file; queries from CSV?

I have a list of about 950 integers in a CSV file and an XML file containing complexly nested info (each entry contains multiple nests). Given an integer, i, in the CSV file, each i corresponds to an i in the XML file: i in i. I…
Wolfpack'08
  • 3,982
  • 11
  • 46
  • 78
0
votes
2 answers

How to get data from two XML file using Xquery?

Sample1.xml 9494594119945117 7813511009460692 7801631009755673
Satheesh Narayanan
  • 321
  • 1
  • 4
  • 16
0
votes
1 answer

XQuery- will a single file or multiple files would be good in any XML DB

I am having an huge XML file containing the Resumes. This file is in two format viz- A single master file containing all the Resumes for ex- ABC ...... ...... PQR
John
  • 2,820
  • 3
  • 30
  • 50
-1
votes
1 answer

Can a BaseX database span multiple folders?

New to BaseX. Working on a project where 100's or sometimes 1000's of XML files are generated each day. Due to other exogenous factors, the preferred file structure would look like:  blah/20220714/  blah/20220715/  etc… Is there some way to create…
dcs1001
  • 3
  • 3
-1
votes
1 answer

Querying XML data with a long, multi special character, path name

Just getting started with XQuery using BaseX. The XML structure that I did not create and have no control over, looks like this: 2002test.xml:
-1
votes
1 answer

How to return data from multiple XML nodes using Xquery with a namespace?

Using the Microsoft namespace as below, how to return output like: a b c c Where I'm running into a syntax error with the return clause: nicholas@mordor:~/flwor$ nicholas@mordor:~/flwor$…
-1
votes
1 answer

add an XPath statement to a FLOWR to select "id" nodes from Twitter database

Looking at the "id" field for a twitter database: thufir@dur:~/flwor$ thufir@dur:~/flwor$ basex BaseX 9.0.1 [Standalone] Try 'help' to get more information. > > open twitter Database 'twitter' was opened in 218.67 ms. > > xquery //id
Thufir
  • 8,216
  • 28
  • 125
  • 273
-1
votes
2 answers

is this valid JSON? error: Content not allowed in prolog

How do I test the below JSON files for correctness? Using basex on the command line: thufir@dur:~/json$ thufir@dur:~/json$ ls formatted.json raw.json thufir@dur:~/json$ thufir@dur:~/json$ basex BaseX 9.0.1 [Standalone] Try 'help' to get more…
Thufir
  • 8,216
  • 28
  • 125
  • 273
-1
votes
1 answer

Overflow in SVG

i am using XSLT in order to show a list of games. Each game is positioned according to its position in the database (y="{($position)*10}%"). My problem is, that when too many games are in the database, these games are not shown. I also tried to use…
stef
  • 11
  • 1
-1
votes
1 answer

BaseX currently open error - BXDB0007

I am using the c basex-api to send an xquery command to my BaseX server. This query updates an xml tag. If I have the same DB open in the BaseX GUI, I get the error "[bxerr:BXDB0007] Database 'site-1' is currently opened by another process." I can't…
-1
votes
2 answers

XQuery aggregate result AND give total

I have an XML inventory of items. The inventory lists how much if Item with ID 1 I have, how much of Item with ID 2, etc (think each item ID represents 1 product). The list, however, is subdivided, depending on what quantity of items of particular…
Gnudiff
  • 4,297
  • 1
  • 24
  • 25
-1
votes
1 answer

XQuery - Enclosing sequence of elements under a single node

I'm using xquery with BaseX to attempt to retrieve information from JMeter test cases (.jmx files) in a format I desire. This is the code I'm actually running (inside BaseX GUI): let $rlist := db:list("JMeter") for $resource in $rlist let $rcontent…
Cong Hui
  • 202
  • 5
  • 16
1 2 3
32
33