29
Jul
09

setup cq on marklogic server

Now that we’ve installed MarkLogic Server, we’ll want a quick and convenient way to interact with our content and to explore MarkLogic features. A great tool for this job is cq.

cq is a web-based XQuery tool, which will allow us to write ad hoc queries directly in a browser that we can then evaluate against a MarkLogic database.

cq is super useful, super cool, super fun, super free, and pretty much the first thing anyone working with MarkLogic Server installs.

MarkLogic recently announced the release of MarkLogic Server 4.1.  cq actually now ships with 4.1 and is made available after installation of the Server through a simple configuration in the Admin UI.  Since our previous demonstration was an express install of 4.0-5, I’m going to show you how to set up and install cq on both versions.

install cq on 4.0-5

When we installed MarkLogic Server, it actually preconfigured a HTTP Application Server and a Database for us.  The name of the Server is Docs and it is running on port 8000.  The Database is named Documents and it is set as the database for the Docs server.  All we need to do is throw cq in the  root directory of our App Server and we’ll then have a convenient way to interact with content in the Documents database.

1) Download cq

You’ll find cq on the Developer Workshop.  For 4.0-5 you’ll want the mark-logic-cq-4.0-4.zip release.

2) Unzip the file you just downloaded.

3) Copy the cq directory within the unzipped mark-logic-cq-4.0-4 directory to the Server root:

On windows copy the cq directory to C:\Program Files\MarkLogic\Docs\cq

On linux copy the cq directory to /opt/MarkLogic/Docs/cq

4) Start cq

Launch your favorite browser and enter the following URL: http://localhost:8000/cq

We’ll be prompted for our MarkLogic Server credentials.  After entering our username and password,  cq opens and we now have an interface for interacting with the Documents database in MarkLogic Server.

cq 101

cq is divided into two major sections. The top half contains an area for entering queries as well as a list of selectable buffers.   The default query screen, from top to bottom, includes:

  • an XQuery version declaration
  • a comment that includes the buffer number
  • a html namespace declaration
  • a simple XML element <p>hello world</p>.

Above the query area we see two links: explore and session. Clicking explore will return uris from documents stored in the selected content source and display them in the bottom half of the browser.  Click session to learn more about sessions and to start, save, or resume one.

Underneath the  query area are a dropdown for the available content sources and 4 buttons.  The dropdown has selected the Documents database for us by default, so we’ll leave that for now.  Just click the XML button to see the XML view of the evaluated query displayed in the bottom half of the browser.

cq

Also note the lower right corner of the query area. If you rollover that area,  you can get a handle to drag and adjust the size of the query area.  Likewise, if you rollover the bar between the query area and the XML results, you can drag and adjust the size of your results area as well.  These options can come in handy when working with large queries or examining large result sets.

configure cq on 4.1-1

cq ships with 4.1 and is made available as a Sample application.  To make cq available on a freshly installed 4.1 MarkLogic Server just:

  • Open the Admin UI by entering the url http://localhost:8001 in your browser
  • Navigate in the tree in the left pane to Groups -> Default -> App Servers -> Docs
  • Change the value in the root directory field from Docs/ to Samples/
  • Click ok

configSamples

You can now use CQ by entering the following url in a browser: http://localhost:8000/cq

NOTE: The version of cq that ships with 4.1, is not the 4.0-4 version, but a 4.1-1 version.  If you’re copying cq to multiple servers, make sure to use the version of cq that correlates with the Server version.

next steps

Boom! That’s it. You’ve installed cq.  Next we want to start loading up our database and running some queries to do something useful. We’ll start next post by exploring Twitter using cq. If you want to keep playing along at home, go sign up and get a Twitter account if you don’t already have one.

04
Jun
09

install marklogic server

Today we’re going to walk you through installing MarkLogic Server.  Why do you want to install this? Because it’s AWESOME and because WE CAN!

MarkLogic Server is the best place to put XML content and there is a ton of XML out there.  MarkLogic Server gives us a repository for storing XML content and an Application Server for creating applications that can query, display, manipulate, and re-use that content.  The repository itself is a combination of database and search engine and provides us with powerful tools for querying and manipulating the content we store.   The goal here is to provide you with demonstrations of the useful things we can do using MarkLogic so you can go out there and create Kick-Ass! applications of your own.

We’re firm believers in learning by doing, so if you want to be able to play along at home as we proceed to do things such as call the Twitter API, store the results in MarkLogic Server, and then query that content in Excel so we can perform Social Network Analysis using NodeXL, well you’ll want to have  your own MarkLogic Server installed.

The great news is its free!  Today we’ll install using the Community License.  The Community License is free of charge for use in production environments for non-commercial projects.  This license does have capacity and usage restrictions, but it will provide us everything we need to get started.  This license does limit the availability of all MarkLogic features.  If you’re interested, there are also Trial and Academic Licenses available.  With these you can use Entity Enrichment, Geospatial, Alerting, and all the other optional features that MarkLogic provides.  If you’re interested, you can check out all the available license options here.

express installation guide

For this post we assume you’re on Windows Vista or XP (or even Server 2003/8).   We’ll be integrating with Microsoft Office, and for development we’ll assume that all our applications are on the same machine.  We’ll be using small content sets in the examples; however, the Community License permits you to store up to 10gb of content, so you may want to consider that before installing.   For all the nitty-gritty details on System Requirements and/or how to install on Linux or Solaris, consult the installation guide.

1. Download MarkLogic Server

Choose the download appropriate for your system.  Under the heading MarkLogic Server Binaries, sub-heading Microsoft Windows, select the x86 bundle .msi for 32-bit machines, and the x64 bundle for 64-bit systems.  You’ll be prompted to check an agreement. If you agree, check it and let the download commence.

2. Click the .msi you just downloaded

You’ll see a dialog box welcoming you to the MarkLogic Server Setup Wizard. Click Next.

The next screen asks you to Choose a Setup Type.

install2

Select Typical and Click Next.

You’ll next be notified that MarkLogic Server is ready to install. Click install, and you’ll then be presented with a progress bar as the installation proceeds.

Upon completion of the installation, you’ll be notified with a final dialog box. Click Finish.

3. Start MarkLogic Server

MarkLogic Server is installed. We just need to start the Server, Accept the License Agreement, and Enter our License Key and we’ll be off  an running.

Go to the Start Button and Select:  All Programs -> MarkLogic Server -> Start MarkLogic Server.

Note: if you’re using Vista, right-click and Start MarkLogic Server as Administrator.

Once the Server is started in Windows, you’ll be able to Start and Stop it from Services. The service is set to start automatically.

4. Open the Admin Interface in a browser.

Launch your favorite browser and enter the following URL: http://localhost:8001

The License Key Entry page appears.  Since we don’t have a License Key yet, just Click the free button in the Get A License Key Section.

Fill out the License Key Request Form and Click Select Community License.

install5

The next screen will provide you with a Key and Licensee information.  Click OK.

The following screen is the Personal Agreement. After reviewing the terms of the  MARK LOGIC CORPORATION ONLINE DEVELOPER PROGRAM LICENSE AGREEMENT, Click Accept.

You’ll then be notified that the server must now self-install the initial databases and applications servers, Click OK to continue.

Finally, we need to address the Security Setup Screen.  Enter an admin username, a password, and confirm the password.  Leave the realm as public for now, and Click OK.

You’ll be prompted to enter the username/password combination you just configured.  Go ahead and enter. You’re now looking at the Admin UI.

install7

Congratulations! You’ve succesfully installed MarkLogic Server. The Server is actually already configured with a Database and a HTTP Server and is ready to Rock!  Next post we’ll get a glimpse of the power we’ve just unleashed as we install CQ and start to load and query content.

31
May
09

Hello, world!

Welcome to our new blog!

We’ll be kicking things off with part 1 of our N part series: “Social Network Analysis using MarkLogic Server, Excel, NodeXL, and Twitter.”




Follow

Get every new post delivered to your Inbox.