MarkLogic Analytics & XQuery Reporting - AgenticBI Integration

AgenticBI enables data plumbing and visualizations from MarkLogic to go from data to visual interactive insights quickly.

Overview

  1. Connect, extract and transform data from your MarkLogic, using one of the following options:

    a. Through our UI to connect directly, if your MarkLogic servers are accessible from the cloud.

  2. Query, Visualize and track all your key metrics instantly.

UI Based Approach

Connecting

  1. Log in to AgenticBI and select Queries from the left sidebar.

  2. Click on New Datasource + button and select MarkLogic from the list of datasources.

  3. After navigating to the New Datasource page, either use the pre-configured settings into AgenticBI's own demo MarkLogic database or follow the prompts and configure the following details to set up connectivity to your own MarkLogic database:

    a. Datasource Name: Enter a name for your datasource
    b. Host Name: Enter the host name to connect to
    c. Port: Enter the database port
    d. Database Name: Enter database name or leave empty to use default database
    e. User: Enter the User ID to connect
    f. Password: Enter the password to connect to the database
    g. Database Properties: Additional database connection properties/url parameters. For example, ssl=true&anotherProp=anotherVal. To set Connection to an SSL-enabled XDBC App Server, please set ssl=true.

  4. Establish Network connectivity and click on the Test Connection button.

    Note: The connection validity of the network can be tested only if it has been established via Direct Connectivity or an SSH tunnel. For more information on connectivity and datasource, please refer to the documentation on- Connectivity & Datasources.

  5. Click on Save and start Querying.

marklogic Connect

Query

Set up Query using a visual builder or query editor

Visual Builder

After connecting to the MarkLogic datasource, AgenticBI will pull out a list of collections along with field samples.

Step1: After connecting to the MarkLogic datasource, AgenticBI will pull out a list of collections along with field samples. Using these tables, you can automatically generate queries through our visual builder in a no-code environment by either dragging and dropping fields or making your selections through the drop-down.

Query marklogic

Tip: You can also write queries directly in the Query Editor, a versatile text editor that offers more advanced editing functionalities like JavaScript/XQuery, support for multiple language modes, Cloud9QL, and more.

Step 2: Define data execution strategy by using any of the following two options:

  • Direct Execution: Directly execute the Query on the original Datasource, without any storage in between. In this case, when a widget is displayed, it will fetch the data in real time from the underlying Datasource.

  • Non-Direct Execution: For non-direct queries, results will be stored in AgenticBI's Elastic Store. Benefits include- long-running queries, reduced load on your database, and more.

Non-direct execution can be put into action if you choose to run the Query once or at scheduled intervals. For more information, feel free to check out this documentation- Defining Data Execution Strategy

Data Strategy marklogic

Step 3: Click on the Preview button to analyze the results of your Query and fine-tune the desired output, if required.

Preview Results

The result of your Query is called Dataset. After reviewing the results, name your dataset and then hit the Create & Run button.

Create and Run

Query Editor

A versatile text editor designed for editing code that comes with a number of language modes including JavaScript and XQuery along with add-ons like Cloud9QL.

Create and Run

Step 1: Write your query using JavaScript or XQuery in the Query Editor. Optionally, apply Cloud9QL on top for additional transformations.

Step 2: Define data execution strategy by using any of the following two options:

  • Direct Execution: Directly execute the Query on the original Datasource, without any storage in between. In this case, when a widget is displayed, it will fetch the data in real time from the underlying Datasource.

  • Non-Direct Execution: For non-direct queries, results will be stored in AgenticBI's Elastic Store. Benefits include- long-running queries, reduced load on your database, and more.

Non-direct execution can be put into action if you choose to run the Query once or at scheduled intervals. For more information, feel free to check out this documentation- Defining Data Execution Strategy

Data Strategy marklogic

Step 3: Click on the Preview button to analyze the results of your Query and fine-tune the desired output, if required.

Data Strategy MysqlDB

Semantics SPARQL with XQuery

Semantic SPARQL can be executed using XQuery as following.

xquery version "1.0-ml";
import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy";
sem:sparql('
  <SPARQL QUERY>
  ')

Example:

xquery version "1.0-ml";
import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy";
sem:sparql('
  SELECT ?person
  WHERE { ?person <http://example.org/marklogic/predicate/livesIn> "London" }
  ')

For more details on Semantics and SPARQL, see MarkLogic Semantics Documentation.