Changes

Jump to navigation Jump to search
2,914 bytes added ,  10:29, 3 August 2022
m
Text replacement - "8984" to "8080"
<p>This tutorial describes how to use is part of the BaseX [[XQueryGetting Started]] ProcessorSection.It describes how to execute queries in access BaseX from the [httphttps://www.oxygenxml.com oXygen XML Editor].You can access the existing [[database|databases]] from Currently, there are two alternatives how to use BaseX within in oXygenand work with the results as XML.</p> ==Required Downloads==:
# * Resources in BaseX [[databases]] can be opened and modified.* XPath/XQuery 1.0 expressions can be run by the [[httpQuery|query processor]] of BaseX.* '''Note://www''' BaseX itself is a highly compliant XQuery 3.inf1 processor.uni-konstanzThe restriction to XQuery 1.0 arises from the XQJ Interface which is used to establish the connection between oXygen and BaseX.deWe strongly encourage you to use the [[Graphical_User_Interface#Text_Editor|XML editor]] integrated into the BaseX GUI to edit and query your XML data!<br/dbis><br/basex> =Access Database Resources= ===Preparations=== # Download one of the [https:/maven/basex.jar basexorg/download BaseX distributions].# Start BaseX (see [[Startup]]).jar# Create a BaseX database, if necessary (see [[Databases]]: Main code ).# Start the BaseX [[http://wwwWebDAV]] service.inf ===Configuration=== # In oXygen, go to menu ''Options'' → ''Preferences'' → ''Data Sources''.uni-konstanz# In the Connections panel (in the lower half of the screen), click the ''New'' button ({{Code|+}}).de/dbis/basex/maven/basex-api# Enter "BaseX WebDAV" as connection name.jar basex-api# Select "WebDAV (S)FTP" in the Data Source dropdown box.jar]# Fill in the appropriate connection details as follows: Implementation of the XQJ API # [* Set the WebDAV/FTP URL to <code><nowiki>http://www.inf.uni-konstanz.delocalhost:8080/dbiswebdav</basexnowiki></mavencode>.#* Set the username to <code>admin</xqjcode> and enter your password.#: [[File:Oxygen-api.jar xqjWebDAV-api1.jarpng]]: XQuery # Now press ''OK'', and your Data Source is ready for Java use. You can then access your database file(Interfaces) via the Data Source Explorer: ''Window'' → ''Show View'' → ''Data Source Explorer''. [[File:Oxygen-WebDAV-2.png]] =Perform Queries= ==One-Time Setup== ===Preparations=== # Download one of the complete [httphttps://wwwbasex.oxygenxmlorg/download BaseX distributions] (ZIP, EXE), if necessary.com oXygen XML Editor# Start BaseX (see [[Startup]]). '''Note: Install ''' Charles Foster's XQJ implementation provides a default (client/server) and a local driver. If you want to use the oXygen XML Editor on your computer first flavor, you need to start a [[Startup#Server|BaseX Server]] instance. ==Setting up== ===Configure Data Source===  #Start In oXygen and go to <code>, select ''Options &#187; '' → ''Preferences &#187; '' → ''Data Sources</code>''. #Add In the Data Sources panel, add a new Data Source with data source using the <code>''New</code> '' button({{Code|+}}). #Enter Name <code>"BaseX"</code> as name and choose <code>select ''XQuery API for Java(XQJ)</code> as type'' from the ''Type'' dropdown box. #Add the three following JAR files (downloaded in Preparations procedure) with the <code>''Add<Files'' Button. The versions of the JAR files may differ.#* {{Code|basex/lib/xqj-api-1.0.jar}}#* {{Code|basex/lib/xqj2-0.2.0.jar}}#* {{Code|basex/lib/code> Buttonbasex-xqj-9.0. jar}}#Now press <code>OK<* {{Code|basex/code>BaseX.jar}}, if you want to use BaseX embedded# Under "Driver class", and your Data Source is readychoose the preferred driver class:#* Client/server communication: {{Code|net.xqj.basex.BaseXXQDataSource}}#* Embedded use (standalone): {{Code|net.xqj.basex.local.BaseXXQDataSource}}# Click ''OK''. ===Configure Connection=== #Now press <code>New</code> in In the Connection Panel Connections section (located in the lower half of the Data SourcesSource dialog), click ''New'' ({{Code|+}}). #Enter Name <code>"BaseXConnectionBaseX XQJ"</code> as name and select <code>"BaseX"</code> as data source.# If you use the default driver, enter the following values in the Data Source BoxConnection Details section:#* port: {{Code|1984}}#* serverName: {{Code|localhost}}#* user: {{Code|admin}}#* password: ''your password''# Click ''OK'' to complete the connection configuration. #Now press <code>Click ''OK</code>, and your Connection is ready'' again to close the Preferences dialog. ==Usage=Configure New Transformation Scenario=== <p>The query execution works as follows:</p> #Configure a new transformation scenario in <code>Select ''Window &#187; '' → ''Show View &#187; '' → ''Transformation Scenarios</code>''. #Press In the <code>plus</code> sign to add a new scenario''Transformation Scenarios'' panel, click {{Code|+}} and select ''XQuery transformation'' in the lower part of the dropdown list. #Enter a Namename for your transformation, e.g. "BaseX" like in the screenshot below.# Specify an optional XML and XQuery URL (your xml file or .#* If you would like to query the BaseX database you connected to via WebDAV, leave it the ''XML URL'' field empty) and . To access your database, you can use the following function from the BaseX [[Database_Module|Database Module]] in your ''XQuery URL '' file:#: [[File:Oxygen-query-example.png]]#* If you specify an XML document in the ''XML URL'' field, you can query its content using {{Code|.}} (dot operator) in your query ''XQuery URL'' file). #Choose <code>"BaseXConnectionBaseX XQJ"</code> in as Transformer from the combo box. #Press <code>Click ''OK</code>'' to complete the scenario configuration. [[File:Oxygen-WebDAV-3.png]] ==Execute Query== After the one-time setup steps are complete, and you can execute your query using the new transformation scenario is ready. Now you can start Start the transformationby clicking the red Run button (''Apply associated scenarios'') in the Transformation Scenarios window, while your scenario is selected. #The results should be immediately occur displayed in the result panel.[[Category:Instructions]]
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu