Some of you may have noticed that as of release 5, MarkLogic has a new entry page on port 8000:
From this page you can access all the goodies like: Information Studio (for flexible content-loading), Application Builder (for automatic generation of search applications), Query Console (for running and profiling code from the browser), Configuration Manager (for browsing and exporting admin settings), and Monitoring Dashboard (for visualizing server performance in real-time).
In previous releases, port 8000 had a simple application for exploring and running the W3C XQuery Use Cases, which provided a decent overview of what XQuery can do. Now that you've upgraded to MarkLogic 5 (you have, haven't you?), things have changed. Fortunately, you can still play around with these XQuery examples—this time using an even better interface: Query Console. Just follow these steps (these assume you're running MarkLogic on the same machine as your browser):
- Go to the Query Console, by clicking the link at the top of the entry page or going straight to http://localhost:8000/qconsole/.
- In Query Console, click the "Workspace" drop-down at the top right of the window, and select "Import Workspace…".
- In the resulting dialog, browse to this file: <marklogic-dir>/Samples/w3c-use-cases.xml (where <marklogic-dir> is the installation directory for MarkLogic: C:\Program Files\MarkLogic on Windows, /opt/MarkLogic on Linux, or ~/Library/MarkLogic on OS X).
- Click the "Import" button.
Now you're ready to get started. You should see all the queries loaded under your new workspace, which will look something like this:
The first query, "Load Source XML," is the one you'll want to run first, since it does just what it says: it loads all the sample data into the database of your choice. Select the database you want to use, using the "Content Source" drop-down. In the following screenshot, I selected the "Documents" database. Then click the "Run" button and wait for all the documents to load:
Now you're ready to start exploring the queries. For example, the following screenshot shows the result of me running the "Nested query" example (Q1.3):
NOTE: Be sure to check the content source drop-down each time you run a query. If you get empty results, it may be because the wrong database is selected.
Thanks to our excellent Documentation team for making this easy to find (in the "Exploring the Use Cases" section of the Getting Started guide)!